362 lines
9.5 KiB
JavaScript
362 lines
9.5 KiB
JavaScript
import { WeaTools } from "ecCom";
|
|
import { postFetch } from "../util/request";
|
|
|
|
//工资单-工资单发放列表
|
|
export const getPayrollList = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/send/list", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-获取table提示信息
|
|
export const getPayrollInfo = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/send/getBaseInfo",
|
|
"get",
|
|
params
|
|
);
|
|
};
|
|
|
|
//工资单-获取工资单发放高级搜索
|
|
export const getPaySa = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/send/getInfoSearchCondition",
|
|
"get",
|
|
params
|
|
);
|
|
};
|
|
|
|
//工资单-工资单发放
|
|
export const grantPayroll = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/send/grant", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-工资单撤回
|
|
export const withdrawPayroll = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/send/withdraw", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-工资单发放详情列表
|
|
export const getPayrollDetailList = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/send/detailList", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-工资单发放详情列表的高级搜索
|
|
export const getPayrollDetailSa = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/send/getDetailSearchCondition", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-导出-工资单发放信息列表
|
|
export const exportPayroll = params => {
|
|
fetch("/api/bs/hrmsalary/salaryBill/send/exportInfoList", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).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);
|
|
})
|
|
);
|
|
};
|
|
|
|
//工资单-工资单模板列表
|
|
export const getPayrollTemplateList = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/template/list", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-获取薪资账套下拉列表
|
|
export const getPayrollTemplateLedgerList = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/template/selectSalarySobList",
|
|
"POST",
|
|
params
|
|
);
|
|
};
|
|
|
|
//工资单-获取工资单基础设置表单
|
|
export const getPayrollBaseForm = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/template/getBaseForm",
|
|
"get",
|
|
params
|
|
);
|
|
};
|
|
|
|
//工资单-获取工资单显示设置表单
|
|
export const getPayrollShowForm = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/template/getShowForm",
|
|
"get",
|
|
params
|
|
);
|
|
};
|
|
|
|
//工资单-获取工资单薪资项目设置
|
|
export const getPayrollItemList = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/template/getSalaryItemSet",
|
|
"get",
|
|
params
|
|
);
|
|
};
|
|
|
|
//工资单-更改默认使用
|
|
export const changePayrollDefaultUse = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/template/defaultUse", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-新建工资单
|
|
export const savePayroll = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/template/save", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-编辑工资单
|
|
export const updatePayroll = params => {
|
|
const { background, ...extra } = params;
|
|
return fetch("/api/bs/hrmsalary/salaryBill/template/update", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify({ background: _.isNil(background) ? "" : background, ...extra })
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-编辑工资单-编辑基础设置
|
|
export const updatePayrollBase = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/template/updateBase",
|
|
"POST",
|
|
params
|
|
);
|
|
};
|
|
|
|
//工资单-编辑工资单-编辑显示设置
|
|
export const updatePayrollShow = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/template/updateShow",
|
|
"POST",
|
|
params
|
|
);
|
|
};
|
|
|
|
//工资单-复制工资单
|
|
export const duplicatePayroll = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/template/copy", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-删除工资单
|
|
export const deletePayroll = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/template/delete", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//工资单-获取租户名
|
|
export const getTenantName = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/template/getTenantName",
|
|
"get",
|
|
params
|
|
);
|
|
};
|
|
|
|
// 工资单发放-工资单发放信息列表
|
|
export const getInfoList = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/send/infoList", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
// 工资单发放-导出-工资单发放详情列表
|
|
export const exportDetailList = params => {
|
|
fetch("/api/bs/hrmsalary/salaryBill/send/exportDetailList", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).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);
|
|
})
|
|
);
|
|
};
|
|
|
|
// 工资单发放-工资单批量发放信息列表
|
|
export const batchSendInfoList = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/send/batchSendInfoList", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
// 工资单发放-工资单批量撤回信息列表
|
|
export const batchWithdrawInfoList = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/send/batchWithdrawInfoList", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
// 工资单发放-按钮状态
|
|
export const getSendBtnStatus = params => {
|
|
return WeaTools.callApi(
|
|
"/api/bs/hrmsalary/salaryBill/send/getSendBtnStatus",
|
|
"get",
|
|
params
|
|
);
|
|
};
|
|
|
|
// 工资单发放-扩展按钮点击
|
|
export const grantProxy = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/grantProxy", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
// 工资单发放-新建时获取补发工资单模板薪资项目设置
|
|
export const getReplenishForm = params => {
|
|
return fetch("/api/bs/hrmsalary/salaryBill/template/getReplenishForm", {
|
|
method: "POST",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(params)
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
// 工资单发放-获取规则设置下拉框
|
|
export const getReplenishRuleSetOptions = ({ salarySobId }) => {
|
|
return fetch(`/api/bs/hrmsalary/salaryBill/template/getReplenishRuleSetOptions?salarySobId=${salarySobId}`, {
|
|
method: "GET",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json"
|
|
}
|
|
}).then(res => res.json());
|
|
};
|
|
|
|
//添加发送和撤回人员范围列表
|
|
export const sendRangeList = (params) => {
|
|
return postFetch("/api/bs/hrmsalary/salaryBill/send/range/list", params);
|
|
};
|
|
//创建范围
|
|
export const sendRangeSave = (params) => {
|
|
return postFetch("/api/bs/hrmsalary/salaryBill/send/range/save", params);
|
|
};
|
|
//刪除范围
|
|
export const sendRangeDelete = (params) => {
|
|
return postFetch("/api/bs/hrmsalary/salaryBill/send/range/delete", params);
|
|
};
|
|
//工资单模板-获取模板可用的分组
|
|
export const getAvailableSalaryGroupSet = (params) => {
|
|
return postFetch("/api/bs/hrmsalary/salaryBill/template/getAvailableSalaryGroupSet", params);
|
|
};
|
|
//工资单模板-获取模板分组下可用的薪资项目
|
|
export const getAvailableSalaryItemSet = (params) => {
|
|
return postFetch("/api/bs/hrmsalary/salaryBill/template/getAvailableSalaryItemSet", params);
|
|
};
|