导入参数校验

This commit is contained in:
MustangDeng 2022-06-15 18:31:10 +08:00
parent 1ce692421a
commit 2adc0ee33a
3 changed files with 22 additions and 2 deletions

View File

@ -39,8 +39,27 @@ export default class ImportModal extends React.Component {
this.props.setStep(step - 1);
}
validateDate() {
const { params } = this.props;
let flag = true
try {
params && Object.keys(params).forEach((key) => {
if(!params[key] || params[key] == "") {
message.warning("参数不完整");
throw new Error("参数不完整")
}
})
} catch(e) {
flag = false
}
return flag;
}
handleStep1Next() {
if(!this.validateDate()) {
return
}
if(this.state.fileId) {
this.props.setStep(1)
} else {

View File

@ -54,7 +54,7 @@ export default class baseFormModal extends React.Component {
saveBasic(params).then((id) => {
this.props.onCancel()
this.props.onRefresh()
window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetail?id=" + id)
window.open("/spa/hrmSalary/static/index.html#/main/hrmSalary/calculateDetailz?id=" + id)
})
}

View File

@ -532,6 +532,7 @@ export default class CumDeduct extends React.Component {
init={() => {
this.handleInitModal();
}}
onValidate={() => {this.handleValidate()}}
params={modalParam}
columns={modalColumns}
step={step}