feat: customer import

This commit is contained in:
xingyu4j
2025-06-05 19:19:08 +08:00
parent fc6ebb8ed9
commit 5af9be3814
3 changed files with 144 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
import ImportForm from './modules/import-form.vue';
const { push } = useRouter();
const sceneType = ref('1');
@@ -35,6 +36,16 @@ function onRefresh() {
gridApi.query();
}
const [ImportModal, importModalApi] = useVbenModal({
connectedComponent: ImportForm,
destroyOnClose: true,
});
/** 导入客户 */
function handleImport() {
importModalApi.open();
}
/** 导出表格 */
async function handleExport() {
const data = await exportCustomer(await gridApi.formApi.getValues());
@@ -124,6 +135,7 @@ function onChangeSceneType(key: number | string) {
</template>
<FormModal @success="onRefresh" />
<ImportModal @success="onRefresh" />
<Grid>
<template #top>
<Tabs class="border-none" @change="onChangeSceneType">
@@ -142,6 +154,13 @@ function onChangeSceneType(key: number | string) {
auth: ['crm:customer:create'],
onClick: handleCreate,
},
{
label: $t('ui.actionTitle.import'),
type: 'primary',
icon: ACTION_ICON.UPLOAD,
auth: ['crm:customer:import'],
onClick: handleImport,
},
{
label: $t('ui.actionTitle.export'),
type: 'primary',