diff --git a/src/api/oa/erp/projectPurchase/index.ts b/src/api/oa/erp/projectPurchase/index.ts
index 1d173b3..f8fa351 100644
--- a/src/api/oa/erp/projectPurchase/index.ts
+++ b/src/api/oa/erp/projectPurchase/index.ts
@@ -98,6 +98,18 @@ export function getErpProjectPurchaseList (query) {
* @param projectId
* @param spareFlag
*/
+/**
+ * 导出项目采购审批单 PDF
+ * @param projectPurchaseId 项目采购ID
+ */
+export const exportProjectPurchaseApprovalPdf = (projectPurchaseId: string | number) => {
+ return request({
+ url: '/oa/erp/projectPurchase/exportApprovalPdf/' + projectPurchaseId,
+ method: 'get',
+ responseType: 'blob'
+ });
+};
+
export const getProjectMaterialsByProjectId = (
projectId: string | number,
spareFlag: string,
diff --git a/src/views/oa/erp/projectPurchase/index.vue b/src/views/oa/erp/projectPurchase/index.vue
index e2f3eb7..7b8f2e6 100644
--- a/src/views/oa/erp/projectPurchase/index.vue
+++ b/src/views/oa/erp/projectPurchase/index.vue
@@ -91,7 +91,7 @@
-
+
@@ -108,6 +108,15 @@
v-hasPermi="['oa/erp:projectPurchase:export']"
>
+
+
+
@@ -125,7 +134,7 @@ import { reactive, ref, toRefs, getCurrentInstance, onMounted } from 'vue';
import type { ComponentInternalInstance } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import type { FormInstance } from 'element-plus';
-import { listProjectPurchase, delProjectPurchase } from '@/api/oa/erp/projectPurchase';
+import { listProjectPurchase, delProjectPurchase, exportProjectPurchaseApprovalPdf } from '@/api/oa/erp/projectPurchase';
import type { ProjectPurchaseVO, ProjectPurchaseQuery } from '@/api/oa/erp/projectPurchase/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -284,6 +293,24 @@ const handleExportSingle = (row: ProjectPurchaseVO) => {
);
};
+const handleExportApprovalPdf = async (row: ProjectPurchaseVO) => {
+ try {
+ const res = await exportProjectPurchaseApprovalPdf(row.projectPurchaseId);
+ const blob = new Blob([res as unknown as BlobPart], { type: 'application/pdf' });
+ const url = window.URL.createObjectURL(blob);
+ const link = document.createElement('a');
+ link.href = url;
+ link.download = `采购审批单_${row.projectCode}_${row.purchaseCode}.pdf`;
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ window.URL.revokeObjectURL(url);
+ proxy?.$modal.msgSuccess('审批单导出成功');
+ } catch {
+ proxy?.$modal.msgError('审批单导出失败,请确认采购单已审批完成');
+ }
+};
+
onMounted(() => {
getList();
});