From 5cbba170e270e6f1c99a91e27dbb7951a27d596a Mon Sep 17 00:00:00 2001
From: “linengliang” <vanSuperEnergy@163.com>
Date: 星期五, 24 十一月 2023 16:41:32 +0800
Subject: [PATCH] 故障报修验收

---
 src/views/eam/modules/equipmentNew/EquipmentModal.vue |  172 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 122 insertions(+), 50 deletions(-)

diff --git a/src/views/eam/modules/equipmentNew/EquipmentModal.vue b/src/views/eam/modules/equipmentNew/EquipmentModal.vue
index 6e9a071..3932501 100644
--- a/src/views/eam/modules/equipmentNew/EquipmentModal.vue
+++ b/src/views/eam/modules/equipmentNew/EquipmentModal.vue
@@ -32,8 +32,9 @@
                 placeholder="璇烽�夋嫨璁惧鎵�灞炲垎绫�"
                 :disabled="formDisabled"
                 :triggerChange="true"
-                :dictCode="'mom_eam_equipment_category,name,id,equipment_category_uda1 = '+'\''+caytegoryParam+'\''"
+                :dictCode="caytegoryParam==='all'?'mom_eam_equipment_category,name,id':'mom_eam_equipment_category,name,id,equipment_category_uda1 = '+'\''+caytegoryParam+'\''"
                 v-model="model.equipmentCategoryId"
+                @change="categoryChange"
               />
             </a-form-model-item>
           </a-col>
@@ -46,7 +47,7 @@
             >
               <a-input
                 v-model="model.num"
-                placeholder="璇疯緭鍏ヨ澶囩紪鍙�"
+                placeholder="璇疯緭鍏ョ粺涓� 缂栧彿"
                 :disabled="formDisabled"
               ></a-input>
             </a-form-model-item>
@@ -116,20 +117,22 @@
               :wrapperCol="wrapperCol"
               prop="useId"
             >
-              <a-tree-select
-                style="width: 100%"
+            
+            
+
+              <j-dict-select-tag
+                allow-clear
                 :disabled="formDisabled"
-                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
-                :tree-data="treeData"
                 placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬"
-                tree-default-expand-all
+                :triggerChange="true"
+                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                 v-model="model.useId"
               />
             </a-form-model-item>
           </a-col>
           <a-col :span="6">
             <a-form-model-item
-              label="杞﹂棿"
+              label="宸ュ尯"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
               prop="factoryModelId"
@@ -137,7 +140,7 @@
               <j-dict-select-tag
                 allow-clear
                 :disabled="formDisabled"
-                placeholder="璇烽�夋嫨杞﹂棿"
+                placeholder="璇烽�夋嫨宸ュ尯"
                 :triggerChange="true"
                 dictCode="mom_base_area,name,id,del_flag!='1'"
                 v-model="model.factoryModelId"
@@ -172,13 +175,21 @@
               :wrapperCol="wrapperCol"
               prop="manageId"
             >
-              <a-tree-select
+              <!-- <a-tree-select
                 :disabled="formDisabled"
                 style="width: 100%"
                 :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                 :tree-data="treeData"
                 placeholder="璇烽�夋嫨缁存姢閮ㄩ棬"
                 tree-default-expand-all
+                v-model="model.manageId"
+              /> -->
+              <j-dict-select-tag
+                allow-clear
+                :disabled="formDisabled"
+                placeholder="璇烽�夋嫨缁存姢閮ㄩ棬"
+                :triggerChange="true"
+                dictCode="sys_depart,depart_name,id,del_flag!='1'"
                 v-model="model.manageId"
               />
             </a-form-model-item>
@@ -261,11 +272,14 @@
               :wrapperCol="wrapperCol"
               prop="coolingSystem"
             >
-              <a-input
+              <j-dict-select-tag
+                allow-clear
                 v-model="model.coolingSystem"
                 :disabled="formDisabled"
                 placeholder="璇疯緭鍏ュ喎鍗寸郴缁�"
-              ></a-input>
+                :triggerChange="true"
+                dictCode="cooling_system"
+              />
             </a-form-model-item>
           </a-col>
           <a-col :span="6">
