From 0c6b2eb953f5ed4df00a77a5f7b14b9ff6c563fe Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 04 一月 2026 23:59:06 +0800
Subject: [PATCH] 修改代码

---
 src/views/archiveManager/index.vue |  100 ++++++++++++++++++++++++++++++++-----------------
 1 files changed, 65 insertions(+), 35 deletions(-)

diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index aa291a8..6f319d2 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -1820,9 +1820,9 @@
       this.getExcelFile(id).then(blob => {
         this.$modal.closeLoading();
         // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
-        alert(23)
+     //   alert(23)
         this.currentExcelUrl = URL.createObjectURL(blob);
-        alert(this.currentExcelUrl)
+       // alert(this.currentExcelUrl)
         this.currentExcelBlob = blob;
         this.currentExcelId = id;
         this.excelDialogVisible = true;
@@ -1996,28 +1996,49 @@
         // 鑾峰彇鐢ㄦ埛閫夋嫨鐨勯�夐」
         const { includeQrCode, selectedAnnotations } = this.excelOptions;
         console.log('涓嬭浇閫夐」:', { includeQrCode, selectedAnnotations });
+     var id = this.recordId ;
+        this.getExcelFile(id).then(blob => {
+           this.$modal.closeLoading();
+           // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+        //   alert(23)
+           this.currentExcelUrl = URL.createObjectURL(blob);
 
+           const link = document.createElement('a');
+           link.href = this.currentExcelUrl;
+
+           // 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
+           let filename = `record_${this.currentExcelId}`;
+           if (includeQrCode) filename += '_qr';
+           // if (selectedAnnotations.length > 0) {
+           //   filename += `_anno${selectedAnnotations.join('')}`;x
+           // }
+           filename += `_${new Date().getTime()}.xls`;
+
+           link.download = filename;
+
+           // 瑙﹀彂涓嬭浇
+           document.body.appendChild(link);
+           link.click();
+           document.body.removeChild(link);
+
+           // 鎻愮ず涓嬭浇鎴愬姛
+           this.$modal.msgSuccess('Excel鏂囦欢涓嬭浇鎴愬姛');
+          // alert(this.currentExcelUrl)
+           // this.currentExcelBlob = blob;
+           // this.currentExcelId = id;
+           // this.excelDialogVisible = true;
+           // this.excelLoading = false;
+         }).catch(error => {
+           this.$modal.closeLoading();
+           console.error('鑾峰彇Excel鏂囦欢澶辫触:', error);
+           this.$modal.msgError('鑾峰彇Excel鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+
+
+               this.showExcelPreview = false;
+         });
+       // alert(this.excelOptions.includeQrCode)
         // 鍒涘缓涓嬭浇閾炬帴锛屾枃浠跺悕鍖呭惈閫夐」淇℃伅
-        const link = document.createElement('a');
-        link.href = this.currentExcelUrl;
 
-        // 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
-        let filename = `record_${this.currentExcelId}`;
-        if (includeQrCode) filename += '_qr';
-        // if (selectedAnnotations.length > 0) {
-        //   filename += `_anno${selectedAnnotations.join('')}`;x
-        // }
-        filename += `_${new Date().getTime()}.xls`;
-
-        link.download = filename;
-
-        // 瑙﹀彂涓嬭浇
-        document.body.appendChild(link);
-        link.click();
-        document.body.removeChild(link);
-
-        // 鎻愮ず涓嬭浇鎴愬姛
-        this.$modal.msgSuccess('Excel鏂囦欢涓嬭浇鎴愬姛');
       }
     },
 
@@ -2059,20 +2080,25 @@
     /** 浠庡悗绔幏鍙朎xcel鏂囦欢 */
     getExcelFile(id) {
       var includeQrCode = this.excelOptions.includeQrCode;
-      var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode;
+      var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`
+      //+"/"+includeQrCode;
 
 
-      if(this.excelOptions.subselectedSignatures.length!=0)
-      {
-        var selectedSignatures = this.excelOptions.subselectedSignatures
-        urls = urls +'/'+ selectedSignatures
-        }
-      if(this.excelOptions.subselectedAnnotations.length!=0)
-      {
-        var selectedAnnotations = this.excelOptions.subselectedAnnotations
-        urls = urls+"/"+selectedAnnotations
-        }
-
+//       // if(this.excelOptions.subselectedSignatures.length!=0)
+//       // {
+//       //   var selectedSignatures = this.excelOptions.subselectedSignatures
+//       //   urls = urls +'/'+ selectedSignatures
+//       //  // alert(urls)
+//       //   }
+//       console.log(this.excelOptions.subselectedAnnotations)
+//       alert(234)
+//       if(this.excelOptions.subselectedAnnotations.length!=0)
+//       {
+//         var selectedAnnotations = this.excelOptions.subselectedAnnotations
+//         urls = urls+"/"+selectedAnnotations
+//        // alert(urls)
+//         }
+// alert(urls)
       return new Promise((resolve, reject) => {
         // 棣栧厛灏濊瘯浣跨敤axios锛堥」鐩凡鏈夌殑HTTP瀹㈡埛绔級
         try {
@@ -2082,13 +2108,17 @@
           // 鏋勫缓鍙傛暟锛屽寘鍚敞瑙e唴瀹�
           const params = {
             recordId: id,
-
+            selectedSignatures: this.excelOptions.subselectedSignatures,
+            selectedAnnotations: this.excelOptions.subselectedAnnotations,
+            includeQrCode: this.excelOptions.includeQrCode
           };
+          console.log(params)
+          alert(457)
 
           axios({
             method: 'Post',
             url: urls,
-            params: params,
+            data: params,
             responseType: 'blob',
             headers: { 'Authorization': 'Bearer ' + getToken() }
           }).then(response => {

--
Gitblit v1.9.1