diff --git a/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue b/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue index 90aea1ad..ba93cff4 100644 --- a/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue +++ b/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue @@ -393,7 +393,16 @@ export default { // 收集所有表单信息 let formDataList = [] if (isValidate) { - formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm, this.baseInfoForm) + // 记录表单验证是否报错 + let err = null + formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm, this.baseInfoForm).catch(() => { + err = true + return [] + }) + // 如果有错误就跳转表单 + if (err !== null) { + throw new Error('base') + } } else { formDataList = [ this.processInfoForm.getFieldsValue(), diff --git a/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue b/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue index 7278a708..bfb4bb21 100644 --- a/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue +++ b/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue @@ -311,8 +311,19 @@ export default { // 收集所有表单信息 let formDataList = [] if (isValidate) { - formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm) - formDataList[2] = await this.$refs.baseInfoForm.getDataValidate() + // 记录表单验证是否报错 + let err = null + formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm).catch(() => { + err = true + return [] + }) + formDataList[2] = await this.$refs.baseInfoForm.getDataValidate().catch(() => { + err = true + }) + // 如果有错误就跳转表单 + if (err !== null) { + throw new Error('base') + } } else { formDataList = [ this.processInfoForm.getFieldsValue(), @@ -322,6 +333,7 @@ export default { // 保存清空校验 this.approvalInfoForm.validateFields(['commitText'], { force: true }, () => {}) } + // 收集人员信息 const getPersonInfo = this.getPersonInfo(isValidate) if (!getPersonInfo) { diff --git a/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue b/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue index 11d8025f..f73c9033 100644 --- a/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue +++ b/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue @@ -251,18 +251,22 @@ export default { // 去除备注必填 this.validatorRules.remarks.rules[0].required = false const params = {} - // 记录验证是否报错 - let err = null // 收集所有表单信息 let formDataList = [] if (isValidate) { + // 记录表单验证是否报错 + let err = null formDataList = await this.validateFormList(this.processInfoForm, this.approvalInfoForm).catch(() => { - err = 'base' + err = true return [] }) formDataList[2] = await this.$refs.baseInfoForm.getDataValidate().catch(() => { - err = 'base' + err = true }) + // 如果有错误就跳转表单 + if (err !== null) { + throw new Error('base') + } } else { formDataList = [ this.processInfoForm.getFieldsValue(), @@ -294,10 +298,6 @@ export default { projectId: this.projectId, id: this.formInfo.id }) - // 如果有错误就跳转对应页面 - if (err !== null) { - throw new Error(err) - } return params }, /**