feat:【antd】【crm】商机的整体代码结构优化

This commit is contained in:
YunaiV
2025-09-28 22:46:00 +08:00
parent 1a3441b662
commit 9c564ea3af
12 changed files with 125 additions and 117 deletions

View File

@@ -26,6 +26,10 @@ export function useFormSchema(): VbenFormSchema[] {
label: '商机名称',
component: 'Input',
rules: 'required',
componentProps: {
placeholder: '请输入商机名称',
allowClear: true,
},
},
{
fieldName: 'ownerUserId',
@@ -37,6 +41,8 @@ export function useFormSchema(): VbenFormSchema[] {
label: 'nickname',
value: 'id',
},
placeholder: '请选择负责人',
allowClear: true,
},
defaultValue: userStore.userInfo?.id,
rules: 'required',
@@ -51,6 +57,8 @@ export function useFormSchema(): VbenFormSchema[] {
label: 'name',
value: 'id',
},
placeholder: '请选择客户',
allowClear: true,
},
dependencies: {
triggerFields: ['id'],
@@ -77,6 +85,8 @@ export function useFormSchema(): VbenFormSchema[] {
label: 'name',
value: 'id',
},
placeholder: '请选择商机状态组',
allowClear: true,
},
dependencies: {
triggerFields: ['id'],
@@ -93,6 +103,7 @@ export function useFormSchema(): VbenFormSchema[] {
showTime: false,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
placeholder: '请选择预计成交日期',
},
},
{
@@ -100,6 +111,10 @@ export function useFormSchema(): VbenFormSchema[] {
label: '产品清单',
component: 'Input',
formItemClass: 'col-span-3',
componentProps: {
placeholder: '请输入产品清单',
allowClear: true,
},
},
{
fieldName: 'totalProductPrice',
@@ -108,6 +123,7 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
min: 0,
precision: 2,
placeholder: '请输入产品总金额',
},
rules: z.number().min(0).optional().default(0),
},
@@ -118,6 +134,7 @@ export function useFormSchema(): VbenFormSchema[] {
componentProps: {
min: 0,
precision: 2,
placeholder: '请输入整单折扣',
},
rules: z.number().min(0).max(100).optional().default(0),
},
@@ -129,6 +146,7 @@ export function useFormSchema(): VbenFormSchema[] {
min: 0,
precision: 2,
disabled: true,
placeholder: '请输入折扣后金额',
},
dependencies: {
triggerFields: ['totalProductPrice', 'discountPercent'],
@@ -170,83 +188,83 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
field: 'name',
title: '商机名称',
fixed: 'left',
minWidth: 240,
width: 160,
slots: { default: 'name' },
},
{
field: 'customerName',
title: '客户名称',
fixed: 'left',
minWidth: 240,
width: 120,
slots: { default: 'customerName' },
},
{
field: 'totalPrice',
title: '商机金额(元)',
minWidth: 140,
width: 140,
formatter: 'formatAmount2',
},
{
field: 'dealTime',
title: '预计成交日期',
formatter: 'formatDate',
minWidth: 180,
width: 180,
},
{
field: 'remark',
title: '备注',
minWidth: 200,
width: 200,
},
{
field: 'contactNextTime',
title: '下次联系时间',
formatter: 'formatDate',
minWidth: 180,
formatter: 'formatDateTime',
width: 180,
},
{
field: 'ownerUserName',
title: '负责人',
minWidth: 120,
width: 100,
},
{
field: 'ownerUserDeptName',
title: '所属部门',
minWidth: 120,
width: 100,
},
{
field: 'contactLastTime',
title: '最后跟进时间',
formatter: 'formatDateTime',
minWidth: 180,
},
{
field: 'createTime',
title: '创建时间',
formatter: 'formatDateTime',
minWidth: 180,
},
{
field: 'creatorName',
title: '创建人',
minWidth: 120,
width: 180,
},
{
field: 'updateTime',
title: '更新时间',
formatter: 'formatDateTime',
minWidth: 180,
width: 180,
},
{
field: 'createTime',
title: '创建时间',
formatter: 'formatDateTime',
width: 180,
},
{
field: 'creatorName',
title: '创建人',
width: 100,
},
{
field: 'statusTypeName',
title: '商机状态组',
fixed: 'right',
minWidth: 120,
width: 140,
},
{
field: 'statusName',
title: '商机阶段',
fixed: 'right',
minWidth: 120,
width: 120,
},
{
title: '操作',