From 3a8223b71d18205d40b894fd0b4c0fa1ca773e86 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 13 十一月 2023 10:44:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/mdc-test' into mdc-test

---
 src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue |   85 +++++++++++++++++++++++++++++-------------
 1 files changed, 59 insertions(+), 26 deletions(-)

diff --git a/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue b/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue
index 5923fdd..f8a4047 100644
--- a/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue
+++ b/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue
@@ -29,7 +29,7 @@
           </a-col>
           <a-col :span="12">
             <a-form-item
-              label="瀵硅薄閮ㄩ棬"
+              label="浣跨敤閮ㄩ棬"
               :labelCol="labelCol"
               :wrapperCol="wrapperCol"
             >
@@ -263,6 +263,7 @@
       rowKey='id'
       :columns="columns"
       :dataSource="dataSource"
+      :pagination="false"
     >
       <template
         v-for="col in columns"
@@ -292,8 +293,9 @@
             v-if="col.dataIndex == 'location'"
             :maxLength="500"
             auto-size
-            placeholder="璇疯緭鍏ヤ綅缃�"
+            placeholder="璇疯緭鍏ヤ繚鍏讳綅缃�"
             @change="(e)=>handleChange(e, record.key, col, index)"
+            :disabled="true"
           />
           <j-image-upload
             :value="text"
@@ -304,6 +306,16 @@
             @change="(e)=>handleChange(e, record.key, col, index)"
           >
           </j-image-upload>
+          <j-dict-select-tag
+            v-if="col.dataIndex == 'maintenanceRole'"
+            :value="text"
+            allow-clear
+            :triggerChange="true"
+            dictCode="maintenance_role"
+            placeholder="璇烽�夋嫨淇濆吇瑙掕壊"
+            style="width: 100%"
+            @change="(e)=>handleChange(e, record.key, col, index)"
+          />
         </div>
       </template>
 
@@ -450,21 +462,21 @@
           align: 'center',
           dataIndex: 'standard'
         },
-        {
-          title: '鏂规硶',
-          align: 'center',
-          dataIndex: 'maintenanceMethodName'
-        },
-        {
-          title: '宸ュ叿',
-          align: 'center',
-          dataIndex: 'maintenanceTool'
-        },
-        {
-          title: '缁翠繚涓撲笟',
-          align: 'center',
-          dataIndex: 'maintenanceSpecialtyName'
-        },
+        // {
+        //   title: '鏂规硶',
+        //   align: 'center',
+        //   dataIndex: 'maintenanceMethodName'
+        // },
+        // {
+        //   title: '宸ュ叿',
+        //   align: 'center',
+        //   dataIndex: 'maintenanceTool'
+        // },
+        // {
+        //   title: '缁翠繚涓撲笟',
+        //   align: 'center',
+        //   dataIndex: 'maintenanceSpecialtyName'
+        // },
         {
           title: '瀹夊叏瑕佹眰',
           align: 'center',
@@ -485,7 +497,7 @@
           width: 150,
         },
         {
-          title: '閮ㄤ綅',
+          title: '淇濆吇閮ㄤ綅',
           align: 'center',
           dataIndex: 'location',
           scopedSlots: { customRender: 'location' },
@@ -496,6 +508,13 @@
           align: 'center',
           dataIndex: 'maintenanceCycleId',
           scopedSlots: { customRender: 'maintenanceCycleId' },
+          width: 150,
+        },
+        {
+          title: '淇濆吇瑙掕壊',
+          align: 'center',
+          dataIndex: 'maintenanceRole',
+          scopedSlots: { customRender: 'maintenanceRole' },
           width: 150,
         },
         {
@@ -569,11 +588,12 @@
         add: "/eam/maintenanceStandard/add",
         edit: "/eam/maintenanceStandard/edit",
         addDetail: "/eam/maintenanceStandardDetail/add",
-        getMaintenanceCycle: "/eam/maintenanceStandardDetail/getMaintenanceCycle",
+        getMaintenanceCycle: "/eam/maintenanceStandardDetail/getPeriodicMaintenanceCycle",
         realDelete: "/eam/maintenanceStandardDetail/realDelete",
         revise: '/eam/maintenanceStandard/revise',
         getReviseVersion: "/eam/maintenanceStandard/getReviseVersion",
         loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
+        getNum: '/eam/sysIdentity/getNumNew'
       },
 
       dataSource: [],
@@ -593,6 +613,7 @@
           standard: data[i].standard,
           maintenanceMethodName: data[i].maintenanceMethod_dictText,
           maintenanceTool: data[i].maintenanceTool,
+          location: data[i].location,
           maintenanceSpecialtyName: data[i].maintenanceSpecialtyId_dictText,
           maintenanceRequire: data[i].maintenanceRequire,
           workingHourQuota: data[i].workingHourQuota,
@@ -641,28 +662,27 @@
 
     add() {
       this.edit({ maintenanceStandardDetaillist: [] })
+      this.getSeq()
     },
 
     edit(record) {
       let that = this;
       this.initOptions();
-      this.getMaintenanceCycle()
+      // this.getMaintenanceCycle()
       this.dataSource = [];
       this.form.resetFields();
       this.model = Object.assign({}, record);
       this.visible = true;
       if (record.maintenanceStandardDetaillist != undefined) {
         const temp = [...record.maintenanceStandardDetaillist];
-        // for (let i = 0; i < temp.length; i++) {
-        //   let r = temp[i].upload;
-        //   r.src = this.getSrc(temp[i].upload);
-        // }
         that.dataSource = temp;
       }
       that.$nextTick(() => {
         that.form.setFieldsValue(pick(that.model, 'num', 'departId', 'teamId', 'equipmentId', 'equipmentName', 'useDepartName', 'useId', 'teamName', 'assignMode', 'version', 'remark'));
       });
       if (record.id) {
+        this.maintenanceCycles = []
+        this.getMaintenanceCycle(this.model.equipmentId)
         this.codeDisable = true;
         that.$nextTick(() => {
           if (that.isRevise) {
@@ -691,6 +711,13 @@
       })
     },
 
+    getSeq() {
+      getAction(this.url.getNum, { type: 'DailyMaintenanceStandard', length: 4 }).then(res => {
+        if (res.success) {
+          this.form.setFieldsValue({ "num": res.result })
+        }
+      })
+    },
 
     onEquipmentList() {
       let data = this.form.getFieldsValue(['departId']);
@@ -704,7 +731,9 @@
     sendEquipmentRecord(data) {
       this.dataSource = [];
       let record = data.record;
+      this.getMaintenanceCycle(record.id)
       this.form.setFieldsValue({ equipmentId: record.id, equipmentName: record.num + "/" + record.name + "/" + record.model, teamId: record.teamId, teamName: record.teamId_dictText });
+
     },
 
     onDepartList() {
@@ -786,8 +815,9 @@
       })
     },
 
-    getMaintenanceCycle() {
-      getAction(this.url.getMaintenanceCycle).then((res) => {
+    getMaintenanceCycle(equipmentId) {
+      debugger
+      getAction(this.url.getMaintenanceCycle, { equipmentId: equipmentId }).then((res) => {
         if (res.success) {
           this.maintenanceCycles = res.result
         }
@@ -815,6 +845,9 @@
         if (column.dataIndex == 'location') {
           target[column.dataIndex] = value.target.value;
         }
+        if (column.dataIndex == 'maintenanceRole') {
+          target[column.dataIndex] = value;
+        }
         //鏄剧ず甯﹁繃鏉ョ殑鏁版嵁
         that.dataSource = temp;
       }

--
Gitblit v1.9.3