import request from '@/config/axios'

// ERP 应付职工薪酬 VO
export interface EmployeeSalaryVO {
  id: number // 主键
  salaryMonth: string // 日期（yyyy-MM）
  payableSalary: number // 应付职工薪酬
  basicSalary: number // 工资
  salaryDept: string // 工资部门
  remark: string // 备注
  employeeWelfare: number // 职工福利
  socialInsurance: number // 社保保险费
  bonus: number // 奖金
  unionFund: number // 工会经费
  commercialInsurance: number // 商业保险
  compensation: number // 赔偿补偿
  installationLabor: number // 安装人工费
  personalIncomeTax: number // 个人所得税
  createTime: Date // 创建时间
}

// ERP 应付职工薪酬 API
export const EmployeeSalaryApi = {
  // 查询应付职工薪酬分页
  getEmployeeSalaryPage: async (params: any) => {
    return await request.get({ url: `/erp/employee-salary/page`, params })
  },

  // 查询应付职工薪酬详情
  getEmployeeSalary: async (id: number) => {
    return await request.get({ url: `/erp/employee-salary/get?id=` + id })
  },

  // 新增应付职工薪酬
  createEmployeeSalary: async (data: EmployeeSalaryVO) => {
    return await request.post({ url: `/erp/employee-salary/create`, data })
  },

  // 修改应付职工薪酬
  updateEmployeeSalary: async (data: EmployeeSalaryVO) => {
    return await request.put({ url: `/erp/employee-salary/update`, data })
  },

  // 删除应付职工薪酬
  deleteEmployeeSalary: async (id: number) => {
    return await request.delete({ url: `/erp/employee-salary/delete?id=` + id })
  },

  // 导出应付职工薪酬 Excel
  exportEmployeeSalary: async (params: any) => {
    return await request.download({ url: `/erp/employee-salary/export-excel`, params })
  }
}
