From 33ef783d2b4336beca663f7888f11ef75690b094 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 11:42:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E5=B7=AE=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/adjustTable.js | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js index 40ed6fc1..07313d27 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js @@ -355,10 +355,20 @@ class AdjustTable extends Component { title: "信息确认", content: "确定保存吗?保存后数据将即时更新到台账!", onOk: () => { - const { adjustToOptions, categoryTypeOptions, key, target, ...extraParams } = record; + const { + adjustToOptions, categoryTypeOptions, key, target, status, + originId, targetOptions: targetOption, + ...extraParams + } = record; const month = getQueryString("billMonth"); const paymentOrg = getQueryString("paymentOrganization"); - const bool = _.every(Object.keys({ ...extraParams, target }), child => !!{ ...extraParams, target }[child]); + const tmpObj = { ...extraParams, target }; + for (let i in tmpObj) { + Object.assign(tmpObj,{[i]:tmpObj[i].toString()}) + } + const bool = _.every(Object.keys({ ...extraParams, target }), child => { + return !!tmpObj[child]; + }); if (!bool) { Modal.warning({ title: "信息确认", @@ -377,15 +387,17 @@ class AdjustTable extends Component { if (status) { 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, id: successIds[0] }; - } - return { ...it }; - }) - }); + !_.isEmpty(errorMessage) ? message.error(msg) : message.success(msg || "保存成功"); + if (_.isEmpty(errorMessage)) { + this.setState({ + dataSource: _.map(this.state.dataSource, it => { + if (record.target === it.target) { + return { ...it, status: true, id: successIds[0] }; + } + return { ...it }; + }) + }); + } } else { message.error(errormsg || "保存失败"); }