新增采购申请文件归档打包下载

This commit is contained in:
吴红兵
2026-02-08 23:39:47 +08:00
parent 48f07afc40
commit 00a005e65f
2 changed files with 32 additions and 2 deletions

View File

@@ -336,11 +336,12 @@
import { ref, reactive, defineAsyncComponent, onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { getPage, delObj, submitObj } from "/@/api/finance/purchasingrequisition";
import { getPage, delObj, submitObj, getArchiveDownloadUrl } 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 } from '@element-plus/icons-vue'
import { List, Document, DocumentCopy, Search, Collection, Money, CircleCheck, InfoFilled, Calendar, OfficeBuilding, Warning, DocumentChecked, Edit, Delete, Upload, FolderOpened } from '@element-plus/icons-vue'
import other from '/@/utils/other'
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
@@ -536,6 +537,12 @@ const getActionMenuItems = (row: any) => {
icon: Upload,
visible: () => isTemp,
},
{
command: 'archive',
label: '文件归档',
icon: FolderOpened,
visible: () => true,
},
];
};
@@ -557,9 +564,24 @@ const handleMoreCommand = (command: string, row: any) => {
case 'implement':
handleImplement(row);
break;
case 'archive':
handleArchive(row);
break;
}
};
/** 文件归档:按文件类型打包下载该申请单下所有附件 */
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);
};
// 获取字典数据和品目树数据
const loadDictData = async () => {
try {