采购申请中下载上传的文件
This commit is contained in:
@@ -376,7 +376,19 @@ const handleRemove = (file: { name?: string; id?: string; url?: string }) => {
|
||||
};
|
||||
|
||||
const handlePreview = (file: any) => {
|
||||
other.downBlobFile(file.url, {}, file.name);
|
||||
// 优先使用文件ID下载(采购附件使用 downloadById 接口)
|
||||
if (file.id) {
|
||||
// 判断是否是采购附件(通过 fileType 判断)
|
||||
const downloadUrl = `/purchase/purchasingfiles/downloadById?fileId=${encodeURIComponent(file.id)}`;
|
||||
other.downBlobFile(downloadUrl, {}, file.name || file.fileTitle || '文件');
|
||||
return;
|
||||
}
|
||||
// 兼容旧的URL下载方式
|
||||
if (file.url) {
|
||||
other.downBlobFile(file.url, {}, file.name || file.fileTitle || '文件');
|
||||
return;
|
||||
}
|
||||
useMessage().warning('无法获取文件下载信息');
|
||||
};
|
||||
|
||||
// 添加 handleExceed 函数
|
||||
|
||||
Reference in New Issue
Block a user