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

View File

@ -1,5 +1,5 @@
<template>
<!-- TODO @zyna少了一个外边框 -->
<ContentWrap>
<el-collapse v-model="activeNames">
<el-collapse-item name="basicInfo">
<template #title>
@ -34,7 +34,7 @@
{{ contact.areaName }}
</el-descriptions-item>
<el-descriptions-item label="详细地址">
{{ contact.address }}
{{ contact.detailAddress }}
</el-descriptions-item>
<el-descriptions-item label="性别">
<dict-tag :type="DICT_TYPE.SYSTEM_USER_SEX" :value="contact.sex" />
@ -64,6 +64,7 @@
</el-descriptions>
</el-collapse-item>
</el-collapse>
</ContentWrap>
</template>
<script setup lang="ts">
import * as ContactApi from '@/api/crm/contact'

View File

@ -5,7 +5,9 @@
<el-tab-pane label="详细资料">
<ContactDetailsInfo :contact="contact" />
</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>
<PermissionList :biz-id="contact.id!" :biz-type="BizTypeEnum.CRM_CONTACT" />
</el-tab-pane>
@ -20,7 +22,6 @@
</el-col>
</template>
<script setup lang="ts">
import { ElMessage } from 'element-plus' // TODO @zyna使 hook message
import { useTagsViewStore } from '@/store/modules/tagsView'
import * as ContactApi from '@/api/crm/contact'
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 PermissionList from '@/views/crm/permission/components/PermissionList.vue' //
import { BizTypeEnum } from '@/api/crm/permission'
import { OperateLogV2VO } from '@/api/system/operatelog'
defineOptions({ name: 'CrmContactDetail' })
@ -41,11 +43,24 @@ const getContactData = async (id: number) => {
loading.value = true
try {
contact.value = await ContactApi.getContact(id)
await getOperateLog(id)
} finally {
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 { currentRoute } = useRouter() //