diff --git a/pc4mobx/hrmSalary/apis/cumDeduct.js b/pc4mobx/hrmSalary/apis/cumDeduct.js index 18ddb1a5..8d54f306 100644 --- a/pc4mobx/hrmSalary/apis/cumDeduct.js +++ b/pc4mobx/hrmSalary/apis/cumDeduct.js @@ -123,3 +123,7 @@ export const deleteSelectAddUpDeduction = (params) => { export const deleteAllAddUpDeduction = (params) => { return postFetch('/api/bs/hrmsalary/addUpDeduction/deleteAllAddUpDeduction', params); } +//一键累计 +export const autoAddAll = (params) => { + return postFetch('/api/bs/hrmsalary/addUpDeduction/autoAddAll', params); +} diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js index f3861c66..c63452f8 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumDeduct/index.js @@ -24,6 +24,7 @@ export default class CumDeduct extends React.Component { addVisible: false, editId: {}, saveLoading: false, + addAllLoading: false, value: "", selectedKey: [], slideSelectedKey: [], //详情表格的选中项 @@ -411,9 +412,35 @@ export default class CumDeduct extends React.Component { }); } }; + autoAddAll = () => { + const { monthValue: declareMonth, taxAgentId } = this.state; + const { cumDeductStore: { doSearch } } = this.props; + this.setState({ addAllLoading: true }); + API.autoAddAll({}).then(({ status, errormsg }) => { + this.setState({ addAllLoading: false }); + if (status) { + message.success("操作成功"); + doSearch({ + declareMonth: [declareMonth], + taxAgentId: taxAgentId === "All" ? "" : taxAgentId + }); + } else { + message.error(errormsg || "操作失败"); + } + }).catch(() => this.setState({ addAllLoading: false })); + }; render() { - const { modalParam, slideSelectedKey, monthValue, taxAgentId, addVisible, editId, saveLoading } = this.state; + const { + modalParam, + slideSelectedKey, + monthValue, + taxAgentId, + addVisible, + editId, + saveLoading, + addAllLoading + } = this.state; const { cumDeductStore, taxAgentStore } = this.props; const { loading, @@ -546,7 +573,13 @@ export default class CumDeduct extends React.Component { } type="ghost"> 一键清空 - + , + ]; const handleExportAllDetailClick = () => {