From 45d4fe24016c03fcccbe7c9798533ca97e2e7aea Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 03 十二月 2026 16:59:34 +0800
Subject: [PATCH] 回款新增和修改问题

---
 src/views/project/fund/applyDetail/index.vue |   71 +++++++++++++++++++++++++++++++----
 1 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index 381772a..62dc708 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -304,7 +304,7 @@
                 <i class="el-icon-warning-outline" />
                 褰撳墠涓烘煡鐪嬫ā寮忥紝涓嶈兘涓婁紶闄勪欢
               </div>
-              <el-table ref="annexTable" :data="fileListto" :row-class-name="annexRowClass" @row-click="downFile" style="width: 100%" height="400">
+              <el-table ref="annexTable" :data="fileListto" :row-class-name="annexRowClass" @row-click="previewInline" @row-dblclick="downFile" style="width: 100%" height="400">
                 <el-table-column prop="name" :show-overflow-tooltip="true" label="鍚嶇О">
                   <template slot-scope="scope">
                     <i style="color:#409EFF" class=" el-icon-s-order" />{{
@@ -616,7 +616,7 @@
                 <i class="el-icon-warning-outline" />
                 褰撳墠涓烘煡鐪嬫ā寮忥紝涓嶈兘涓婁紶闄勪欢
               </div>
-                <el-table ref="annexTable2" :data="fileListto" :row-class-name="annexRowClass" @row-click="downFile" style="width: 100%" height="400">
+                <el-table ref="annexTable2" :data="fileListto" :row-class-name="annexRowClass" @row-click="previewInline" @row-dblclick="downFile" style="width: 100%" height="400">
                   <el-table-column prop="name" :show-overflow-tooltip="true" label="鍚嶇О">
                     <template slot-scope="scope">
                       <i style="color:#409EFF" class=" el-icon-s-order" />
@@ -664,7 +664,7 @@
                 <i class="el-icon-warning-outline" />
                 褰撳墠涓烘煡鐪嬫ā寮忥紝涓嶈兘涓婁紶闄勪欢
               </div>
-                <el-table ref="invoiceTable" :data="invoicefileListto" :row-class-name="invoiceRowClass" @row-click="downFile" style="width: 100%" height="400">
+                <el-table ref="invoiceTable" :data="invoicefileListto" :row-class-name="invoiceRowClass" @row-click="previewInline" @row-dblclick="downFile" style="width: 100%" height="400">
                   <el-table-column prop="name" :show-overflow-tooltip="true" label="鍚嶇О">
                     <template slot-scope="scope">
                       <i style="color:#409EFF" class=" el-icon-s-order" />
@@ -1144,6 +1144,7 @@
       flashInvoiceName: "",
       invoicepdfimg: "",
       invoicepdfimgsrcList: [],
+      previewToken: 0,
       invoDatatop: [],
       activeName: "invoice", //鏂囦欢绫诲瀷锛氶粯璁ゅ彂绁ㄦ枃浠�
       //涓婁紶闄勪欢璺緞
@@ -2807,6 +2808,9 @@
       } else {
         this.rbDetails.splice(rowIndex + 1, 0, rowData);
       }
+      // 2026-11-30锛氭柊澧炶鍚庢妸褰撳墠鎿嶄綔琛屽垏鍒版柊琛岋紝骞舵竻绌轰笂涓�娆$殑棰勮鎬�
+      this.atpresent = this.rbDetails.indexOf(rowData);
+      this.resetPreviewState();
       this.Reminderquantity++;
       this.totalquantity++;
       for (let i = 0; i < this.rbDetails.length; i++) {
@@ -3239,18 +3243,33 @@
     },
 
     // 鐐瑰嚮绁ㄦ嵁
+    /**
+     * 2026-11-30锛氭竻绌虹エ鎹脊绐楃殑棰勮鐘舵�併��
+     * 鍘熷疄鐜版紡娓� embeddedFile / invoiceEmbeddedFile锛屽鑷村啀娆℃墦寮�寮圭獥鏃�
+     * 棰勮缁勪欢浠嶆樉绀轰笂涓�娆¢�夋嫨鐨勫彂绁ㄥ浘鐗囥��
+     */
+    resetPreviewState() {
+      this.fileListto = [];
+      this.invoicefileListto = [];
+      this.pdfimg = "";
+      this.invoicepdfimg = "";
+      this.pdfimgsrcList = [];
+      this.invoicepdfimgsrcList = [];
+      this.embeddedFile = null;
+      this.invoiceEmbeddedFile = null;
+      this.pdftitle = "";
+      // 閫掑浠ょ墝锛氳涓婁竴琛屽皻鏈繑鍥炵殑 fetch 缁撴灉澶辨晥锛岄伩鍏嶅紓姝ュ洖鍐欒鐩�
+      this.previewToken = (this.previewToken || 0) + 1;
+    },
+
     Filepopup(index, rows, row) {
       const config = {
         headers: { Authorization: "Bearer " + this.ICDtoken }
       };
 
       this.tableDatatop = [];
-      this.fileListto = [];
-      this.invoicefileListto = [];
-      this.pdfimg = "";
-      this.invoicepdfimg = [];
-      this.pdfimgsrcList = [];
-      this.invoicepdfimgsrcList = [];
+      this.resetPreviewState();
+      const previewToken = ++this.previewToken;
       this.tableDatatop.push(row);
       this.atpresent = index;
       this.pdfVisible = true;
@@ -3298,6 +3317,11 @@
         );
 
         Promise.all(fetchPromises).then(fileListto => {
+          // 2026-11-30锛氬垏鎹㈣鍚庢棫璇锋眰杩斿洖锛屼涪寮冭繃鏈熺粨鏋滐紝閬垮厤瑕嗙洊褰撳墠琛岄瑙�
+          if (previewToken !== this.previewToken) {
+            return;
+          }
+
           this.fileListto = fileListto.filter(item => item !== null);
           this.pdfimg =
             this.fileListto.length > 0 ? this.fileListto[0].previewUrl : "";
@@ -3334,6 +3358,11 @@
         );
 
         Promise.all(fetchPromises).then(invoicefileListto => {
+          // 2026-11-30锛氬垏鎹㈣鍚庢棫璇锋眰杩斿洖锛屼涪寮冭繃鏈熺粨鏋滐紝閬垮厤瑕嗙洊褰撳墠琛岄瑙�
+          if (previewToken !== this.previewToken) {
+            return;
+          }
+
           this.invoicefileListto = invoicefileListto.filter(
             item => item !== null
           );
@@ -3364,6 +3393,30 @@
     },
 
     // 璐圭敤鎶ラ攢锛氶檮浠剁粺涓�浣跨敤鐙珛 FilePreview锛堝綍鍏ャ�佸鎵广�佽鎯呬竴鑷达級
+    /**
+     * 2026-11-30锛氬崟鍑诲垪琛ㄩ」 鈫� 鍦ㄦ湰椤甸瑙堬紙鍙充晶 preview-pane锛夈��
+     * 鍙屽嚮鎵嶆墦寮�鐙珛鐨勯瑙堥〉闈紙downFile 鈫� $previewFile锛夈��
+     */
+    previewInline(row) {
+      if (!row) {
+        return;
+      }
+      const url = row.previewUrl || row.url;
+      if (!url) {
+        return;
+      }
+      const file = {
+        name: row.name || "",
+        url,
+        type: /\.pdf$/i.test(row.name || "") ? "pdf" : "image"
+      };
+      if (this.activeName == "common") {
+        this.embeddedFile = file;
+      } else {
+        this.invoiceEmbeddedFile = file;
+      }
+    },
+
     downFile(item) {
       const source =
         this.activeName == "common" ? this.fileListto : this.invoicefileListto;

--
Gitblit v1.9.3