Merge branch 'feature/2.9.42310.02-社保福利档案页面重构' into feature/V2-dev合并多语言

# Conflicts:
#	pc4mobx/hrmSalary/components/importDialog/index.js
This commit is contained in:
黎永顺 2023-12-13 11:17:52 +08:00
commit f0ea119865
3 changed files with 64 additions and 24 deletions

View File

@ -19,7 +19,7 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
current: 0
current: 0, fileid: ""
};
}
@ -29,7 +29,10 @@ class Index extends Component {
current: this.state.current + 1
});
}
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ current: 0 });
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
current: 0,
fileid: ""
}, () => this.props.onResetImportResult());
}
renderChildren = () => {
@ -76,25 +79,36 @@ class Index extends Component {
* Date: 2023/8/11
*/
handleNext = () => {
const { params, importResult } = this.props;
const { params, importResult, excludeKey } = this.props;
const { current } = this.state;
if (_.isEmpty(importResult)) {
const { fileList } = this.step1Ref.state;
if (!_.isEmpty(params)) {
if (!Object.values(params).every(o => !!o)) {
Modal.warning({
title: getLabel(131329, "信息确认"),
content: getLabel(518702, "必要信息不完整,红色*为必填项!")
});
if (current === 0) {
const { fileList } = this.step1Ref.state;
if (!_.isEmpty(params)) {
if (!Object.values(params).every(o => !!o)) {
Modal.warning({
title: getLabel(131329, "信息确认"),
content: getLabel(518702, "必要信息不完整,红色*为必填项!")
});
return;
}
}
if (_.isEmpty(fileList)) {
message.warning(getLabel(545065, "请先上传EXCEL文件"));
return;
}
const [file] = fileList;
const { response } = file;
this.setState({
current: this.state.current + 1,
fileid: response.data.fileid
}, () => {
!excludeKey && this.props.nextCallback && this.props.nextCallback(this.state.fileid);
excludeKey && this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid);
});
} else {
this.props.nextUplaodCallback && this.props.nextUplaodCallback(this.state.fileid);
}
if (_.isEmpty(fileList)) {
message.warning(getLabel(545065, "请先上传EXCEL文件"));
return;
}
const [file] = fileList;
const { response } = file;
this.props.nextCallback(response.data.fileid);
} else {
this.setState({ current: this.state.current + 1 });
}

View File

@ -76,14 +76,14 @@ class Index extends Component {
})}
exportDataDom={
<WeaCheckbox
value={getURLParameters(link)[runStatuses !== "ext" ? "exportData" : "extWelArchiveList"] === "true" ? "1" : "0"}
value={getURLParameters(link)["exportData"] === "true" ? "1" : "0"}
content={getLabel(543208, "导出现有数据")}
helpfulTip={getLabel(545244, "提示:建议先导出现有最新数据,修改后再导入")}
onChange={val => {
const payload = {
[runStatuses !== "ext" ? "exportData" : "extWelArchiveList"]: val === "1",
runStatuses, ...welfareForm.getFormParams()
let payload = {
exportData: val === "1", runStatuses, ...welfareForm.getFormParams()
};
runStatuses === "ext" && (payload = { ...payload, extWelArchiveList: true, runStatuses: "" });
this.setState({
importDialog: {
...importDialog,
@ -93,7 +93,8 @@ class Index extends Component {
}}
/>
}
nextCallback={imageId => this.handleImport({ imageId })}
nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
nextUplaodCallback={imageId => this.handleImport({ imageId })}
/>
);
}

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