From d2eed0eb7c2f9537d5eaab7ccc3b6ab258959227 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期六, 24 十月 2026 20:48:11 +0800
Subject: [PATCH] feat(device): 设备核查计划附件上传与运行记录导出调整

---
 src/views/business/inspectionView/index.vue |   45 +++++++++++++++++++++++++++++----------------
 1 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/src/views/business/inspectionView/index.vue b/src/views/business/inspectionView/index.vue
index f71a490..8abe80f 100644
--- a/src/views/business/inspectionView/index.vue
+++ b/src/views/business/inspectionView/index.vue
@@ -83,7 +83,6 @@
         <div style="display: flex; align-items: center">
           <el-button v-if="state == 1" size="small" type="primary" @click="openAddUnpass">鏂板涓嶅悎鏍煎娴�</el-button>
           <el-button v-if="state == 1" size="small" type="primary" @click="unpassCheck">涓嶅悎鏍煎娴�</el-button>
-          <el-button v-if="state > 1" size="small" type="primary" @click="viewUnpassCheck">鏌ョ湅涓嶅悎鏍煎娴�</el-button>
           <span v-if="cableTagList.length > 0">&nbsp;&nbsp;鐢电紗閰嶇疆锛�</span>
           <el-select v-if="cableTagList.length > 0" v-model="currentTab" clearable placeholder="璇烽�夋嫨" size="small"
                      @change="(m) => handleChangeCableTag(currentSample.id, 0, 'cableTag', m)
@@ -145,9 +144,9 @@
             <span class="template-panel__unit">鈩�</span>
           </el-form-item>
           <el-form-item label="妫�娴嬫椂闂�:">
-            <el-date-picker v-model="currentOtherForm.detectionTime" :disabled="state > 1" type="date"
-                            value-format="YYYY-MM-DD" placeholder="璇烽�夋嫨鏃ユ湡" size="small" style="width: 160px"
-                            @change="m => subOtherForm(m, 'detectionTime')" />
+            <el-date-picker v-model="currentOtherForm.detectionTimeRange" :disabled="state > 1" type="daterange"
+                            value-format="YYYY-MM-DD" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡" size="small" style="width: 260px"
+                            @change="m => subOtherForm(m, 'detectionTimeRange')" />
           </el-form-item>
           <el-form-item label="妫�娴嬪湴鐐�:">
             <el-input v-model="currentOtherForm.detectionPlace" :disabled="state > 1" clearable
@@ -156,7 +155,8 @@
           </el-form-item>
           <el-form-item label="璁惧:">
             <el-select v-model="currentOtherForm.deviceIds" :disabled="state != 1" multiple filterable clearable
-                       placeholder="璇烽�夋嫨璁惧" size="small" style="width: 360px"
+                       class="device-select" placeholder="璇烽�夋嫨璁惧" size="small"
+                       style="width: 360px !important; min-width: 360px; flex: 0 0 360px"
                        @change="m => subOtherForm(m, 'deviceIds')">
               <el-option v-for="device in orderDeviceOptions" :key="device.id" :label="device.label"
                          :value="device.id" />
@@ -491,6 +491,7 @@
 <script>
 // Vue3 娌℃湁 this.$createElement锛堜笅闈㈢敤 h 閫� VNode 褰� $msgbox 鐨� message锛�
 import { h } from 'vue'
+import { readDetectionTimeRange, isCompleteDetectionTimeRange, toDetectionTimePayload } from '@/utils/detectionTimeRange'
 import excelFunction from "@/utils/excelFountion";
 import limsTable from "@/components/Table/lims-table.vue";
 import UnPassDialog from "../unpass/components/unPassDialog.vue";
@@ -706,7 +707,7 @@
       page: {
         total: 0,
         size: 10,
-        current: 0,
+        current: 1,
       },
       tableLoading: false,
       // 鏂囦欢鍒楄〃鐩稿叧--缁撴潫
