From c77086ad2d7949ab36dd0c4e0b59907e672dd64f Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 18 九月 2026 15:04:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'refs/remotes/origin/dev_pro2.0' into dev_宁夏_九泓化工
---
src/views/srm/supplier/index.vue | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/src/views/srm/supplier/index.vue b/src/views/srm/supplier/index.vue
index ff73e1a..6fe70eb 100644
--- a/src/views/srm/supplier/index.vue
+++ b/src/views/srm/supplier/index.vue
@@ -3,18 +3,21 @@
import type { SrmSupplierApi } from '#/api/srm/supplier';
import { Page, useVbenModal } from '@vben/common-ui';
+import { downloadFileFromBlobPart } from '@vben/utils';
import { message } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import {
deleteSupplier,
+ exportSupplierExcel,
getSupplierPage,
} from '#/api/srm/supplier';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import SupplierForm from './modules/form.vue';
+import SupplierImportForm from './modules/import-form.vue';
defineOptions({ name: 'SrmSupplier' });
@@ -28,6 +31,18 @@
function handleEdit(row: SrmSupplierApi.SupplierVO) {
formModalApi.setData(row).open();
+}
+
+/** 瀵煎叆渚涘簲鍟� */
+function handleImport() {
+ importModalApi.open();
+}
+
+/** 瀵煎嚭渚涘簲鍟嗭紙鎸夊綋鍓嶆悳绱㈡潯浠讹級 */
+async function handleExport() {
+ const formValues = await gridApi.formApi.getValues();
+ const data = await exportSupplierExcel(formValues);
+ downloadFileFromBlobPart({ fileName: '渚涘簲鍟嗘暟鎹�.xlsx', source: data });
}
async function handleDelete(row: SrmSupplierApi.SupplierVO) {
@@ -46,6 +61,11 @@
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: SupplierForm,
+ destroyOnClose: true,
+});
+
+const [SupplierImportModal, importModalApi] = useVbenModal({
+ connectedComponent: SupplierImportForm,
destroyOnClose: true,
});
@@ -77,6 +97,7 @@
<template>
<Page auto-content-height>
<FormModal @success="handleRefresh" />
+ <SupplierImportModal @success="handleRefresh" />
<Grid table-title="渚涘簲鍟嗗垪琛�">
<template #toolbar-tools>
<TableAction
@@ -88,6 +109,20 @@
auth: ['srm:supplier:create'],
onClick: handleCreate,
},
+ {
+ label: $t('ui.actionTitle.import'),
+ type: 'primary',
+ icon: ACTION_ICON.UPLOAD,
+ auth: ['srm:supplier:import'],
+ onClick: handleImport,
+ },
+ {
+ label: $t('ui.actionTitle.export'),
+ type: 'primary',
+ icon: ACTION_ICON.DOWNLOAD,
+ auth: ['srm:supplier:export'],
+ onClick: handleExport,
+ },
]"
/>
</template>
--
Gitblit v1.9.3