From 0108bdd2a028858d988dcc7d7d2cff75db10cfbf Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 23 十月 2026 09:11:54 +0800
Subject: [PATCH] fix(download): 修复文件下载路径拼接问题

---
 src/views/business/inspectionTask/inspection.vue |   60 ++++++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index a39d7c2..f16f59f 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -121,9 +121,6 @@
           </el-radio-group>
         </div>
         <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)
@@ -190,7 +187,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 orderDeviceOptions" :key="device.id" :label="device.label" :value="device.id" />
             </el-select>
@@ -399,7 +397,7 @@
         </div>
         <div class="search_input" style="width: 100%">
           <el-select v-model="verifyUser" clearable filterable placeholder="璇烽�夋嫨" size="small" style="width: 100%">
-            <el-option v-for="(item, i) in personList" :key="i" :label="item.label" :value="item.value">
+            <el-option v-for="(item, i) in reviewerOptions" :key="i" :label="item.label" :value="item.value">
             </el-option>
           </el-select>
         </div>
@@ -524,6 +522,7 @@
 import { mapGetters } from "@/utils/store-compat";
 import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
 import {getDicts} from "@/api/system/dict/data";
+import { parseInspectionValueAnnotation, formatInspectionValue } from "@/utils/inspectionValueFormat";
 export default {
   name: 'Inspection',
   components: {
@@ -556,6 +555,7 @@
       state: null,
       inspectorList: null,
       typeSource: null,
+      taskSource: null,
       sagData: [],
       sagForm: {
         sampleCode: null,
@@ -688,7 +688,7 @@
       page: {
         total: 0,
         size: 10,
-        current: 0,
+        current: 1,
       },
       // 鏂囦欢鍒楄〃鐩稿叧--缁撴潫
       // 浠诲姟鍒囨崲鍒楄〃--寮�濮�
@@ -729,6 +729,11 @@
   // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
   computed: {
     ...mapGetters(["userId"]),
+    reviewerOptions() {
+      return this.taskSource === 'QUALITY_MONITOR'
+        ? this.personList.filter(item => Number(item.value) !== Number(this.userId))
+        : this.personList;
+    },
     action() {
       return this.javaApi + "/insOrderPlan/uploadFile";
     },
@@ -833,14 +838,16 @@
   },
   methods: {
     syncRouteContext() {
-      const { sonLaboratory, orderId, state, inspectorList, typeSource } = this.$route.query;
+      const { sonLaboratory, orderId, state, inspectorList, typeSource, taskSource } = this.$route.query;
       const orderChanged = this.id !== orderId;
       this.sonLaboratory = sonLaboratory;
       this.orderId = orderId;
       this.state = state;
       this.inspectorList = inspectorList;
       this.typeSource = typeSource;
+      this.taskSource = taskSource;
       if (orderChanged) {
+        if (taskSource === 'QUALITY_MONITOR') this.verifyUser = null;
         this.tableLists = [];
         this.tableList = [];
         this.sampleProduct = [];
@@ -1002,6 +1009,7 @@
         laboratory: this.sonLaboratory,
       }).then(async (res) => {
         this.insOrder = res.data.insOrder;
+        this.taskSource = this.insOrder.taskSource || this.taskSource;
         if(res.data.insOrder.ifsOrderType==='02wg'){
           //鏌ヨ闆朵欢灞炴��
           this.getPartProps(res.data.insOrder.ifsInventoryId)
@@ -1578,6 +1586,17 @@
     // 妫�楠屽�艰緭鍏ュ悗瑙﹀彂鐨勫嚱鏁�
     changeInput(m, code, n) {
       if (n) {
+        const config = parseInspectionValueAnnotation(n.v && n.v.ps && n.v.ps.value);
+        if (config && !config.error && config.decimalPlaces != null && typeof n.v.v === 'string') {
+          const numericPattern = config.displayMode === 'SCIENTIFIC'
+            ? /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/
+            : /^[+-]?\d*\.?\d+$/;
+          if (n.v.v.trim() && !numericPattern.test(n.v.v.trim())) {
+            this.$message.warning('璇ユ楠屽�煎繀椤诲~鍐欐暟瀛�');
+            return;
+          }
+          n.v.v = formatInspectionValue(n.v.v, config);
+        }
         // 瀹氫箟涓�涓嚱鏁版潵楠岃瘉鍒嗘暟鏄惁鏈夋晥
         if (typeof n.v.v == "string") {
           function isValidFraction(fraction) {
@@ -1708,7 +1727,7 @@
         const v = n.v.v;
         // 鑳藉姏鑼冨洿宸插簾寮�,妫�楠屽�肩被鍨嬩笉鍐嶄綔涓哄垽鏂緷鎹�傛暣涓插彧鐢辩畻寮忓瓧绗︾粍鎴愭椂鎵嶈鑼冨寲鏍煎紡,
         // 鍑虹幇涓枃绛夊叾瀹冨瓧绗﹀嵆鎸夋枃鏈鐞嗗師鏍蜂繚鐣�,鍚﹀垯鏂囧瓧浼氳閫愬瓧鍒犳帀
-        if (typeof v !== "string" || /[^\d.^e>锛炩墺鈮�<锛滄柇瑁傝剢鍖朶-/+]/.test(v)) {
+        if (typeof v !== "string" || /[^\d.^eE>锛炩墺鈮�<锛滄柇瑁傝剢鍖朶-/+]/.test(v)) {
           return;
         }
         n.v.v = v
@@ -1750,6 +1769,10 @@
       }
     },
     openAddCheck() {
+      if (this.taskSource === 'QUALITY_MONITOR') {
+        this.upInsReview(1);
+        return;
+      }
       this.addCheck = true;
     },
     // 鏀堕泦妯℃澘绾ф娴嬫潯浠剁殑缂哄け椤癸紙姣忎釜妯℃澘閮借濉叏锛�
@@ -1888,7 +1911,6 @@
             temperature: form.temperature == null ? null : form.temperature,
             detectionTime: form.detectionTime || null,
             detectionPlace: form.detectionPlace || null,
-            deviceIds: Array.isArray(form.deviceIds) ? [...form.deviceIds] : [],
           });
         }));
       } catch (error) {
@@ -2217,7 +2239,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) => { });
     },
@@ -2284,7 +2308,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;
@@ -2302,13 +2326,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;
 }
 
@@ -2487,7 +2519,7 @@
 }
 
 .inspection .el-drawer__header {
-  color: #303133;
+  color: var(--lims-text);
   text-align: left;
 }
 

--
Gitblit v1.9.3