@@ -754,7 +755,7 @@
     currentOtherForm() {
       return this.otherForm[this.currentTable] || {
         temperature: null,
-        detectionTime: null,
+        detectionTimeRange: null,
         detectionPlace: null,
         deviceIds: [],
         insResult: null,
@@ -950,7 +951,7 @@
         (this.insOrder.templateConditions || []).forEach((item) => {
           this.otherForm[item.templateId] = {
             temperature: item.temperature != null ? item.temperature : null,
-            detectionTime: item.detectionTime != null ? item.detectionTime : null,
+            detectionTimeRange: readDetectionTimeRange(item),
             detectionPlace: item.detectionPlace != null ? item.detectionPlace : null,
             deviceIds: Array.isArray(item.deviceIds) ? [...item.deviceIds] : [],
             insResult: item.insResult != null ? item.insResult : null,
@@ -1463,7 +1464,7 @@
       if (templateId == null || this.otherForm[templateId]) return;
       this.otherForm[templateId] = {
         temperature: null,
-        detectionTime: null,
+        detectionTimeRange: null,
         detectionPlace: null,
         deviceIds: [],
         insResult: null,
@@ -1478,7 +1479,9 @@
         payload.templateId = this.currentTable;
         if (type === "deviceIds") {
           payload.deviceIds = Array.isArray(m) ? [...m] : [];
-        } else if (type === "detectionTime" || type === "detectionPlace") {
+        } else if (type === "detectionTimeRange") {
+          Object.assign(payload, toDetectionTimePayload(m));
+        } else if (type === "detectionPlace") {
           payload[type] = m === "" || m == null ? null : m;
         } else {
           payload[type] = Number(m);
@@ -2111,7 +2114,7 @@
         if (this.insOrder.ifsOrderType !== "02wg") {
           if (!form.temperature) missing.push(`璇峰~鍐欍��${item.templateName}銆嶇殑娓╁害`);
         }
-        if (!form.detectionTime) missing.push(`璇烽�夋嫨銆�${item.templateName}銆嶇殑妫�娴嬫椂闂碻);
+        if (!isCompleteDetectionTimeRange(form.detectionTimeRange)) missing.push(`璇烽�夋嫨銆�${item.templateName}銆嶇殑妫�娴嬫椂闂碻);
         if (!form.detectionPlace) missing.push(`璇峰~鍐欍��${item.templateName}銆嶇殑妫�娴嬪湴鐐筦);
         if (!form.deviceIds || form.deviceIds.length === 0) {
           missing.push(`璇烽�夋嫨銆�${item.templateName}銆嶇殑璁惧`);
@@ -2467,7 +2470,9 @@
     },
     handleDown(row) {
       downFile({ id: row.id }).then((res) => {
-        this.$download.saveAs(res.data.fileUrl, row.fileName)
+        const resourcePath = Number(res.data.type) === 1 ? "/img/" : "/word/";
+        const fileUrl = this.javaApi + resourcePath + encodeURIComponent(res.data.fileUrl);
+        this.$download.saveAs(fileUrl, row.fileName);
       })
         .catch((error) => { });
     },
@@ -2524,7 +2529,7 @@
 
 .template-panel {
   background-color: #f8f9fb;
-  border: 1px solid #ebeef5;
+  border: 1px solid var(--el-border-color-light);
   border-radius: 3px;
   padding: 16px 16px 4px;
   margin-bottom: 12px;
@@ -2541,13 +2546,21 @@
   flex: none;
 }
 
+/* 璁惧涓嬫媺鍥哄畾瀹藉害锛岀姝㈣琛屽唴甯冨眬鍘嬬缉锛屽惁鍒欓�変腑鍐呭涓嶅彲瑙� */
+.template-panel:deep(.device-select) {
+  display: inline-block !important;
+  width: 360px !important;
+  min-width: 360px;
+  flex: 0 0 360px;
+}
+
 .template-panel__unit {
   margin-left: 4px;
-  color: #606266;
+  color: var(--lims-text-2);
 }
 
 .template-panel__conclusion--divided {
-  border-top: 1px dashed #e4e7ed;
+  border-top: 1px dashed var(--el-border-color);
   padding-top: 12px;
 }
 
@@ -2726,7 +2739,7 @@
 }
 
 .inspection .el-drawer__header {
-  color: #303133;
+  color: var(--lims-text);
   text-align: left;
 }
 

--
Gitblit v1.9.3