From f371d3ffa56f5cc279d1f9079a909665ccd13b1f Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 16 十一月 2025 10:49:00 +0800
Subject: [PATCH] 详细

---
 src/views/archiveManager/index.vue |   42 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index ca8a990..f19eec4 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -420,7 +420,7 @@
               <div class="option-label">閫夋嫨娉ㄨВ:</div>
               <div class="annotation-options">
               <label v-for="(annotation, index) in excelOptions.selectedAnnotations" :key="index" class="signature-checkbox">
-                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="annotation">
+                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="index">
                               <span>{{ annotation }}
                               </span>
               </label>
@@ -433,7 +433,7 @@
               <div class="signature-options">
                 <div class="signature-checkboxes">
                  <label v-for="(signature, index) in excelOptions.selectedSignatures" :key="index" class="signature-checkbox">
-                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="signature">
+                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="index">
                                  <span>{{ signature }}</span>
                   </label>
 
@@ -1349,6 +1349,8 @@
     /** 鏌ョ湅骞舵墦鍗癊xcel鏂囦欢 */
     viewAndPrintExcel(row) {
       const id = row.id || this.ids;
+     // alert(id)
+      this.recordId = id;
       this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
 
       // 浠庡悗绔幏鍙朎xcel鏂囦欢
@@ -1392,7 +1394,23 @@
     handlePreviewClick() {
       this.showExcelPreview = true;
       this.excelRenderError = '';
-
+      var id = this.recordId ;
+      this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
+      alert(id)
+      // 浠庡悗绔幏鍙朎xcel鏂囦欢
+      this.getExcelFile(id).then(blob => {
+        this.$modal.closeLoading();
+        // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+        this.currentExcelUrl = URL.createObjectURL(blob);
+        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鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+      });
       // 閲嶇疆vue-office-excel缁勪欢
       if (this.currentExcelUrl) {
         const tempUrl = this.currentExcelUrl;
@@ -1616,6 +1634,20 @@
     /** 浠庡悗绔幏鍙朎xcel鏂囦欢 */
     getExcelFile(id) {
       var includeQrCode = this.excelOptions.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
+        }
+
       return new Promise((resolve, reject) => {
         // 棣栧厛灏濊瘯浣跨敤axios锛堥」鐩凡鏈夌殑HTTP瀹㈡埛绔級
         try {
@@ -1627,10 +1659,10 @@
             recordId: id,
 
           };
-alert(355)
+
           axios({
             method: 'Post',
-            url: `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode,
+            url: urls,
             params: params,
             responseType: 'blob',
             headers: { 'Authorization': 'Bearer ' + getToken() }

--
Gitblit v1.9.1