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/specialtyMaintenancePlan/SpecialtyMaintenancePlanModal.vue |   61 +++++++++++++++++++++++-------
 1 files changed, 47 insertions(+), 14 deletions(-)

diff --git a/src/views/eam/modules/specialtyMaintenancePlan/SpecialtyMaintenancePlanModal.vue b/src/views/eam/modules/specialtyMaintenancePlan/SpecialtyMaintenancePlanModal.vue
index 2652e8f..036d907 100644
--- a/src/views/eam/modules/specialtyMaintenancePlan/SpecialtyMaintenancePlanModal.vue
+++ b/src/views/eam/modules/specialtyMaintenancePlan/SpecialtyMaintenancePlanModal.vue
@@ -29,15 +29,24 @@
           </a-col>
           <a-col :span="12">
             <a-form-item
-              label="瀵硅薄閮ㄩ棬"
+              label="浣跨敤閮ㄩ棬"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
             >
-              <a-select
-                :placeholder="disableSubmit?'':'璇烽�夋嫨瀵硅薄閮ㄩ棬'"
+              <!-- <a-select
+                :placeholder="disableSubmit?'':'璇烽�夋嫨浣跨敤閮ㄩ棬'"
                 :options="this.departs"
                 style="width: 100%"
                 :disabled="disableSubmit"
+                v-decorator="['departId', validatorRules.departId]"
+                @change="(e)=>handle2Change(e)"
+              /> -->
+              <a-tree-select
+                style="width: 100%"
+                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
+                :tree-data="treeData"
+                placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬"
+                tree-default-expand-all
                 v-decorator="['departId', validatorRules.departId]"
                 @change="(e)=>handle2Change(e)"
               />
@@ -67,7 +76,7 @@
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
             >
-            <j-dict-select-tag
+              <j-dict-select-tag
                 allow-clear
                 :disabled="disableSubmit"
                 :placeholder="disableSubmit?'':'璇烽�夋嫨璐d换鐝粍'"
@@ -184,7 +193,7 @@
               />
             </a-form-item>
           </a-col>
-      
+
         </a-row>
       </a-form>
     </a-spin>
@@ -282,7 +291,7 @@
           dataIndex: 'versionStatusName'
         },
         {
-          title: '璁惧缂栫爜',
+          title: '缁熶竴缂栫爜',
           align: 'center',
           dataIndex: 'equipmentNum'
         },
@@ -311,6 +320,7 @@
       codeDisable: true,
       model: {},
       maintenanceCycles: [],
+      treeData: [],
       departs: [],
       labelCol: {
         xs: { span: 24 },
@@ -336,10 +346,10 @@
         },
         departId: {
           rules: [
-            { required: true, message: '璇烽�夋嫨瀵硅薄閮ㄩ棬!' },
+            { required: true, message: '璇烽�夋嫨浣跨敤閮ㄩ棬!' },
           ]
         },
-       teamId: {
+        teamId: {
           rules: [
             { required: true, message: '璇烽�夋嫨璐d换鐝粍!' },
           ]
@@ -377,6 +387,8 @@
         listByBusIdAndBusType: "/system/sysUploadRela/listByBusIdAndBusType",
         getMaintenanceCycles: "/eam/maintenanceStandardDetail/getMaintenanceCycle",
         getSysDeparts: "/eam/equipment/getSysDeparts",
+        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
+        getNum: '/eam/sysIdentity/getNumNew'
       },
       dataSource: [],
       //鐢ㄤ簬灞曠ず鏂囦欢
@@ -396,9 +408,9 @@
           maintenanceStandardId: data[i].id,
           num: data[i].num,
           equipmentId: data[i].equipmentId,
-          version:data[i].version,
-          versionStatus:data[i].versionStatus,
-          versionStatusName:data[i].versionStatusName,
+          version: data[i].version,
+          versionStatus: data[i].versionStatus,
+          versionStatusName: data[i].versionStatusName,
           equipmentNum: data[i].equipmentNum,
           equipmentName: data[i].equipmentName,
           equipmentModel: data[i].equipmentModel,
@@ -409,7 +421,7 @@
 
   created() {
     this.getMaintenanceCycles()
-    this.getSysDeparts()
+    // this.getSysDeparts()
     const token = Vue.ls.get(ACCESS_TOKEN);
     const tenantid = Vue.ls.get(TENANT_ID)
     this.headers = {
@@ -425,7 +437,7 @@
     selectMaintenanceProjects: function () {
       let dataDepartId = this.form.getFieldsValue(['departId']);
       if (dataDepartId.departId === "" || dataDepartId.departId === null || dataDepartId.departId === undefined) {
-        this.$message.warning("璇烽�夋嫨瀵硅薄閮ㄩ棬锛�");
+        this.$message.warning("璇烽�夋嫨浣跨敤閮ㄩ棬锛�");
         return
       }
       let data = this.form.getFieldsValue(['maintenanceCycleId']);
@@ -480,18 +492,21 @@
 
     add() {
       this.edit({ specialtyMaintenancePlanDetailList: [] })
+      this.getSeq()
     },
 
     edit(record) {
       let that = this;
       that.visible = true;
       that.isFileChange = false;
+      that.initOptions();
       that.model = Object.assign({}, record);
       that.$nextTick(() => {
-        that.form.setFieldsValue(pick(that.model, 'num', 'departId','teamId','teamName' ,'assignMode','maintenanceCycleId', 'dutyDepartId', 'maintenanceTypeId', 'maintenanceMode', 'remark'))
+        that.form.setFieldsValue(pick(that.model, 'num', 'departId', 'teamId', 'teamName', 'assignMode', 'maintenanceCycleId', 'dutyDepartId', 'maintenanceTypeId', 'maintenanceMode', 'remark'))
       });
       that.fileList = [];
       that.form.resetFields();
+
       that.uploadId = ''
       if (record.specialtyMaintenancePlanDetailList != undefined) {
         const temp = [...record.specialtyMaintenancePlanDetailList];
@@ -526,6 +541,24 @@
       this.visible = false;
     },
 
+    initOptions() {
+      getAction(this.url.loadOptions).then(res => {
+        if (res.success) {
+          this.treeData = res.result
+        } else {
+          this.$message.warning(res.message)
+        }
+      })
+    },
+
+    getSeq() {
+      getAction(this.url.getNum, { type: 'SpecialtyMaintenancePlan', length: 4 }).then(res => {
+        if (res.success) {
+          this.form.setFieldsValue({ "num": res.result })
+        }
+      })
+    },
+
     handleOk() {
       const that = this;
       // 瑙﹀彂琛ㄥ崟楠岃瘉

--
Gitblit v1.9.3