更新采购导出

This commit is contained in:
吴红兵
2026-02-24 10:36:05 +08:00
parent 9c7798ac41
commit 7104b2ec07
4 changed files with 104 additions and 2 deletions

View File

@@ -335,11 +335,11 @@
import { ref, reactive, defineAsyncComponent, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { getPage, delObj, submitObj, getArchiveDownloadUrl } from "/@/api/finance/purchasingrequisition";
import { getPage, delObj, submitObj, getArchiveDownloadUrl, getApplyTemplateDownloadUrl } from "/@/api/finance/purchasingrequisition";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { getDicts } from '/@/api/admin/dict';
import { getTree } from '/@/api/finance/purchasingcategory';
import { List, Document, DocumentCopy, Search, Collection, Money, CircleCheck, InfoFilled, Calendar, OfficeBuilding, Warning, DocumentChecked, Edit, Delete, Upload, FolderOpened } from '@element-plus/icons-vue'
import { List, Document, DocumentCopy, Search, Collection, Money, CircleCheck, InfoFilled, Calendar, OfficeBuilding, Warning, DocumentChecked, Edit, Delete, Upload, FolderOpened, Download } from '@element-plus/icons-vue'
import other from '/@/utils/other'
// 引入组件
@@ -541,6 +541,12 @@ const getActionMenuItems = (row: any) => {
icon: FolderOpened,
visible: () => true,
},
{
command: 'downloadApply',
label: '下载审批表',
icon: Download,
visible: () => true,
},
];
};
@@ -565,9 +571,24 @@ const handleMoreCommand = (command: string, row: any) => {
case 'archive':
handleArchive(row);
break;
case 'downloadApply':
handleDownloadApply(row);
break;
}
};
/** 下载审批表 */
const handleDownloadApply = (row: any) => {
const id = row?.id ?? row?.purchaseId;
if (id == null || id === '') {
useMessage().warning('无法获取申请单ID');
return;
}
const url = getApplyTemplateDownloadUrl(id);
const fileName = `审批表_${row?.purchaseNo || id}.docx`;
other.downBlobFile(url, {}, fileName);
};
/** 文件归档:按文件类型打包下载该申请单下所有附件 */
const handleArchive = (row: any) => {
const id = row?.id ?? row?.purchaseId;