From ad112923c5bcb152275dcd6e2403c3fc29a45382 Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期四, 14 八月 2025 17:36:00 +0800
Subject: [PATCH] 产线必填校验

---
 src/views/base/modules/factoryManager/FactoryModal.vue |    7 ++++++-
 src/views/base/FactoryManager.vue                      |    7 +++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/views/base/FactoryManager.vue b/src/views/base/FactoryManager.vue
index 61c782a..1ed3c6c 100644
--- a/src/views/base/FactoryManager.vue
+++ b/src/views/base/FactoryManager.vue
@@ -86,7 +86,7 @@
                 </a-tree-select>
               </a-form-model-item>
               <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鎺掑簭">
-                <a-input-number v-model="model.sorter"/>
+                <a-input-number v-model="model.sorter" style="width:100%"/>
               </a-form-model-item>
               <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="澶囨敞">
                 <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark"/>
@@ -166,7 +166,9 @@
           edges: []
         },
         validatorRules: {
-          factoryName: [{ required: true, message: '璇疯緭鍏ヤ骇绾�/杞﹂棿鍚嶇О!' }]
+          factoryCode:[{ required: true, message: '璇疯緭鍏ュ伐鍘�/杞﹂棿/浜х嚎缂栧彿!' }],
+          factoryName:[{ required: true, message: '璇疯緭鍏ュ伐鍘�/杞﹂棿/浜х嚎鍚嶇О!' }],
+          productionType:[{ required: false, message: '璇烽�夋嫨浜х嚎绫诲瀷!' }],
         },
         url: {
           delete: '/base/factory/delete',
@@ -348,6 +350,7 @@
         this.setValuesToForm(record)
         if(record.factoryCategory == '3'){
           this.$refs.userFactory.show(record.id)
+          this.validatorRules.productionType[0].required = true
         }else{
           this.$refs.userFactory.factoryId = ''
         }
diff --git a/src/views/base/modules/factoryManager/FactoryModal.vue b/src/views/base/modules/factoryManager/FactoryModal.vue
index 4454250..f26ce6c 100644
--- a/src/views/base/modules/factoryManager/FactoryModal.vue
+++ b/src/views/base/modules/factoryManager/FactoryModal.vue
@@ -55,7 +55,7 @@
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
           label="鎺掑簭">
-          <a-input-number v-model="model.sorter"/>
+          <a-input-number v-model="model.sorter" style="width:100%"/>
         </a-form-model-item>
         <a-form-model-item
           :labelCol="labelCol"
@@ -98,7 +98,9 @@
 
         confirmLoading: false,
         validatorRules:{
+          factoryCode:[{ required: true, message: '璇疯緭鍏ュ伐鍘�/杞﹂棿/浜х嚎缂栧彿!' }],
           factoryName:[{ required: true, message: '璇疯緭鍏ュ伐鍘�/杞﹂棿/浜х嚎鍚嶇О!' }],
+          productionType:[{ required: false, message: '璇烽�夋嫨浜х嚎绫诲瀷!' }],
         },
         url: {
           add: "/base/factory/add",
@@ -157,6 +159,9 @@
       edit (record,factoryCategory) {
         this.visible = true;
         this.model = Object.assign({}, this.defaultModel, record)
+        if(factoryCategory == '2'){
+          this.validatorRules.productionType[0].required = true
+        }
         this.loadTreeData();
         this.model.parentId = record!=null?record.toString():null;
         this.factoryCategory = factoryCategory

--
Gitblit v1.9.3