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

//个税扣缴义务人列表
export const getTaxAgentList = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/list", params);
};
//同步人员范围
export const taxAgentRangeSync = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/sync", params);
};

// 系统管理员权限
export const getPermission = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/permission", "GET", params);
};

//获取个税扣缴义务人表单
export const getTaxAgentForm = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/getForm", "get", params);
};

//获取个税扣缴义务人基础信息表单
export const getTaxAgentBaseForm = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/base/getForm", "get", params);
};

//新建个税扣缴义务人
export const saveTaxAgent = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/save", params);
};

//编辑个税扣缴义务人
export const updateTaxAgent = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/update", params);
};
//保存个税扣缴义务人基础信息
export const taxAgentBaseSave = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/base/save", params);
};

//删除个税扣缴义务人
export const deleteTaxAgent = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/delete", params);
};

//人员范围保存
export const taxAgentRangeSave = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/save", params);
};
//编辑人员范围
export const taxAgentRangeEdit = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/edit", params);
};
//非系统人员范围查询
export const taxAgentRangelistExt = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/listExt", params);
};
//非系统人员范围删除
export const taxAgentRangeExtDelete = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/delete", params);
};
//非系统人员范围保存
export const taxAgentRangeExtSave = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/ext/save", params);
};
//人员范围删除
export const taxAgentRangeDelete = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/delete", params);
};
//人员范围列表
export const getTaxAgentRangeListInclude = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/listInclude", params);
};
//人员范围排除列表
export const getTaxAgentRangeListExclude = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/listExclude", params);
};
//获取人员范围表单
export const getTaxAgentRangeForm = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/getForm", params);
};
//预览个税扣缴义务人中人员范围
export const taxAgentRangePreview = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/preview", params);
};
//导入个税扣缴义务人中人员范围
export const taxAgentRangeImportData = (params) => {
  return postFetch("/api/bs/hrmsalary/taxAgent/range/importData", params);
};

//个税扣缴义务人下拉列表
export const getTaxAgentSelectList = (isShare = false) => {
  return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectList", "GET", { isShare });
};

//当前登录人个税扣缴义务人下拉列表
export const getTaxAgentSelectListAsAdmin = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/selectListAsAdmin", "GET", params);
};
//当前登录人是否有添加人员范围的权限
export const hasIconInTax = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", "GET", params);
};
