From 5d9a3141d4b3677bf8155da16b435d2a8818793b Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 23 十月 2026 17:44:08 +0800
Subject: [PATCH] feat(report): 引入 SuperDoc 在线编辑器实现报告审核功能 支持审核页面直接编辑报告 - 新增检测报告与检验报告切换功能,切换时自动保存当前编辑内容 - 检测时间从单日选择改为日期范围选择,兼容历史单日数据回显 - 标准模型新增标准要求值字段,复制模板时携带完整表单数据 - 产品委托单下载报告按钮增加可用性状态控制

---
 src/views/business/inspectionTask/components/InspectionWord.vue |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue
index 7b8d99c..97a0b2a 100644
--- a/src/views/business/inspectionTask/components/InspectionWord.vue
+++ b/src/views/business/inspectionTask/components/InspectionWord.vue
@@ -34,9 +34,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>
+              <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-date-picker>
             </el-form-item>
             <el-form-item label="妫�娴嬪湴鐐�:">
               <el-input v-model="currentOtherForm.detectionPlace" :disabled="state > 1" clearable
@@ -45,7 +45,8 @@
             </el-form-item>
             <el-form-item label="璁惧:">
               <el-select v-model="currentOtherForm.deviceIds" :disabled="state != 1" multiple filterable clearable
-                size="small" placeholder="璇烽�夋嫨璁惧" style="width: 360px"
+                class="device-select" size="small" placeholder="璇烽�夋嫨璁惧"
+                style="width: 360px !important; min-width: 360px; flex: 0 0 360px"
                 @change="m => subOtherForm(m, 'deviceIds')">
                 <el-option v-for="device in deviceOptions" :key="device.id" :label="device.label"
                   :value="device.id" />
@@ -252,6 +253,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 UnPassDialog from "@/views/business/unpass/components/unPassDialog.vue";
 import AddUnPass from "@/views/business/unpass/components/addUnPass.vue";
@@ -385,7 +387,7 @@
       numOptions: [],
       temperatureOptions: [],
       wareTableData: [],
-      // 妫�娴嬫潯浠舵寜妯℃澘 id 鍒嗙粍锛歿 [templateId]: { temperature, detectionTime, detectionPlace, deviceIds } }
+      // 妫�娴嬫潯浠舵寜妯℃澘 id 鍒嗙粍锛歿 [templateId]: { temperature, detectionTimeRange, detectionPlace, deviceIds } }
       otherForm: {},
       deviceOptions: [],
       equipForm: {
@@ -467,7 +469,7 @@
     currentOtherForm() {
       return this.otherForm[this.currentTable] || {
         temperature: null,
-        detectionTime: null,
+        detectionTimeRange: null,
         detectionPlace: null,
         deviceIds: [],
         insResult: null
@@ -513,7 +515,7 @@
         conditionList.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
@@ -1428,7 +1430,7 @@
       if (!this.otherForm[templateId]) {
         this.otherForm[templateId] = {
           temperature: null,
-          detectionTime: null,
+          detectionTimeRange: null,
           detectionPlace: null,
           deviceIds: [],
           insResult: null
@@ -1443,7 +1445,9 @@
       }
       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)
@@ -1461,7 +1465,7 @@
       this.tableLists.forEach(m => {
         const form = this.otherForm[m.templateId] || {}
         if (!form.temperature) missing.push(`璇峰~鍐欍��${m.templateName}銆嶇殑娓╁害`)
-        if (!form.detectionTime) missing.push(`璇烽�夋嫨銆�${m.templateName}銆嶇殑妫�娴嬫椂闂碻)
+        if (!isCompleteDetectionTimeRange(form.detectionTimeRange)) missing.push(`璇烽�夋嫨銆�${m.templateName}銆嶇殑妫�娴嬫椂闂碻)
         if (!form.detectionPlace) missing.push(`璇峰~鍐欍��${m.templateName}銆嶇殑妫�娴嬪湴鐐筦)
         if (!form.deviceIds || form.deviceIds.length === 0) {
           missing.push(`璇烽�夋嫨銆�${m.templateName}銆嶇殑璁惧`)
@@ -1780,7 +1784,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-top: 12px;
@@ -1798,13 +1802,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;
 }
 
@@ -1982,7 +1994,7 @@
 }
 
 .inspection .el-drawer__header {
-  color: #303133;
+  color: var(--lims-text);
   text-align: left;
 }
 

--
Gitblit v1.9.3