diff --git a/apps/web-antd/src/views/crm/contact/data.ts b/apps/web-antd/src/views/crm/contact/data.ts index 788730e1..7a6d0830 100644 --- a/apps/web-antd/src/views/crm/contact/data.ts +++ b/apps/web-antd/src/views/crm/contact/data.ts @@ -203,15 +203,6 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 240, slots: { default: 'customerName' }, }, - { - field: 'sex', - title: '性别', - minWidth: 120, - cellRender: { - name: 'CellDict', - props: { type: DICT_TYPE.SYSTEM_USER_SEX }, - }, - }, { field: 'mobile', title: '手机', @@ -220,12 +211,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'telephone', title: '电话', - minWidth: 120, + minWidth: 130, }, { field: 'email', title: '邮箱', - minWidth: 120, + minWidth: 180, }, { field: 'post', @@ -233,10 +224,15 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 120, }, { - field: 'detailAddress', + field: 'areaName', title: '地址', minWidth: 120, }, + { + field: 'detailAddress', + title: '详细地址', + minWidth: 180, + }, { field: 'master', title: '关键决策人', @@ -252,6 +248,32 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 120, slots: { default: 'parentId' }, }, + { + field: 'contactNextTime', + title: '下次联系时间', + formatter: 'formatDateTime', + minWidth: 180, + }, + { + field: 'sex', + title: '性别', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.SYSTEM_USER_SEX }, + }, + }, + { + field: 'remark', + title: '备注', + minWidth: 200, + }, + { + field: 'contactLastTime', + title: '最后跟进时间', + formatter: 'formatDateTime', + minWidth: 180, + }, { field: 'ownerUserName', title: '负责人', @@ -263,16 +285,11 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 120, }, { - field: 'contactNextTime', - title: '下次联系时间', + field: 'updateTime', + title: '更新时间', formatter: 'formatDateTime', minWidth: 180, }, - { - field: 'remark', - title: '备注', - minWidth: 200, - }, { field: 'createTime', title: '创建时间', @@ -280,10 +297,9 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 180, }, { - field: 'updateTime', - title: '更新时间', - formatter: 'formatDateTime', - minWidth: 180, + field: 'creatorName', + title: '创建人', + minWidth: 120, }, { title: '操作', diff --git a/apps/web-antd/src/views/crm/contact/index.ts b/apps/web-antd/src/views/crm/contact/index.ts index 254dc8f5..16ce8d9d 100644 --- a/apps/web-antd/src/views/crm/contact/index.ts +++ b/apps/web-antd/src/views/crm/contact/index.ts @@ -8,10 +8,6 @@ export const ContactForm = defineAsyncComponent( () => import('./modules/form.vue'), ); -export const ContactDetails = defineAsyncComponent( - () => import('./detail/index.vue'), -); - export const ContactDetailsList = defineAsyncComponent( () => import('./detail/modules/detail-list.vue'), ); diff --git a/apps/web-antd/src/views/crm/contact/index.vue b/apps/web-antd/src/views/crm/contact/index.vue index de13da97..de6d1b8a 100644 --- a/apps/web-antd/src/views/crm/contact/index.vue +++ b/apps/web-antd/src/views/crm/contact/index.vue @@ -30,13 +30,17 @@ const [FormModal, formModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } /** 导出表格 */ async function handleExport() { - const data = await exportContact(await gridApi.formApi.getValues()); + const formValues = await gridApi.formApi.getValues(); + const data = await exportContact({ + sceneType: sceneType.value, + ...formValues, + }); downloadFileFromBlobPart({ fileName: '联系人.xls', source: data }); } @@ -58,10 +62,8 @@ async function handleDelete(row: CrmContactApi.Contact) { }); try { await deleteContact(row.id as number); - message.success({ - content: $t('ui.actionMessage.deleteSuccess', [row.name]), - }); - onRefresh(); + message.success($t('ui.actionMessage.deleteSuccess', [row.name])); + handleRefresh(); } finally { hideLoading(); } @@ -77,6 +79,12 @@ function handleCustomerDetail(row: CrmContactApi.Contact) { push({ name: 'CrmCustomerDetail', params: { id: row.customerId } }); } +/** 处理场景类型的切换 */ +function handleChangeSceneType(key: number | string) { + sceneType.value = key.toString(); + gridApi.query(); +} + const [Grid, gridApi] = useVbenVxeGrid({ formOptions: { schema: useGridFormSchema(), @@ -99,6 +107,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -106,11 +115,6 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, } as VxeTableGridOptions, }); - -function onChangeSceneType(key: number | string) { - sceneType.value = key.toString(); - gridApi.query(); -} - + + diff --git a/apps/web-antd/src/views/crm/contact/modules/form.vue b/apps/web-antd/src/views/crm/contact/modules/form.vue index 8f107bb5..a70060cf 100644 --- a/apps/web-antd/src/views/crm/contact/modules/form.vue +++ b/apps/web-antd/src/views/crm/contact/modules/form.vue @@ -59,8 +59,6 @@ const [Modal, modalApi] = useVbenModal({ // 加载数据 const data = modalApi.getData(); if (!data || !data.id) { - // 设置到 values - await formApi.setValues(data); return; } modalApi.lock();