From c6e96cdb8b1cfb51e9a45bf86c38d1353e983127 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期一, 19 十月 2026 15:19:48 +0800
Subject: [PATCH] 设备模块业务完善及前序页面优化

---
 src/views/CNAS/resourceDemand/device/component/deviceOverview.vue |   74 +++++++++++++++++-------------------
 1 files changed, 35 insertions(+), 39 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue b/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
index 60e79e3..88aa48d 100644
--- a/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
+++ b/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
@@ -4,16 +4,16 @@
     <div style="display: flex;justify-content: space-between;margin-top: 10px;">
       <div style="display: flex;">
         <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
-          <span style="width: 48px;font-size: 14px;font-weight: 700;color: #606266;">鐘舵��</span>
+          <span style="width: 48px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">鐘舵��</span>
           <el-select v-model="entity.deviceStatus" placeholder="鍏ㄩ儴"
                      @change="currentPage = 1, keyMap = {}, list = [], finishLoding = false, refreshTable()"
-                     size="small" clearable>
+                     size="small" clearable style="width: 120px">
             <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
             </el-option>
           </el-select>
         </div>
         <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
-          <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">璁惧鍚嶇О</span>
+          <span style="width: 88px;font-size: 14px;font-weight: 700;color: var(--lims-text-2);">璁惧鍚嶇О</span>
           <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="entity.deviceName"
                     @keyup.enter="currentPage = 1, keyMap = {}, list = [], finishLoding = false, refreshTable()"></el-input>
         </div>
@@ -29,17 +29,26 @@
         v-if="list.length > 0 || loading">
         <ul class="card">
           <li v-for="(m, i) in list" :key="i">
-            <el-image class="img" :src="javaApi + '/img/' + m.imageUpload">
+            <el-image v-if="m.imageUpload" class="img" :src="javaApi + '/img/' + m.imageUpload">
               <template #error><div  class="image-error" style="width: 88px;
             height: 88px;
             border-radius: 16px;
             display: flex;
             align-items: center;
             justify-content: center;
-            border: 1px solid #EEEEEE;">
-                <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:#666666;"></lims-icon>
+            border: 1px solid var(--lims-divider);">
+                <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:var(--lims-text-2);"></lims-icon>
               </div></template>
             </el-image>
+            <div v-else class="image-error" style="width: 88px;
+            height: 88px;
+            border-radius: 16px;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            border: 1px solid var(--lims-divider);margin-right: 10px;">
+              <lims-icon name="el-icon-picture-outline" style="font-size:20px;color:var(--lims-text-2);"></lims-icon>
+            </div>
             <div class="list-left">
               <div class="list-left-info">
                 <span class="label" style="white-space: nowrap;">璁惧鍚嶇О锛�</span>
@@ -52,13 +61,13 @@
               </div>
               <div class="list-left-info">
                 <span class="label">瑙勬牸鍨嬪彿锛�</span>
