import request from '@/utils/request'

// 获取制作薪资单列表
export function getSalaryList(data) {
  return request({
    url: '/csf/api/salary/page',
    method: 'post',
    data: data
  })
}
// 批量新增薪资单
export function batchAddSalary(data) {
  return request({
    url: '/csf/api/salary/batch/add',
    method: 'post',
    data: data
  })
}
// 计算实发金额
export function calculatePaidAmount(data) {
  return request({
    url: '/csf/api/salary/calculate/paidAmount',
    method: 'post',
    data: data
  })
}
// 计算汇率
export function getExchangeRate(data) {
  return request({
    url: '/csf/api/salary/get/exchangeRate',
    method: 'post',
    data: data
  })
}
// 计算实发金额
export function grossAmountApi(data) {
  return request({
    url: '/csf/api/salary/get/grossAmount',
    method: 'post',
    data: data
  })
}
// 获取制作薪资单详情
export function updateSalaryDetail(salaryBizId) {
  return request({
    url: '/csf/api/salary/detail?salaryBizId=' + salaryBizId,
    method: 'get'
  })
}
// 计算信息汇款明细总金额
export function calculateTotalAmountApi(data) {
  return request({
    url: '/csf/api/salary/calculate/totalAmount',
    method: 'post',
    data: data
  })
}
// 修改单个薪资单
export function editSingleSalaryApi(data) {
  return request({
    url: '/csf/api/salary/edit',
    method: 'put',
    data: data
  })
}
// 新增单个薪资单
export function addSingleSalaryApi(data) {
  return request({
    url: '/csf/api/salary/add',
    method: 'post',
    data: data
  })
}
// 取消薪资单
export function cancelSalaryApi(data) {
  return request({
    url: '/csf/api/salary/cancel',
    method: 'put',
    data: data
  })
}
//删除银行
export function delSalaryApi(salaryRemittanceBizId) {
  return request({
    url: `/csf/api/salary/delSalaryRemittance?salaryRemittanceBizId=${salaryRemittanceBizId}`,
    method: 'delete'
  })
}
// 电子薪资单列表
export function electronicSalaryListApi(data) {
  return request({
    url: '/csf/api/salary/push/page',
    method: 'post',
    data: data
  })
}
//提交核对
export function submitCheckApi(data) {
  return request({
    url: '/csf/api/salary/submit/check',
    method: 'put',
    data: data
  })
}
//推送电子薪资单
export function pushSalaryApi(data) {
  return request({
    url: '/csf/api/salary/push',
    method: 'put',
    data: data
  })
}
//核对/退回电子薪资单
export function checkSalaryApi(data) {
  return request({
    url: '/csf/api/salary/check',
    method: 'put',
    data: data
  })
}
// 电子薪资单导出
export function electronicExport(data) {
  return request({
    url: '/csf/api/salary/salary/export',
    method: 'post',
    data: data,
  })
}

// 下载选中的发佣数据

export function downloadPolicyFortune(data) {
  return request({
    url: '/csf/api/fortune/download/raw',
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}

// 应收款导出
export function exportReceivedFortune(data) {
  return request({
    url: '/csf/api/CommissionExpected/export',
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}
