From 634b5be6768781251a3d1ba25f1378ca0971b662 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 23 Sep 2025 23:44:56 +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=E4=BC=98=E5=8C=96=20clue=20=E7=BA=BF=E7=B4=A2?= =?UTF-8?q?=E7=9A=84=E5=88=97=E8=A1=A8=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/views/crm/clue/data.ts | 52 ++++++++++-------- apps/web-antd/src/views/crm/clue/index.vue | 62 +++++++++++++++++----- 2 files changed, 77 insertions(+), 37 deletions(-) diff --git a/apps/web-antd/src/views/crm/clue/data.ts b/apps/web-antd/src/views/crm/clue/data.ts index eb4070e7..efbdfcc1 100644 --- a/apps/web-antd/src/views/crm/clue/data.ts +++ b/apps/web-antd/src/views/crm/clue/data.ts @@ -140,6 +140,7 @@ export function useGridFormSchema(): VbenFormSchema[] { { label: '已转化', value: true }, ], }, + defaultValue: false, }, { fieldName: 'mobile', @@ -170,7 +171,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { field: 'name', title: '线索名称', fixed: 'left', - minWidth: 240, + minWidth: 160, slots: { default: 'name', }, @@ -178,7 +179,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'source', title: '线索来源', - minWidth: 120, + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_SOURCE }, @@ -192,22 +193,22 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'telephone', title: '电话', - minWidth: 120, + minWidth: 130, }, { field: 'email', title: '邮箱', - minWidth: 120, + minWidth: 180, }, { field: 'detailAddress', title: '地址', - minWidth: 120, + minWidth: 180, }, { field: 'industryId', title: '客户行业', - minWidth: 120, + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_INDUSTRY }, @@ -216,34 +217,44 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'level', title: '客户级别', - minWidth: 120, + minWidth: 135, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.CRM_CUSTOMER_LEVEL }, }, }, - { - field: 'ownerUserName', - title: '负责人', - minWidth: 120, - }, - { - field: 'ownerUserDeptName', - title: '所属部门', - minWidth: 120, - }, { field: 'contactNextTime', title: '下次联系时间', formatter: 'formatDateTime', minWidth: 180, }, + { + field: 'remark', + title: '备注', + minWidth: 200, + }, { field: 'contactLastTime', title: '最后跟进时间', formatter: 'formatDateTime', minWidth: 180, }, + { + field: 'contactLastContent', + title: '最后跟进记录', + minWidth: 200, + }, + { + field: 'ownerUserName', + title: '负责人', + minWidth: 100, + }, + { + field: 'ownerUserDeptName', + title: '所属部门', + minWidth: 100, + }, { field: 'updateTime', title: '更新时间', @@ -254,12 +265,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { field: 'createTime', title: '创建时间', formatter: 'formatDateTime', - minWidth: 120, - }, - { - field: 'creatorName', - title: '创建人', - minWidth: 120, + minWidth: 180, }, { title: '操作', diff --git a/apps/web-antd/src/views/crm/clue/index.vue b/apps/web-antd/src/views/crm/clue/index.vue index 5576b58c..8b5209cf 100644 --- a/apps/web-antd/src/views/crm/clue/index.vue +++ b/apps/web-antd/src/views/crm/clue/index.vue @@ -2,12 +2,13 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { CrmClueApi } from '#/api/crm/clue'; +import { ref } from 'vue'; import { useRouter } from 'vue-router'; import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; import { downloadFileFromBlobPart } from '@vben/utils'; -import { Button, message } from 'ant-design-vue'; +import { Button, message, Tabs } from 'ant-design-vue'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { deleteClue, exportClue, getCluePage } from '#/api/crm/clue'; @@ -17,6 +18,7 @@ import { useGridColumns, useGridFormSchema } from './data'; import Form from './modules/form.vue'; const { push } = useRouter(); +const sceneType = ref('1'); const [FormModal, formModalApi] = useVbenModal({ connectedComponent: Form, @@ -24,10 +26,19 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } +/** 导出表格 */ +async function handleExport() { + const data = await exportClue({ + sceneType: sceneType.value, + ...(await gridApi.formApi.getValues()), + }); + downloadFileFromBlobPart({ fileName: '线索.xls', source: data }); +} + /** 创建线索 */ function handleCreate() { formModalApi.setData(null).open(); @@ -46,26 +57,24 @@ async function handleDelete(row: CrmClueApi.Clue) { }); try { await deleteClue(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.name]), - }); - onRefresh(); + message.success($t('ui.actionMessage.deleteSuccess', [row.name])); + handleRefresh(); } catch { hideLoading(); } } -/** 导出表格 */ -async function handleExport() { - const data = await exportClue(await gridApi.formApi.getValues()); - downloadFileFromBlobPart({ fileName: '线索.xls', source: data }); -} - /** 查看线索详情 */ function handleDetail(row: CrmClueApi.Clue) { push({ name: 'CrmClueDetail', params: { id: row.id } }); } +/** 处理场景类型的切换 */ +function handleChangeSceneType(key: number | string) { + sceneType.value = key.toString(); + gridApi.query(); +} + const [Grid, gridApi] = useVbenVxeGrid({ formOptions: { schema: useGridFormSchema(), @@ -80,6 +89,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ return await getCluePage({ pageNo: page.currentPage, pageSize: page.pageSize, + sceneType: sceneType.value, ...formValues, }); }, @@ -87,6 +97,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -109,8 +120,15 @@ const [Grid, gridApi] = useVbenVxeGrid({ /> - - + + +