crm联系人新增操作日志

This commit is contained in:
zyna 2024-01-06 21:04:58 +08:00
parent 8801c82e15
commit 3af6811c72
4 changed files with 90 additions and 70 deletions

View File

@ -80,3 +80,8 @@ export const createContactBusinessList = async (data: ContactBusinessReqVO) => {
export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => { export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => {
return await request.delete({ url: `/crm/contact/delete-business-list`, data }) return await request.delete({ url: `/crm/contact/delete-business-list`, data })
} }
// 查询联系人操作日志
export const getOperateLogPage = async (params: any) => {
return await request.get({ url: '/crm/contact/operate-log-page', params })
}

View File

@ -136,7 +136,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- TODO @zyna解决下 ide 报错 -->
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="直属上级" prop="parentId"> <el-form-item label="直属上级" prop="parentId">
@ -233,7 +232,7 @@ const ownerUserList = ref<any[]>([])
const userList = ref<UserApi.UserVO[]>([]) // const userList = ref<UserApi.UserVO[]>([]) //
// TODO // TODO
const customerList = ref<CustomerApi.CustomerVO[]>([]) // const customerList = ref<CustomerApi.CustomerVO[]>([]) //
const allContactList = ref([]) // const allContactList = ref<ContactApi.ContactVO[]>([]) //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
dialogVisible.value = true dialogVisible.value = true

View File

@ -1,69 +1,70 @@
<template> <template>
<!-- TODO @zyna少了一个外边框 --> <ContentWrap>
<el-collapse v-model="activeNames"> <el-collapse v-model="activeNames">
<el-collapse-item name="basicInfo"> <el-collapse-item name="basicInfo">
<template #title> <template #title>
<span class="text-base font-bold">基本信息</span> <span class="text-base font-bold">基本信息</span>
</template> </template>
<el-descriptions :column="4"> <el-descriptions :column="4">
<el-descriptions-item label="姓名"> <el-descriptions-item label="姓名">
{{ contact.name }} {{ contact.name }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="客户"> <el-descriptions-item label="客户">
{{ contact.customerName }} {{ contact.customerName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="手机"> <el-descriptions-item label="手机">
{{ contact.mobile }} {{ contact.mobile }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="座机"> <el-descriptions-item label="座机">
{{ contact.telephone }} {{ contact.telephone }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="邮箱"> <el-descriptions-item label="邮箱">
{{ contact.email }} {{ contact.email }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="QQ"> <el-descriptions-item label="QQ">
{{ contact.qq }} {{ contact.qq }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="微信"> <el-descriptions-item label="微信">
{{ contact.wechat }} {{ contact.wechat }}
</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="所在地"> <el-descriptions-item label="所在地">
{{ contact.areaName }} {{ contact.areaName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="详细地址"> <el-descriptions-item label="详细地址">
{{ contact.address }} {{ contact.detailAddress }}
</el-descriptions-item> </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>
<el-descriptions-item label="备注"> <el-descriptions-item label="备注">
{{ contact.remark }} {{ contact.remark }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-collapse-item> </el-collapse-item>
<el-collapse-item name="systemInfo"> <el-collapse-item name="systemInfo">
<template #title> <template #title>
<span class="text-base font-bold">系统信息</span> <span class="text-base font-bold">系统信息</span>
</template> </template>
<el-descriptions :column="2"> <el-descriptions :column="2">
<el-descriptions-item label="负责人"> <el-descriptions-item label="负责人">
{{ contact.ownerUserName }} {{ contact.ownerUserName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="创建人"> <el-descriptions-item label="创建人">
{{ contact.creatorName }} {{ contact.creatorName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="创建时间"> <el-descriptions-item label="创建时间">
{{ contact.createTime ? formatDate(contact.createTime) : '空' }} {{ contact.createTime ? formatDate(contact.createTime) : '空' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="更新时间"> <el-descriptions-item label="更新时间">
{{ contact.updateTime ? formatDate(contact.updateTime) : '空' }} {{ contact.updateTime ? formatDate(contact.updateTime) : '空' }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
</ContentWrap>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as ContactApi from '@/api/crm/contact' import * as ContactApi from '@/api/crm/contact'

View File

@ -5,7 +5,9 @@
<el-tab-pane label="详细资料"> <el-tab-pane label="详细资料">
<ContactDetailsInfo :contact="contact" /> <ContactDetailsInfo :contact="contact" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="操作日志" lazy>TODO 待开发</el-tab-pane> <el-tab-pane label="操作日志">
<OperateLogV2 :log-list="logList" />
</el-tab-pane>
<el-tab-pane label="团队成员" lazy> <el-tab-pane label="团队成员" lazy>
<PermissionList :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT" /> <PermissionList :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT" />
</el-tab-pane> </el-tab-pane>
@ -20,7 +22,6 @@
</el-col> </el-col>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ElMessage } from 'element-plus' // TODO @zyna使 hook message
import { useTagsViewStore } from '@/store/modules/tagsView' import { useTagsViewStore } from '@/store/modules/tagsView'
import * as ContactApi from '@/api/crm/contact' import * as ContactApi from '@/api/crm/contact'
import ContactDetailsHeader from '@/views/crm/contact/detail/ContactDetailsHeader.vue' import ContactDetailsHeader from '@/views/crm/contact/detail/ContactDetailsHeader.vue'
@ -28,6 +29,7 @@ import ContactDetailsInfo from '@/views/crm/contact/detail/ContactDetailsInfo.vu
import BusinessList from '@/views/crm/business/components/BusinessList.vue' // import BusinessList from '@/views/crm/business/components/BusinessList.vue' //
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // import PermissionList from '@/views/crm/permission/components/PermissionList.vue' //
import { BizTypeEnum } from '@/api/crm/permission' import { BizTypeEnum } from '@/api/crm/permission'
import { OperateLogV2VO } from '@/api/system/operatelog'
defineOptions({ name: 'CrmContactDetail' }) defineOptions({ name: 'CrmContactDetail' })
@ -41,11 +43,24 @@ const getContactData = async (id: number) => {
loading.value = true loading.value = true
try { try {
contact.value = await ContactApi.getContact(id) contact.value = await ContactApi.getContact(id)
await getOperateLog(id)
} finally { } finally {
loading.value = false loading.value = false
} }
} }
const logList = ref<OperateLogV2VO[]>([]) //
/**
* 获取操作日志
*/
const getOperateLog = async (contactId: number) => {
if (!contactId) {
return
}
const data = await ContactApi.getOperateLogPage({
bizId: contactId
})
logList.value = data.list
}
/** 初始化 */ /** 初始化 */
const { delView } = useTagsViewStore() // const { delView } = useTagsViewStore() //
const { currentRoute } = useRouter() // const { currentRoute } = useRouter() //