/*
 * @Author: your name
 * @Date: 2021-09-27 11:06:43
 * @LastEditTime: 2021-12-29 14:43:29
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /MedicalWisdomCheckSys/src/pages/PlatformMana/generalSetting/serve.ts
 */


import { request } from 'umi';

// 获取评审细则类型数据
export const getAccreditationTypeData  = async ()=>{
    
        return request('/api/pfm/sysgeneralconfig/getReviewRulesConfig', {
            method: 'GET',
        });
}




// 添加数据
export const addTableData  = async (data: API.AddtableDataPostType)=>{
    
    return request('/api/pfm/sysgeneralconfig/addSysGeneralConfig', {
        method: 'POST',
        data
    });
}

// 编辑数据
export const editTableData  = async (data: API.EdittableDataPostType)=>{
    
    return request('/api/pfm/sysgeneralconfig/updateSysGeneralConfig', {
        method: 'POST',
        data
    });
}


// 获取分数等级数据
export const getScoreLevelData  = async ()=>{
    
    return request<Promise<any[]>>('/api/pfm/sysgeneralconfig/getScoreConfig', {
        method: 'GET',
    });
}

// 获取台账类型数据
export const getLedgerType  = async ()=>{
    
    return request<{
        configNote: string,
        configStatus: number,
        generalName: string,
        id: number,
        levelNumber: string
    }[]>('/api/pfm/sysgeneralconfig/getAccountConfig', {
        method: 'GET',
    });
}

// 删除数据
export const delTableData  = async (id: number)=>{
    
    return request('/api/pfm/sysgeneralconfig/deleteSysGeneralConfig', {
        method: 'POST',
        params:{id}
    });
}

// 导入
export const importFile  = async (formData: FormData)=>{

    return request('/api/pfm/excel/importReviewRule', {
        method: 'POST',
        data:formData
    });
}
