Commit 038f3d6a by 芋道源码 Committed by Gitee

!335 crm联系人review修改

Merge pull request !335 from zyna/master
parents 8aa17b67 46a8755c
/* /*
* @Author: zyna * @Author: zyna
* @Date: 2023-11-05 13:34:41 * @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 * @FilePath: \yudao-ui-admin-vue3\src\api\crm\contact\index.ts
* @Description: * @Description:
*/ */
...@@ -22,13 +22,15 @@ export interface ContactVO { ...@@ -22,13 +22,15 @@ export interface ContactVO {
id: number id: number
parentId: number parentId: number
qq: number qq: number
webchat: string wechat: string
sex: number sex: number
policyMakers: boolean master: boolean
creatorName: string creatorName: string
updateTime?: Date updateTime?: Date
createTime?: Date createTime?: Date
customerName: string customerName: string,
areaName: string,
ownerUserName: string
} }
// 查询crm联系人列表 // 查询crm联系人列表
...@@ -60,6 +62,6 @@ export const deleteContact = async (id: number) => { ...@@ -60,6 +62,6 @@ export const deleteContact = async (id: number) => {
export const exportContact = async (params) => { export const exportContact = async (params) => {
return await request.download({ url: `/crm/contact/export-excel`, params }) return await request.download({ url: `/crm/contact/export-excel`, params })
} }
export const simpleAlllist = async () => { export const simpleAllList = async () => {
return await request.get({ url: `/crm/contact/simpleAlllist` }) return await request.get({ url: `/crm/contact/simple-all-list` })
} }
...@@ -62,3 +62,7 @@ export const deleteCustomer = async (id: number) => { ...@@ -62,3 +62,7 @@ export const deleteCustomer = async (id: number) => {
export const exportCustomer = async (params) => { export const exportCustomer = async (params) => {
return await request.download({ url: `/crm/customer/export-excel`, 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
<!--
* @Author: zyna
* @Date: 2023-11-26 10:39:46
* @LastEditTime: 2023-11-26 20:43:43
* @FilePath: \yudao-ui-admin-vue3\src\views\crm\contact\detail\ContactDetails.vue
* @Description:
-->
<template> <template>
<el-collapse v-model="activeNames"> <el-collapse v-model="activeNames">
<el-collapse-item name="basicInfo"> <el-collapse-item name="basicInfo">
...@@ -24,14 +31,17 @@ ...@@ -24,14 +31,17 @@
{{ contact.qq }} {{ contact.qq }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="微信"> <el-descriptions-item label="微信">
{{ contact.webchat }} {{ contact.wechat }}
</el-descriptions-item>
<el-descriptions-item label="详细地址">
{{ contact.address }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="下次联系时间"> <el-descriptions-item label="下次联系时间">
{{ contact.nextTime ? formatDate(contact.nextTime) : '空' }} {{ contact.nextTime ? formatDate(contact.nextTime) : '空' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="所在地">
{{ contact.areaName }}
</el-descriptions-item>
<el-descriptions-item label="详细地址">
{{ contact.address }}
</el-descriptions-item>
<el-descriptions-item label="性别"> <el-descriptions-item label="性别">
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="contact.sex" /> <dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="contact.sex" />
</el-descriptions-item> </el-descriptions-item>
...@@ -46,7 +56,7 @@ ...@@ -46,7 +56,7 @@
</template> </template>
<el-descriptions :column="2"> <el-descriptions :column="2">
<el-descriptions-item label="负责人"> <el-descriptions-item label="负责人">
{{ gotOwnerUser(contact.ownerUserId) }} {{ contact.ownerUserName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="创建人"> <el-descriptions-item label="创建人">
{{ contact.creatorName }} {{ contact.creatorName }}
...@@ -66,29 +76,9 @@ ...@@ -66,29 +76,9 @@
import * as ContactApi from '@/api/crm/contact' import * as ContactApi from '@/api/crm/contact'
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as UserApi from '@/api/system/user'
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>() const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
// 展示的折叠面板 // 展示的折叠面板
const activeNames = ref(['basicInfo', 'systemInfo']) 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<UserApi.UserVO[]>([]) // 用户列表
/** 初始化 **/
onMounted(async () => {
userList.value = await UserApi.getSimpleUserList()
})
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>
...@@ -63,33 +63,18 @@ ...@@ -63,33 +63,18 @@
<!-- TODO wanwan:这个 tab 拉满哈,可以更好看; --> <!-- TODO wanwan:这个 tab 拉满哈,可以更好看; -->
<el-col :span="18"> <el-col :span="18">
<el-tabs> <el-tabs>
<el-tab-pane label="详细资料"> <el-tab-pane label="基本信息">
<!-- TODO wanwan:这个 ml-2 是不是可以优化下,不要整个左移,而是里面的内容有个几 px 的偏移,不顶在框里 --> <!-- TODO wanwan:这个 ml-2 是不是可以优化下,不要整个左移,而是里面的内容有个几 px 的偏移,不顶在框里 -->
<ContactDetails class="ml-2" :contact="contact" /> <ContactDetails class="ml-2" :contact="contact" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="活动" lazy> 活动</el-tab-pane> <el-tab-pane label="跟进记录" lazy> 跟进记录</el-tab-pane>
<el-tab-pane label="邮件" lazy> 邮件</el-tab-pane>
<el-tab-pane label="工商信息" lazy> 工商信息</el-tab-pane>
<!-- TODO wanwan 以下标签上的数量需要接口统计返回 -->
<el-tab-pane label="客户" lazy>
<template #label> 客户<el-badge :value="12" class="item" type="primary" /> </template>
客户
</el-tab-pane>
<el-tab-pane label="团队成员" lazy>
<template #label> 团队成员<el-badge :value="2" class="item" type="primary" /> </template>
团队成员
</el-tab-pane>
<el-tab-pane label="商机" lazy> 商机</el-tab-pane> <el-tab-pane label="商机" lazy> 商机</el-tab-pane>
<el-tab-pane label="合同" lazy> <el-tab-pane label="附件" lazy> 附件</el-tab-pane>
<template #label> 合同<el-badge :value="3" class="item" type="primary" /> </template> <!-- TODO wanwan 以下标签上的数量需要接口统计返回 -->
合同 <el-tab-pane label="操作记录" lazy>
</el-tab-pane> <template #label> 操作记录<el-badge :value="12" class="item" type="primary" /> </template>
<el-tab-pane label="回款" lazy> 操作记录
<template #label> 回款<el-badge :value="4" class="item" type="primary" /> </template>
回款
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="回访" lazy> 回访</el-tab-pane>
<el-tab-pane label="发票" lazy> 发票</el-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
......
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="微信" prop="webchat"> <el-form-item label="微信" prop="wechat">
<el-input <el-input
v-model="queryParams.webchat" v-model="queryParams.wechat"
placeholder="请输入微信" placeholder="请输入微信"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
...@@ -109,20 +109,16 @@ ...@@ -109,20 +109,16 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="职位" align="center" prop="post" /> <el-table-column label="职位" align="center" prop="post" />
<el-table-column label="是否关键决策人" align="center" prop="policyMakers"> <el-table-column label="是否关键决策人" align="center" prop="master">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.policyMakers" /> <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.master" />
</template>
</el-table-column>
<el-table-column label="直属上级" align="center" prop="parentId">
<template #default="scope">
{{ allContactList.find((contact) => contact.id === scope.row.parentId)?.name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="直属上级" align="center" prop="parentName"/>
<el-table-column label="手机号" align="center" prop="mobile" /> <el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="座机" align="center" prop="telephone" /> <el-table-column label="座机" align="center" prop="telephone" />
<el-table-column label="QQ" align="center" prop="qq" /> <el-table-column label="QQ" align="center" prop="qq" />
<el-table-column label="微信" align="center" prop="webchat" /> <el-table-column label="微信" align="center" prop="wechat" />
<el-table-column label="邮箱" align="center" prop="email" /> <el-table-column label="邮箱" align="center" prop="email" />
<el-table-column label="地址" align="center" prop="address" /> <el-table-column label="地址" align="center" prop="address" />
<el-table-column <el-table-column
...@@ -142,7 +138,7 @@ ...@@ -142,7 +138,7 @@
/> />
<el-table-column label="负责人" align="center" prop="ownerUserId"> <el-table-column label="负责人" align="center" prop="ownerUserId">
<template #default="scope"> <template #default="scope">
{{ gotOwnerUser(scope.row.ownerUserId) }} {{ scope.row.ownerUserName}}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="所属部门" align="center" prop="ownerUserId" /> --> <!-- <el-table-column label="所属部门" align="center" prop="ownerUserId" /> -->
...@@ -239,13 +235,12 @@ const queryParams = reactive({ ...@@ -239,13 +235,12 @@ const queryParams = reactive({
name: null, name: null,
post: null, post: null,
qq: null, qq: null,
webchat: null, wechat: null,
sex: null, sex: null,
policyMakers: null policyMakers: null
}) })
const queryFormRef = ref() // 搜索的表单 const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中 const exportLoading = ref(false) // 导出的加载中
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
...@@ -305,35 +300,15 @@ const handleExport = 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 { push } = useRouter()
const openDetail = (id: number) => { const openDetail = (id: number) => {
push({ name: 'CrmContactDetail', params: { id } }) push({ name: 'CrmContactDetail', params: { id } })
} }
// TODO @zyna:这个上级的读取,放在后端读取,更合适;因为可能数据量比较大
const allContactList = ref([]) //所有联系人列表
const allCustomerList = ref([]) //客户列表
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getList() await getList()
userList.value = await UserApi.getSimpleUserList()
allContactList.value = await ContactApi.simpleAlllist()
}) })
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment