diff --git a/src/api/purchase/purchasingrequisition.ts b/src/api/purchase/purchasingrequisition.ts
index fed90cd..4a61709 100644
--- a/src/api/purchase/purchasingrequisition.ts
+++ b/src/api/purchase/purchasingrequisition.ts
@@ -429,11 +429,23 @@ export function getSupplementFilesByApplyId(applyId: string) {
});
}
-export function exportPurchaseApply(params?: any) {
- return request({
- url: '/purchase/purchasingapply/export',
- method: 'get',
- params,
- responseType: 'blob',
- });
-}
+export function exportPurchaseApply(params?: any, ids?: string[]) {
+ const queryParams = new URLSearchParams();
+ if (params) {
+ Object.keys(params).forEach((key) => {
+ if (params[key] !== undefined && params[key] !== null && params[key] !== '') {
+ queryParams.append(key, params[key]);
+ }
+ });
+ }
+ if (ids && ids.length > 0) {
+ ids.forEach((id) => {
+ queryParams.append('ids', id);
+ });
+ }
+ return request({
+ url: '/purchase/purchasingapply/export?' + queryParams.toString(),
+ method: 'get',
+ responseType: 'blob',
+ });
+ }
diff --git a/src/views/purchase/purchasingrequisition/index.vue b/src/views/purchase/purchasingrequisition/index.vue
index 3e7c7ab..cb2d036 100644
--- a/src/views/purchase/purchasingrequisition/index.vue
+++ b/src/views/purchase/purchasingrequisition/index.vue
@@ -110,7 +110,9 @@
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
class="modern-table"
+ @selection-change="handleSelectionChange"
>
+
@@ -606,14 +608,16 @@ const currFlowJob = ref<{ id?: number; flowInstId?: number } | null>(null);
const currFlowCommentType = ref<'apply' | 'file'>('apply');
const implementFormRef = ref();
-const fileArchiveDialogRef = ref();
-const updateFilesDialogRef = ref();
-const contractDialogRef = ref();
-const supplementFilesDialogRef = ref();
-const supplementViewDialogRef = ref();
-const docAuditViewDialogRef = ref();
-const purchaseContractDialogRef = ref();
-const purchaseContractDetailDialogRef = ref();
+ const fileArchiveDialogRef = ref();
+ const updateFilesDialogRef = ref();
+ const contractDialogRef = ref();
+ const supplementFilesDialogRef = ref();
+ const supplementViewDialogRef = ref();
+ const docAuditViewDialogRef = ref();
+ const purchaseContractDialogRef = ref();
+ const purchaseContractDetailDialogRef = ref();
+
+ const selectedRows = ref([]);
/** 采购代表弹窗 */
const representorDialogVisible = ref(false);
@@ -1277,14 +1281,19 @@ const loadSecondDeptList = async () => {
};
// 导出功能
-const handleExport = async () => {
- try {
- const res: any = await exportPurchaseApply(state.queryForm);
- downloadFile(res, '采购申请列表.xlsx');
- } catch (err: any) {
- useMessage().error(err.msg || '导出失败');
- }
-};
+ const handleExport = async () => {
+ try {
+ const ids = selectedRows.value.length > 0 ? selectedRows.value.map((row) => row.id) : undefined;
+ const res: any = await exportPurchaseApply(state.queryForm, ids);
+ downloadFile(res, '采购申请列表.xlsx');
+ } catch (err: any) {
+ useMessage().error(err.msg || '导出失败');
+ }
+ };
+
+ const handleSelectionChange = (rows: any[]) => {
+ selectedRows.value = rows;
+ };
const downloadFile = (blob: Blob, fileName: string) => {
const url = window.URL.createObjectURL(blob);