From 5baf4061e09622c6d057afa337a2bb04da971390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=BA=A2=E5=85=B5?= <374362909@qq.com> Date: Tue, 3 Mar 2026 16:15:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=87=E4=BB=B6=E5=BD=92=E6=A1=A3?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=94=B9=E4=B8=BA=E5=BC=B9=E7=AA=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E4=BB=B6=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 FileArchiveDialog.vue 弹窗组件,显示项目所有文件 - 弹窗顶部增加下载按钮,点击可打包下载全部文件 - 修改 handleArchive 方法,改为打开弹窗而非直接下载 - 新增 listDownloadUrls API 获取文件列表 --- src/api/purchase/purchasingrequisition.ts | 12 ++ .../FileArchiveDialog.vue | 185 ++++++++++++++++++ .../purchase/purchasingrequisition/index.vue | 15 +- 3 files changed, 206 insertions(+), 6 deletions(-) create mode 100644 src/views/purchase/purchasingrequisition/FileArchiveDialog.vue diff --git a/src/api/purchase/purchasingrequisition.ts b/src/api/purchase/purchasingrequisition.ts index 5484b8c..bef29cb 100644 --- a/src/api/purchase/purchasingrequisition.ts +++ b/src/api/purchase/purchasingrequisition.ts @@ -347,3 +347,15 @@ export function downloadFileById(fileId: string) { }); } +/** + * 批量获取文件下载地址列表 + * @param purchaseId 采购申请ID + */ +export function listDownloadUrls(purchaseId: string | number) { + return request({ + url: '/purchase/purchasingfiles/listDownloadUrls', + method: 'get', + params: { purchaseId } + }); +} + diff --git a/src/views/purchase/purchasingrequisition/FileArchiveDialog.vue b/src/views/purchase/purchasingrequisition/FileArchiveDialog.vue new file mode 100644 index 0000000..6d36e4c --- /dev/null +++ b/src/views/purchase/purchasingrequisition/FileArchiveDialog.vue @@ -0,0 +1,185 @@ + + + + + + + 文件归档 - {{ purchaseNo || purchaseId }} + + + + 下载全部文件 + + + + + + + + + + + {{ row.fileTitle }} + + + + + + {{ row.fileTypeDesc || '未知类型' }} + + + + + + 下载 + + + + + + + + + + + 关闭 + + + + + + + \ No newline at end of file diff --git a/src/views/purchase/purchasingrequisition/index.vue b/src/views/purchase/purchasingrequisition/index.vue index d4bf562..3a13a3a 100644 --- a/src/views/purchase/purchasingrequisition/index.vue +++ b/src/views/purchase/purchasingrequisition/index.vue @@ -289,9 +289,12 @@ - + + + + @@ -345,7 +348,7 @@ import { ref, reactive, defineAsyncComponent, onMounted, computed } from 'vue' import { useRouter } from 'vue-router' import { BasicTableProps, useTable } from "/@/hooks/table"; -import { getPage, delObj, submitObj, getArchiveDownloadUrl, getApplyTemplateDownloadUrl, getFileApplyTemplateDownloadUrl, getDeptMembers, saveRepresentor } from "/@/api/purchase/purchasingrequisition"; +import { getPage, delObj, submitObj, getApplyTemplateDownloadUrl, getFileApplyTemplateDownloadUrl, getDeptMembers, saveRepresentor, listDownloadUrls } from "/@/api/purchase/purchasingrequisition"; import { useMessage, useMessageBox } from "/@/hooks/message"; import { useAuth } from '/@/hooks/auth'; import { getDicts } from '/@/api/admin/dict'; @@ -365,6 +368,7 @@ const ImplementForm = defineAsyncComponent(() => import('./implementForm.vue')); const ActionDropdown = defineAsyncComponent(() => import('/@/components/tools/action-dropdown.vue')); const PurchasingAcceptModal = defineAsyncComponent(() => import('./accept/PurchasingAcceptModal.vue')); const FlowCommentTimeline = defineAsyncComponent(() => import('/@/views/jsonflow/comment/timeline.vue')); +const FileArchiveDialog = defineAsyncComponent(() => import('./FileArchiveDialog.vue')); // const DocAuditDialog = defineAsyncComponent(() => import('./docAudit/DocAuditDialog.vue')); // 字典数据和品目树数据 @@ -393,6 +397,7 @@ const currFlowJob = ref<{ id?: number; flowInstId?: number } | null>(null) const currFlowCommentType = ref<'apply' | 'file'>('apply') const implementFormRef = ref() +const fileArchiveDialogRef = ref() /** 采购代表弹窗 */ const representorDialogVisible = ref(false) @@ -713,16 +718,14 @@ const handleDownloadFileApply = (row: any) => { other.downBlobFile(url, {}, fileName); }; -/** 文件归档:按文件类型打包下载该申请单下所有附件 */ +/** 文件归档:打开弹窗查看文件列表,支持打包下载 */ const handleArchive = (row: any) => { const id = row?.id ?? row?.purchaseId; if (id == null || id === '') { useMessage().warning('无法获取申请单ID'); return; } - const url = getArchiveDownloadUrl(id); - const fileName = `归档_${row?.purchaseNo || id}.zip`; - other.downBlobFile(url, {}, fileName); + fileArchiveDialogRef.value?.open(String(id), row?.purchaseNo); }; // 获取字典数据和品目树数据