From 8e133ea43a7a5e692dfc4f4f2a045a9d846669bf Mon Sep 17 00:00:00 2001 From: 18652063575 Date: Mon, 7 Nov 2022 15:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E4=B8=93=E9=A1=B9=E6=89=A3?= =?UTF-8?q?=E9=99=A4=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/cumDeduct.js | 4 ++ .../pages/dataAcquisition/cumDeduct/index.js | 37 ++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) 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 = () => {