From e1dd822239ce5b1fd85462c95b264b300153a4cf Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期二, 03 十一月 2026 21:45:00 +0800
Subject: [PATCH] 修改了回款名字

---
 src/views/project/fund/applyDetail/index.vue |  178 ++++++++++++++++++++++-------------------------------------
 1 files changed, 66 insertions(+), 112 deletions(-)

diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index b4b6494..715f80a 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -516,7 +516,24 @@
       </span>
     </el-dialog>
     <el-dialog v-dialogDrags :modal="false" :close-on-click-modal="false" :title="pdftitle" :visible.sync="pdfVisible"
-      width="60%">
+      :fullscreen="pdfFullscreen" width="60%" custom-class="pdf-resize-dialog" @closed="pdfFullscreen = false">
+      <template slot="title">
+        <span>{{ pdftitle }}</span>
+        <el-button class="pdf-fullscreen-btn" size="mini"
+          :icon="pdfFullscreen ? 'el-icon-close' : 'el-icon-full-screen'"
+          @click="pdfFullscreen = !pdfFullscreen">{{ pdfFullscreen ? "杩樺師" : "鍏ㄥ睆" }}</el-button>
+      </template>
+      <el-alert
+        :title="
+          activeName == 'invoice'
+            ? '褰撳墠姝e湪鎿嶄綔锛氬彂绁ㄦ枃浠讹紙璇风‘璁ょエ鎹睘浜庡彂绁級'
+            : '褰撳墠姝e湪鎿嶄綔锛氭櫘閫氶檮浠讹紙璇峰嬁鍦ㄦ涓婁紶鍙戠エ锛�'
+        "
+        :type="activeName == 'invoice' ? 'success' : 'warning'"
+        :closable="false"
+        show-icon
+        style="margin-bottom: 10px;"
+      />
       <div style="margin-bottom: 10px;">
         <el-table :data="tableDatatop" style="width: 100%">
           <el-table-column v-if="businessType == 4" prop="price" align="center" label="鍗曚环">
@@ -601,18 +618,7 @@
               </div>
             </div>
 
-            <div v-if="this.previewpdf && pdfimgsrcList.length" class="pdfimgmin">
-              <!-- <img :src="pdfimg" /> -->
-              <el-image ref="imagePreview" style="width: 95%; height: 90%" :src="pdfimg"
-                @click="handleImageClick(initialIndex)">
-                <!-- <div slot="error" class="image-slot">
-                <i class="el-icon-picture-outline"></i>
-              </div> -->
-              </el-image>
-              <custom-image-viewer :url-list="pdfimgsrcList" :initial-index="currentIndex" :visible="viewerVisible"
-                @update:visible="viewerVisible = $event" @close="handleViewerClose" />
-            </div>
-            <div v-else class="pdfimgmins">{{ hintitle }}</div>
+            <attachment-preview-pane :file="embeddedFile" style="flex: 1; min-width: 0;" />
           </div>
         </el-tab-pane>
         <el-tab-pane label="鍙戠エ鏂囦欢" name="invoice">
@@ -653,19 +659,7 @@
               </div>
             </div>
 
-            <div v-if="this.previewpdf && invoicepdfimgsrcList.length" class="pdfimgmin">
-              <!-- <img :src="pdfimg" /> -->
-              <el-image style="width: 95%; height: 90%" :src="invoicepdfimg"
-                @click="invoicehandleImageClick(initialIndex)">
-                <!-- <div slot="error" class="image-slot">
-                <i class="el-icon-picture-outline"></i>
-              </div> -->
-              </el-image>
-              <custom-image-viewer :url-list="invoicepdfimgsrcList" :initial-index="invoicecurrentIndex"
-                :visible="invoiceviewerVisible" @update:visible="invoiceviewerVisible = $event"
-                @close="invoicehandleViewerClose" />
-            </div>
-            <div v-else class="pdfimgmins">{{ hintitle }}</div>
+            <attachment-preview-pane :file="invoiceEmbeddedFile" style="flex: 1; min-width: 0;" />
           </div>
         </el-tab-pane>
       </el-tabs>
@@ -1121,7 +1115,7 @@
       invoicepdfimg: "",
       invoicepdfimgsrcList: [],
       invoDatatop: [],
-      activeName: "common", //鏂囦欢绫诲瀷
+      activeName: "invoice", //鏂囦欢绫诲瀷锛氶粯璁ゅ彂绁ㄦ枃浠�
       //涓婁紶闄勪欢璺緞
       uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
       ICDtoken: getToken(),
