diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index 5ef43950..50eebd64 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -67,3 +67,8 @@ export const exportCustomer = async (params) => { export const queryAllList = async () => { return await request.get({ url: `/crm/customer/query-all-list` }) } + +// 查询客户操作日志 +export const getOperateLogPage = async (params) => { + return await request.get({ url: '/crm/customer/operate-log-page', params }) +} diff --git a/src/api/system/operatelog/index.ts b/src/api/system/operatelog/index.ts index 848a5333..0ebe0d33 100644 --- a/src/api/system/operatelog/index.ts +++ b/src/api/system/operatelog/index.ts @@ -23,6 +23,32 @@ export type OperateLogVO = { resultData: string } +export type OperateLogV2VO = { + id: number + userNickname: string + traceId: string + userType: number + userId: number + userName: string + type: string + subType: string + bizId: number + action: string + extra: string + requestMethod: string + requestUrl: string + userIp: string + userAgent: string + creator: string + creatorName: string + createTime: Date + // 数据扩展-渲染时使用 + title: string // 操作标题(如果为空则取 name 值) + colSize: number // 变更记录行数 + contentStrList: string[] + tagsContentList: string[] +} + // 查询操作日志列表 export const getOperateLogPage = (params: PageParam) => { return request.get({ url: '/system/operate-log/page', params }) diff --git a/src/components/OperateLogV2/index.ts b/src/components/OperateLogV2/index.ts new file mode 100644 index 00000000..f69c222e --- /dev/null +++ b/src/components/OperateLogV2/index.ts @@ -0,0 +1,3 @@ +import OperateLogV2 from './src/OperateLogV2.vue' + +export { OperateLogV2 } diff --git a/src/components/OperateLogV2/src/OperateLogV2.vue b/src/components/OperateLogV2/src/OperateLogV2.vue new file mode 100644 index 00000000..cb5663b2 --- /dev/null +++ b/src/components/OperateLogV2/src/OperateLogV2.vue @@ -0,0 +1,170 @@ + + + + + + + + ======================= + {{ log.userName }} + {{ log.title }} + ======================= + + + + + + + {{ tagVal }} + {{ log.contentStrList[index2] }} + + + + + + + + {{ getDictLabel(DICT_TYPE.USER_TYPE, log.userType)[0] }} + + + + + + + + + + diff --git a/src/views/crm/customer/CustomerForm.vue b/src/views/crm/customer/CustomerForm.vue index 99f7e858..1730ef45 100644 --- a/src/views/crm/customer/CustomerForm.vue +++ b/src/views/crm/customer/CustomerForm.vue @@ -1,11 +1,11 @@ - + @@ -17,7 +17,7 @@ @@ -139,13 +139,13 @@ - 确 定 + 确 定 取 消 - - + diff --git a/src/views/crm/customer/detail/index.vue b/src/views/crm/customer/detail/index.vue index f21a6ac3..e8d73582 100644 --- a/src/views/crm/customer/detail/index.vue +++ b/src/views/crm/customer/detail/index.vue @@ -5,7 +5,9 @@ - TODO 待开发 + + + @@ -38,24 +40,39 @@ import ReceivableList from '@/views/crm/receivable/components/ReceivableList.vue import ReceivablePlanList from '@/views/crm/receivable/plan/components/ReceivablePlanList.vue' // 回款计划列表 import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限) import { BizTypeEnum } from '@/api/crm/permission' +import { OperateLogV2VO } from '@/api/system/operatelog' defineOptions({ name: 'CrmCustomerDetail' }) const route = useRoute() const id = Number(route.params.id) // 客户编号 const loading = ref(true) // 加载中 - /** 获取详情 */ const customer = ref({} as CustomerApi.CustomerVO) // 客户详情 const getCustomer = async (id: number) => { loading.value = true try { customer.value = await CustomerApi.getCustomer(id) + await getOperateLog(id) } finally { loading.value = false } } - +const logList = ref([]) // 操作日志列表 +/** + * 获取操作日志 + */ +const getOperateLog = async (customerId: number) => { + if (!customerId) { + return + } + const data = await CustomerApi.getOperateLogPage({ + pageNo: 1, + pageSize: 10, + bizId: customerId + }) + logList.value = data.list +} /** 初始化 */ const { delView } = useTagsViewStore() // 视图操作 const { currentRoute } = useRouter() // 路由