采购申请中下载上传的文件
This commit is contained in:
@@ -1313,13 +1313,20 @@ function formatImplementFileTime(t?: string) {
|
||||
return isNaN(d.getTime()) ? t : d.toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' });
|
||||
}
|
||||
|
||||
function downloadImplementFile(file: { remark?: string; fileTitle?: string }) {
|
||||
if (!file?.remark) {
|
||||
useMessage().warning('无法获取文件路径');
|
||||
function downloadImplementFile(file: { id?: string; remark?: string; fileTitle?: string }) {
|
||||
// 优先使用文件ID下载
|
||||
if (file?.id) {
|
||||
const url = `/purchase/purchasingfiles/downloadById?fileId=${encodeURIComponent(file.id)}`;
|
||||
other.downBlobFile(url, {}, file.fileTitle || '采购文件');
|
||||
return;
|
||||
}
|
||||
const url = `/purchase/purchasingfiles/download?fileName=${encodeURIComponent(file.remark)}&fileTitle=${encodeURIComponent(file.fileTitle || '采购文件')}`;
|
||||
other.downBlobFile(url, {}, file.fileTitle || '采购文件');
|
||||
// 兼容旧数据:使用文件路径下载
|
||||
if (file?.remark) {
|
||||
const url = `/purchase/purchasingfiles/download?fileName=${encodeURIComponent(file.remark)}&fileTitle=${encodeURIComponent(file.fileTitle || '采购文件')}`;
|
||||
other.downBlobFile(url, {}, file.fileTitle || '采购文件');
|
||||
return;
|
||||
}
|
||||
useMessage().warning('无法获取文件信息');
|
||||
}
|
||||
|
||||
/** 流程嵌入时提供给 orderVue.currElTabIsView 的 methods(只读/禁用提交) */
|
||||
|
||||
Reference in New Issue
Block a user