diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustTable.js index 76bf1491..8f344401 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 () => { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/adjustmentSlide.js index a7fdc244..53d961da 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); @@ -106,7 +101,7 @@ class AdjustmentSlide extends Component { customOperate={this.renderCustomOperate()} /> } - content={ this.adjustTableRef = dom}/>} + content={ this.adjustTableRef = dom} visible={visible}/>} onClose={onCancel} /> );