Skip to content

Commit 5adf75d

Browse files
author
puhui999
committed
CRM:统一日志获取接口
1 parent 26daa3a commit 5adf75d

File tree

8 files changed

+33
-24
lines changed

8 files changed

+33
-24
lines changed

src/api/crm/contact/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,3 @@ export const createContactBusinessList = async (data: ContactBusinessReqVO) => {
8585
export const deleteContactBusinessList = async (data: ContactBusinessReqVO) => {
8686
return await request.delete({ url: `/crm/contact/delete-business-list`, data })
8787
}
88-
89-
// 查询联系人操作日志
90-
export const getOperateLogPage = async (params: any) => {
91-
return await request.get({ url: '/crm/contact/operate-log-page', params })
92-
}

src/api/crm/customer/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ export const getSimpleCustomerList = async () => {
7373
return await request.get({ url: `/crm/customer/list-all-simple` })
7474
}
7575

76-
// 查询客户操作日志
77-
export const getOperateLogPage = async (id: number) => {
78-
return await request.get({ url: '/crm/customer/operate-log-page?id=' + id })
79-
}
80-
8176
// ======================= 业务操作 =======================
8277

8378
export interface TransferReqVO {

src/api/crm/operateLog/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import request from '@/config/axios'
2+
3+
export interface OperateLogVO extends PageParam {
4+
bizType: number
5+
bizId: number
6+
}
7+
8+
// 获得操作日志
9+
export const getOperateLogPage = async (params: OperateLogVO) => {
10+
return await request.get({ url: `/crm/operate-log/page`, params })
11+
}

src/api/crm/permission/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ export enum BizTypeEnum {
2222
CRM_LEADS = 1, // 线索
2323
CRM_CUSTOMER = 2, // 客户
2424
CRM_CONTACT = 3, // 联系人
25-
CRM_BUSINESS = 5, // 商机
26-
CRM_CONTRACT = 6 // 合同
25+
CRM_BUSINESS = 4, // 商机
26+
CRM_CONTRACT = 5, // 合同
27+
CRM_PRODUCT = 6, // 产品
28+
CRM_RECEIVABLE = 7, // 回款
29+
CRM_RECEIVABLE_PLAN = 8 // 回款计划
2730
}
2831

2932
/**

src/api/crm/product/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,3 @@ export const deleteProduct = async (id: number) => {
4141
export const exportProduct = async (params) => {
4242
return await request.download({ url: `/crm/product/export-excel`, params })
4343
}
44-
45-
// 查询产品操作日志
46-
export const getOperateLogPage = async (params: any) => {
47-
return await request.get({ url: '/crm/product/operate-log-page', params })
48-
}

src/views/crm/contact/detail/index.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</el-tabs>
2222
</el-col>
2323
</template>
24-
<script setup lang="ts">
24+
<script lang="ts" setup>
2525
import { useTagsViewStore } from '@/store/modules/tagsView'
2626
import * as ContactApi from '@/api/crm/contact'
2727
import ContactDetailsHeader from '@/views/crm/contact/detail/ContactDetailsHeader.vue'
@@ -30,6 +30,7 @@ import BusinessList from '@/views/crm/business/components/BusinessList.vue' //
3030
import PermissionList from '@/views/crm/permission/components/PermissionList.vue' // 团队成员列表(权限)
3131
import { BizTypeEnum } from '@/api/crm/permission'
3232
import { OperateLogV2VO } from '@/api/system/operatelog'
33+
import { getOperateLogPage } from '@/api/crm/operateLog'
3334
3435
defineOptions({ name: 'CrmContactDetail' })
3536
@@ -57,7 +58,8 @@ const getOperateLog = async (contactId: number) => {
5758
if (!contactId) {
5859
return
5960
}
60-
const data = await ContactApi.getOperateLogPage({
61+
const data = await getOperateLogPage({
62+
bizType: BizTypeEnum.CRM_CONTACT,
6163
bizId: contactId
6264
})
6365
logList.value = data.list

src/views/crm/customer/detail/index.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ import CrmTransferForm from '@/views/crm/permission/components/TransferForm.vue'
9191
import FollowUpList from '@/views/crm/followup/index.vue'
9292
import { BizTypeEnum } from '@/api/crm/permission'
9393
import type { OperateLogV2VO } from '@/api/system/operatelog'
94+
import { getOperateLogPage } from '@/api/crm/operateLog'
9495
9596
defineOptions({ name: 'CrmCustomerDetail' })
9697
@@ -164,7 +165,10 @@ const getOperateLog = async () => {
164165
if (!customerId.value) {
165166
return
166167
}
167-
const data = await CustomerApi.getOperateLogPage(customerId.value)
168+
const data = await getOperateLogPage({
169+
bizType: BizTypeEnum.CRM_CUSTOMER,
170+
bizId: customerId.value
171+
})
168172
logList.value = data.list
169173
}
170174

src/views/crm/product/detail/index.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<ProductDetailsHeader :product="product" :loading="loading" @refresh="getProductData(id)" />
2+
<ProductDetailsHeader :loading="loading" :product="product" @refresh="getProductData(id)" />
33
<el-col>
44
<el-tabs>
55
<el-tab-pane label="详细资料">
@@ -11,16 +11,19 @@
1111
</el-tabs>
1212
</el-col>
1313
</template>
14-
<script setup lang="ts">
14+
<script lang="ts" setup>
1515
import { useTagsViewStore } from '@/store/modules/tagsView'
1616
import { OperateLogV2VO } from '@/api/system/operatelog'
1717
import * as ProductApi from '@/api/crm/product'
1818
import ProductDetailsHeader from '@/views/crm/product/detail/ProductDetailsHeader.vue'
1919
import ProductDetailsInfo from '@/views/crm/product/detail/ProductDetailsInfo.vue'
20+
import { BizTypeEnum } from '@/api/crm/permission'
21+
import { getOperateLogPage } from '@/api/crm/operateLog'
2022
2123
defineOptions({ name: 'CrmProductDetail' })
2224
2325
const route = useRoute()
26+
const message = useMessage()
2427
const id = Number(route.params.id) // 编号
2528
const loading = ref(true) // 加载中
2629
const product = ref<ProductApi.ProductVO>({} as ProductApi.ProductVO) // 详情
@@ -42,7 +45,8 @@ const getOperateLog = async (productId: number) => {
4245
if (!productId) {
4346
return
4447
}
45-
const data = await ProductApi.getOperateLogPage({
48+
const data = await getOperateLogPage({
49+
bizType: BizTypeEnum.CRM_PRODUCT,
4650
bizId: productId
4751
})
4852
logList.value = data.list
@@ -53,7 +57,7 @@ const { delView } = useTagsViewStore() // 视图操作
5357
const { currentRoute } = useRouter() // 路由
5458
onMounted(async () => {
5559
if (!id) {
56-
ElMessage.warning('参数错误,产品不能为空!')
60+
message.warning('参数错误,产品不能为空!')
5761
delView(unref(currentRoute))
5862
return
5963
}

0 commit comments

Comments
 (0)