diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js index 82fa8fc0..fef6d30f 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js @@ -136,14 +136,18 @@ class Index extends Component { if (formData[cur] || formData[cur] === 0) return { ...pre, [cur]: toDecimal_n(formData[cur], 2).toString() }; return { ...pre, [cur]: "0" }; }, {})) : "", - welfareType + welfareType, validate: welfareData[`${underTakeType}SchemeId`] ? !!welfareData[`${underTakeType}StartTime`] : true }; }; save = async () => { - this.setState({ loading: true }); const socailPayload = this.covertPayload("SOCIAL_SECURITY", "social", getConditionDomkeys(this.props.socialBase.items)), fundPayload = this.covertPayload("ACCUMULATION_FUND", "fund", getConditionDomkeys(this.props.fundBase.items)), otherPayload = this.covertPayload("OTHER", "other", getConditionDomkeys(this.props.otherBase.items)); + if (!(socailPayload.validate && fundPayload.validate && otherPayload.validate)) { + message.warning(getLabel(111, "请维护起始缴纳月!")); + return; + } + this.setState({ loading: true }); const [{ status: socialStatus, errormsg: socialErrorMsg = "!" @@ -168,6 +172,27 @@ class Index extends Component { const { archivesStore: { setHasBeenModify }, onChangeProgramme, employeeId, paymentOrganization } = this.props; setHasBeenModify(true); if (changeKey === "socialSchemeId" || changeKey === "fundSchemeId" || changeKey === "otherSchemeId") { + this.setState({ + conditions: _.map(this.state.conditions, o => { + if ( + (o.typename === "SOCIAL_SECURITY" && changeKey === "socialSchemeId") || + (o.typename === "ACCUMULATION_FUND" && changeKey === "fundSchemeId") || + (o.typename === "OTHER" && changeKey === "otherSchemeId") + ) { + return { + ...o, items: _.map(o.items, g => { + if (getKey(g).indexOf("StartTime") !== -1) { + return { + ...g, viewAttr: changeVal ? 3 : g.viewAttr + }; + } + return { ...g }; + }) + }; + } + return { ...o }; + }) + }); onChangeProgramme(changeKey.slice(0, changeKey.indexOf("SchemeId")), changeVal, { employeeId, paymentOrganization