diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 6ac5a01dbdca5d440e863eba60188e445c36ef9c..e980d3612dae420feab69c4f8063acffa3d98350 100644 --- a/src/api/crm/contact/index.ts +++ b/src/api/crm/contact/index.ts @@ -1,7 +1,7 @@ /* * @Author: zyna * @Date: 2023-11-05 13:34:41 - * @LastEditTime: 2023-11-11 16:20:19 + * @LastEditTime: 2023-11-26 20:47:04 * @FilePath: \yudao-ui-admin-vue3\src\api\crm\contact\index.ts * @Description: */ @@ -22,13 +22,15 @@ export interface ContactVO { id: number parentId: number qq: number - webchat: string + wechat: string sex: number - policyMakers: boolean + master: boolean creatorName: string updateTime?: Date createTime?: Date - customerName: string + customerName: string, + areaName: string, + ownerUserName: string } // 查询crm联系人列表 @@ -60,6 +62,6 @@ export const deleteContact = async (id: number) => { export const exportContact = async (params) => { return await request.download({ url: `/crm/contact/export-excel`, params }) } -export const simpleAlllist = async () => { - return await request.get({ url: `/crm/contact/simpleAlllist` }) +export const simpleAllList = async () => { + return await request.get({ url: `/crm/contact/simple-all-list` }) } diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index 59260cbcfb8ed15309934eecbeac9d154d3ab5c1..30d8981ac6c292322ffe8024d65044a06a3c89c7 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -62,3 +62,7 @@ export const deleteCustomer = async (id: number) => { export const exportCustomer = async (params) => { return await request.download({ url: `/crm/customer/export-excel`, params }) } +//客户列表 +export const queryAllList = async () => { + return await request.get({ url: `/crm/customer/query-all-list` }) +} \ No newline at end of file diff --git a/src/views/crm/contact/ContactForm.vue b/src/views/crm/contact/ContactForm.vue index 68d0030bc4fcfa382f5ff8085745931d2806f1cb..288539fc1915eb8db3bca507b9ba8a4955a10cfa 100644 --- a/src/views/crm/contact/ContactForm.vue +++ b/src/views/crm/contact/ContactForm.vue @@ -1,170 +1,131 @@ diff --git a/src/views/crm/contact/detail/ContactDetails.vue b/src/views/crm/contact/detail/ContactDetails.vue index 9cf586b2ad057eadad223ee28764e612bfd47145..de31306e10bd73c43bb2277f1e8c660a0c845432 100644 --- a/src/views/crm/contact/detail/ContactDetails.vue +++ b/src/views/crm/contact/detail/ContactDetails.vue @@ -1,3 +1,10 @@ + - {{ gotOwnerUser(contact.ownerUserId) }} + {{ contact.ownerUserName }} {{ contact.creatorName }} @@ -66,29 +76,9 @@ import * as ContactApi from '@/api/crm/contact' import { DICT_TYPE } from '@/utils/dict' import { formatDate } from '@/utils/formatTime' -import * as UserApi from '@/api/system/user' const { contact } = defineProps<{ contact: ContactApi.ContactVO }>() // 展示的折叠面板 const activeNames = ref(['basicInfo', 'systemInfo']) -const gotOwnerUser = (owerUserId: string) => { - let ownerName = '' - if (owerUserId !== null && owerUserId != undefined) { - owerUserId.split(',').forEach((item: string, index: number) => { - if (index != 0) { - ownerName = - ownerName + ',' + userList.value.find((user: { id: any }) => user.id == item)?.nickname - } else { - ownerName = userList.value.find((user: { id: any }) => user.id == item)?.nickname || '' - } - }) - } - return ownerName -} -const userList = ref([]) // 用户列表 -/** 初始化 **/ -onMounted(async () => { - userList.value = await UserApi.getSimpleUserList() -}) diff --git a/src/views/crm/contact/detail/index.vue b/src/views/crm/contact/detail/index.vue index 03bbb4e67955bd4b5d6e37e2383e08da12227330..5ec47f92938f04e72b92cbba1c110413093153ed 100644 --- a/src/views/crm/contact/detail/index.vue +++ b/src/views/crm/contact/detail/index.vue @@ -63,33 +63,18 @@ - + - 活动 - 邮件 - 工商信息 - - - - 客户 - - - - 团队成员 - + 跟进记录 商机 - - - 合同 - - - - 回款 + 附件 + + + + 操作记录 - 回访 - 发票 diff --git a/src/views/crm/contact/index.vue b/src/views/crm/contact/index.vue index d81b0449c4c3424d95e9910b52d2d62466de9e85..8de0a19a2362b3c5fb4fd4f8c9ae7564f2b30a8b 100644 --- a/src/views/crm/contact/index.vue +++ b/src/views/crm/contact/index.vue @@ -55,9 +55,9 @@ class="!w-240px" /> - + - + - - - + - + @@ -239,13 +235,12 @@ const queryParams = reactive({ name: null, post: null, qq: null, - webchat: null, + wechat: null, sex: null, policyMakers: null }) const queryFormRef = ref() // 搜索的表单 const exportLoading = ref(false) // 导出的加载中 -const userList = ref([]) // 用户列表 /** 查询列表 */ const getList = async () => { @@ -305,35 +300,15 @@ const handleExport = async () => { } } -// TODO @zyna:这个负责人的读取,放在后端好点 -const gotOwnerUser = (owerUserId: string) => { - let ownerName = '' - if (owerUserId !== null) { - owerUserId.split(',').forEach((item: string, index: number) => { - if (index != 0) { - ownerName = - ownerName + ',' + userList.value.find((user: { id: any }) => user.id == item)?.nickname - } else { - ownerName = userList.value.find((user: { id: any }) => user.id == item)?.nickname || '' - } - }) - } - return ownerName -} - /** 打开客户详情 */ const { push } = useRouter() const openDetail = (id: number) => { push({ name: 'CrmContactDetail', params: { id } }) } -// TODO @zyna:这个上级的读取,放在后端读取,更合适;因为可能数据量比较大 -const allContactList = ref([]) //所有联系人列表 -const allCustomerList = ref([]) //客户列表 + /** 初始化 **/ onMounted(async () => { await getList() - userList.value = await UserApi.getSimpleUserList() - allContactList.value = await ContactApi.simpleAlllist() })