From 9e7c8d26cfbe9eca1f0d0e1302581832e3b7d22a Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 26 十一月 2026 09:35:44 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/opo-web

---
 src/views/project/fund/applyDetail/index.vue |  116 ++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 92 insertions(+), 24 deletions(-)

diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index b929c31..381772a 100644
--- a/src/views/project/fund/applyDetail/index.vue
+++ b/src/views/project/fund/applyDetail/index.vue
@@ -2521,6 +2521,10 @@
 
             addorupdateFund(this.form).then(response => {
               if (response.code === 200) {
+                // 2026-11-23锛氬悗绔墧闄や簡鏃犳晥锛坆lob:/data:锛夐檮浠跺湴鍧�鏃剁粰鍑烘彁绀�
+                if (response.attachWarn) {
+                  this.$modal.msgWarning(response.attachWarn);
+                }
                 this.$modal.msgSuccess("鐢宠鍗曚繚瀛樻垚鍔燂紒");
                 // 闈炴彁閱掔姸鎬佷笅鎵ц瀹℃壒瑙e喅寮傛璋冪敤寤惰繜闂
                 if (!this.Savereminder) {
@@ -3072,13 +3076,33 @@
     },
 
     remove(file, fileList) {
-      const rbDetails = [...this.rbDetails];
+      // 2026-11-23锛氫笉鍐嶇敤"棰勮鐢ㄤ复鏃跺垪琛�"(blob: URL) 鏁磋〃瑕嗙洊闄勪欢瀛楁锛�
+      // 鏀逛负鎸夋枃浠跺悕绮剧‘鍒犻櫎锛岄伩鍏� blob: 鍦板潃琚繚瀛樿繘 annexfiles / invoicefiles銆�
+      const name =
+        (file && (file.name || (file.raw && file.raw.name))) || "";
+      if (!this.rbDetails[this.atpresent]) {
+        return;
+      }
       if (this.activeName == "common") {
-        this.fileListto.splice(this.fileListto.indexOf(file), 1);
-        rbDetails[this.atpresent].annexfilesList = this.fileListto;
+        this.spliceByName(this.fileListto, name);
+        this.spliceByName(this.rbDetails[this.atpresent].annexfilesList, name);
       } else {
-        this.invoicefileListto.splice(this.invoicefileListto.indexOf(file), 1);
-        rbDetails[this.atpresent].invoicefilesList = this.invoicefileListto;
+        this.spliceByName(this.invoicefileListto, name);
+        this.spliceByName(
+          this.rbDetails[this.atpresent].invoicefilesList,
+          name
+        );
+      }
+    },
+
+    /** 鎸夋枃浠跺悕浠庡垪琛ㄤ腑鍒犻櫎涓�椤癸紙鎵句笉鍒板垯涓嶅仛浠讳綍浜嬶級 */
+    spliceByName(list, name) {
+      if (!list || !name) {
+        return;
+      }
+      const idx = list.findIndex(item => item && item.name === name);
+      if (idx > -1) {
+        list.splice(idx, 1);
       }
     },
 
@@ -3087,9 +3111,17 @@
      * 瑙勫垯涓庡悗绔� AttachmentNameValidator 鍚屽彛寰勶細涓嶅己鍒跺惈涓枃 / 鍘绘帀鎵╁睍鍚嶅悗涓诲共 鈮�20 瀛� /
      * 涓嶅惈绌烘牸鍙� / \ : * ? " < > | # % 绛夌壒娈婂瓧绗︺��
      */
+    /**
+     * 2026-11-17锛氶檮浠跺悕鏄惁蹇呴』鍚腑鏂�
+     * 涓撳鍔冲姟璐�(1)銆佷鸡鐞嗕笓瀹惰垂(2) 涓嶈姹傦紱鍖诲鎴愭湰(3)銆佸姙鍏垂鐢�(4) 绛夊叾浠栫被鍨嬪繀椤诲惈涓枃
+     * 锛堝尰闄㈡姤閿�鍗曞鎵硅姹傦細闄勪欢鍚嶈鍙嶆槧鍙戠エ涓昏鍐呭锛�
+     */
+    requireChineseName() {
+      return !(this.businessType == "1" || this.businessType == "2");
+    },
     checkUploadFileName(file) {
       const raw = file && file.raw ? file.raw.name : file && file.name;
-      const r = checkFileName(raw);
+      const r = checkFileName(raw, { requireChinese: this.requireChineseName() });
       if (!r.ok) {
         this.$modal.msgError(r.msg);
         return false;
@@ -3107,7 +3139,9 @@
       if (this.form && this.form.id) {
         return true;
       }
-      const c = checkDetails(this.rbDetails);
+      const c = checkDetails(this.rbDetails, {
+        requireChinese: this.requireChineseName()
+      });
       if (!c.ok) {
         this.$modal.msgError(c.msg);
         return false;
@@ -3140,9 +3174,11 @@
             type: /\.pdf$/i.test(file.name) ? "pdf" : "image"
           };
           this.pdfimgsrcList.push(localUrl);
+          // 2026-11-23锛歶rl 瀛樻湇鍔$璺緞锛堟潈濞佸�硷級锛宲reviewUrl 鍙敤浜庢湰鍦伴瑙�
           this.fileListto.push({
             name: file.name,
-            url: localUrl
+            url: response.fileName,
+            previewUrl: localUrl
           });
 
           this.$modal.msgSuccess(response.msg);
@@ -3175,9 +3211,11 @@
             type: /\.pdf$/i.test(file.name) ? "pdf" : "image"
           };
           this.invoicepdfimgsrcList.push(localUrl);
+          // 2026-11-23锛歶rl 瀛樻湇鍔$璺緞锛堟潈濞佸�硷級锛宲reviewUrl 鍙敤浜庢湰鍦伴瑙�
           this.invoicefileListto.push({
             name: file.name,
-            url: localUrl
+            url: response.fileName,
+            previewUrl: localUrl
           });
 
           this.$modal.msgSuccess(response.msg);
@@ -3247,7 +3285,9 @@
               .then(blob => {
                 return {
                   name: value.name,
-                  url: URL.createObjectURL(blob)
+                  // 2026-11-23锛氭潈濞佸湴鍧�浠嶆槸鏈嶅姟绔矾寰勶紝blob 鍙斁 previewUrl
+                  url: value.url,
+                  previewUrl: URL.createObjectURL(blob)
                 };
               })
               .catch(error => {
@@ -3259,9 +3299,10 @@
 
         Promise.all(fetchPromises).then(fileListto => {
           this.fileListto = fileListto.filter(item => item !== null);
-          this.pdfimg = this.fileListto[0].url;
+          this.pdfimg =
+            this.fileListto.length > 0 ? this.fileListto[0].previewUrl : "";
           console.log(this.pdfimg, "pdfimg");
-          this.pdfimgsrcList = this.fileListto.map(item => item.url);
+          this.pdfimgsrcList = this.fileListto.map(item => item.previewUrl);
         });
 
         this.previewpdf = true;
@@ -3280,7 +3321,9 @@
               .then(blob => {
                 return {
                   name: value.name,
-                  url: URL.createObjectURL(blob)
+                  // 2026-11-23锛氭潈濞佸湴鍧�浠嶆槸鏈嶅姟绔矾寰勶紝blob 鍙斁 previewUrl
+                  url: value.url,
+                  previewUrl: URL.createObjectURL(blob)
                 };
               })
               .catch(error => {
@@ -3294,10 +3337,13 @@
           this.invoicefileListto = invoicefileListto.filter(
             item => item !== null
           );
-          this.invoicepdfimg = this.invoicefileListto[0].url;
+          this.invoicepdfimg =
+            this.invoicefileListto.length > 0
+              ? this.invoicefileListto[0].previewUrl
+              : "";
           console.log(this.invoicepdfimg, "invoicepdfimg");
           this.invoicepdfimgsrcList = this.invoicefileListto.map(
-            item => item.url
+            item => item.previewUrl
           );
         });
 
@@ -3321,10 +3367,15 @@
     downFile(item) {
       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 }];
+      // 2026-11-23锛氶瑙堜紭鍏堢敤鏈湴 blob锛坧reviewUrl锛夛紝娌℃湁鍒欓��鍥炴湇鍔$璺緞
+      let list = (source || []).map(f => ({
+        name: f.name,
+        url: f.previewUrl || f.url
+      }));
+      const target = item && (item.previewUrl || item.url);
+      let index = list.findIndex(f => f.url === target);
+      if (index < 0 && target) {
+        list = [{ name: item.name, url: target }];
         index = 0;
       }
       this.$previewFile(list, index > -1 ? index : 0);
@@ -3345,7 +3396,10 @@
       console.log(row);
       let indexvalue = "";
       if (this.activeName == "common") {
-        const indexlist = this.getIndexInArray(this.pdfimgsrcList, row.url);
+        const indexlist = this.getIndexInArray(
+          this.pdfimgsrcList,
+          row.previewUrl || row.url
+        );
         this.pdfimgsrcList.splice(indexlist, 1);
         const index = this.getIndexInArray(this.fileListto, row);
         this.fileListto.splice(index, 1);
@@ -3354,11 +3408,13 @@
           item => item.name == row.name
         );
         console.log(indexvalue, "鍒犻櫎绱㈠紩");
-        this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1);
+        if (indexvalue > -1) {
+          this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1);
+        }
       } else {
         const indexlist = this.getIndexInArray(
           this.invoicepdfimgsrcList,
-          row.url
+          row.previewUrl || row.url
         );
         this.invoicepdfimgsrcList.splice(indexlist, 1);
         const index = this.getIndexInArray(this.invoicefileListto, row);
@@ -3368,7 +3424,9 @@
           item => item.name == row.name
         );
         console.log(indexvalue, "鍒犻櫎绱㈠紩");
-        this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1);
+        if (indexvalue > -1) {
+          this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1);
+        }
       }
     },
     // 鐐瑰嚮涓婄Щ
@@ -3421,7 +3479,17 @@
       // console.log(this.rbDetails[this.atpresent].invoicefilesList,'invoicefilesList');
     },
     Downloadfile(row) {
-      window.location.href = row.url;
+      // 2026-11-23锛氫紭鍏堢敤鏈湴 blob 涓嬭浇锛涙病鏈夊垯鎷兼湇鍔$鍦板潃
+      const target = (row && (row.previewUrl || row.url)) || "";
+      if (!target) {
+        return;
+      }
+      if (/^(blob:|data:|https?:)/i.test(target)) {
+        window.location.href = target;
+      } else {
+        window.location.href =
+          this.Networkheader + process.env.VUE_APP_BASE_API + target;
+      }
     },
 
     //涓撳/鍖荤枟鏈烘瀯/璐圭敤鎶ラ攢鏈烘瀯閫夋嫨

--
Gitblit v1.9.3