@@ -1132,6 +1126,7 @@
       //绁ㄦ嵁鏂囦欢
       pdftitle: "",
       pdfimg: "",
+      invoiceEmbeddedFile: null,
       pdfimgsrcList: [],
       currentIndex: 0, // 鍒濆绱㈠紩
       invoicecurrentIndex: 0, // 鍒濆绱㈠紩
@@ -1234,14 +1229,8 @@
     },
     // 鑾峰彇璇锋眰澶�
     Getnetworkheader() {
-      let string = window.location.href;
-      if (string.includes("9091")) {
-        const index = string.indexOf("9091");
-        this.Networkheader = string.slice(0, index + 4); // 鎴彇9091鍙婂叾鍓嶉儴瀛楃
-      } else {
-        const index = string.indexOf("8032");
-        this.Networkheader = string.slice(0, index + 4); // 鎴彇8032鍙婂叾鍓嶉儴瀛楃
-      }
+      // 浠ュ綋鍓嶉〉闈� origin 涓哄噯锛屽吋瀹� 80/8032/9091 鍙婂悗缁鍙h皟鏁�
+      this.Networkheader = window.location.origin;
     },
     /** 閫氳繃鍙傛暟鑾峰彇涓氬姟绫诲瀷 */
     getroute() {
@@ -2975,7 +2964,7 @@
 
     /**
      * 2026-10-15锛氫笂浼犳椂鏍¢獙闄勪欢鏂囦欢鍚嶏紙涓氬姟瑕佹眰锛氫笉鍚堟牸绔嬪嵆鎻愮ず涓斾笉鍔犲叆鍒楄〃锛夈��
-     * 瑙勫垯涓庡悗绔� AttachmentNameValidator 鍚屽彛寰勶細蹇呴』鍚腑鏂� / 鍘绘帀鎵╁睍鍚嶅悗涓诲共 鈮�20 瀛� /
+     * 瑙勫垯涓庡悗绔� AttachmentNameValidator 鍚屽彛寰勶細涓嶅己鍒跺惈涓枃 / 鍘绘帀鎵╁睍鍚嶅悗涓诲共 鈮�20 瀛� /
      * 涓嶅惈绌烘牸鍙� / \ : * ? " < > | # % 绛夌壒娈婂瓧绗︺��
      */
     checkUploadFileName(file) {
@@ -3014,27 +3003,27 @@
       const config = {
         headers: { Authorization: "Bearer " + this.ICDtoken }
       };
-      const pdfimg = this.Networkheader + "/prod-api" + response.fileName;
+      const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + response.fileName;
       //鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆
       if (this.activeName == "common") {
         if (response.code == 200) {
           this.previewpdf = true;
 
-          fetch(pdfimg, config)
-            .then(response => response.blob())
-            .then(blob => {
-              // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL
-              this.pdfimg = URL.createObjectURL(blob);
-              this.pdfimgsrcList.push(URL.createObjectURL(blob));
-              this.fileListto.push({
-                name: file.name,
-                url: URL.createObjectURL(blob)
-              });
-            })
-            .catch(error => {
-              console.error("Error loading image", error);
-              return;
-            });
+          // 鏂颁笂浼犳枃浠剁洿鎺ヤ娇鐢ㄦ祻瑙堝櫒鏈湴 File锛岄伩鍏嶆湇鍔$鏂囦欢鍦板潃/Token
+          // 寮傚父鏃舵妸 JSON 閿欒鍝嶅簲褰撴垚鍥剧墖鎴� PDF 棰勮銆�
+          const localBlob = file.raw;
+          const localUrl = URL.createObjectURL(localBlob);
+          this.pdfimg = localUrl;
+          this.embeddedFile = {
+            name: file.name,
+            url: localUrl,
+            type: /\.pdf$/i.test(file.name) ? "pdf" : "image"
+          };
+          this.pdfimgsrcList.push(localUrl);
+          this.fileListto.push({
+            name: file.name,
+            url: localUrl
+          });
 
           this.$modal.msgSuccess(response.msg);
 
@@ -3053,21 +3042,19 @@
       } else {
         if (response.code == 200) {
           this.previewpdf = true;
-          fetch(pdfimg, config)
-            .then(response => response.blob())
-            .then(blob => {
-              // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL
-              this.invoicepdfimg = URL.createObjectURL(blob);
-              this.invoicepdfimgsrcList.push(URL.createObjectURL(blob));
-              this.invoicefileListto.push({
-                name: file.name,
-                url: URL.createObjectURL(blob)
-              });
-            })
-            .catch(error => {
-              console.error("Error loading image", error);
-              return;
-            });
+          const localBlob = file.raw;
+          const localUrl = URL.createObjectURL(localBlob);
+          this.invoicepdfimg = localUrl;
+          this.invoiceEmbeddedFile = {
+            name: file.name,
+            url: localUrl,
+            type: /\.pdf$/i.test(file.name) ? "pdf" : "image"
+          };
+          this.invoicepdfimgsrcList.push(localUrl);
+          this.invoicefileListto.push({
+            name: file.name,
+            url: localUrl
+          });
 
           this.$modal.msgSuccess(response.msg);
 
@@ -3103,7 +3090,7 @@
 
       if (this.rbDetails[index].annexfilesList) {
         // this.rbDetails[index].annexfilesList.forEach((value, indexson) => {
-        //   const pdfimg = this.Networkheader + "/prod-api" + value.url;
+        //   const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + value.url;
         //   fetch(pdfimg, config)
         //     .then(response => response.blob())
         //     .then(blob => {
@@ -3125,7 +3112,7 @@
 
         const fetchPromises = this.rbDetails[index].annexfilesList.map(
           (value, indexson) => {
-            const pdfimg = this.Networkheader + "/prod-api" + value.url;
+            const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + value.url;
             return fetch(pdfimg, config)
               .then(response => response.blob())
               .then(blob => {
@@ -3158,7 +3145,7 @@
       if (this.rbDetails[index].invoicefilesList) {
         const fetchPromises = this.rbDetails[index].invoicefilesList.map(
           (value, indexson) => {
-            const pdfimg = this.Networkheader + "/prod-api" + value.url;
+            const pdfimg = this.Networkheader + process.env.VUE_APP_BASE_API + value.url;
             return fetch(pdfimg, config)
               .then(response => response.blob())
               .then(blob => {
@@ -3201,50 +3188,17 @@
       console.log(this.rbDetails[index].annexfilesList, "annexfilesList");
     },
 
-    // 鐐瑰嚮宸蹭笂浼犳枃浠�
+    // 璐圭敤鎶ラ攢锛氶檮浠剁粺涓�浣跨敤鐙珛 FilePreview锛堝綍鍏ャ�佸鎵广�佽鎯呬竴鑷达級
     downFile(item) {
-      if (this.activeName == "common") {
-        this.pdftitle =
-          "鍏�" + this.pdfimgsrcList.length + "椤癸紝褰撳墠閫変腑" + item.name;
-        let name = item.name.split(".");
-        if (name[1] == "pdf") {
-          this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-          this.previewpdf = false;
-          this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-        } else if (name[1] == "jpg" || "png") {
-          console.log(item, "灞曠ず");
-          this.previewpdf = true;
-          if (item.url) {
-            this.pdfimg = item.url;
-          } else {
-            this.pdfimg = "";
-          }
-        } else {
-          this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-          this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-          this.previewpdf = false;
-        }
-      } else {
-        this.pdftitle =
-          "鍏�" + this.invoicepdfimgsrcList.length + "椤癸紝褰撳墠閫変腑" + item.name;
-        let name = item.name.split(".");
-        if (name[1] == "pdf") {
-          this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-          this.previewpdf = false;
-          this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-        } else if (name[1] == "jpg" || "png") {
-          this.previewpdf = true;
-          if (item.url) {
-            this.invoicepdfimg = item.url;
-          } else {
-            this.invoicepdfimg = "";
-          }
-        } else {
-          this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮";
-          this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮");
-          this.previewpdf = false;
-        }
+      const source =
+        this.activeName == "common" ? this.fileListto : this.invoicefileListto;
+      let list = (source || []).map(f => ({ name: f.name, url: f.url }));
+      let index = list.findIndex(f => f.url === item.url);
+      if (index < 0 && item && item.url) {
+        list = [{ name: item.name, url: item.url }];
+        index = 0;
       }
+      this.$previewFile(list, index > -1 ? index : 0);
     },
     getIndexInArray(arr, obj) {
       return arr.indexOf(obj);

--
Gitblit v1.9.3