From ca332579e1be450f614644542581c55f7da542cc Mon Sep 17 00:00:00 2001 From: danshihao Date: Thu, 21 Dec 2023 09:42:06 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=A9=B3=E5=9B=9E=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EnterpriseStandardInspectionPlanFlow.vue | 13 ++++++++++++- .../EnterpriseStandardInspectionProcess.vue | 13 ++++++++++++- .../EnterpriseStandardInspectionRectification.vue | 13 ++++++++++++- .../InspectionExtensionRequestProcess.vue | 13 ++++++++++++- .../PermissionApplicationProcess.vue | 13 ++++++++++++- .../PostMeetingManageProcess.vue | 4 +++- .../StandardPromotionProcess.vue | 4 +++- 7 files changed, 66 insertions(+), 7 deletions(-) diff --git a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue index cf3566e8..95dee5ea 100644 --- a/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue +++ b/src/views/workCenter/enterpriseStandardInspectionPlan/EnterpriseStandardInspectionPlanFlow.vue @@ -326,6 +326,8 @@ export default { }, // 获取页面参数 async getPageParams (isValidate = true) { + // 去除备注必填 + this.validatorRules.remarks.rules[0].required = false if (this.$refs.inspectionPlanTable.dataSource.length === 0) { this.$message.warning(this.$t('addAtLeastOneRowOfData')) throw new Error('base') @@ -517,6 +519,15 @@ export default { */ handleReject () { if (this.loading) return + // 备注设置必填并校验(校验第一次正常,第二次校验就不提示,force配置项解决问题) + this.validatorRules.remarks.rules[0].required = true + this.$nextTick(() => { + this.approvalInfoForm.validateFields(['commitText'], { force: true }, (err) => { + if (err) { + this.switchChange('base') + } + }) + }) // 驳回需要填写备注 if (!this.approvalInfoForm.getFieldValue('commitText')) { this.$message.warning(this.$t('pleaseEnterRemarks')) @@ -576,7 +587,7 @@ export default { for (const form of formList) { promiseList.push( new Promise((resolve, reject) => { - form.validateFields((err, val) => { + form.validateFields({ force: true }, (err, val) => { if (!err) { resolve(val) } else { diff --git a/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue b/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue index e11db8e4..8b35e779 100644 --- a/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue +++ b/src/views/workCenter/enterpriseStandardInspectionProcess/EnterpriseStandardInspectionProcess.vue @@ -279,6 +279,8 @@ export default { }, // 获取页面参数 async getPageParams (isValidate = true) { + // 去除备注必填 + this.validatorRules.remarks.rules[0].required = false if (this.$refs.inspectionProcessTable.dataSource.length === 0) { this.$message.warning(this.$t('addAtLeastOneRowOfData')) throw new Error('base') @@ -440,6 +442,15 @@ export default { */ handleReject () { if (this.loading) return + // 备注设置必填并校验(校验第一次正常,第二次校验就不提示,force配置项解决问题) + this.validatorRules.remarks.rules[0].required = true + this.$nextTick(() => { + this.approvalInfoForm.validateFields(['commitText'], { force: true }, (err) => { + if (err) { + this.switchChange('base') + } + }) + }) // 驳回需要填写备注 if (!this.approvalInfoForm.getFieldValue('commitText')) { this.$message.warning(this.$t('pleaseEnterRemarks')) @@ -473,7 +484,7 @@ export default { for (const form of formList) { promiseList.push( new Promise((resolve, reject) => { - form.validateFields((err, val) => { + form.validateFields({ force: true }, (err, val) => { if (!err) { resolve(val) } else { diff --git a/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue b/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue index 0ce2d31d..0a3d4237 100644 --- a/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue +++ b/src/views/workCenter/enterpriseStandardInspectionRectification/EnterpriseStandardInspectionRectification.vue @@ -278,6 +278,8 @@ export default { }, // 获取页面参数 async getPageParams (isValidate = true) { + // 去除备注必填 + this.validatorRules.remarks.rules[0].required = false const params = {} // 收集所有表单信息 let formDataList = [] @@ -437,6 +439,15 @@ export default { */ handleReject () { if (this.loading) return + // 备注设置必填并校验(校验第一次正常,第二次校验就不提示,force配置项解决问题) + this.validatorRules.remarks.rules[0].required = true + this.$nextTick(() => { + this.approvalInfoForm.validateFields(['commitText'], { force: true }, (err) => { + if (err) { + this.switchChange('base') + } + }) + }) // 驳回需要填写备注 if (!this.approvalInfoForm.getFieldValue('commitText')) { this.$message.warning(this.$t('pleaseEnterRemarks')) @@ -470,7 +481,7 @@ export default { for (const form of formList) { promiseList.push( new Promise((resolve, reject) => { - form.validateFields((err, val) => { + form.validateFields({ force: true }, (err, val) => { if (!err) { resolve(val) } else { diff --git a/src/views/workCenter/inspectionExtensionRequestProcess/InspectionExtensionRequestProcess.vue b/src/views/workCenter/inspectionExtensionRequestProcess/InspectionExtensionRequestProcess.vue index 3c6f48c5..03afa187 100644 --- a/src/views/workCenter/inspectionExtensionRequestProcess/InspectionExtensionRequestProcess.vue +++ b/src/views/workCenter/inspectionExtensionRequestProcess/InspectionExtensionRequestProcess.vue @@ -284,6 +284,8 @@ export default { }, // 获取页面参数 async getPageParams (isValidate = true) { + // 去除备注必填 + this.validatorRules.remarks.rules[0].required = false // 必须有数据才能提交 if (this.$refs.extensionRequestTable.dataSource.length === 0) { this.$message.warning(this.$t('addAtLeastOneRowOfData')) @@ -449,6 +451,15 @@ export default { */ handleReject () { if (this.loading) return + // 备注设置必填并校验(校验第一次正常,第二次校验就不提示,force配置项解决问题) + this.validatorRules.remarks.rules[0].required = true + this.$nextTick(() => { + this.approvalInfoForm.validateFields(['commitText'], { force: true }, (err) => { + if (err) { + this.switchChange('base') + } + }) + }) // 驳回需要填写备注 if (!this.approvalInfoForm.getFieldValue('commitText')) { this.$message.warning(this.$t('pleaseEnterRemarks')) @@ -482,7 +493,7 @@ export default { for (const form of formList) { promiseList.push( new Promise((resolve, reject) => { - form.validateFields((err, val) => { + form.validateFields({ force: true }, (err, val) => { if (!err) { resolve(val) } else { diff --git a/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue b/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue index 54d75708..41543277 100644 --- a/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue +++ b/src/views/workCenter/permissionApplicationProcess/PermissionApplicationProcess.vue @@ -359,6 +359,8 @@ export default { }, // 获取页面参数 async getPageParams (isValidate = true) { + // 去除备注必填 + this.validatorRules.remarks.rules[0].required = false // 节点1判断表格是否有数据 if (this.isInitiate && this.$refs.baseInfoTable.dataSource.length === 0) { this.$message.warning(this.$t('addAtLeastOneRowOfData')) @@ -529,6 +531,15 @@ export default { */ handleReject () { if (this.loading) return + // 备注设置必填并校验(校验第一次正常,第二次校验就不提示,force配置项解决问题) + this.validatorRules.remarks.rules[0].required = true + this.$nextTick(() => { + this.approvalInfoForm.validateFields(['commitText'], { force: true }, (err) => { + if (err) { + this.switchChange('base') + } + }) + }) // 驳回需要填写备注 if (!this.approvalInfoForm.getFieldValue('commitText')) { this.$message.warning(this.$t('pleaseEnterRemarks')) @@ -562,7 +573,7 @@ export default { for (const form of formList) { promiseList.push( new Promise((resolve, reject) => { - form.validateFields((err, val) => { + form.validateFields({ force: true }, (err, val) => { if (!err) { resolve(val) } else { diff --git a/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue b/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue index 3e07d424..9d731111 100644 --- a/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue +++ b/src/views/workCenter/postMeetingManageProcess/PostMeetingManageProcess.vue @@ -305,6 +305,8 @@ export default { }, // 获取页面参数 async getPageParams (isValidate = true) { + // 去除备注必填 + this.validatorRules.remarks.rules[0].required = false const params = {} // 收集所有表单信息 let formDataList = [] @@ -495,7 +497,7 @@ export default { for (const form of formList) { promiseList.push( new Promise((resolve, reject) => { - form.validateFields((err, val) => { + form.validateFields({ force: true }, (err, val) => { if (!err) { resolve(val) } else { diff --git a/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue b/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue index e60133eb..5b320af6 100644 --- a/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue +++ b/src/views/workCenter/standardPromotionProcess/StandardPromotionProcess.vue @@ -248,6 +248,8 @@ export default { }, // 获取页面参数 async getPageParams (isValidate = true) { + // 去除备注必填 + this.validatorRules.remarks.rules[0].required = false const params = {} // 收集所有表单信息 let formDataList = [] @@ -341,7 +343,7 @@ export default { for (const form of formList) { promiseList.push( new Promise((resolve, reject) => { - form.validateFields((err, val) => { + form.validateFields({ force: true }, (err, val) => { if (!err) { resolve(val) } else {