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 @@ + + + + + \ 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); }; // 获取字典数据和品目树数据