diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js index a15527d0..4ef1c14e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js @@ -32,12 +32,11 @@ class AdjustTable extends Component { }; } - componentDidMount() { - this.getCompensationList().then(r => { - }); - } - componentWillReceiveProps(nextProps, nextContext) { + if (nextProps.visible !== this.props.visible) { + nextProps.visible && this.getCompensationList().then(r => { + }); + } } getCompensationList = async () => { @@ -353,7 +352,7 @@ class AdjustTable extends Component { const { adjustToOptions, categoryTypeOptions, key, target, ...extraParams } = record; const month = getQueryString("billMonth"); const paymentOrg = getQueryString("paymentOrganization"); - const bool = _.every(Object.keys(record), child => !!record[child]); + const bool = _.every(Object.keys({ ...extraParams, target }), child => !!{ ...extraParams, target }[child]); if (!bool) { Modal.warning({ title: "信息确认", @@ -370,8 +369,9 @@ class AdjustTable extends Component { }; compensationSave([payload]).then(({ status, data, errormsg }) => { if (status) { - const { data: dataMsg } = data; - message.success(dataMsg || "保存成功"); + const { data: dataMsg, errorMessage = [] } = data; + const msg = dataMsg + errorMessage.join(","); + message.success(msg || "保存成功"); this.getCompensationList().then(r => { }); } else { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index a7fdc244..d3bb5e43 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js @@ -28,11 +28,6 @@ class AdjustmentSlide extends Component { this.adjustTableRef = null; } - componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.visible !== this.props.visible) { - } - } - handleSave = () => { let { dataSource, targetOptions } = this.adjustTableRef.state; dataSource = _.filter(dataSource, it => !it.id); @@ -69,8 +64,9 @@ class AdjustmentSlide extends Component { compensationSave(payload).then(({ status, data, errormsg }) => { this.setState({ loading: false }); if (status) { - const { data: dataMsg } = data; - message.success(dataMsg || "保存成功"); + const { data: dataMsg, errorMessage = [] } = data; + const msg = dataMsg + errorMessage.join(","); + message.success(msg || "保存成功"); this.adjustTableRef.getCompensationList().then(r => { }); } else { @@ -106,7 +102,7 @@ class AdjustmentSlide extends Component { customOperate={this.renderCustomOperate()} /> } - content={ this.adjustTableRef = dom}/>} + content={ this.adjustTableRef = dom} visible={visible}/>} onClose={onCancel} /> );