diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js index b4bf9e84..ffeb9a2d 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js @@ -40,10 +40,11 @@ class Index extends Component { getBaseForm = async (props) => { const { data: taxAgentList } = await getTaxAgentSelectList(); const { - archivesStore: { welfareProfileForm }, + archivesStore: { welfareProfileForm }, socialBase, fundBase, othersBase, employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData } = props; const payload = { employeeId, paymentOrganization, welfareTypeEnum: "" }; + console.log(props); API.getBaseForm(payload).then(({ status, data }) => { if (status) { const { data: result } = data; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index 74260961..0fed894a 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -102,6 +102,22 @@ class Index extends Component { othersItems: othersItems.data.items[0].items, othersBaseData: { OTHER: { ...othersItems.data.data, otherUnderTake: othersItems.data.data.underTake } } } + }, async () => { + const { socialBaseData, fundBaseData, othersBaseData } = this.state.welfareEditSlide; + const { SOCIAL_SECURITY: { socialSchemeId } } = socialBaseData, + { ACCUMULATION_FUND: { fundSchemeId } } = fundBaseData, + { OTHER: { otherSchemeId } } = othersBaseData; + const [socialBase, fundBase, othersBase] = await Promise.all([ + this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["social"], schemeId: socialSchemeId }), + this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"], schemeId: fundSchemeId }), + this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["others"], schemeId: otherSchemeId }) + ]); + this.setState({ + welfareEditSlide: { + ...this.state.welfareEditSlide, + socialBase: socialBase.data, fundBase: fundBase.data, othersBase: othersBase.data + } + },()=>console.log(this.state.welfareEditSlide)); }); break; case "ADD-TO-PAY": @@ -130,6 +146,11 @@ class Index extends Component { const payload = { employeeId, paymentOrganization, welfareTypeEnum }; return API.getBaseForm(payload); }; + getPaymentForm = async (props) => { + const { employeeId, paymentOrganization, welfareTypeEnum } = props; + const payload = { employeeId, paymentOrganization, welfareTypeEnum }; + return API.getPaymentForm(payload); + }; getWelfareList = (props) => { const { pageInfo } = this.state; const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props;