From 3ba046def770136808a2c8ad029ded32562f7b9a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 27 Sep 2025 21:08:08 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90antd=E3=80=91=E3=80=90crm?= =?UTF-8?q?=E3=80=91=E5=AE=A2=E6=88=B7=E5=85=AC=E6=B5=B7=E5=88=86=E9=85=8D?= =?UTF-8?q?=20form=20=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/crm/customer/detail/data.ts | 32 +++++++++++++++++++ .../src/views/crm/customer/detail/index.vue | 2 +- apps/web-antd/src/views/crm/customer/index.ts | 5 --- 3 files changed, 33 insertions(+), 6 deletions(-) delete mode 100644 apps/web-antd/src/views/crm/customer/index.ts diff --git a/apps/web-antd/src/views/crm/customer/detail/data.ts b/apps/web-antd/src/views/crm/customer/detail/data.ts index e718e5a1..0f45ff4a 100644 --- a/apps/web-antd/src/views/crm/customer/detail/data.ts +++ b/apps/web-antd/src/views/crm/customer/detail/data.ts @@ -1,12 +1,44 @@ +import type { VbenFormSchema } from '#/adapter/form'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; import { DICT_TYPE } from '@vben/constants'; +import { useUserStore } from '@vben/stores'; import { formatDateTime } from '@vben/utils'; +import { getSimpleUserList } from '#/api/system/user'; import { DictTag } from '#/components/dict-tag'; +/** 分配客户表单 */ +export function useDistributeFormSchema(): VbenFormSchema[] { + const userStore = useUserStore(); + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'ownerUserId', + label: '负责人', + component: 'ApiSelect', + componentProps: { + api: () => getSimpleUserList(), + fieldNames: { + label: 'nickname', + value: 'id', + }, + }, + defaultValue: userStore.userInfo?.id, + rules: 'required', + }, + ]; +} + /** 详情页的字段 */ export function useDetailSchema(): DescriptionItemSchema[] { return [ diff --git a/apps/web-antd/src/views/crm/customer/detail/index.vue b/apps/web-antd/src/views/crm/customer/detail/index.vue index 06c3083e..edb1eaa9 100644 --- a/apps/web-antd/src/views/crm/customer/detail/index.vue +++ b/apps/web-antd/src/views/crm/customer/detail/index.vue @@ -25,7 +25,6 @@ import { ACTION_ICON, TableAction } from '#/components/table-action'; import { BusinessDetailsList } from '#/views/crm/business'; import { ContactDetailsList } from '#/views/crm/contact/components'; import { ContractDetailsList } from '#/views/crm/contract'; -import { DistributeForm } from '#/views/crm/customer'; import { FollowUp } from '#/views/crm/followup'; import { PermissionList, TransferForm } from '#/views/crm/permission'; import { @@ -35,6 +34,7 @@ import { import Form from '../modules/form.vue'; import { useDetailSchema } from './data'; +import DistributeForm from './modules/distribute-form.vue'; import Info from './modules/info.vue'; const route = useRoute(); diff --git a/apps/web-antd/src/views/crm/customer/index.ts b/apps/web-antd/src/views/crm/customer/index.ts deleted file mode 100644 index 6993021a..00000000 --- a/apps/web-antd/src/views/crm/customer/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { defineAsyncComponent } from 'vue'; - -export const DistributeForm = defineAsyncComponent( - () => import('./poolConfig/distribute-form.vue'), -);