From 3c54f5f565a4f82c420b8beffc6e1914476de552 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Sat, 6 Apr 2024 15:38:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0[=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=85=AC=E6=B5=B7=E5=88=86=E6=9E=90]tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/statistics/customer.ts | 30 +++- .../customer/components/PoolSummary.vue | 148 ++++++++++++++++++ src/views/crm/statistics/customer/index.vue | 42 +++-- 3 files changed, 207 insertions(+), 13 deletions(-) create mode 100644 src/views/crm/statistics/customer/components/PoolSummary.vue diff --git a/src/api/crm/statistics/customer.ts b/src/api/crm/statistics/customer.ts index ebb9dfb3..815fe653 100644 --- a/src/api/crm/statistics/customer.ts +++ b/src/api/crm/statistics/customer.ts @@ -44,6 +44,18 @@ export interface CrmStatisticsCustomerContractSummaryRespVO { orderDate: Date } +export interface CrmStatisticsPoolSummaryByDateRespVO { + time: string + customerPutCount: number + customerTakeCount: number +} + +export interface CrmStatisticsPoolSummaryByUserRespVO { + ownerUserName: string + customerPutCount: number + customerTakeCount: number +} + export interface CrmStatisticsCustomerDealCycleByDateRespVO { time: string customerDealCycle: number @@ -99,14 +111,28 @@ export const StatisticsCustomerApi = { params }) }, - // 5.1 获取客户成交周期(按日期) + // 5.1 获取客户公海分析(按日期) + getPoolSummaryByDate: (param: any) => { + return request.get({ + url: '/crm/statistics-customer/get-pool-summary-by-date', + params: param + }) + }, + // 5.2 获取客户公海分析(按用户) + getPoolSummaryByUser: (param: any) => { + return request.get({ + url: '/crm/statistics-customer/get-pool-summary-by-user', + params: param + }) + }, + // 6.1 获取客户成交周期(按日期) getCustomerDealCycleByDate: (params: any) => { return request.get({ url: '/crm/statistics-customer/get-customer-deal-cycle-by-date', params }) }, - // 5.2 获取客户成交周期(按用户) + // 6.2 获取客户成交周期(按用户) getCustomerDealCycleByUser: (params: any) => { return request.get({ url: '/crm/statistics-customer/get-customer-deal-cycle-by-user', diff --git a/src/views/crm/statistics/customer/components/PoolSummary.vue b/src/views/crm/statistics/customer/components/PoolSummary.vue new file mode 100644 index 00000000..fdb54d03 --- /dev/null +++ b/src/views/crm/statistics/customer/components/PoolSummary.vue @@ -0,0 +1,148 @@ + + + diff --git a/src/views/crm/statistics/customer/index.vue b/src/views/crm/statistics/customer/index.vue index fe3aa555..e84b0850 100644 --- a/src/views/crm/statistics/customer/index.vue +++ b/src/views/crm/statistics/customer/index.vue @@ -19,10 +19,16 @@ start-placeholder="开始日期" type="daterange" value-format="YYYY-MM-DD HH:mm:ss" + @change="handleQuery" /> - + - + - 搜索 + 查询 @@ -85,6 +98,10 @@ + + + + @@ -97,19 +114,20 @@ import * as DeptApi from '@/api/system/dept' import * as UserApi from '@/api/system/user' import { useUserStore } from '@/store/modules/user' +import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime' import { defaultProps, handleTree } from '@/utils/tree' -import CustomerSummary from './components/CustomerSummary.vue' -import CustomerFollowUpSummary from './components/CustomerFollowUpSummary.vue' -import CustomerFollowUpType from './components/CustomerFollowUpType.vue' import CustomerConversionStat from './components/CustomerConversionStat.vue' import CustomerDealCycle from './components/CustomerDealCycle.vue' -import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' +import CustomerFollowUpSummary from './components/CustomerFollowUpSummary.vue' +import CustomerFollowUpType from './components/CustomerFollowUpType.vue' +import CustomerSummary from './components/CustomerSummary.vue' +import PoolSummary from './components/PoolSummary.vue' defineOptions({ name: 'CrmStatisticsCustomer' }) const queryParams = reactive({ - interval: 1, + interval: 2, // WEEK, 周 deptId: useUserStore().getUser.deptId, userId: undefined, times: [ @@ -135,8 +153,7 @@ const customerSummaryRef = ref() // 1. 客户总量分析 const followUpSummaryRef = ref() // 2. 客户跟进次数分析 const followUpTypeRef = ref() // 3. 客户跟进方式分析 const conversionStatRef = ref() // 4. 客户转化率分析 -// 5. TODO 公海客户分析 -// 缺 crm_owner_record 表 TODO @dhb52:可以先做界面 + 接口,接口数据直接写死返回,相当于 mock 出来 +const poolSummaryRef = ref() // 5. 客户公海分析 const dealCycleRef = ref() // 6. 成交周期分析 /** 搜索按钮操作 */ @@ -154,6 +171,9 @@ const handleQuery = () => { case 'conversionStat': // 客户转化率分析 conversionStatRef.value?.loadData?.() break + case 'poolSummary': // 公海客户分析 + poolSummaryRef.value?.loadData?.() + break case 'dealCycle': // 成交周期分析 dealCycleRef.value?.loadData?.() break