diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts index 6ac5a01d..e980d361 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 59260cbc..30d8981a 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 68d0030b..288539fc 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 9cf586b2..de31306e 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 03bbb4e6..5ec47f92 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 d81b0449..8de0a19a 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() })