!335 crm联系人review修改

Merge pull request !335 from zyna/master
This commit is contained in:
芋道源码 2023-11-27 12:30:20 +00:00 committed by Gitee
commit 038f3d6ab0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 170 additions and 327 deletions

View File

@ -1,7 +1,7 @@
/* /*
* @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 {
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) => {
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` })
} }

View File

@ -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` })
}

View File

@ -1,170 +1,131 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" :width="800"> <Dialog :title="dialogTitle" v-model="dialogVisible" :width="820">
<el-form <el-form ref="formRef" :model="formData" :rules="formRules" label-width="110px" v-loading="formLoading">
ref="formRef" <el-row :gutter="20">
:model="formData" <el-col :span="12">
:rules="formRules" <el-form-item label="姓名" prop="name">
label-width="130px" <el-input input-style="width:190px;" v-model="formData.name" placeholder="请输入姓名" />
v-loading="formLoading" </el-form-item>
:inline="true" </el-col>
> <el-col :span="12">
<el-form-item label="姓名" prop="name"> <el-form-item label="负责人" prop="ownerUserId">
<el-input v-model="formData.name" placeholder="请输入姓名" /> <el-select v-model="formData.ownerUserId" placeholder="请选择负责人" value-key="id" lable-key="nickname">
</el-form-item> <el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" />
<el-form-item label="负责人" prop="ownerUserId"> </el-select>
<el-select </el-form-item>
v-model="ownerUserList" </el-col>
placeholder="请选择负责人" </el-row>
multiple <el-row>
value-key="id" <el-col :span="12">
lable-key="nickname" <el-form-item label="客户名称" prop="customerName">
@click="openOwerForm('open')" <el-select v-model="formData.customerId" placeholder="请选择客户" value-key="id" lable-key="name">
> <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" />
<el-option </el-select>
v-for="item in ownerUserList" </el-form-item>
:key="item.id" </el-col>
:label="item.nickname" <el-col :span="12"><el-form-item label="性别" prop="sex">
:value="item" <el-select v-model="formData.sex" placeholder="请选择">
/> <el-option
</el-select> v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX)" :key="dict.value"
</el-form-item> :label="dict.label" :value="dict.value" />
<!-- TODO 芋艿封装成一个组件 --> </el-select>
<el-form-item label="客户名称" prop="customerName"> </el-form-item></el-col>
<el-popover </el-row>
placement="bottom" <el-row>
:width="600" <el-col :span="12">
trigger="click" <el-form-item label="手机号" prop="mobile">
:teleported="false" <el-input input-style="width:190px;" v-model="formData.mobile" placeholder="请输入手机号" />
:visible="showCustomer" </el-form-item>
:offset="10" </el-col>
> <el-col :span="12">
<template #reference> <el-form-item label="座机" prop="telephone">
<el-input <el-input v-model="formData.telephone" placeholder="请输入座机" style="width: 215px" />
placeholder="请选择" </el-form-item>
@click="openCustomerSelect" </el-col>
v-model="formData.customerName" </el-row>
/> <el-row>
</template> <el-col :span="12">
<el-table :data="list" ref="multipleTableRef" @select="handleSelectionChange"> <el-form-item label="邮箱" prop="email">
<el-table-column label="选择" type="selection" width="55" /> <el-input input-style="width:190px;" v-model="formData.email" placeholder="请输入邮箱" />
<el-table-column width="100" property="id" label="编号" /> </el-form-item>
<el-table-column width="150" property="name" label="客户名称" /> </el-col>
<el-table-column label="客户来源" align="center" prop="source" width="100"> <el-col :span="12">
<template #default="scope"> <el-form-item label="QQ" prop="qq">
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="scope.row.source" /> <el-input v-model="formData.qq" placeholder="请输入QQ" style="width: 215px" />
</template> </el-form-item>
</el-table-column> </el-col>
<el-table-column label="客户等级" align="center" prop="level" width="120"> </el-row>
<template #default="scope"> <el-row>
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="scope.row.level" /> <el-col :span="12">
</template> <el-form-item label="微信" prop="wechat">
</el-table-column> <el-input input-style="width:190px;" v-model="formData.wechat" placeholder="请输入微信" />
</el-table> </el-form-item>
<!-- 分页 --> </el-col>
<el-row :gutter="20"> <el-col :span="12"> <el-form-item label="下次联系时间" prop="nextTime">
<el-col> <el-date-picker v-model="formData.nextTime" type="date" value-format="x" placeholder="选择下次联系时间" />
<Pagination </el-form-item>
:total="total" </el-col>
v-model:page="queryParams.pageNo" </el-row>
v-model:limit="queryParams.pageSize" <el-row>
@pagination="getList" <el-col :span="12">
layout="sizes, prev, pager, next" <el-form-item label="所在地" prop="areaId">
/> <el-tree-select
</el-col> v-model="formData.areaId" :data="areaList" :props="defaultProps"
</el-row> :render-after-expand="true" />
<el-row :gutter="20"> </el-form-item>
<el-col :span="10" :offset="13"> </el-col>
<el-button @click="selectCustomer">确认</el-button> <el-col :span="12">
<el-button @click="showCustomer = false">取消</el-button> <el-form-item label="地址" prop="address">
</el-col> <el-input input-style="width:190px;" v-model="formData.address" placeholder="请输入地址" />
</el-row> </el-form-item>
</el-popover> </el-col>
</el-form-item> </el-row><el-row>
<el-form-item label="性别" prop="sex"> <el-col :span="12">
<el-select v-model="formData.sex" placeholder="请选择"> <el-form-item label="直属上级" prop="parentId">
<el-option <el-select v-model="formData.parentId" placeholder="请选择">
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_USER_SEX)" <el-option
:key="dict.value" v-for="item in allContactList" :key="item.id" :label="item.name" :value="item.id"
:label="dict.label" :disabled="item.id == formData.id" />
:value="dict.value" </el-select>
/> </el-form-item>
</el-select> </el-col>
</el-form-item> <el-col :span="12"> <el-form-item label="职位" prop="post">
<el-form-item label="手机号" prop="mobile"> <el-input input-style="width:190px;" v-model="formData.post" placeholder="请输入职位" />
<el-input v-model="formData.mobile" placeholder="请输入手机号" /> </el-form-item>
</el-form-item> </el-col>
<el-form-item label="座机" prop="telephone"> </el-row><el-row>
<el-input v-model="formData.telephone" placeholder="请输入座机" style="width: 215px" /> <el-col :span="12"><el-form-item label="是否关键决策人" prop="master" style="width: 400px">
</el-form-item> <el-radio-group v-model="formData.master">
<el-form-item label="邮箱" prop="email"> <el-radio
<el-input v-model="formData.email" placeholder="请输入邮箱" /> v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)" :key="dict.value"
</el-form-item> :label="dict.value">
<el-form-item label="QQ" prop="qq"> {{ dict.label }}
<el-input v-model="formData.qq" placeholder="请输入QQ" style="width: 215px" /> </el-radio>
</el-form-item> </el-radio-group>
<el-form-item label="微信" prop="webchat"> </el-form-item>
<el-input v-model="formData.webchat" placeholder="请输入微信" /> </el-col>
</el-form-item> </el-row>
<el-form-item label="下次联系时间" prop="nextTime"> <el-row>
<el-date-picker <el-col :span="24"><el-form-item label="备注" prop="remark">
v-model="formData.nextTime" <el-input v-model="formData.remark" placeholder="请输入备注" />
type="date" </el-form-item>
value-format="x" </el-col>
placeholder="选择下次联系时间" </el-row>
/>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="formData.address" placeholder="请输入地址" />
</el-form-item>
<el-form-item label="直属上级" prop="parentId">
<el-select v-model="formData.parentId" placeholder="请选择">
<el-option
v-for="item in allContactList"
:key="item.id"
:label="item.name"
:value="item.id"
:disabled="item.id == formData.id"
/>
</el-select>
</el-form-item>
<el-form-item label="职位" prop="post">
<el-input v-model="formData.post" placeholder="请输入职位" />
</el-form-item>
<el-form-item label="是否关键决策人" prop="policyMakers" style="width: 400px">
<el-radio-group v-model="formData.policyMakers">
<el-radio
v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
:key="dict.value"
:label="dict.value"
>
{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注" />
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button> <el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</template> </template>
</Dialog> </Dialog>
<OwerSelect
ref="owerRef"
@confirmOwerSelect="owerSelectValue"
:initOwerUser="formData.ownerUserId"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as ContactApi from '@/api/crm/contact' import * as ContactApi from '@/api/crm/contact'
import { DICT_TYPE, getIntDictOptions, getBoolDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions, getBoolDictOptions } from '@/utils/dict'
import OwerSelect from './OwerSelect.vue'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import * as CustomerApi from '@/api/crm/customer' import * as CustomerApi from '@/api/crm/customer'
import { ElTable } from 'element-plus' import { ElTable } from 'element-plus'
import * as AreaApi from '@/api/system/area'
import { defaultProps } from '@/utils/tree'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -172,6 +133,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const areaList = ref([]) //
const formData = ref({ const formData = ref({
nextTime: undefined, nextTime: undefined,
mobile: undefined, mobile: undefined,
@ -188,21 +150,10 @@ const formData = ref({
name: undefined, name: undefined,
post: undefined, post: undefined,
qq: undefined, qq: undefined,
webchat: undefined, wechat: undefined,
sex: undefined, sex: undefined,
policyMakers: undefined master: false,
}) areaId: undefined
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
name: null,
mobile: null,
industryId: null,
level: null,
source: null
}) })
const formRules = reactive({ const formRules = reactive({
name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }], name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
@ -212,56 +163,33 @@ const formRules = reactive({
const formRef = ref() // Ref const formRef = ref() // Ref
const ownerUserList = ref<any[]>([]) const ownerUserList = ref<any[]>([])
const userList = ref<UserApi.UserVO[]>([]) // const userList = ref<UserApi.UserVO[]>([]) //
const customerList = ref<CustomerApi.CustomerVO[]>([]) //
const allContactList = ref([]) //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
allContactList.value = await ContactApi.simpleAlllist()
resetForm() resetForm()
allContactList.value = await ContactApi.simpleAllList()
userList.value = await UserApi.getSimpleUserList()
customerList.value = await CustomerApi.queryAllList()
areaList.value = await AreaApi.getAreaTree()
// //
if (id) { if (id) {
formLoading.value = true formLoading.value = true
try { try {
formData.value = await ContactApi.getContact(id) formData.value = await ContactApi.getContact(id)
userList.value = await UserApi.getSimpleUserList()
await gotOwnerUser(formData.value.ownerUserId)
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
} }
defineExpose({ open }) // open defineExpose({ open }) // open
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await CustomerApi.getCustomerPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
const gotOwnerUser = (owerUserId: any) => {
if (owerUserId !== null) {
owerUserId.split(',').forEach((item: string) => {
userList.value.find((user: { id: any }) => {
if (user.id == item) {
ownerUserList.value.push(user)
}
})
})
}
}
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
owerSelectValue(ownerUserList) // owerSelectValue(ownerUserList)
// //
if (!formRef) return if (!formRef) return
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
@ -302,52 +230,11 @@ const resetForm = () => {
name: undefined, name: undefined,
post: undefined, post: undefined,
qq: undefined, qq: undefined,
webchat: undefined, wechat: undefined,
sex: undefined, sex: undefined,
policyMakers: undefined master: false
} }
formRef.value?.resetFields() formRef.value?.resetFields()
ownerUserList.value = [] ownerUserList.value = []
} }
/** 添加/修改操作 */
// TODO @zynaowner
const owerRef = ref()
const openOwerForm = (type: string) => {
owerRef.value.open(type, ownerUserList.value)
}
const owerSelectValue = (value) => {
ownerUserList.value = value.value
formData.value.ownerUserId = undefined
value.value.forEach((item, index) => {
if (index != 0) {
formData.value.ownerUserId = formData.value.ownerUserId + ',' + item.id
} else {
formData.value.ownerUserId = item.id
}
})
}
//
const showCustomer = ref(false)
const openCustomerSelect = () => {
showCustomer.value = !showCustomer.value
queryParams.pageNo = 1
getList()
}
const multipleTableRef = ref<InstanceType<typeof ElTable>>()
const multipleSelection = ref()
const handleSelectionChange = ({}, row) => {
multipleSelection.value = row
multipleTableRef.value!.clearSelection()
multipleTableRef.value!.toggleRowSelection(row, undefined)
}
const selectCustomer = () => {
formData.value.customerId = multipleSelection.value.id
formData.value.customerName = multipleSelection.value.name
showCustomer.value = !showCustomer.value
}
const allContactList = ref([]) //
onMounted(async () => {
allContactList.value = await ContactApi.simpleAlllist()
})
</script> </script>

View File

@ -1,3 +1,10 @@
<!--
* @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 @@
{{ 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 @@
</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 @@
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>

View File

@ -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>
<template #label> 操作记录<el-badge :value="12" class="item" type="primary" /> </template>
操作记录
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="回款" lazy>
<template #label> 回款<el-badge :value="4" 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-tabs> </el-tabs>
</el-col> </el-col>

View File

@ -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 @@
</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 @@
/> />
<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({
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 () => {
} }
} }
// 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>