From bebc1c8c98d05d4056cb9f2ef4456000ae4a32c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 8 Dec 2022 10:11:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E8=B0=83=E5=B7=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/adjustTable.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js index 4ef1c14e..9a7b040b 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js @@ -89,7 +89,7 @@ class AdjustTable extends Component { options={targetOptions} value={record.target} style={{ width: "100%" }} - viewAttr={3} + viewAttr={record.status ? 1 : 3} onChange={v => this.handleChangeTableItem("target", v, index)} /> ); @@ -107,7 +107,7 @@ class AdjustTable extends Component { this.handleChangeTableItem("welfareType", v, index)} /> ) @@ -125,7 +125,7 @@ class AdjustTable extends Component { multiple options={record.categoryTypeOptions || []} value={record.categoryType} - viewAttr={3} + viewAttr={record.status ? 1 : 3} onChange={v => this.handleChangeTableItem("categoryType", v, index)} /> ) @@ -142,7 +142,7 @@ class AdjustTable extends Component { this.handleChangeTableItem("countryTotal", v, index)} /> ) @@ -202,7 +202,7 @@ class AdjustTable extends Component { this.handleChangeTableItem("adjustTo", v, index)} /> ); @@ -334,7 +334,13 @@ class AdjustTable extends Component { compensationBack(payload).then(({ status, data, errormsg }) => { if (status) { message.success(data || "撤回成功"); - this.getCompensationList().then(r => { + this.setState({ + dataSource: _.map(this.state.dataSource, it => { + if (id === it.id) { + return { ...it, status: false }; + } + return { ...it }; + }) }); } else { message.error(errormsg || "撤回失败"); @@ -372,7 +378,13 @@ class AdjustTable extends Component { const { data: dataMsg, errorMessage = [] } = data; const msg = dataMsg + errorMessage.join(","); message.success(msg || "保存成功"); - this.getCompensationList().then(r => { + this.setState({ + dataSource: _.map(this.state.dataSource, it => { + if (record.target === it.target) { + return { ...it, status: true }; + } + return { ...it }; + }) }); } else { message.error(errormsg || "保存失败"); From a41a37db67496b15dc2e51ea9e718c2abdeb0936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Thu, 8 Dec 2022 10:36:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../standingBookDetail/components/adjustTable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js index 9a7b040b..40ed6fc1 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js @@ -375,13 +375,13 @@ class AdjustTable extends Component { }; compensationSave([payload]).then(({ status, data, errormsg }) => { if (status) { - const { data: dataMsg, errorMessage = [] } = data; + const { data: dataMsg, errorMessage = [], successIds = [] } = data; const msg = dataMsg + errorMessage.join(","); message.success(msg || "保存成功"); this.setState({ dataSource: _.map(this.state.dataSource, it => { if (record.target === it.target) { - return { ...it, status: true }; + return { ...it, status: true, id: successIds[0] }; } return { ...it }; })