From c7b28eb2e224f62e45c268ffb3db85bf02bce168 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, 29 Dec 2022 16:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E5=8D=95=E6=9D=A1=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/adjustTable.js | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js index fab22731..ceafe065 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js @@ -276,7 +276,14 @@ class AdjustTable extends Component { ); }; handleChangeCom = (dataSource) => { - this.setState({ dataSource }); + this.setState({ + dataSource: _.map(dataSource, (item, index) => { + return { + ...item, + uuid: new Date().getTime() + index + }; + }) + }); }; handleChangeTableItem = (filedItemkey, value, index) => { const { dataSource, targetOptions } = this.state; @@ -335,11 +342,15 @@ class AdjustTable extends Component { if (status) { message.success(data || "撤回成功"); this.setState({ - dataSource: _.map(this.state.dataSource, it => { + dataSource: _.map(this.state.dataSource, (it, idx) => { if (id === it.id) { - return { ...it, status: false }; + return { + ...it, + status: false, + uuid: new Date().getTime() + idx + }; } - return { ...it }; + return { ...it, uuid: new Date().getTime() + idx }; }) }); } else { @@ -393,7 +404,7 @@ class AdjustTable extends Component { if (_.isEmpty(errorMessage)) { this.setState({ dataSource: _.map(this.state.dataSource, it => { - if (record.target === it.target) { + if (record.target === it.target && record.uuid === it.uuid) { return { ...it, status: true, id: successIds[0] }; } return { ...it };