From 2f0774358a91313dc7ed75888b3db27751d66707 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 08 八月 2025 09:55:59 +0800
Subject: [PATCH] 修改检验的下载和预览

---
 src/components/do/b1-inspect-order-plan/Inspection.vue |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 8ef3574..dcc3251 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -3927,10 +3927,10 @@
       if (name == '妫�楠屽師濮嬭褰�' || name == '杈愬皠璇曢獙妫�娴嬪師濮嬭褰�') {
         let num = 0
         for (let i in this.param) {
-          if(!this.param[i].insResult||!this.param[i].insResult.v||(!this.param[i].insResult.v.v&&this.param[i].insResult.v.v!==0)){
-              this.$message.error("璇疯緭鍏ユ楠岃繃绋嬪��");
-              return;
-          }else{
+          if (!this.param[i].insResult || !this.param[i].insResult.v || (!this.param[i].insResult.v.v && this.param[i].insResult.v.v !== 0)) {
+            this.$message.error("璇疯緭鍏ユ楠岃繃绋嬪��");
+            return;
+          } else {
             if (this.param[i].insResult.v.v != 0 && this.param[i].insResult.v.v != 1) {
               num++;
             }
@@ -4438,9 +4438,13 @@
         if (this.sonLaboratory === "鐢佃矾璇曢獙") {
           // // 鐢佃矾璇曢獙鏁伴噰
           // 鑾峰彇褰撳墠鏍峰搧鐨勬楠岄」
-          let list = await this.getCurrentProduct(this.currentSample.id, 0);
-          this.currentSample.insProduct = this.HaveJson(list);
-          this.currentNum++;
+          if (response.data &&
+            ((response.data.includes('xlsx') && response.data.includes('浜よ皟')) ||
+              (response.data.includes('csv') && response.data.includes('椹绘尝')))) {
+            let list = await this.getCurrentProduct(this.currentSample.id, 0);
+            this.currentSample.insProduct = this.HaveJson(list);
+            this.currentNum++;
+          }
         } else if (this.sonLaboratory === "鎸姩") {
           this.getDocAnalysis(response.data)
         }
@@ -4448,7 +4452,7 @@
         this.$message.error(response.message);
       }
     },
-    getDocAnalysis (data) {
+    getDocAnalysis(data) {
       const psToDataKeyMap = {
         '妫�楠屽��1': '1',
         '妫�楠屽��9': '9',
@@ -4506,9 +4510,11 @@
             let url = "";
             if (res.data.type == 1) {
               url = this.javaApi + "/img/" + res.data.fileUrl;
+              url = url.replace(/#/g, "%23");
               file.downloadIamge(url, row.fileName);
             } else {
               url = this.javaApi + "/word/" + res.data.fileUrl;
+              url = url.replace(/#/g, "%23");
               const link = document.createElement("a");
               link.href = url;
               link.download = row.fileName;
@@ -4582,6 +4588,7 @@
       } else {
         this.currentFile.url = this.javaApi + "/word/" + row.fileUrl;
       }
+      this.currentFile.url = this.currentFile.url.replace(/#/g, "%23");
       this.lookFileVisible = true;
     },
     handleBack() {

--
Gitblit v1.9.3