From 57c746aa1c682d96465b3fe5d2f95eeb1ed2c4c1 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 09 七月 2025 19:54:01 +0800
Subject: [PATCH] art: 技术状态鉴定-基础代码生成

---
 src/views/eam/equipment/modules/EamEquipmentModal.vue |  109 ++++++++++++++++++++++++++++--------------------------
 1 files changed, 56 insertions(+), 53 deletions(-)

diff --git a/src/views/eam/equipment/modules/EamEquipmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentModal.vue
index 5bc74b5..a06b114 100644
--- a/src/views/eam/equipment/modules/EamEquipmentModal.vue
+++ b/src/views/eam/equipment/modules/EamEquipmentModal.vue
@@ -24,7 +24,7 @@
                 </a-col>
                 <a-col :span="customSpan">
                   <a-form-model-item prop="equipmentCode" label="缁熶竴缂栫爜">
-                    <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode"/>
+                    <a-input placeholder="璇疯緭鍏ョ粺涓�缂栫爜" v-model="model.equipmentCode" :disabled="!editable"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
@@ -35,7 +35,7 @@
                 <a-col :span="customSpan">
                   <a-form-model-item prop="factoryOrgCode" label="浣跨敤閮ㄩ棬">
                     <a-tree-select v-model="model.factoryOrgCode" style="width: 100%" show-search
-                                   :tree-data="productionTreeData"
+                                   :tree-data="productionTreeData" :disabled="!editable"
                                    :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                                    placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬" allow-clear treeNodeFilterProp="title"
                                    :replaceFields="{key:'orgCode',value:'orgCode'}"
@@ -47,18 +47,8 @@
               <a-row>
                 <a-col :span="customSpan">
                   <a-form-model-item prop="equipmentCategory" label="鎵�灞炲垎绫�">
-                    <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨鎵�灞炲垎绫�"
+                    <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨鎵�灞炲垎绫�" :disabled="!editable"
                                        v-model="model.equipmentCategory"/>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span="customSpan">
-                  <a-form-model-item label="璐ㄤ繚寮�濮嬫棩鏈�">
-                    <a-date-picker v-model="model.warrantyStartDate" value-format="YYYY-MM-DD" style="width:100%"/>
-                  </a-form-model-item>
-                </a-col>
-                <a-col :span="customSpan">
-                  <a-form-model-item label="璐ㄤ繚缁撴潫鏃ユ湡">
-                    <a-date-picker v-model="model.warrantyEndDate" value-format="YYYY-MM-DD" style="width:100%"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
@@ -66,12 +56,13 @@
                     <j-dict-select-tag dict-code="abc_flag" placeholder="璇烽�夋嫨ABC鏍囪瘑" v-model="model.abcFlag"/>
                   </a-form-model-item>
                 </a-col>
-              </a-row>
-
-              <a-row>
                 <a-col :span="customSpan">
                   <a-form-model-item prop="repairDepartOrgCode" label="缁翠慨鐝粍">
-                    <a-input placeholder="璇烽�夋嫨缁翠慨鐝粍" v-model="model.repairDepartOrgCode"/>
+                    <a-tree-select v-model="model.repairDepartOrgCode" style="width: 100%"
+                                   show-search :tree-data="repairDepartTreeData" treeNodeFilterProp="title"
+                                   :replaceFields="{key:'orgCode',value:'orgCode'}" searchPlaceholder="璇疯緭鍏ュ叧閿瓧鎼滅储"
+                                   :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="璇烽�夋嫨缁翠慨鐝粍"
+                                   allow-clear tree-default-expand-all/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
@@ -89,13 +80,13 @@
                 </a-col>
                 <a-col :span="customSpan">
                   <a-form-model-item label="鐏伀鍣�">
-                    <a-input placeholder="璇疯緭鍏ョ伃鐏櫒" v-model="model.fireExtinguisher"/>
+                    <j-dict-select-tag dict-code="yn" type="radio" v-model="model.fireExtinguisher"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
                   <a-form-model-item label="鐏伀鍣ㄦ湁鏁堟湡">
-                    <a-date-picker v-model="model.fireExtinguisherExpirationDate" value-format="YYYY-MM-DD"
-                                   style="width:100%"/>
+                    <a-input :disabled="!Boolean(+model.fireExtinguisher)"
+                             v-model="model.fireExtinguisherExpirationDate" placeholder="璇疯緭鍏ョ伃鐏櫒鏈夋晥鏈�"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
@@ -108,7 +99,7 @@
               <a-row>
                 <a-col :span="customSpan">
                   <a-form-model-item label="绯荤粺">
-                    <a-input placeholder="璇疯緭鍏ョ郴缁�" v-model="model.system"/>
+                    <a-input placeholder="璇疯緭鍏ョ郴缁�" :disabled="!Boolean(+model.operationSystem)" v-model="model.system"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
@@ -118,7 +109,8 @@
                 </a-col>
                 <a-col :span="customSpan">
                   <a-form-model-item label="鍧愭爣鏁伴噺">
