diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/index.js index 1972be82..5cb2331f 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempNormalSet/index.js @@ -42,7 +42,6 @@ class Index extends Component { const { salaryTemplateShowSet, salaryTemplateSalaryItemSet: salaryItemSet, salaryBillItemNameSet } = data; const { data: result } = salaryTemplateShowSet; const { ...fieldsEchoData } = { ...result, ...toJS(tmplDataSource) }; - console.log(111, toJS(tmplDataSource), { ...result, ...toJS(tmplDataSource) }); this.setState({ conditions: _.map(tempNormalSetConditions, it => { if (it.title === "themeSet") { diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempReissueSet/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempReissueSet/index.js index ea4c59cb..247da322 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempReissueSet/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTempReissueSet/index.js @@ -33,10 +33,10 @@ class Index extends Component { this.setState({ replenishSalaryTemplateSalaryItemSet, salaryBillItemNameSet }, () => { - // setTmplDataSource({ - // ...toJS(tmplDataSource), - // replenishSalaryItemSetting: replenishSalaryTemplateSalaryItemSet - // }); + setTmplDataSource({ + ...toJS(tmplDataSource), + replenishSalaryItemSetting: replenishSalaryTemplateSalaryItemSet + }); }); } }); diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTemplateTableList/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTemplateTableList/index.js index 0b3bbaad..aca60f91 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTemplateTableList/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/payrollTemplateTableList/index.js @@ -182,7 +182,7 @@ class Index extends Component { this.setState({ tmplSlide: { ...tmplSlide, visible: false, copyId: "" } - }, () => v === "refresh" && console.log(this.props))} + }, () => v === "refresh" && this.getPayrollTemplateList(this.props))} /> diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js index 085d6e9d..c6ed81a2 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/updatePayrollTemplateSlide/index.js @@ -49,10 +49,8 @@ class Index extends Component { autoAckDays: Number(autoAckDays), replenishRule: replenishRule === "0" ? "" : replenishRule }; - this.setState({ - current: this.state.current + 1 - }, () => { - setTmplDataSource(payload); + setTmplDataSource(payload); + this.setState({ current: this.state.current + 1 }, () => { initPayrollTempForm(); initPayrollTempFeedbackForm(); }); @@ -77,11 +75,8 @@ class Index extends Component { salaryItemZeroStatus: salaryItemZeroStatus === "1", salaryItemNullStatus: salaryItemNullStatus === "1" }; - this.setState({ - current: this.state.current + 1 - }, () => { - setTmplDataSource(payload); - }); + setTmplDataSource(payload); + this.setState({ current: this.state.current + 1 }); } else { f.showErrors(); this.forceUpdate(); @@ -89,15 +84,35 @@ class Index extends Component { }); }; savePayroll = () => { - const { payrollStore: { tmplDataSource, salaryBillItemNameSetting } } = this.props; + const { + payrollStore: { + tmplDataSource, salaryBillItemNameSetting, initPayrollTempForm, initPayrollTempFeedbackForm, + initPayrollTempNormalForm, setTmplDataSource, setSalaryBillItemNameSetting + } + } = this.props; const payload = { ...toJS(tmplDataSource), salaryBillItemNameSetting: toJS(salaryBillItemNameSetting) }; - console.log(payload, tmplDataSource, toJS(salaryBillItemNameSetting)); - return; this.setState({ loading: true }); savePayroll(payload).then(({ status, errormsg }) => { this.setState({ loading: false }); if (status) { + initPayrollTempForm(); + initPayrollTempFeedbackForm(); + initPayrollTempNormalForm(); + setTmplDataSource({}); + setSalaryBillItemNameSetting([ + { + salaryTemplateId: "", + salaryBillType: 0, + itemShowNameSetting: [] + }, + { + salaryTemplateId: "", + salaryBillType: 1, + itemShowNameSetting: [] + } + ]); message.success(getLabel(30700, "操作成功!")); + this.props.onClose("refresh"); } else { message.error(errormsg); } @@ -105,6 +120,7 @@ class Index extends Component { }; renderTitle = () => { const { tmplId } = this.props, { current, loading } = this.state; + const { payrollStore: { payrollTempNormalForm, setTmplDataSource, tmplDataSource } } = this.props; return
@@ -117,7 +133,19 @@ class Index extends Component { current === 1 ? + onClick={() => { + const { + salaryItemNullStatus, salaryItemZeroStatus, + background, ...extra + } = payrollTempNormalForm.getFormParams(); + const payload = { + ...toJS(tmplDataSource), ...extra, + salaryItemZeroStatus: salaryItemZeroStatus === "1", + salaryItemNullStatus: salaryItemNullStatus === "1" + }; + setTmplDataSource(payload); + this.setState({ current: current - 1 }); + }}>{getLabel(1876, "上一步")} :