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

89 lines
2.9 KiB
JavaScript

import { WeaTools } from 'ecCom';
//数据采集-其他免税扣除列表
export const getOtherDeductList = params => {
return fetch('/api/bs/hrmsalary/otherDeduction/list', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
//数据采集-其他免税扣除列表的高级搜索
export const getOtherDeductSaCondition = params => {
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/getSearchCondition', 'get', params);
}
//数据采集-其他免税扣除-获取导入参数
export const getImportOtherDeductParam = params => {
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/getImportParams', 'get', params);
}
//数据采集-其他免税扣除-导出
export const exportOtherDeductList = (ids = "") => {
fetch('/api/bs/hrmsalary/otherDeduction/export?ids=' + ids).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);
}))
return WeaTools.callApi('/api/bs/hrmsalary/otherDeduction/export', 'POST', params);
}
//数据采集-获取其他免税扣除记录
export const getOtherDeductDetailList = params => {
return fetch('/api/bs/hrmsalary/otherDeduction/getDetailList', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
//数据采集-其他免税扣除-导出明细
export const exportOtherDeductDetailList = (id, ids) => {
fetch('/api/bs/hrmsalary/otherDeduction/exportDetail?otherTaxExemptDeductionId='+id+'&ids=' + ids).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 importOtherDeductionParam = params => {
return fetch('/api/bs/hrmsalary/otherDeduction/importData', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}
// 数据采集-其他免税扣除-导入预览
export const importOtherDeductionPreview = params => {
return fetch('/api/bs/hrmsalary/otherDeduction/preview', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(params)
}).then(res => res.json())
}