/*
 * @Author: code4eat awesomedema@gmail.com
 * @Date: 2023-01-04 13:59:26
 * @LastEditors: code4eat awesomedema@gmail.com
 * @LastEditTime: 2023-03-01 15:50:03
 * @FilePath: /BudgetManaSystem/src/pages/budgetMana/personnelSalaryBudget/service.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */





import { request } from '@@/plugin-request';




//获取薪酬预算表格数据

export type getDataRespType = {
    income:number,
    cost:number,
    rate:number,
    personalCost:number,
    detail:[
        unitType:string,
        unitTypeName:string,
        percent:string,
        cost:string,
        salary:string,
        subsidies:string,
        variableCompensation:string,
        staffRate:string,
        averageSalary:number
    ]

}

export const getData = (computeDate:string,reportCode:number)=>{

    return request<getDataRespType>('/performance/first/getList', {
         method:'GET',
         params:{computeDate,reportCode}
    })
}


//获取审核状态
export const getCurrentCheckStatus = (computeDate:string)=>{
    return request('/performance/first/getStatus', {
        method:'GET',
        params:{computeDate}
   })
}

//审核
export const checkRequest = (data:{computeDate:string,auditType:string})=>{
    return request('/performance/first/audit', {
        method:'POST',
        params:data
   })
}



//计算
export const caculate = (computeDate:string)=>{
    return request('/performance/first/compute', {
        method:'POST',
        params:{computeDate}
   })
}



