From c18b6a9b75ed067b295b7c7c98444f380e8b35de Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Thu, 29 May 2025 14:51:23 +0800 Subject: [PATCH] feat: crm --- apps/web-antd/src/views/crm/backlog/data.ts | 128 +--------- apps/web-antd/src/views/crm/business/data.ts | 22 +- apps/web-antd/src/views/crm/contact/index.vue | 227 +++++++++++++++--- apps/web-antd/src/views/crm/customer/data.ts | 47 +--- .../web-antd/src/views/crm/customer/index.vue | 105 ++++---- 5 files changed, 272 insertions(+), 257 deletions(-) diff --git a/apps/web-antd/src/views/crm/backlog/data.ts b/apps/web-antd/src/views/crm/backlog/data.ts index b56566f14..7bf354c3b 100644 --- a/apps/web-antd/src/views/crm/backlog/data.ts +++ b/apps/web-antd/src/views/crm/backlog/data.ts @@ -133,14 +133,12 @@ export function useClueFollowColumns(): VxeTableGridOptions['columns'] { { field: 'name', title: '线索名称', - minWidth: 160, fixed: 'left', slots: { default: 'name' }, }, { field: 'source', title: '线索来源', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_SOURCE }, @@ -149,27 +147,22 @@ export function useClueFollowColumns(): VxeTableGridOptions['columns'] { { field: 'mobile', title: '手机', - minWidth: 120, }, { field: 'telephone', title: '电话', - minWidth: 130, }, { field: 'email', title: '邮箱', - minWidth: 180, }, { field: 'detailAddress', title: '地址', - minWidth: 180, }, { field: 'industryId', title: '客户行业', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY }, @@ -178,7 +171,6 @@ export function useClueFollowColumns(): VxeTableGridOptions['columns'] { { field: 'level', title: '客户级别', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_LEVEL }, @@ -187,51 +179,42 @@ export function useClueFollowColumns(): VxeTableGridOptions['columns'] { { field: 'contactNextTime', title: '下次联系时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'remark', title: '备注', - minWidth: 200, }, { field: 'contactLastTime', title: '最后跟进时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'contactLastContent', title: '最后跟进记录', - minWidth: 200, }, { field: 'ownerUserName', title: '负责人', - minWidth: 100, }, { field: 'ownerUserDeptName', title: '所属部门', - minWidth: 100, }, { field: 'updateTime', title: '更新时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'createTime', title: '创建时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'creatorName', title: '创建人', - minWidth: 100, }, ]; } @@ -276,124 +259,96 @@ export function useContractColumns( { field: 'no', title: '合同编号', - minWidth: 160, fixed: 'left', }, { field: 'name', title: '合同名称', - minWidth: 160, - slots: { - default: 'name', - }, + slots: { default: 'name' }, }, { field: 'customerName', title: '客户名称', - minWidth: 160, - slots: { - default: 'customerName', - }, + slots: { default: 'customerName' }, }, { field: 'businessName', title: '商机名称', - minWidth: 160, - slots: { - default: 'businessName', - }, + slots: { default: 'businessName' }, }, { field: 'price', title: '合同金额(元)', - minWidth: 120, formatter: 'formatNumber', }, { field: 'orderDate', title: '下单时间', - minWidth: 120, formatter: 'formatDateTime', }, { field: 'startTime', title: '合同开始时间', - minWidth: 120, formatter: 'formatDateTime', }, { field: 'endTime', title: '合同结束时间', - minWidth: 120, formatter: 'formatDateTime', }, { field: 'contactName', title: '客户签约人', - minWidth: 130, - slots: { - default: 'contactName', - }, + slots: { default: 'contactName' }, }, { field: 'signUserName', title: '公司签约人', - minWidth: 130, }, { field: 'remark', title: '备注', - minWidth: 200, }, { field: 'totalReceivablePrice', title: '已回款金额(元)', - minWidth: 140, formatter: 'formatNumber', }, { field: 'noReceivablePrice', title: '未回款金额(元)', - minWidth: 120, formatter: 'formatNumber', }, { field: 'contactLastTime', title: '最后跟进时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'ownerUserName', title: '负责人', - minWidth: 120, }, { field: 'ownerUserDeptName', title: '所属部门', - minWidth: 100, }, { field: 'updateTime', title: '更新时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'createTime', title: '创建时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'creatorName', title: '创建人', - minWidth: 100, }, { field: 'auditStatus', title: '合同状态', - minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_AUDIT_STATUS }, @@ -402,7 +357,7 @@ export function useContractColumns( { field: 'operation', title: '操作', - minWidth: 130, + width: 130, align: 'center', fixed: 'right', cellRender: { @@ -487,15 +442,11 @@ export function useCustomerColumns(): VxeTableGridOptions['columns'] { { field: 'name', title: '客户名称', - minWidth: 160, - slots: { - default: 'name', - }, + slots: { default: 'name' }, }, { field: 'source', title: '客户来源', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_SOURCE }, @@ -504,22 +455,18 @@ export function useCustomerColumns(): VxeTableGridOptions['columns'] { { field: 'mobile', title: '手机', - minWidth: 120, }, { field: 'telephone', title: '电话', - minWidth: 130, }, { field: 'email', title: '邮箱', - minWidth: 180, }, { field: 'level', title: '客户级别', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_LEVEL }, @@ -528,7 +475,6 @@ export function useCustomerColumns(): VxeTableGridOptions['columns'] { { field: 'industryId', title: '客户行业', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY }, @@ -537,18 +483,15 @@ export function useCustomerColumns(): VxeTableGridOptions['columns'] { { field: 'contactNextTime', title: '下次联系时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'remark', title: '备注', - minWidth: 200, }, { field: 'lockStatus', title: '锁定状态', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, @@ -557,7 +500,6 @@ export function useCustomerColumns(): VxeTableGridOptions['columns'] { { field: 'dealStatus', title: '成交状态', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, @@ -566,50 +508,41 @@ export function useCustomerColumns(): VxeTableGridOptions['columns'] { { field: 'contactLastTime', title: '最后跟进时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'contactLastContent', title: '最后跟进记录', - minWidth: 200, }, { field: 'detailAddress', title: '地址', - minWidth: 200, }, { field: 'poolDay', title: '距离进入公海天数', - minWidth: 180, }, { field: 'ownerUserName', title: '负责人', - minWidth: 100, }, { field: 'ownerUserDeptName', title: '所属部门', - minWidth: 100, }, { field: 'updateTime', title: '更新时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'createTime', title: '创建时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'creatorName', title: '创建人', - minWidth: 100, }, ]; } @@ -638,44 +571,32 @@ export function useReceivableAuditColumns( { field: 'no', title: '回款编号', - minWidth: 180, fixed: 'left', - slots: { - default: 'no', - }, + slots: { default: 'no' }, }, { field: 'customerName', title: '客户名称', - minWidth: 120, - slots: { - default: 'customerName', - }, + slots: { default: 'customerName' }, }, { field: 'contractNo', title: '合同编号', - minWidth: 180, - slots: { - default: 'contractNo', - }, + slots: { default: 'contractNo' }, }, { field: 'returnTime', title: '回款日期', - minWidth: 150, formatter: 'formatDateTime', }, { field: 'price', title: '回款金额(元)', - minWidth: 140, formatter: 'formatNumber', }, { field: 'returnType', title: '回款方式', - minWidth: 130, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE }, @@ -684,45 +605,37 @@ export function useReceivableAuditColumns( { field: 'remark', title: '备注', - minWidth: 200, }, { field: 'contract.totalPrice', title: '合同金额(元)', - minWidth: 140, formatter: 'formatNumber', }, { field: 'ownerUserName', title: '负责人', - minWidth: 120, }, { field: 'ownerUserDeptName', title: '所属部门', - minWidth: 100, }, { field: 'updateTime', title: '更新时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'createTime', title: '创建时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'creatorName', title: '创建人', - minWidth: 120, }, { field: 'auditStatus', title: '回款状态', - minWidth: 120, fixed: 'right', cellRender: { name: 'CellDict', @@ -778,52 +691,40 @@ export function useReceivablePlanRemindColumns( { field: 'customerName', title: '客户名称', - minWidth: 160, fixed: 'left', - slots: { - default: 'customerName', - }, + slots: { default: 'customerName' }, }, { field: 'contractNo', title: '合同编号', - minWidth: 200, }, { field: 'period', title: '期数', - minWidth: 160, - slots: { - default: 'period', - }, + slots: { default: 'period' }, }, { field: 'price', title: '计划回款金额(元)', - minWidth: 120, formatter: 'formatNumber', }, { field: 'returnTime', title: '计划回款日期', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'remindDays', title: '提前几天提醒', - minWidth: 150, }, { field: 'remindTime', title: '提醒日期', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'returnType', title: '回款方式', - minWidth: 120, fixed: 'right', cellRender: { name: 'CellDict', @@ -833,41 +734,34 @@ export function useReceivablePlanRemindColumns( { field: 'remark', title: '备注', - minWidth: 200, }, { field: 'ownerUserName', title: '负责人', - minWidth: 100, }, { field: 'receivable.price', title: '实际回款金额(元)', - minWidth: 160, formatter: 'formatNumber', }, { field: 'receivable.returnTime', title: '实际回款日期', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'updateTime', title: '更新时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'createTime', title: '创建时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'creatorName', title: '创建人', - minWidth: 100, }, { field: 'operation', diff --git a/apps/web-antd/src/views/crm/business/data.ts b/apps/web-antd/src/views/crm/business/data.ts index 4906fed70..0dd176d4b 100644 --- a/apps/web-antd/src/views/crm/business/data.ts +++ b/apps/web-antd/src/views/crm/business/data.ts @@ -99,87 +99,69 @@ export function useGridColumns( { field: 'name', title: '商机名称', - minWidth: 160, fixed: 'left', - slots: { - default: 'name', - }, + slots: { default: 'name' }, }, { field: 'customerName', title: '客户名称', - minWidth: 120, fixed: 'left', - slots: { - default: 'customerName', - }, + slots: { default: 'customerName' }, }, { field: 'totalPrice', title: '商机金额(元)', - minWidth: 140, formatter: 'formatNumber', }, { field: 'dealTime', title: '预计成交日期', - minWidth: 180, formatter: 'formatDate', }, { field: 'remark', title: '备注', - minWidth: 200, }, { field: 'contactNextTime', title: '下次联系时间', - minWidth: 180, formatter: 'formatDate', }, { field: 'ownerUserName', title: '负责人', - minWidth: 100, }, { field: 'ownerUserDeptName', title: '所属部门', - minWidth: 100, }, { field: 'contactLastTime', title: '最后跟进时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'updateTime', title: '更新时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'createTime', title: '创建时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'creatorName', title: '创建人', - minWidth: 100, }, { field: 'statusTypeName', title: '商机状态组', - minWidth: 140, fixed: 'right', }, { field: 'statusName', title: '商机阶段', - minWidth: 120, fixed: 'right', }, { diff --git a/apps/web-antd/src/views/crm/contact/index.vue b/apps/web-antd/src/views/crm/contact/index.vue index c17be72b3..21fd5acd4 100644 --- a/apps/web-antd/src/views/crm/contact/index.vue +++ b/apps/web-antd/src/views/crm/contact/index.vue @@ -1,38 +1,207 @@ diff --git a/apps/web-antd/src/views/crm/customer/data.ts b/apps/web-antd/src/views/crm/customer/data.ts index c1f505a48..551569da0 100644 --- a/apps/web-antd/src/views/crm/customer/data.ts +++ b/apps/web-antd/src/views/crm/customer/data.ts @@ -1,11 +1,9 @@ import type { VbenFormSchema } from '#/adapter/form'; -import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; -import type { CrmCustomerApi } from '#/api/crm/customer'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; -import { useAccess } from '@vben/access'; import { formatDateTime } from '@vben/utils'; import { getAreaTree } from '#/api/system/area'; @@ -13,8 +11,6 @@ import { getSimpleUserList } from '#/api/system/user'; import { DictTag } from '#/components/dict-tag'; import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils'; -const { hasAccessByCodes } = useAccess(); - /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ @@ -158,14 +154,11 @@ export function useGridFormSchema(): VbenFormSchema[] { } /** 列表的字段 */ -export function useGridColumns( - onActionClick: OnActionClickFn, -): VxeTableGridOptions['columns'] { +export function useGridColumns(): VxeTableGridOptions['columns'] { return [ { field: 'name', title: '客户名称', - minWidth: 160, fixed: 'left', slots: { default: 'name', @@ -174,7 +167,6 @@ export function useGridColumns( { field: 'source', title: '客户来源', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_SOURCE }, @@ -183,27 +175,22 @@ export function useGridColumns( { field: 'mobile', title: '手机', - minWidth: 120, }, { field: 'telephone', title: '电话', - minWidth: 130, }, { field: 'email', title: '邮箱', - minWidth: 180, }, { field: 'detailAddress', title: '地址', - minWidth: 180, }, { field: 'industryId', title: '客户行业', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY }, @@ -212,7 +199,6 @@ export function useGridColumns( { field: 'level', title: '客户级别', - minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_LEVEL }, @@ -221,61 +207,36 @@ export function useGridColumns( { field: 'ownerUserName', title: '负责人', - minWidth: 100, }, { field: 'ownerUserDeptName', title: '所属部门', - minWidth: 100, }, { field: 'contactNextTime', title: '下次联系时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'contactLastTime', title: '最后跟进时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'updateTime', title: '更新时间', - minWidth: 180, formatter: 'formatDateTime', }, { field: 'createTime', title: '创建时间', - minWidth: 180, formatter: 'formatDateTime', }, { - field: 'operation', title: '操作', - width: 130, + width: 180, fixed: 'right', - align: 'center', - cellRender: { - attrs: { - nameField: 'name', - nameTitle: '线索', - onClick: onActionClick, - }, - name: 'CellOperation', - options: [ - { - code: 'edit', - show: hasAccessByCodes(['crm:clue:update']), - }, - { - code: 'delete', - show: hasAccessByCodes(['crm:clue:delete']), - }, - ], - }, + slots: { default: 'actions' }, }, ]; } diff --git a/apps/web-antd/src/views/crm/customer/index.vue b/apps/web-antd/src/views/crm/customer/index.vue index df3c8e7ee..5795fdb0c 100644 --- a/apps/web-antd/src/views/crm/customer/index.vue +++ b/apps/web-antd/src/views/crm/customer/index.vue @@ -1,20 +1,16 @@