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/travelexpenseapply/travelexpensedetail/index.vue |   69 ++++++++++++++++++++++++++++++----
 1 files changed, 61 insertions(+), 8 deletions(-)

diff --git a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
index cc5e04d..999832d 100644
--- a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
+++ b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -605,7 +605,7 @@
                         type="primary">鐐瑰嚮涓婁紶</el-button></em>
                   </div>
                 </el-upload>
-                <el-table :data="fileListto" @row-click="downFile" style="width: 100%" height="400">
+                <el-table :data="fileListto" @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" />{{
@@ -650,7 +650,7 @@
                         type="primary">鐐瑰嚮涓婁紶</el-button></em>
                   </div>
                 </el-upload>
-                <el-table :data="invoicefileListto" @row-click="downFile" style="width: 100%" height="400">
+                <el-table :data="invoicefileListto" @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" />{{
@@ -932,6 +932,7 @@
       invoicefileListto: [],
       invoicepdfimg: "",
       invoicepdfimgsrcList: [],
+      previewToken: 0,
       currentIndex: 0, // 鍒濆绱㈠紩
       invoicecurrentIndex: 0, // 鍒濆绱㈠紩
       initialIndex: 0, // 鍒濆绱㈠紩
@@ -1481,18 +1482,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;
@@ -1517,6 +1533,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[0].url;
           console.log(this.pdfimg, "pdfimg");
@@ -1555,6 +1576,11 @@
         );
 
         Promise.all(fetchPromises).then(invoicefileListto => {
+          // 2026-11-30锛氬垏鎹㈣鍚庢棫璇锋眰杩斿洖锛屼涪寮冭繃鏈熺粨鏋滐紝閬垮厤瑕嗙洊褰撳墠琛岄瑙�
+          if (previewToken !== this.previewToken) {
+            return;
+          }
+
           this.invoicefileListto = invoicefileListto.filter(
             item => item !== null
           );
@@ -1584,6 +1610,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 == 2) {
+        this.invoiceEmbeddedFile = file;
+      } else {
+        this.embeddedFile = file;
+      }
+    },
+
     downFile(item) {
       const source =
         this.activeName == 1 ? this.fileListto : this.invoicefileListto;
@@ -2870,6 +2920,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++) {

--
Gitblit v1.9.3