From a1615e0c7d06ee3fdf4ab776a2b07ca3f264a5bd Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期二, 01 四月 2025 16:04:26 +0800
Subject: [PATCH] 1、设备台账页面新增设备履历功能(未与后端进行联调) 2、设备台账页面新增点击设备展示对应保养标准功能并完成与后端联调

---
 src/views/eam/equipment/EamEquipmentList.vue |  107 +++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 86 insertions(+), 21 deletions(-)

diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue
index 802b6ca..d8ed389 100644
--- a/src/views/eam/equipment/EamEquipmentList.vue
+++ b/src/views/eam/equipment/EamEquipmentList.vue
@@ -101,7 +101,7 @@
       <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a
         style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
-        <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a>
+        <a style="margin-left: 24px" @click="onSelectChange([])">娓呯┖</a>
       </div>
 
       <a-table
@@ -115,7 +115,9 @@
         :loading="loading"
         :scroll="{ x: 'max-content' }"
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange">
+        @change="handleTableChange"
+        :customRow="customTableRow"
+      >
         <span slot="equipmentImportance" slot-scope="text">
           <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�"/>
         </span>
@@ -132,7 +134,7 @@
           <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�"/>
         </span>
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">缂栬緫</a>
+          <a @click.stop="handleEdit(record)">缂栬緫</a>
 
           <a-divider type="vertical"/>
           <a-dropdown>
@@ -140,6 +142,9 @@
             <a-menu slot="overlay">
               <a-menu-item>
                 <a href="javascript:;" @click="handleOpenNameplateModal(record)">閾墝</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a href="javascript:;" @click="handleOpenResumeDrawer(record)">灞ュ巻</a>
               </a-menu-item>
               <a-menu-item>
                 <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a>
@@ -157,10 +162,18 @@
     </div>
     <!-- table鍖哄煙-end -->
 
+    <a-tabs v-model="activeTabKey">
+      <a-tab-pane tab="淇濆吇鏍囧噯" :key="1">
+        <eam-maintenance-standard-list ref="tabPaneTableListRef" :isDisplayOperation="false"/>
+      </a-tab-pane>
+    </a-tabs>
+
     <!-- 琛ㄥ崟鍖哄煙 -->
     <eamEquipment-modal ref="modalForm" @ok="modalFormOk"></eamEquipment-modal>
     <!--閾墝寮圭獥-->
     <nameplate-modal ref="nameplateModalRef"/>
+    <!--灞ュ巻寮圭獥-->
+    <resume-drawer ref="resumeDrawerRef"/>
   </a-card>
 </template>
 
@@ -171,11 +184,15 @@
 import { getAction, templateXlsDownload } from '@api/manage'
 import NameplateModal from '@views/eam/equipment/modules/NameplateModal.vue'
 import { getSystemConfigValue } from '@api/api'
