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/performancedetails/index.vue |   67 +++++++++++++++++++++++++++++----
 1 files changed, 58 insertions(+), 9 deletions(-)

diff --git a/src/views/project/fund/performancedetails/index.vue b/src/views/project/fund/performancedetails/index.vue
index 597d9b8..fe9e8b3 100644
--- a/src/views/project/fund/performancedetails/index.vue
+++ b/src/views/project/fund/performancedetails/index.vue
@@ -435,7 +435,24 @@
                 </el-button>
                 <el-button
                   @click.native.prevent="
-                    Filepopup(scope.$index, rbDetails, scope.row)
+                    /**
+     * 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 = "";
+      this.previewToken = (this.previewToken || 0) + 1;
+    },
+
+    Filepopup(scope.$index, rbDetails, scope.row)
                   "
                   type="text"
                   size="small"
@@ -706,7 +723,7 @@
                 </el-upload>
                 <el-table
                   :data="fileListto"
-                  @row-click="downFile"
+                  @row-click="previewInline" @row-dblclick="downFile"
                   style="width: 100%"
                   height="400"
                 >
@@ -794,7 +811,7 @@
                 </el-upload>
                 <el-table
                   :data="invoicefileListto"
-                  @row-click="downFile"
+                  @row-click="previewInline" @row-dblclick="downFile"
                   style="width: 100%"
                   height="400"
                 >
@@ -1256,6 +1273,7 @@
       invoicefileListto: [],
       invoicepdfimg: "",
       invoicepdfimgsrcList: [],
+      previewToken: 0,
       activeName: 2, //鏂囦欢绫诲瀷锛氶粯璁ゅ彂绁ㄦ枃浠�
       //涓婁紶闄勪欢璺緞
       uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
@@ -2687,6 +2705,9 @@
         this.rbDetails.splice(rowIndex + 1, 0, rowData);
         console.log(14);
       }
+      // 2026-11-30锛氭柊澧炶鍚庢妸褰撳墠鎿嶄綔琛屽垏鍒版柊琛岋紝骞舵竻绌轰笂涓�娆$殑棰勮鎬�
+      this.atpresent = this.rbDetails.indexOf(rowData);
+      this.resetPreviewState();
       this.Reminderquantity++;
       this.totalquantity++;
       for (let i = 0; i < this.rbDetails.length; i++) {
@@ -2961,12 +2982,8 @@
       };
 
       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;
@@ -2991,6 +3008,10 @@
         );
 
         Promise.all(fetchPromises).then(fileListto => {
+          // 2026-11-30锛氬垏鎹㈣鍚庝涪寮冭繃鏈熺粨鏋�
+          if (previewToken !== this.previewToken) {
+            return;
+          }
           this.fileListto = fileListto.filter(item => item !== null);
           this.pdfimg = this.fileListto[0].url;
           console.log(this.pdfimg, "pdfimg");
@@ -3024,6 +3045,10 @@
         );
 
         Promise.all(fetchPromises).then(invoicefileListto => {
+          // 2026-11-30锛氬垏鎹㈣鍚庝涪寮冭繃鏈熺粨鏋�
+          if (previewToken !== this.previewToken) {
+            return;
+          }
           this.invoicefileListto = invoicefileListto.filter(
             item => item !== null
           );
@@ -3051,6 +3076,30 @@
     },
 
     // 鐐瑰嚮宸蹭笂浼犳枃浠讹細鍦ㄩ檮浠跺脊绐楀彸渚у唴宓岄瑙�
+    /**
+     * 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 == 2) {
+        this.invoiceEmbeddedFile = file;
+      } else {
+        this.embeddedFile = file;
+      }
+    },
+
     downFile(item) {
       if (this.operationType == "detail") {
         const source =

--
Gitblit v1.9.3