-                <span style="color:#333333;font-size: 16px;">{{ m.specificationModel ? m.specificationModel : '鏃�'
+                <span style="color:var(--lims-text);font-size: 16px;">{{ m.specificationModel ? m.specificationModel : '鏃�'
                   }}</span>
               </div>
               <div class="list-left-info">
                 <span class="label">鐘舵�侊細</span>
                 <el-tag :type="m.type" v-if="m.deviceStatusName">{{ m.deviceStatusName }}</el-tag>
-                <span v-else style="color:#333333;font-size: 16px;">鏃�</span>
+                <span v-else style="color:var(--lims-text);font-size: 16px;">鏃�</span>
               </div>
             </div>
             <div class="circles" :class="m.type">
@@ -70,7 +79,7 @@
           </li>
         </ul>
       </scroll-pagination>
-      <div v-if="list.length < 1 && !loading" style="color:#909399;font-size:14px;text-align: center;margin-top:200px">
+      <div v-if="list.length < 1 && !loading" style="color:var(--lims-text-3);font-size:14px;text-align: center;margin-top:200px">
         鏆傛棤鏁版嵁
       </div>
     </div>
@@ -99,6 +108,7 @@
   selectDeviceParameter,
   downloadDeviceImportTemplate,
 } from '@/api/cnas/resourceDemand/device.js'
+import { saveBlobOrShowError } from '@/utils/saveBlob'
 export default {
   props: {
     clickNodeVal: {
@@ -116,6 +126,7 @@
       entity: {
         deviceStatus: null,
         deviceName: null,
+        largeCategory: null,
       },
       options: [],
       list: [],
@@ -125,7 +136,6 @@
       loading: true, // 缁勪欢loading鐨勫睍绀�,榛樿涓簍rue
       finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
       keyMap: {},
-      laboratoryNameIsNull: false,
       importVisible: false,
       importing: false,
       importFiles: [],
@@ -146,8 +156,8 @@
   methods: {
     downloadTemplate() {
       downloadDeviceImportTemplate().then(res => {
-        this.$download.saveAs(new Blob([res]), '璁惧瀵煎叆妯℃澘.xlsx')
-      })
+        saveBlobOrShowError(res, '璁惧瀵煎叆妯℃澘.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
+      }).catch(() => { })
     },
     submitImport() {
       if (!this.$refs.deviceUpload.uploadFiles.length) {
@@ -206,7 +216,6 @@
         this.finishLoding = false;
       }
       selectDeviceParameter({
-        laboratoryNameIsNull: this.laboratoryNameIsNull,
         current: this.currentPage,
         size: this.pageSize,
         ...this.entity
@@ -253,6 +262,11 @@
           }
         }
         this.loading = false
+      }).catch(() => {
+        // 娓呮帀鏈〉鍗犱綅锛屽け璐ュ悗鍙敤鏌ヨ/閲嶇疆閲嶆柊鍔犺浇
+        delete this.keyMap[key]
+        this.loading = false
+        this.finishLoding = true
       })
     },
     refresh() {
@@ -263,6 +277,7 @@
       this.entity = {
         deviceStatus: null,
         deviceName: null,
+        largeCategory: null,
       };
       this.refreshTable()
     },
@@ -275,33 +290,14 @@
     },
     // 鐐瑰嚮渚ц竟鏍忓埛鏂�
     clickSidebar(clickNodeVal) {
-      this.laboratoryNameIsNull = false
-      // 鏄惁瀛樺湪value锛屽瓨鍦╲alue浠h〃涓轰笁绾�
+      // 瀛樺湪value浠h〃閫変腑浜嗚澶囷紝鐢辫澶囪鎯呭睍绀哄鐞�
       if (!clickNodeVal.value) {
         this.finishLoding = false;
         this.keyMap = {};
         this.currentPage = 1;
         this.list = [];
-        this.entity.laboratoryName = null
-        this.entity.storagePoint = null
-        // 绛変簬1浠h〃涓烘爲鐨勪竴绾э紝label涓洪儴闂�
-        if (clickNodeVal.label == '鍏朵粬') {
-          this.laboratoryNameIsNull = true
-          this.refreshTable();
-          return
-        }
-        if (clickNodeVal.level == 1) {
-          this.entity.laboratoryName = clickNodeVal.label
-          // 绛変簬浜岀骇銆俵abel涓哄瓨鍌ㄥ湴鐐�
-        } else if (clickNodeVal.level == 2) {
-          // 鍏朵粬琛ㄧず娌℃湁閰嶇疆瀹為獙瀹わ紝鍙厤缃簡鍦扮偣
-          if (clickNodeVal.parent.label == '鍏朵粬') {
-            this.laboratoryNameIsNull = true
-          } else {
-            this.entity.laboratoryName = clickNodeVal.parent.label
-          }
-          this.entity.storagePoint = clickNodeVal.label
-        }
+        // 鏍戠殑涓�绾т负鍒嗙被锛氬叏閮�/璁惧/璁¢噺鍣ㄥ叿
+        this.entity.largeCategory = clickNodeVal.label === '鍏ㄩ儴' ? null : clickNodeVal.label;
         this.refreshTable();
       }
     }
@@ -336,14 +332,14 @@
   width: 330px;
   height: 165px;
   border-radius: 8px 8px 8px 8px;
-  border: 1px solid #EEEEEE;
+  border: 1px solid var(--lims-divider);
   margin: 0 !important;
   display: flex;
   align-items: center;
   box-sizing: border-box;
   padding: 16px;
   font-size: 14px;
-  color: #666666;
+  color: var(--lims-text-2);
   position: relative;
   overflow: hidden;
 }
@@ -415,7 +411,7 @@
 }
 
 .success .circle {
-  background: #34BD66;
+  background: var(--el-color-success);
 }
 
 .danger .circle {
@@ -427,7 +423,7 @@
 }
 
 .info .circle {
-  background: #909399;
+  background: var(--lims-text-3);
 }
 
 .el-form-item {

--
Gitblit v1.9.3