-
-
- 可输入入场卷号或厂家卷号,两者互通匹配
-
-
+
+
+
+
+ 可输入入场卷号或厂家卷号,两者互通匹配
+
+
-
-
+
-
+
请输入入场卷号
+
+
+
@@ -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");
},