@@ -305,14 +319,20 @@
               :wrapperCol="wrapperCol"
               prop="operatingSystem"
             >
-              <a-input
-                v-model="model.operatingSystem"
+              <j-dict-select-tag
+                allow-clear
+                placeholder="鏄惁鏈夋搷浣滅郴缁�"
                 :disabled="formDisabled"
-                placeholder="璇疯緭鍏ユ搷浣滅郴缁�"
-              ></a-input>
+                :triggerChange="true"
+                dictCode="operation_flag"
+                v-model="model.operatingSystem"
+              />
             </a-form-model-item>
           </a-col>
-          <a-col :span="6">
+          <a-col
+            :span="6"
+            v-if="model.operatingSystem=='yes'"
+          >
             <a-form-model-item
               label="绯荤粺"
               :labelCol="labelCol"
@@ -341,12 +361,12 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="6">
-              <a-form-model-item
-                label="鍧愭爣鏁伴噺"
-                :labelCol="labelCol"
-                :wrapperCol="wrapperCol"
-                prop="coordinateNum"
-              >
+            <a-form-model-item
+              label="鍧愭爣鏁伴噺"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="coordinateNum"
+            >
               <a-input-number
                 v-model="model.coordinateNum"
                 :disabled="formDisabled"
@@ -357,23 +377,6 @@
           </a-col>
         </a-row>
         <a-row>
-          <!-- <a-col :span="6">
-            <a-form-model-item
-              label="浜х嚎"
-              :labelCol="labelCol"
-              :wrapperCol="wrapperCol"
-              prop="workCenterId"
-            >
-              <j-dict-select-tag
-                allow-clear
-                :disabled="formDisabled"
-                placeholder="璇烽�夋嫨浜х嚎"
-                :triggerChange="true"
-                dictCode="mom_base_work_center,name,id,del_flag!='1'"
-                v-model="model.workCenterId"
-              />
-            </a-form-model-item>
-          </a-col> -->
           <a-col :span="6">
             <a-form-model-item
               label="璧勪骇鍒堕�犲晢"
@@ -389,6 +392,39 @@
                 dictCode="mom_base_constructor,name,id,status!='0' and del_flag!='1'"
                 v-model="model.constructorId"
               />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-model-item
+              label="鎶�鏈姸鎬侀壌瀹氬懆鏈�"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="checkPeriod"
+            >
+              <j-dict-select-tag
+                allow-clear
+                placeholder="璇烽�夋嫨鎶�鏈姸鎬侀壌瀹氬懆鏈� "
+                :triggerChange="true"
+                dictCode="check_period"
+                :disabled="true"
+                v-model="model.checkPeriod"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="6">
+            <a-form-model-item
+              label="涓嬫鎶�鏈壌瀹氭椂闂�"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="nextTechnologyStatusQualificationTime"
+            >
+              <j-date
+                :disabled="formDisabled"
+                style="width: 100%;"
+                placeholder="璇烽�夋嫨鏃ユ湡"
+                class="query-group-cust"
+                v-model="model.nextTechnologyStatusQualificationTime"
+              ></j-date>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -668,8 +704,8 @@
               ></a-input>
             </a-form-model-item>
           </a-col>
-          </a-row>
-          <a-row hidden>
+        </a-row>
+        <a-row hidden>
           <a-col :span="6">
             <a-form-model-item
               label="骞冲潎浣跨敤鐜�"
@@ -848,6 +884,7 @@
       ></process-parameters-template-list>
       <precision-parameters-template-list
         ref="PrecisionParametersTemplateList"
+        :num="model.num"
         @sendPrecisionParametersTemplateRecord='sendPrecisionParametersTemplateRecord'
       ></precision-parameters-template-list>
     </a-spin>
@@ -878,8 +915,8 @@
       default: false,
       required: false
     },
-    caytegoryParam:{
-      type:String,
+    caytegoryParam: {
+      type: String,
       default: '',
       required: false
     }
@@ -893,11 +930,11 @@
       },
       labelCol: {
         xs: { span: 24 },
-        sm: { span: 8 },
+        sm: { span: 10 },
       },
       wrapperCol: {
         xs: { span: 24 },
-        sm: { span: 16 },
+        sm: { span: 14 },
       },
 
       confirmLoading: false,
