commit
538783ce2d
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zyna
|
||||||
|
* @Date: 2023-11-05 13:34:41
|
||||||
|
* @LastEditTime: 2023-11-11 16:20:19
|
||||||
|
* @FilePath: \yudao-ui-admin-vue3\src\api\crm\contact\index.ts
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface ContactVO {
|
||||||
|
name: string
|
||||||
|
nextTime: Date
|
||||||
|
mobile: string
|
||||||
|
telephone: string
|
||||||
|
email: string
|
||||||
|
post: string
|
||||||
|
customerId: number
|
||||||
|
address: string
|
||||||
|
remark: string
|
||||||
|
ownerUserId: string
|
||||||
|
lastTime: Date
|
||||||
|
id: number
|
||||||
|
parentId: number
|
||||||
|
qq: number
|
||||||
|
webchat: string
|
||||||
|
sex: number
|
||||||
|
policyMakers: boolean
|
||||||
|
creatorName: string
|
||||||
|
updateTime?: Date
|
||||||
|
createTime?: Date
|
||||||
|
customerName: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询crm联系人列表
|
||||||
|
export const getContactPage = async (params) => {
|
||||||
|
return await request.get({ url: `/crm/contact/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询crm联系人详情
|
||||||
|
export const getContact = async (id: number) => {
|
||||||
|
return await request.get({ url: `/crm/contact/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增crm联系人
|
||||||
|
export const createContact = async (data: ContactVO) => {
|
||||||
|
return await request.post({ url: `/crm/contact/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改crm联系人
|
||||||
|
export const updateContact = async (data: ContactVO) => {
|
||||||
|
return await request.put({ url: `/crm/contact/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除crm联系人
|
||||||
|
export const deleteContact = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/crm/contact/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出crm联系人 Excel
|
||||||
|
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` })
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zyna
|
||||||
|
* @Date: 2023-11-11 14:50:11
|
||||||
|
* @LastEditTime: 2023-11-11 14:52:47
|
||||||
|
* @FilePath: \yudao-ui-admin-vue3\src\views\crm\contact\detail\ContactBasicInfo.vue
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-col>
|
||||||
|
<el-row>
|
||||||
|
<span class="text-xl font-bold">{{ contact.name }}</span>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col class="mt-10px">
|
||||||
|
<!-- TODO 标签 -->
|
||||||
|
<!-- <Icon icon="ant-design:tag-filled" />-->
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as ContactApi from '@/api/crm/contact'
|
||||||
|
|
||||||
|
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
|
||||||
|
</script>
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
<template>
|
||||||
|
<el-collapse v-model="activeNames">
|
||||||
|
<el-collapse-item name="basicInfo">
|
||||||
|
<template #title>
|
||||||
|
<span class="text-base font-bold">基本信息</span>
|
||||||
|
</template>
|
||||||
|
<el-descriptions :column="4">
|
||||||
|
<el-descriptions-item label="姓名">
|
||||||
|
{{ contact.name }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="客户名称">
|
||||||
|
{{ contact.customerName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="手机">
|
||||||
|
{{ contact.mobile }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="座机">
|
||||||
|
{{ contact.telephone }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="邮箱">
|
||||||
|
{{ contact.email }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="QQ">
|
||||||
|
{{ contact.qq }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="微信">
|
||||||
|
{{ contact.webchat }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="详细地址">
|
||||||
|
{{ contact.address }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="下次联系时间">
|
||||||
|
{{ contact.nextTime ? formatDate(contact.nextTime) : '空' }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="性别">
|
||||||
|
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="contact.sex" />
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="备注">
|
||||||
|
{{ contact.remark }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-collapse-item>
|
||||||
|
<el-collapse-item name="systemInfo">
|
||||||
|
<template #title>
|
||||||
|
<span class="text-base font-bold">系统信息</span>
|
||||||
|
</template>
|
||||||
|
<el-descriptions :column="2">
|
||||||
|
<el-descriptions-item label="负责人">
|
||||||
|
{{ gotOwnerUser(contact.ownerUserId) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="创建人">
|
||||||
|
{{ contact.creatorName }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="创建时间">
|
||||||
|
{{ contact.createTime ? formatDate(contact.createTime) : '空' }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="更新时间">
|
||||||
|
{{ contact.updateTime ? formatDate(contact.updateTime) : '空' }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
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<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(async () => {
|
||||||
|
userList.value = await UserApi.getSimpleUserList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
Loading…
Reference in New Issue