feat:【antd】【crm】contact form 的优化

This commit is contained in:
YunaiV
2025-09-26 08:38:57 +08:00
parent 3c0723d82f
commit 0d018c37c5
3 changed files with 109 additions and 3 deletions

View File

@@ -26,6 +26,9 @@ export function useFormSchema(): VbenFormSchema[] {
label: '线索名称', label: '线索名称',
component: 'Input', component: 'Input',
rules: 'required', rules: 'required',
componentProps: {
placeholder: '请输入线索名称',
},
}, },
{ {
fieldName: 'source', fieldName: 'source',
@@ -33,6 +36,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_SOURCE, 'number'), options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_SOURCE, 'number'),
placeholder: '请选择客户来源',
}, },
rules: 'required', rules: 'required',
}, },
@@ -40,6 +44,9 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'mobile', fieldName: 'mobile',
label: '手机', label: '手机',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入手机号',
},
}, },
{ {
fieldName: 'ownerUserId', fieldName: 'ownerUserId',
@@ -50,6 +57,7 @@ export function useFormSchema(): VbenFormSchema[] {
labelField: 'nickname', labelField: 'nickname',
valueField: 'id', valueField: 'id',
allowClear: true, allowClear: true,
placeholder: '请选择负责人',
}, },
defaultValue: userStore.userInfo?.id, defaultValue: userStore.userInfo?.id,
rules: 'required', rules: 'required',
@@ -58,21 +66,33 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'telephone', fieldName: 'telephone',
label: '电话', label: '电话',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入电话',
},
}, },
{ {
fieldName: 'email', fieldName: 'email',
label: '邮箱', label: '邮箱',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入邮箱',
},
}, },
{ {
fieldName: 'wechat', fieldName: 'wechat',
label: '微信', label: '微信',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入微信',
},
}, },
{ {
fieldName: 'qq', fieldName: 'qq',
label: 'QQ', label: 'QQ',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入 QQ',
},
}, },
{ {
fieldName: 'industryId', fieldName: 'industryId',
@@ -80,6 +100,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY, 'number'), options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_INDUSTRY, 'number'),
placeholder: '请选择客户行业',
}, },
}, },
{ {
@@ -88,6 +109,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_LEVEL, 'number'), options: getDictOptions(DICT_TYPE.CRM_CUSTOMER_LEVEL, 'number'),
placeholder: '请选择客户级别',
}, },
}, },
{ {
@@ -97,12 +119,16 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: { componentProps: {
api: () => getAreaTree(), api: () => getAreaTree(),
fieldNames: { label: 'name', value: 'id', children: 'children' }, fieldNames: { label: 'name', value: 'id', children: 'children' },
placeholder: '请选择地址',
}, },
}, },
{ {
fieldName: 'detailAddress', fieldName: 'detailAddress',
label: '详细地址', label: '详细地址',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入详细地址',
},
}, },
{ {
fieldName: 'contactNextTime', fieldName: 'contactNextTime',
@@ -112,12 +138,16 @@ export function useFormSchema(): VbenFormSchema[] {
showTime: true, showTime: true,
format: 'YYYY-MM-DD HH:mm:ss', format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x',
placeholder: '请选择下次联系时间',
}, },
}, },
{ {
fieldName: 'remark', fieldName: 'remark',
label: '备注', label: '备注',
component: 'Textarea', component: 'Textarea',
componentProps: {
placeholder: '请输入备注',
},
}, },
]; ];
} }
@@ -129,6 +159,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'name', fieldName: 'name',
label: '线索名称', label: '线索名称',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入线索名称',
allowClear: true,
},
}, },
{ {
fieldName: 'transformStatus', fieldName: 'transformStatus',
@@ -139,6 +173,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
{ label: '未转化', value: false }, { label: '未转化', value: false },
{ label: '已转化', value: true }, { label: '已转化', value: true },
], ],
placeholder: '请选择转化状态',
allowClear: true,
}, },
defaultValue: false, defaultValue: false,
}, },
@@ -146,11 +182,19 @@ export function useGridFormSchema(): VbenFormSchema[] {
fieldName: 'mobile', fieldName: 'mobile',
label: '手机号', label: '手机号',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入手机号',
allowClear: true,
},
}, },
{ {
fieldName: 'telephone', fieldName: 'telephone',
label: '电话', label: '电话',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入电话',
allowClear: true,
},
}, },
{ {
fieldName: 'createTime', fieldName: 'createTime',
@@ -159,6 +203,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: { componentProps: {
...getRangePickerDefaultProps(), ...getRangePickerDefaultProps(),
allowClear: true, allowClear: true,
placeholder: ['开始日期', '结束日期'],
}, },
}, },
]; ];

View File

