diff --git a/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js b/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js index 390d4f43..394ad979 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/salaryArchiveEditAdjLogRecord.js @@ -131,7 +131,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component { }); }; handleChangeAdjustAfter = (record, v) => { - const { salaryArchiveItemDetail } = this.state, { salaryFileStore: { adjForm } } = this.props; + const { salaryArchiveItemDetail } = this.state; const { list } = salaryArchiveItemDetail; this.setState({ salaryArchiveItemDetail: { @@ -145,13 +145,14 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component { return { ...o }; }) } - }, () => { - const { salaryArchiveItemDetail } = this.state; - adjForm.updateFields({ - sumVal: _.reduce(salaryArchiveItemDetail.list, (pre, cur) => { - return pre + parseFloat(cur.adjustAfter || 0); - }, 0).toString() - }); + }, () => this.updateSumVal()); + }; + updateSumVal = () => { + const { salaryArchiveItemDetail } = this.state, { salaryFileStore: { adjForm } } = this.props; + adjForm.updateFields({ + sumVal: _.reduce(salaryArchiveItemDetail.list, (pre, cur) => { + return pre + parseFloat(cur.adjustAfter || 0); + }, 0).toString() }); }; save = () => { @@ -256,7 +257,7 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component { salaryArchiveItemDetail: { ...salaryArchiveItemDetail, list: _.map(o, it => ({ ...it, dataType: "" })) } - })} columns={_.map(adjColumns, o => { + }, () => this.updateSumVal())} columns={_.map(adjColumns, o => { if (o.dataIndex === "adjustAfter") { return { ...o, render: (__, record) => { @@ -286,4 +287,4 @@ class SalaryArchiveEditAdjLogRecordDialog extends Component { } } -export default SalaryArchiveEditAdjLogRecordDialog; +export default SalaryArchiveEditAdjLogRecordDialog; \ No newline at end of file