salary-management-front/pc4mobx/hrmSalary/apis/attendance.js

295 lines
7.9 KiB
JavaScript
Raw Normal View History

2022-06-02 17:11:28 +08:00
import { WeaTools } from "ecCom";
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-考勤数据列表
2022-06-02 17:11:28 +08:00
export const checkOperation = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/checkOperation", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
//数据采集-考勤引用-考勤数据列表
export const getAttendanceList = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-考勤数据-获取导入参数
2022-06-02 17:11:28 +08:00
export const getImportAttendanceParam = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getImportParams",
"get",
params
);
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-获取账套列表
2022-06-02 17:11:28 +08:00
export const getLedgerList = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/selectSalarySobList",
"get",
params
);
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-获取引用考勤表单
2022-06-02 17:11:28 +08:00
export const getAttendanceReferForm = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getSyncForm",
"get",
params
);
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-获取引用考勤表单周期数据
2022-06-02 17:11:28 +08:00
export const getAttendanceReferPeriod = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle",
"post",
params
);
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-同步引用考勤数据
2022-06-02 17:11:28 +08:00
export const syncAttendanceRefer = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/syncAttendQuoteData", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-查看考勤数据
2022-06-02 17:11:28 +08:00
export const getAttendanceDetail = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/attendQuote/view", "get", params);
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-删除考勤数据
2022-06-02 17:11:28 +08:00
export const deleteAttendance = (params) => {
2022-06-28 18:07:41 +08:00
return fetch("/api/bs/hrmsalary/attendQuote/delete", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
// return WeaTools.callApi(
// "/api/bs/hrmsalary/attendQuote/delete",
// "POST",
// params
// );
2022-06-02 17:11:28 +08:00
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-导出考勤数据
2022-06-02 17:11:28 +08:00
export const exportAttendance = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/export",
"POST",
params
);
};
2022-02-28 09:29:46 +08:00
//数据采集- 考勤应用-导出模版+全量数据
2022-06-02 17:11:28 +08:00
export const exportForTemplate = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/exportForTemplate",
"POST",
params
);
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-考勤字段管理列表
2022-06-02 17:11:28 +08:00
export const getAttendanceFieldList = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldList", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-获取考勤字段表单
2022-06-02 17:11:28 +08:00
export const getAttendanceFieldForm = (params) => {
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getFieldForm",
"get",
params
);
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-新建考勤字段
2022-06-02 17:11:28 +08:00
export const saveAttendanceField = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/saveField", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-修改考勤字段
2022-06-02 17:11:28 +08:00
export const updateAttendanceField = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/updateField", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-启用/停用自定义字段
2022-06-02 17:11:28 +08:00
export const updateAttendanceFieldStatus = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/updateEnableStatus", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-删除考勤字段
2022-06-02 17:11:28 +08:00
export const deleteAttendanceField = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/deleteField", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-考勤引用字段设置-列表
2022-06-02 17:11:28 +08:00
export const getAttendanceFieldSettingList = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/list", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-考勤引用字段设置-保存
2022-06-02 17:11:28 +08:00
export const saveAttendanceFieldSetting = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/save", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-考勤引用字段设置-恢复默认设置
2022-06-02 17:11:28 +08:00
export const returnToAttendanceFieldSettingDefault = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/recoverAsDefault", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-02-28 09:29:46 +08:00
//数据采集-考勤引用-考勤引用字段设置-设为默认设置
2022-06-02 17:11:28 +08:00
export const saveAttendanceFieldSettingAsDefault = (params) => {
return fetch("/api/bs/hrmsalary/attendQuote/fieldSetting/saveAsDefault", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-04-25 14:32:51 +08:00
// 考勤导入模板下载
export const downloadTemplate = (salaryYearMonth, salarySobId) => {
2022-06-02 17:11:28 +08:00
// /api/bs/hrmsalary/attendQuote/downloadTemplate
fetch(
"/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=" +
salaryYearMonth +
"&salarySobId=" +
salarySobId
).then((res) =>
res.blob().then((blob) => {
var filename = `考勤导入模板.xlsx`;
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
})
);
};
2022-04-25 14:32:51 +08:00
// 考勤导入预览
export const previewAttendQuote = (params) => {
2022-06-02 17:11:28 +08:00
return fetch("/api/bs/hrmsalary/attendQuote/preview", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
2022-04-25 14:32:51 +08:00
// 考勤数据导入
export const importAttendQuoteData = (params) => {
2022-06-02 17:11:28 +08:00
return fetch("/api/bs/hrmsalary/attendQuote/importAttendQuoteData", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(params),
}).then((res) => res.json());
};
// 查看考勤详情
2023-03-07 14:47:47 +08:00
export const viewAttendQuote = (params) => {
2022-06-02 17:11:28 +08:00
return fetch("/api/bs/hrmsalary/attendQuote/view", {
method: "POST",
mode: "cors",
headers: {
"Content-Type": "application/json",
},
2023-03-07 14:47:47 +08:00
body: JSON.stringify(params),
2022-06-02 17:11:28 +08:00
}).then((res) => res.json());
};
2022-05-07 14:47:14 +08:00
// 根据所属月和账套获取周期
export const getSalaryCycleAndAttendCycle = (params) => {
2022-06-02 17:11:28 +08:00
return WeaTools.callApi(
"/api/bs/hrmsalary/attendQuote/getSalaryCycleAndAttendCycle",
"get",
params
);
};