@@ -940,7 +977,7 @@
           { required: true, message: '璇烽�夋嫨缁存姢閮ㄩ棬!' },
         ],
         useId: [
-          { required: true, message: '璇烽�夋嫨浣跨敤閮ㄩ棬閮ㄩ棬!' },
+          { required: true, message: '璇烽�夋嫨浣跨敤閮ㄩ棬!' },
         ],
         specificEquipment: [
           { required: true, message: '璇烽�夋嫨鍏抽敭璁惧鏍囪瘑!' },
@@ -955,7 +992,7 @@
           { required: true, message: '璇烽�夋嫨璁惧浜х嚎!' },
         ],
         factoryModelId: [
-          { required: true, message: '璇烽�夋嫨璁惧杞﹂棿!' },
+          { required: true, message: '璇烽�夋嫨宸ュ尯!' },
         ],
         warrantyStart: [
           { required: true, message: '璇烽�夋嫨寮�濮嬫棩鏈�!' },
@@ -966,11 +1003,15 @@
         propertyStatus: [
           { required: true, message: '璇烽�夋嫨璧勪骇鐘舵��!' },
         ],
+        system: [
+          { required: true, message: '璇疯緭鍏ョ郴缁�!' },
+        ]
       },
       url: {
         add: "/eam/equipment/add",
         edit: "/eam/equipment/edit",
         loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
+        getCategoryFlag: "/eam/equipmentCategory/queryById"
       },
       treeData: [],
       needSpecific: false,
@@ -990,8 +1031,8 @@
     edit(record) {
       console.log(this.disabled)
       this.model = Object.assign({}, record);
-      if(!this.model.id){
-          this.model.equipmentStatus = '1'
+      if (!this.model.id) {
+        this.model.equipmentStatus = '1'
       }
       this.visible = true;
     },
@@ -1139,6 +1180,10 @@
     },
 
     onSearchPrecisionParametersTemplate() {
+      if (this.model.num == '' || this.model.num == undefined || this.model.num == null) {
+        this.$message.warn("璇峰厛濉啓缁熶竴缂栫爜")
+        return false;
+      }
       this.$refs.PrecisionParametersTemplateList.list();
       this.$refs.PrecisionParametersTemplateList.title = "閫夋嫨璁惧绮惧害妯℃澘";
     },
@@ -1187,6 +1232,33 @@
           }
         })
       }
+      //鏀瑰彉鎶�鏈姸鎬侀壌瀹氬懆鏈�
+      if (this.model.equipmentCategoryId !== null && this.model.equipmentCategoryId != '') {
+        var value = this.model.equipmentCategoryId;
+        getAction(this.url.getCategoryFlag, { id: value }).then(res => {
+          if (res.result.equipmentCategoryUda1 !== 'weldingMachine' && res.result.equipmentCategoryUda11 !== 'filesCarousel' && res.result.equipmentCategoryUda1 !== 'tester') {
+            if (val === 'A') {
+              this.model.checkPeriod = 365 * 3 + '';
+            }
+            if (val === 'B' || val === 'C' || val === 'D') {
+              this.model.checkPeriod = 365 * 4 + '';
+            }
+          }
+          this.model = Object.assign({}, this.model);
+        })
+      }
+    },
+    categoryChange(value) {
+      getAction(this.url.getCategoryFlag, { id: value }).then(res => {
+        if (res.result.equipmentCategoryUda1 === 'weldingMachine') {
+          this.model.checkPeriod = 365 * 3 + '';
+        } else if (res.result.equipmentCategoryUda1 === 'filesCarousel') {
+          this.model.checkPeriod = 365 * 4 + '';
+        } else if (res.result.equipmentCategoryUda1 === 'tester') {
+          this.model.checkPeriod = 365 * 1 + '';
+        }
+        this.model = Object.assign({}, this.model);
+      })
     }
   },
   computed: {

--
Gitblit v1.9.3