import { WeaTools } from "ecCom";
import { postExportFetch, postFetch } from "../util/request";

//社会福利台账-获取正常缴纳列表
export const getCommonList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/batch/list", params);
};

//社会福利台账-获取tab列表
export const getTabList = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/siaccount/tabList", "get", params);
};

//社会福利台账-获取正常缴纳列表
export const getNormalList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/detail/common/list", params);
};
//社会福利台账-获取补缴列表
export const getSupplementaryList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/detail/supplementary/list", params);
};

//社会福利台账-获取总览列表
export const getOverViewList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/overView", params);
};

//社会福利台账-获取异常列表
export const getChangeList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/changeList", params);
};
//社会福利台账-保存并进入核算
export const save = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/save", params);
};
//社会福利台账-批量核算
export const batSave = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/batSave", params);
};
//社会福利台账-归档
export const siaccountFile = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/file", params);
};
//社会福利台账-批量归档
export const batSiaccountFile = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/batFile", params);
};
//社会福利台账-核算异常列表
export const inspectList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/inspectList", params);
};
//社会福利台账-删除正常缴纳人员
export const siaccountCommonDelete = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/supplementary/delete", params);
};
//社会福利台账-添加正常缴纳人员
export const siaccountCommonSave = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/common/save", params);
};
//社会福利台账-添加补缴人员
export const siaccountSupplementarySave = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/supplementary/save", params);
};
//社会福利台账-删除月份表单
export const siaccountDelete = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/delete", params);
};
//社会福利台账-批量删除月份表单
export const batSiaccountDelete = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/batDelete", params);
};
//社会福利台账-正常缴纳添加缴纳人员表单
export const siaccountCommonForm = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/siaccount/commonForm", "get", params);
};
//社会福利台账-补缴添加缴纳人员表单
export const querySupplementaryForm = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/siaccount/querySupplementaryForm", "get", params);
};

// 核算详情页核算
export const commonAccount = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/commonAccount", params);
};

// 社保福利台账重新核算
export const socialSecurityBenefitsRecalculate = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/socialSecurityBenefitsRecalculate", params);
};
// 社保福利台账批量重新核算
export const batSocialSecurityBenefitsRecalculate = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/batSocialSecurityBenefitsRecalculate", params);
};

// 获取当前管理员下的所有的个税扣缴义务人
export const getAdminTaxAgentList = () => {
  return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getAdminTaxAgentList", "get", {});
};

// 表单字段对应的接口
export const getWelfareList = () => {
  return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getWelfareList", "get", {});
};
// 补差表单字段对应的接口
export const getBalanceWelfareList = () => {
  return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getBalanceWelfareList", "get", {});
};

// 社保福利台账-导入预览
export const welfarePreview = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/welfare/preview", params);
};

// 社保福利台账-核算数据导入
export const importInsuranceAcctDetail = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/welfare/importInsuranceAcctDetail", params);
};
// 社保福利台账-补差数据导入
export const importBalanceInsuranceDetail = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/welfare/importBalanceInsuranceDetail", params);
};

// 社保福利台账-线下对比数据导入
export const importExcelInsuranceDetail = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/comparisonwelfare/importExcelInsuranceDetail", params);
};

//获取当前登录人所控制的人员范围
export const getEmployeeListByTaxAgent = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/getEmployeeListByTaxAgent", params);
};
//新增退差数据
export const saveRecession = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/saveRecession", params);
};
//查询退差列表
export const recessionList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/detail/recession/list", params);
};
//查询补差列表
export const balanceList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/detail/balance/list", params);
};
//删除退差数据
export const delRecession = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/delRecession", params);
};
//删除补差数据
export const delBalance = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/delBalance", params);
};
//编辑社保福利缴纳数据
export const editAccount = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/editAccount", params);
};
//获取指定月份的福利基数
export const getSupplementPaymentForm = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/detail/getSupplementPaymentForm", params);
};
//获取待编辑的补缴费用相关福利项
export const getPaymentGroup = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/detail/getPaymentGroup", params);
};
//获取核算项个人和公司社保福利缴纳详情
export const getPaymentById = ({ id }) => {
  return WeaTools.callApi("/api/bs/hrmsalary/siaccount/getPaymentById", "GET", { id });
};
//获取社保福利项列表
export const compensationCategoryType = ({ id }) => {
  return WeaTools.callApi("/api/bs/hrmsalary/siaccount/compensationCategoryType", "GET", { id });
};

//获取调差列表
export const getCompensationList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/compensationList", params);
};
//获取可调差的人员列表
export const getEmployeeListToCompensation = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/getEmployeeListToCompensation", params);
};
//获取当前调差行-公司方支出总计
export const getCompensationComTotal = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/compensationComTotal", params);
};
//社保调差保存
export const compensationSave = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/compensationSave", params);
};
//社保调差默认配置保存
export const compensationConfigSave = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/compensationConfigSave", params);
};
//撤回调差数据
export const compensationBack = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/compensationBack", params);
};

export const exportSiaccountWelfareImporttemplate = params => {
  return postExportFetch("/api/bs/hrmsalary/siaccount/welfare/importtemplate/export", params);
};

export const exportSiaccountWelfaresupplyimporttemplatetemplate = params => {
  return postExportFetch("/api/bs/hrmsalary/siaccount/welfare/supplyimporttemplate/export", params);
};

export const exportSiaccountWelfarebalanceimporttemplatetetemplate = params => {
  return postExportFetch("/api/bs/hrmsalary/siaccount/welfare/balanceimporttemplate/export", params);
};
export const getBalancePaymentGroup = params => {
  return postFetch("/api/bs/hrmsalary/siaccount/detail/getBalancePaymentGroup", params);
};
export const addNewBalance = params => {
  return postFetch("/api/bs/hrmsalary/siaccount/detail/addNewBalance", params);
};
// 导入社保台账添加表头字段缓存-正常缴纳以及补缴
export const cacheWelfareListField = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/cacheWelfareList", params);
};
// 导入社保台账添加表头字段缓存-补差缓存
export const cacheBalanceWelfareList = (params) => {
  return postFetch("/api/bs/hrmsalary/siaccount/cacheBalanceWelfareList", params);
};
