From b4d09a09d2a8ffc939e97f8b400ff94a64d13eb7 Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期一, 04 三月 2024 17:46:01 +0800
Subject: [PATCH] 优化用户管理页面表单填写界面选择设备功能,车间重新选择后重置选择设备

---
 src/views/eam/modules/maintenancePlan/StandardSelect.vue |  122 ++++++++++++++++++++++++++++------------
 1 files changed, 86 insertions(+), 36 deletions(-)

diff --git a/src/views/eam/modules/maintenancePlan/StandardSelect.vue b/src/views/eam/modules/maintenancePlan/StandardSelect.vue
index 46b3804..0f3e8a3 100644
--- a/src/views/eam/modules/maintenancePlan/StandardSelect.vue
+++ b/src/views/eam/modules/maintenancePlan/StandardSelect.vue
@@ -8,7 +8,7 @@
     @cancel="close"
     style="top:50px"
     cancelText="鍏抽棴"
-    :width="1050"
+    :width="1500"
   >
     <a-card :bordered="false">
       <div class="table-page-search-wrapper">
@@ -21,14 +21,24 @@
               :md="8"
               :sm="6"
             >
-              <a-form-item label="妫�楠岄」鐩悕绉�">
+              <a-form-item label="缁熶竴缂栫爜">
                 <a-input
-                  placeholder="璇疯緭鍏ユ楠岄」鐩悕绉�"
+                  placeholder="璇疯緭鍏ョ粺涓�缂栫爜"
+                  v-model="queryParam.num"
+                />
+              </a-form-item>
+            </a-col>
+            <a-col
+              :md="8"
+              :sm="6"
+            >
+              <a-form-item label="璁惧鍚嶇О">
+                <a-input
+                  placeholder="璁惧鍚嶇О"
                   v-model="queryParam.name"
                 />
               </a-form-item>
             </a-col>
-
             <a-col :md="3">
               <span
                 style="float: left;overflow: hidden;"
@@ -77,6 +87,11 @@
   mixins: [JeecgListMixin],
   components: {},
   props: {
+    maintenanceType: {
+      type: String,
+      default: '',
+      required: true
+    }
 
   },
   data() {
@@ -86,7 +101,7 @@
       columns: [
         {
           title: '#',
-          dataIndex: '',
+          dataIndex: 'id',
           key: 'rowIndex',
           width: 50,
           align: 'center',
@@ -95,41 +110,52 @@
           }
         },
         {
-          title: '鐗堟湰',
-          align: 'center',
-          dataIndex: 'version',
-          width: 100,
-        },
-        {
-          title: '鐗堟湰鐘舵��',
-          align: 'center',
-          dataIndex: 'versionStatusName',
-          width: 130,
-        },
-        {
-          title: '鏍囧噯缂栫爜',
+          title: '缁熶竴缂栫爜',
           align: 'center',
           dataIndex: 'num',
-        },
-        {
-          title: '瀵硅薄閮ㄩ棬',
-          align: 'center',
-          dataIndex: 'useDepartName',
-        },
-        {
-          title: '璁惧缂栫爜',
-          align: 'center',
-          dataIndex: 'equipmentNum',
+          width: 200
         },
         {
           title: '璁惧鍚嶇О',
           align: 'center',
-          dataIndex: 'equipmentName',
+          dataIndex: 'name',
+          width: 200
         },
         {
           title: '璁惧鍨嬪彿',
           align: 'center',
-          dataIndex: 'equipmentModel',
+          dataIndex: 'model',
+          width: 200
+        },
+        {
+          title: '璁惧瑙勬牸',
+          align: 'center',
+          dataIndex: 'specification',
+          width: 200
+        },
+        {
+          title: 'ABC鏍囪瘑',
+          align: "center",
+          dataIndex: 'equipmentImportanceId',
+          width: 100
+        },
+        {
+          title: '鍏抽敭璁惧鏍囪瘑',
+          align: "center",
+          dataIndex: 'specificEquipment_dictText',
+          width: 100
+        },
+        {
+          title: '璁惧鐘舵��',
+          align: 'center',
+          dataIndex: 'equipmentStatus_dictText',
+          width: 100
+        },
+        {
+          title: '鎶�鏈姸鎬�',
+          align: 'center',
+          dataIndex: 'technologyStatus_dictText',
+          width: 100
         },
       ],
       selectedRowKeys: [],
@@ -157,7 +183,8 @@
       visible: false,
       loading: false,
       url: {
-        list: '/eam/maintenanceStandard/getMaintenanceStandardList',
+        list: '/eam/equipment/showEquipmentList',
+        getStandards: '/eam/equipmentMaintenancePlan/getStandards'
       },
     }
   },
@@ -191,8 +218,9 @@
       }
       let that = this
       this.loading = true
-      this.queryParam.versionStatus = '2'
-      this.queryParam.type = 'daily'
+      // this.queryParam.versionStatus = '2'
+      // this.queryParam.type = 'daily'
+      this.queryParam.isLine = 'no';
       let params = this.getQueryParams()//鏌ヨ鏉′欢
       await getAction(this.url.list, params).then((res) => {
         if (res.success) {
@@ -255,9 +283,31 @@
       this.loadData();
     },
     handleSubmit() {
-      this.$emit('selectionRows', this.selectionRows);
-      this.searchReset(0)
-      this.close();
+      this.loading = true
+      let that = this;
+      var ids = '';
+      if (this.selectionRows.length == 0) {
+        that.$message.warning("璇烽�夋嫨淇濆吇璁惧");
+        this.loading = false;
+        return false;
+      }
+      for (var i = 0; i < this.selectionRows.length; i++) {
+        ids = ids + this.selectionRows[i].id + ',';
+      }
+      getAction(this.url.getStandards, { ids: ids, maintenanceType: this.maintenanceType }).then(res => {
+        if (res.success) {
+          if (res.result.records.length !== that.selectionRows.length) {
+            that.$message.warning(res.result.message);
+          }
+          that.$emit('selectionEquipmentRows', res.result.records);
+          that.searchReset(0)
+          that.close();
+        }
+      }).finally(res => {
+        this.loading = false;
+      })
+
+
     },
     onSelectChange(selectionRows) {
       this.selectionRows = selectionRows;

--
Gitblit v1.9.3