diff --git a/apps/web-antd/src/router/routes/modules/crm.ts b/apps/web-antd/src/router/routes/modules/crm.ts index 0f53404a..19cdcd65 100644 --- a/apps/web-antd/src/router/routes/modules/crm.ts +++ b/apps/web-antd/src/router/routes/modules/crm.ts @@ -18,7 +18,7 @@ const routes: RouteRecordRaw[] = [ title: '线索详情', activePath: '/crm/clue', }, - component: () => import('#/views/crm/clue/modules/detail.vue'), + component: () => import('#/views/crm/clue/detail/index.vue'), }, { path: 'customer/detail/:id', 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/modules/detail-data.ts b/apps/web-antd/src/views/crm/clue/detail/data.ts similarity index 90% rename from apps/web-antd/src/views/crm/clue/modules/detail-data.ts rename to apps/web-antd/src/views/crm/clue/detail/data.ts index 5e09bd01..73e905a2 100644 --- a/apps/web-antd/src/views/crm/clue/modules/detail-data.ts +++ b/apps/web-antd/src/views/crm/clue/detail/data.ts @@ -66,7 +66,11 @@ export function useDetailBaseSchema(): DescriptionItemSchema[] { { field: 'areaName', label: '地址', - content: (data) => data?.areaName + data?.detailAddress, + content: (data) => { + const areaName = data.areaName ?? ''; + const detailAddress = data?.detailAddress ?? ''; + return [areaName, detailAddress].filter((item) => !!item).join(' '); + }, }, { field: 'qq', diff --git a/apps/web-antd/src/views/crm/clue/modules/detail.vue b/apps/web-antd/src/views/crm/clue/detail/index.vue similarity index 75% rename from apps/web-antd/src/views/crm/clue/modules/detail.vue rename to apps/web-antd/src/views/crm/clue/detail/index.vue index 08e43079..4a0aadd4 100644 --- a/apps/web-antd/src/views/crm/clue/modules/detail.vue +++ b/apps/web-antd/src/views/crm/clue/detail/index.vue @@ -7,7 +7,7 @@ import { useRoute, useRouter } from 'vue-router'; import { confirm, Page, useVbenModal } from '@vben/common-ui'; import { useTabs } from '@vben/hooks'; -import { ArrowLeft } from '@vben/icons'; +import { IconifyIcon } from '@vben/icons'; import { Button, Card, message, Tabs } from 'ant-design-vue'; @@ -15,14 +15,15 @@ import { getClue, transformClue } from '#/api/crm/clue'; import { getOperateLogPage } from '#/api/crm/operateLog'; import { BizTypeEnum } from '#/api/crm/permission'; import { useDescription } from '#/components/description'; +// TODO @芋艿:要不要 AsyncOperateLog 风格? import { AsyncOperateLog } from '#/components/operate-log'; import { FollowUp } from '#/views/crm/followup'; import { PermissionList, TransferForm } from '#/views/crm/permission'; -import { useDetailSchema } from './detail-data'; -import ClueForm from './form.vue'; +import ClueForm from '../modules/form.vue'; +import { useDetailSchema } from './data'; -const ClueDetailsInfo = defineAsyncComponent(() => import('./detail-info.vue')); +const ClueInfo = defineAsyncComponent(() => import('./modules/info.vue')); const loading = ref(false); @@ -30,13 +31,12 @@ const route = useRoute(); const router = useRouter(); const tabs = useTabs(); -const clueId = ref(0); - -const clue = ref({} as CrmClueApi.Clue); -const clueLogList = ref([]); +const clueId = ref(0); // 线索编号 +const clue = ref({} as CrmClueApi.Clue); // 线索详情 +const logList = ref([]); // 操作日志 const permissionListRef = ref>(); // 团队成员列表 Ref -// 校验负责人权限和编辑权限 +/** 校验负责人权限和编辑权限 */ const validateOwnerUser = computed( () => permissionListRef.value?.validateOwnerUser, ); @@ -62,17 +62,19 @@ const [TransferModal, transferModalApi] = useVbenModal({ }); /** 加载线索详情 */ -async function loadClueDetail() { +async function getClueDetail() { loading.value = true; - const data = await getClue(clueId.value); - clue.value = data; - // 操作日志 - const logList = await getOperateLogPage({ - bizType: BizTypeEnum.CRM_CLUE, - bizId: clueId.value, - }); - clueLogList.value = logList.list; - loading.value = false; + try { + clue.value = await getClue(clueId.value); + // 操作日志 + const res = await getOperateLogPage({ + bizType: BizTypeEnum.CRM_CLUE, + bizId: clueId.value, + }); + logList.value = res.list; + } finally { + loading.value = false; + } } /** 返回列表页 */ @@ -100,7 +102,6 @@ async function handleTransform(): Promise { .then(async () => { const res = await transformClue(clueId.value); if (res) { - // 提示并返回成功 message.success('转化客户成功'); resolve(true); } else { @@ -113,21 +114,21 @@ async function handleTransform(): Promise { }); } -// 加载数据 +/** 加载数据 */ onMounted(() => { - clueId.value = Number(route.params.id); - loadClueDetail(); + clueId.value = route.params.id as number; + getClueDetail(); });