+import ResumeDrawer from '@views/eam/equipment/modules/ResumeDrawer.vue'
+import EamMaintenanceStandardList from '@views/eam/base/EamMaintenanceStandardList.vue'
 
 export default {
   name: 'EamEquipmentList',
   mixins: [JeecgListMixin],
   components: {
+    EamMaintenanceStandardList,
+    ResumeDrawer,
     NameplateModal,
     EamEquipmentModal
   },
@@ -270,7 +287,7 @@
         {
           title: '璁惧鍨嬪彿',
           align: 'center',
-          width: 100,
+          width: 200,
           dataIndex: 'equipmentModel'
         },
         {
@@ -393,23 +410,23 @@
         },
         {
           title: '鍒涘缓浜�',
-          align: "center",
+          align: 'center',
           dataIndex: 'createBy_dictText'
         },
         {
           title: '鍒涘缓鏃堕棿',
-          align: "center",
-          dataIndex: 'createTime',
+          align: 'center',
+          dataIndex: 'createTime'
         },
         {
           title: '鏇存柊浜�',
-          align: "center",
+          align: 'center',
           dataIndex: 'updateBy_dictText'
         },
         {
           title: '鏇存柊鏃堕棿',
-          align: "center",
-          dataIndex: 'updateTime',
+          align: 'center',
+          dataIndex: 'updateTime'
         },
         {
           title: '澶囨敞',
@@ -433,10 +450,11 @@
         exportXlsUrl: 'eam/equipment/exportXls',
         importExcelUrl: 'eam/equipment/importExcel',
         loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions',
-        templateXlsDownloadUrl: '瀵煎叆妯℃澘/璁惧鍙拌处瀵煎叆妯℃澘_v1.0.xlsx',
+        templateXlsDownloadUrl: '瀵煎叆妯℃澘/璁惧鍙拌处瀵煎叆妯℃澘_v1.0.xlsx'
       },
       treeData: [],
-      appHomeUrl: '',
+      activeTabKey: 1,
+      appHomeUrl: ''
     }
   },
   computed: {
@@ -445,8 +463,8 @@
     }
   },
   created() {
-    this.loadAllProductionTree();
-    this.loadAppHomeUrlConfigValue();
+    this.loadAllProductionTree()
+    this.loadAppHomeUrlConfigValue()
   },
   methods: {
     loadAllProductionTree() {
@@ -462,25 +480,72 @@
 
     /**
      * 寮�鍚摥鐗屽脊绐�
-     * @param record
+     * @param record 琛ㄦ牸琛屼俊鎭�
      */
     handleOpenNameplateModal(record) {
       this.$refs.nameplateModalRef.model = Object.assign({}, record)
-      this.$refs.nameplateModalRef.httpUrl = this.appHomeUrl + record.equipmentCode;
+      this.$refs.nameplateModalRef.httpUrl = this.appHomeUrl + record.equipmentCode
       this.$refs.nameplateModalRef.visible = true
+    },
 
+    /**
+     * 寮�鍚饱鍘嗘娊灞�
+     * @param record
+     */
+    handleOpenResumeDrawer(record) {
+      this.$refs.resumeDrawerRef.visible = true
     },
-    handleTemplateXlsDownload(){
-      templateXlsDownload(this.url.templateXlsDownloadUrl);
+
+    /**
+     * 鑷畾涔夎澶囧彴璐﹁〃鏍艰
+     * @param record 琛ㄦ牸琛屼俊鎭�
+     * @returns {{style: {cursor: string}, on: {click: *}}} 鏍峰紡瀵硅薄涓庝簨浠舵柟娉�
+     */
+    customTableRow(record) {
+      return {
+        style: {
+          cursor: 'pointer'
+        },
+        on: {
+          click: () => {
+            this.onSelectChange([record.id])
+          }
+        }
+      }
     },
+
+    /**
+     * 鍔犺浇椤电琛ㄦ牸鏁版嵁
+     * @param id 璁惧鍙拌处琛岃褰旾d
+     */
+    loadTabPaneTableData(id) {
+      this.$refs.tabPaneTableListRef.queryParam.equipmentId = id
+      this.$refs.tabPaneTableListRef.loadData(1)
+    },
+
+    /**
+     * 璁惧鍙拌处琛ㄦ牸澶氶�夋鐘舵�佹敼鍙樻椂瑙﹀彂
+     * @param selectedRowKeys 宸查�夋嫨鐨剅owKey闆嗗悎
+     */
+    onSelectChange(selectedRowKeys) {
+      this.selectedRowKeys = selectedRowKeys
+      this.$refs.tabPaneTableListRef.dataSource = []
+      this.$refs.tabPaneTableListRef.onClearSelected()
+      if (selectedRowKeys.length === 1) this.loadTabPaneTableData(selectedRowKeys[0])
+    },
+
+    handleTemplateXlsDownload() {
+      templateXlsDownload(this.url.templateXlsDownloadUrl)
+    },
+
     loadAppHomeUrlConfigValue() {
-      let params = {settingKey: 'app_home_url'};
+      let params = { settingKey: 'app_home_url' }
       getSystemConfigValue(params).then(res => {
         if (res.success) {
-          this.appHomeUrl = res.result.settingValue;
+          this.appHomeUrl = res.result.settingValue
         }
       })
-    },
+    }
   }
 }
 </script>

--
Gitblit v1.9.3