更新采购文件审核导出
This commit is contained in:
@@ -190,3 +190,11 @@ export function getApplyTemplateDownloadUrl(id: string | number) {
|
|||||||
return `/purchase/purchasingapply/export-apply-template?id=${encodeURIComponent(String(id))}`;
|
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))}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -343,7 +343,7 @@
|
|||||||
import { ref, reactive, defineAsyncComponent, onMounted } from 'vue'
|
import { ref, reactive, defineAsyncComponent, onMounted } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
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 { useMessage, useMessageBox } from "/@/hooks/message";
|
||||||
import { getDicts } from '/@/api/admin/dict';
|
import { getDicts } from '/@/api/admin/dict';
|
||||||
import { getTree } from '/@/api/finance/purchasingcategory';
|
import { getTree } from '/@/api/finance/purchasingcategory';
|
||||||
@@ -555,6 +555,12 @@ const getActionMenuItems = (row: any) => {
|
|||||||
icon: Download,
|
icon: Download,
|
||||||
visible: () => true,
|
visible: () => true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
command: 'downloadFileApply',
|
||||||
|
label: '下载文件审批表',
|
||||||
|
icon: Download,
|
||||||
|
visible: () => true,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -582,6 +588,9 @@ const handleMoreCommand = (command: string, row: any) => {
|
|||||||
case 'downloadApply':
|
case 'downloadApply':
|
||||||
handleDownloadApply(row);
|
handleDownloadApply(row);
|
||||||
break;
|
break;
|
||||||
|
case 'downloadFileApply':
|
||||||
|
handleDownloadFileApply(row);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -597,6 +606,18 @@ const handleDownloadApply = (row: any) => {
|
|||||||
other.downBlobFile(url, {}, fileName);
|
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 handleArchive = (row: any) => {
|
||||||
const id = row?.id ?? row?.purchaseId;
|
const id = row?.id ?? row?.purchaseId;
|
||||||
|
|||||||
Reference in New Issue
Block a user