From 47dd3a0647addb38d31d52598a69cbd09841bb6d 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, 24 Feb 2026 17:21:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=87=87=E8=B4=AD=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=AE=A1=E6=A0=B8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/finance/purchasingrequisition.ts | 8 +++++++ .../finance/purchasingrequisition/index.vue | 23 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/api/finance/purchasingrequisition.ts b/src/api/finance/purchasingrequisition.ts index 3a477f9..7fec5da 100644 --- a/src/api/finance/purchasingrequisition.ts +++ b/src/api/finance/purchasingrequisition.ts @@ -190,3 +190,11 @@ export function getApplyTemplateDownloadUrl(id: string | number) { return `/purchase/purchasingapply/export-apply-template?id=${encodeURIComponent(String(id))}`; } +/** + * 下载文件审批表:导出采购文件审批表 Word 文档(fileapply.docx 模板) + * @param id 采购申请ID + */ +export function getFileApplyTemplateDownloadUrl(id: string | number) { + return `/purchase/purchasingapply/export-file-apply-template?id=${encodeURIComponent(String(id))}`; +} + diff --git a/src/views/finance/purchasingrequisition/index.vue b/src/views/finance/purchasingrequisition/index.vue index e4f3419..d5dfbc9 100644 --- a/src/views/finance/purchasingrequisition/index.vue +++ b/src/views/finance/purchasingrequisition/index.vue @@ -343,7 +343,7 @@ import { ref, reactive, defineAsyncComponent, onMounted } from 'vue' import { useRouter } from 'vue-router' import { BasicTableProps, useTable } from "/@/hooks/table"; -import { getPage, delObj, submitObj, getArchiveDownloadUrl, getApplyTemplateDownloadUrl } from "/@/api/finance/purchasingrequisition"; +import { getPage, delObj, submitObj, getArchiveDownloadUrl, getApplyTemplateDownloadUrl, getFileApplyTemplateDownloadUrl } from "/@/api/finance/purchasingrequisition"; import { useMessage, useMessageBox } from "/@/hooks/message"; import { getDicts } from '/@/api/admin/dict'; import { getTree } from '/@/api/finance/purchasingcategory'; @@ -555,6 +555,12 @@ const getActionMenuItems = (row: any) => { icon: Download, visible: () => true, }, + { + command: 'downloadFileApply', + label: '下载文件审批表', + icon: Download, + visible: () => true, + }, ]; }; @@ -582,6 +588,9 @@ const handleMoreCommand = (command: string, row: any) => { case 'downloadApply': handleDownloadApply(row); break; + case 'downloadFileApply': + handleDownloadFileApply(row); + break; } }; @@ -597,6 +606,18 @@ const handleDownloadApply = (row: any) => { other.downBlobFile(url, {}, fileName); }; +/** 下载文件审批表 */ +const handleDownloadFileApply = (row: any) => { + const id = row?.id ?? row?.purchaseId; + if (id == null || id === '') { + useMessage().warning('无法获取申请单ID'); + return; + } + const url = getFileApplyTemplateDownloadUrl(id); + const fileName = `文件审批表_${row?.purchaseNo || id}.docx`; + other.downBlobFile(url, {}, fileName); +}; + /** 文件归档:按文件类型打包下载该申请单下所有附件 */ const handleArchive = (row: any) => { const id = row?.id ?? row?.purchaseId;