diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js index 4ef1c14e..40ed6fc1 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 || "撤回失败"); @@ -369,10 +375,16 @@ 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.getCompensationList().then(r => { + 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 || "保存失败");