@@ -27,17 +27,22 @@ export function useFormSchema(): VbenFormSchema[] {
label: '联系人姓名', label: '联系人姓名',
component: 'Input', component: 'Input',
rules: 'required', rules: 'required',
componentProps: {
placeholder: '请输入联系人姓名',
},
}, },
{ {
fieldName: 'ownerUserId', fieldName: 'ownerUserId',
label: '负责人', label: '负责人',
component: 'ApiSelect', component: 'ApiSelect',
rules: 'required',
componentProps: { componentProps: {
api: () => getSimpleUserList(), api: () => getSimpleUserList(),
fieldNames: { fieldNames: {
label: 'nickname', label: 'nickname',
value: 'id', value: 'id',
}, },
placeholder: '请选择负责人',
}, },
defaultValue: userStore.userInfo?.id, defaultValue: userStore.userInfo?.id,
}, },
@@ -45,51 +50,75 @@ export function useFormSchema(): VbenFormSchema[] {
fieldName: 'customerId', fieldName: 'customerId',
label: '客户名称', label: '客户名称',
component: 'ApiSelect', component: 'ApiSelect',
rules: 'required',
componentProps: { componentProps: {
api: () => getCustomerSimpleList(), api: () => getCustomerSimpleList(),
fieldNames: { fieldNames: {
label: 'name', label: 'name',
value: 'id', value: 'id',
}, },
placeholder: '请选择客户',
}, },
}, },
{ {
fieldName: 'mobile', fieldName: 'mobile',
label: '手机', label: '手机',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入手机号',
},
}, },
{ {
fieldName: 'telephone', fieldName: 'telephone',
label: '电话', label: '电话',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入电话',
},
}, },
{ {
fieldName: 'email', fieldName: 'email',
label: '邮箱', label: '邮箱',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入邮箱',
},
}, },
{ {
fieldName: 'wechat', fieldName: 'wechat',
label: '微信', label: '微信',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入微信',
},
}, },
{ {
fieldName: 'qq', fieldName: 'qq',
label: 'QQ', label: 'QQ',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入QQ',
},
}, },
{ {
fieldName: 'post', fieldName: 'post',
label: '职位', label: '职位',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入职位',
},
}, },
{ {
fieldName: 'master', fieldName: 'master',
label: '关键决策人', label: '关键决策人',
component: 'Select', component: 'RadioGroup',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'),
placeholder: '请选择是否关键决策人',
buttonStyle: 'solid',
optionType: 'button',
}, },
defaultValue: false,
}, },
{ {
fieldName: 'sex', fieldName: 'sex',
@@ -97,6 +126,7 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'), options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number'),
placeholder: '请选择性别',
}, },
}, },
{ {
@@ -109,6 +139,7 @@ export function useFormSchema(): VbenFormSchema[] {
label: 'name', label: 'name',
value: 'id', value: 'id',
}, },
placeholder: '请选择直属上级',
}, },
}, },
{ {
@@ -118,12 +149,16 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: { componentProps: {
api: () => getAreaTree(), api: () => getAreaTree(),
fieldNames: { label: 'name', value: 'id', children: 'children' }, fieldNames: { label: 'name', value: 'id', children: 'children' },
placeholder: '请选择地址',
}, },
}, },
{ {
fieldName: 'detailAddress', fieldName: 'detailAddress',
label: '详细地址', label: '详细地址',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入详细地址',
},
}, },
{ {
fieldName: 'contactNextTime', fieldName: 'contactNextTime',
@@ -133,12 +168,16 @@ export function useFormSchema(): VbenFormSchema[] {
showTime: true, showTime: true,
format: 'YYYY-MM-DD HH:mm:ss', format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x',
placeholder: '请选择下次联系时间',
}, },
}, },
{ {
fieldName: 'remark', fieldName: 'remark',
label: '备注', label: '备注',
component: 'Textarea', component: 'Textarea',
componentProps: {
placeholder: '请输入备注',
},
}, },
]; ];
} }
@@ -147,7 +186,7 @@ export function useFormSchema(): VbenFormSchema[] {
export function useGridFormSchema(): VbenFormSchema[] { export function useGridFormSchema(): VbenFormSchema[] {
return [ return [
{ {
fieldName: 'name', fieldName: 'customerId',
label: '客户', label: '客户',
component: 'ApiSelect', component: 'ApiSelect',
componentProps: { componentProps: {
@@ -156,32 +195,54 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: 'name', label: 'name',
value: 'id', value: 'id',
}, },
placeholder: '请选择客户',
allowClear: true,
}, },
}, },
{ {
fieldName: 'name', fieldName: 'name',
label: '姓名', label: '姓名',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入联系人姓名',
allowClear: true,
},
}, },
{ {
fieldName: 'mobile', fieldName: 'mobile',
label: '手机号', label: '手机号',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入手机号',
allowClear: true,
},
}, },
{ {
fieldName: 'telephone', fieldName: 'telephone',
label: '电话', label: '电话',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入电话',
allowClear: true,
},
}, },
{ {
fieldName: 'wechat', fieldName: 'wechat',
label: '微信', label: '微信',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入微信',
allowClear: true,
},
}, },
{ {
fieldName: 'email', fieldName: 'email',
label: '电子邮箱', label: '电子邮箱',
component: 'Input', component: 'Input',
componentProps: {
placeholder: '请输入电子邮箱',
allowClear: true,
},
}, },
]; ];
} }

View File

@@ -19,9 +19,9 @@ import {
import { BizTypeEnum } from '#/api/crm/permission'; import { BizTypeEnum } from '#/api/crm/permission';
import { $t } from '#/locales'; import { $t } from '#/locales';
import { useDetailListColumns } from '../data';
import ListModal from '../../modules/detail-list-modal.vue'; import ListModal from '../../modules/detail-list-modal.vue';
import Form from '../../modules/form.vue'; import Form from '../../modules/form.vue';
import { useDetailListColumns } from '../data';
const props = defineProps<{ const props = defineProps<{
bizId: number; // 业务编号 bizId: number; // 业务编号