-                    <a-input-number placeholder="璇疯緭鍏ュ潗鏍囨暟閲�" v-model="model.coordinateNum" :min="0" style="width: 100%"/>
+                    <a-input-number placeholder="璇疯緭鍏ュ潗鏍囨暟閲�" v-model="model.coordinateNum" :min="0" :max="12"
+                                    style="width: 100%"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
@@ -199,8 +191,9 @@
 
               <a-row>
                 <a-col :span="customSpan">
-                  <a-form-model-item label="鎬诲姛鐜�">
-                    <a-input placeholder="璇疯緭鍏ユ�诲姛鐜�" v-model="model.equipmentPower"/>
+                  <a-form-model-item label="鎬诲姛鐜�(KW)">
+                    <a-input-number placeholder="璇疯緭鍏ユ�诲姛鐜�(KW)" v-model="model.equipmentPower" :min="0"
+                                    style="width: 100%"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
@@ -223,7 +216,8 @@
               <a-row>
                 <a-col :span="customSpan">
                   <a-form-model-item label="鏈涓変繚鏃ユ湡">
-                    <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD" style="width:100%"/>
+                    <a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD"
+                                   :disabled="!editable" style="width:100%"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
@@ -232,14 +226,15 @@
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
-                  <a-form-model-item label="涓変繚鍛ㄦ湡">
-                    <a-input-number placeholder="璇疯緭鍏ヤ笁淇濆懆鏈�" v-model="model.thirdMaintenancePeriod" :min="0"
+                  <a-form-model-item label="涓変繚鍛ㄦ湡锛堝勾锛�">
+                    <a-input-number placeholder="璇疯緭鍏ヤ笁淇濆懆鏈燂紙骞达級" v-model="model.thirdMaintenancePeriod" :min="1"
                                     style="width: 100%"/>
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
                   <a-form-model-item label="鏈鎶�鏈壌瀹氭棩鏈�">
-                    <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD" style="width:100%"/>
+                    <a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD"
+                                   :disabled="!editable" style="width:100%"/>
                   </a-form-model-item>
                 </a-col>
               </a-row>
@@ -251,8 +246,8 @@
                   </a-form-model-item>
                 </a-col>
                 <a-col :span="customSpan">
-                  <a-form-model-item label="鎶�鏈壌瀹氬懆鏈�">
-                    <a-input-number placeholder="璇疯緭鍏ユ妧鏈壌瀹氬懆鏈�" v-model="model.technologyCheckPeriod" :min="0"
+                  <a-form-model-item label="鎶�鏈壌瀹氬懆鏈燂紙骞达級">
+                    <a-input-number placeholder="璇疯緭鍏ユ妧鏈壌瀹氬懆鏈燂紙骞达級" v-model="model.technologyCheckPeriod" :min="1"
                                     style="width: 100%"/>
                   </a-form-model-item>
                 </a-col>
@@ -300,6 +295,9 @@
     name: 'EamEquipmentModal',
     props: {
       productionTreeData: {
+        type: Array
+      },
+      repairDepartTreeData: {
         type: Array
       }
     },
@@ -359,14 +357,17 @@
     },
     methods: {
       add() {
-        this.editable = false
+        this.editable = true
         //鍒濆鍖栭粯璁ゅ��
-        this.model = {}
+        this.model = {
+          operationSystem: 1,
+          fireExtinguisher: 0
+        }
         this.visible = true
       },
 
       edit(record) {
-        this.editable = true
+        this.editable = false
         this.model = Object.assign({}, record)
         this.visible = true
       },
@@ -377,32 +378,34 @@
         this.$refs.form.validate(valid => {
           if (valid) {
             that.confirmLoading = true
-            let httpurl = ''
+            let httpUrl = ''
             let method = ''
             if (!this.model.id) {
-              httpurl += this.url.add
+              httpUrl += this.url.add
               method = 'post'
             } else {
-              httpurl += this.url.edit
+              httpUrl += this.url.edit
               method = 'put'
             }
-            httpAction(httpurl, this.model, method).then((res) => {
-              if (res.success) {
-                that.$notification.success({
-                  message: '娑堟伅',
-                  description: res.message
-                })
-                that.$emit('ok')
-                that.close()
-              } else {
-                that.$notification.warning({
-                  message: '娑堟伅',
-                  description: res.message
-                })
-              }
-            }).finally(() => {
-              that.confirmLoading = false
-            })
+            httpAction(httpUrl, this.model, method)
+              .then((res) => {
+                if (res.success) {
+                  that.$notification.success({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                  that.$emit('ok')
+                  that.close()
+                } else {
+                  that.$notification.warning({
+                    message: '娑堟伅',
+                    description: res.message
+                  })
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = false
+              })
           } else {
             return false
           }

--
Gitblit v1.9.3