From 4acefa765c42b0cf4ebb4bf8bd63b2c5b9c4da33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Tue, 12 Dec 2023 15:19:59 +0800
Subject: [PATCH] =?UTF-8?q?hotfix/2.9.9.2312.01=20=E5=AF=BC=E5=85=A5?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/importDialog/index.js | 48 ++++++++++++-------
.../calcOc/components/salaryCalcOcImport.js | 3 +-
.../components/salaryEditCalcImport/index.js | 3 +-
.../socialSecurityBenefits/archives/index.js | 3 +-
4 files changed, 37 insertions(+), 20 deletions(-)
diff --git a/pc4mobx/hrmSalary/components/importDialog/index.js b/pc4mobx/hrmSalary/components/importDialog/index.js
index b7eafd97..f174e93d 100644
--- a/pc4mobx/hrmSalary/components/importDialog/index.js
+++ b/pc4mobx/hrmSalary/components/importDialog/index.js
@@ -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(111, "请先上传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(111, "请先上传EXCEL文件"));
- return;
- }
- const [file] = fileList;
- const { response } = file;
- this.props.nextCallback(response.data.fileid);
} else {
this.setState({ current: this.state.current + 1 });
}
diff --git a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js
index 10f92051..11a784ca 100644
--- a/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js
+++ b/pc4mobx/hrmSalary/pages/calculate/calcOc/components/salaryCalcOcImport.js
@@ -62,7 +62,8 @@ class SalaryCalcOcImport extends Component {
onResetImportResult={() => this.setState(({
importDialog: { ...importDialog, importResult: {}, imageId: "" }
}))}
- nextCallback={imageId => this.handleImport({ imageId })}
+ nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
+ nextUplaodCallback={imageId => this.handleImport({ imageId })}
/>
);
}
diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
index ede7b2fa..463c7df4 100644
--- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
+++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalcImport/index.js
@@ -141,7 +141,8 @@ class Index extends Component {
}}
/>
}
- nextCallback={imageId => this.handleImport({ imageId })}
+ nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
+ nextUplaodCallback={imageId => this.handleImport({ imageId })}
/>
}
- nextCallback={imageId => this.handleImport({ imageId })}
+ nextCallback={imageId => this.setState({ importDialog: { ...importDialog, imageId } })}
+ nextUplaodCallback={imageId => this.handleImport({ imageId })}
/>
{
this.state.importVisible &&