diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index 779f6261..6c9a9053 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -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()) -} \ No newline at end of file +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index 81ba2bae..23d2e43f 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -159,6 +159,8 @@ export default class CumDeduct extends React.Component { } const handleButtonClick = () => { + const { cumDeductStore: {exportCumDeductList}} = this.props; + exportCumDeductList(); } const handleMenuClick = () => { diff --git a/pc4mobx/hrmSalary/stores/cumDeduct.js b/pc4mobx/hrmSalary/stores/cumDeduct.js index 067ff834..d47334fb 100644 --- a/pc4mobx/hrmSalary/stores/cumDeduct.js +++ b/pc4mobx/hrmSalary/stores/cumDeduct.js @@ -94,4 +94,12 @@ export class CumDeductStore { } })) } + + // 导出 + @action exportCumDeductList = (params ={}) => { + API.exportCumDeductList(params).then(action(res => { + + })) + } + } \ No newline at end of file