feature/2.9.42310.02-社保福利档案页面重构

This commit is contained in:
黎永顺 2023-12-12 18:29:46 +08:00
parent a9bd1dc625
commit 90ef0e1360
1 changed files with 27 additions and 2 deletions

View File

@ -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