diff --git a/apps/web-antd/src/api/crm/customer/index.ts b/apps/web-antd/src/api/crm/customer/index.ts
index 3f7faaab5..611d56bc2 100644
--- a/apps/web-antd/src/api/crm/customer/index.ts
+++ b/apps/web-antd/src/api/crm/customer/index.ts
@@ -35,6 +35,11 @@ export namespace CrmCustomerApi {
createTime: Date; // 创建时间
updateTime: Date; // 更新时间
}
+ export interface CustomerImport {
+ ownerUserId: number;
+ file: File;
+ updateSupport: boolean;
+ }
}
/** 查询客户列表 */
@@ -78,8 +83,8 @@ export function importCustomerTemplate() {
}
/** 导入客户 */
-export function importCustomer(file: File) {
- return requestClient.upload('/crm/customer/import', { file });
+export function importCustomer(data: CrmCustomerApi.CustomerImport) {
+ return requestClient.upload('/crm/customer/import', data);
}
/** 获取客户精简信息列表 */
diff --git a/apps/web-antd/src/views/crm/customer/index.vue b/apps/web-antd/src/views/crm/customer/index.vue
index 5795fdb0c..1e4f6b3bb 100644
--- a/apps/web-antd/src/views/crm/customer/index.vue
+++ b/apps/web-antd/src/views/crm/customer/index.vue
@@ -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) {
+
@@ -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',
diff --git a/apps/web-antd/src/views/crm/customer/modules/import-form.vue b/apps/web-antd/src/views/crm/customer/modules/import-form.vue
new file mode 100644
index 000000000..2db456eff
--- /dev/null
+++ b/apps/web-antd/src/views/crm/customer/modules/import-form.vue
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+
+
+
+
+
+