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 | 102 ++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 80 insertions(+), 22 deletions(-)
diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue
index f3fa626..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);
}
},
@@ -3150,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);
@@ -3185,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);
@@ -3257,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 => {
@@ -3269,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;
@@ -3290,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 => {
@@ -3304,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
);
});
@@ -3331,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);
@@ -3355,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);
@@ -3364,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);
@@ -3378,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);
+ }
}
},
// 鐐瑰嚮涓婄Щ
@@ -3431,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