导出全部

This commit is contained in:
MustangDeng 2022-03-10 18:10:14 +08:00
parent 9f78eb6115
commit 59f1ca0975
3 changed files with 20 additions and 2 deletions

View File

@ -19,7 +19,15 @@ export const getCumDeductSaCondition = params => {
//数据采集-累计专项附加扣除-导出
export const exportCumDeductList = params => {
return WeaTools.callApi('/api/bs/hrmsalary/addUpDeduction/export', 'POST', params);
fetch('/api/bs/hrmsalary/addUpDeduction/export').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);
}))
}
//数据采集-累计专项附加扣除-获取导入参数
@ -59,4 +67,4 @@ export const importCumDeductPreview = params => {
},
body: JSON.stringify(params)
}).then(res => res.json())
}
}

View File

@ -159,6 +159,8 @@ export default class CumDeduct extends React.Component {
}
const handleButtonClick = () => {
const { cumDeductStore: {exportCumDeductList}} = this.props;
exportCumDeductList();
}
const handleMenuClick = () => {

View File

@ -94,4 +94,12 @@ export class CumDeductStore {
}
}))
}
// 导出
@action exportCumDeductList = (params ={}) => {
API.exportCumDeductList(params).then(action(res => {
}))
}
}