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

//数据采集-考勤引用-考勤数据列表
export const checkOperation = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/checkOperation", params);
};
//数据采集-考勤引用-考勤数据列表
export const getAttendanceList = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/list", params);
};

//数据采集-考勤引用-获取账套列表
export const getLedgerList = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/selectSalarySobList", "get", params);
};

//数据采集-考勤引用-同步引用考勤数据
export const syncAttendanceRefer = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/syncAttendQuoteData", params);
};

//数据采集-考勤引用-删除考勤数据
export const deleteAttendance = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/delete", params);
};

//数据采集-考勤引用-考勤字段管理列表
export const getAttendanceFieldList = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/fieldList", params);
};

//数据采集-考勤引用-新建考勤字段
export const saveAttendanceField = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/saveField", params);
};

//数据采集-考勤引用-启用/停用自定义字段
export const updateAttendanceFieldStatus = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/updateEnableStatus", params);
};

//数据采集-考勤引用-考勤引用字段设置-列表
export const getAttendanceFieldSettingList = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/fieldSetting/list", params);
};

//数据采集-考勤引用-考勤引用字段设置-保存
export const saveAttendanceFieldSetting = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/fieldSetting/save", params);
};
//数据采集-考勤引用-考勤引用字段设置-恢复默认设置
export const returnToAttendanceFieldSettingDefault = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/fieldSetting/recoverAsDefault", params);
};

//数据采集-考勤引用-考勤引用字段设置-设为默认设置
export const saveAttendanceFieldSettingAsDefault = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/fieldSetting/saveAsDefault", params);
};

// 考勤导入预览
export const previewAttendQuote = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/preview", params);
};

// 考勤数据导入
export const importAttendQuoteData = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/importAttendQuoteData", params);
};

// 查看考勤详情
export const viewAttendQuote = (params) => {
  return postFetch("/api/bs/hrmsalary/attendQuote/view", params);
};

// 根据所属月和账套获取周期
export const getSalaryCycleAndAttendCycle = (params) => {
  return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle", "get", params);
};
