From 715c1b9728d67bad61928a1564cc493e21ee7409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= <2178503051@qq.com> Date: Tue, 2 Jun 2026 16:49:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(qc/inspection):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=A3=80=E9=AA=8C=E5=85=A5=E5=9C=BA=E5=8D=B7?= =?UTF-8?q?=E5=8F=B7=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 移除表单内置的入场卷号校验规则,改为手动校验 2. 添加失焦校验和实时错误提示 3. 优化两个页面的卷号选择表单结构 --- .../KLPService/SchemeSelect/index.vue | 55 +++++++++---------- klp-ui/src/views/mes/qc/inspection/task.vue | 28 ++++++---- 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/klp-ui/src/components/KLPService/SchemeSelect/index.vue b/klp-ui/src/components/KLPService/SchemeSelect/index.vue index cf3a72c7..49f37663 100644 --- a/klp-ui/src/components/KLPService/SchemeSelect/index.vue +++ b/klp-ui/src/components/KLPService/SchemeSelect/index.vue @@ -63,22 +63,19 @@ - - - - -
-
- - 可输入入场卷号或厂家卷号,两者互通匹配 -
- + -
- +
-
+
请输入入场卷号
+ + +
@@ -527,14 +530,12 @@ export default { attachmentLoading: false, attachmentTaskRow: null, attachmentFiles: '', + enterCoilNoError: false, }; }, computed: { taskRules() { - return { - ...this.baseTaskRules, - enterCoilNos: [{ required: this.taskForm.taskType === '产品检验', message: '请输入入场卷号', trigger: 'blur' }], - }; + return { ...this.baseTaskRules }; }, itemReadonly() { if (!this.readonly) return false; @@ -629,7 +630,12 @@ export default { this.taskTitle = "修改检验任务"; }); }, + validateEnterCoilNos() { + this.enterCoilNoError = this.taskForm.taskType === '产品检验' && this.selectedEnterCoilNos.length === 0; + }, submitTaskForm() { + this.validateEnterCoilNos(); + if (this.enterCoilNoError) return; this.$refs["taskForm"].validate(valid => { if (valid) { this.buttonLoading = true; @@ -794,12 +800,13 @@ export default { if (!this.selectedEnterCoilNos.includes(item.value)) { this.selectedEnterCoilNos.push(item.value); } - this.tempEnterCoilNo = ''; this.taskForm.enterCoilNos = this.selectedEnterCoilNos.join(','); + this.validateEnterCoilNos(); }, removeEnterCoilNo(index) { this.selectedEnterCoilNos.splice(index, 1); this.taskForm.enterCoilNos = this.selectedEnterCoilNos.join(','); + this.validateEnterCoilNos(); }, querySupplierCoilNo(queryString, cb) { if (!queryString || queryString.length < 2) { @@ -830,9 +837,9 @@ export default { if (item.enterCoilNo && !this.selectedEnterCoilNos.includes(item.enterCoilNo)) { this.selectedEnterCoilNos.push(item.enterCoilNo); this.taskForm.enterCoilNos = this.selectedEnterCoilNos.join(','); - this.$refs["taskForm"].validateField('enterCoilNos'); } this.tempSupplierCoilNo = ''; + this.validateEnterCoilNos(); }, removeSupplierCoilNo(index) { this.selectedSupplierCoilNos.splice(index, 1); @@ -870,6 +877,7 @@ export default { this.tempEnterCoilNo = ''; this.selectedSupplierCoilNos = []; this.tempSupplierCoilNo = ''; + this.enterCoilNoError = false; this.resetForm("taskForm"); },