From bc95dc2959b08cf6e3f0e658c24e67af7bfef1d9 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 14 Apr 2024 16:31:43 +0800 Subject: [PATCH] =?UTF-8?q?CRM:=20=E5=AE=8C=E5=96=84=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=95=86=E6=9C=BA=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/statistics/funnel.ts | 20 ++ src/views/crm/business/index.vue | 84 +++--- .../funnel/components/BusinessSummary.vue | 259 ++++++++++++++++++ src/views/crm/statistics/funnel/index.vue | 43 ++- 4 files changed, 360 insertions(+), 46 deletions(-) create mode 100644 src/views/crm/statistics/funnel/components/BusinessSummary.vue diff --git a/src/api/crm/statistics/funnel.ts b/src/api/crm/statistics/funnel.ts index 91093c35..0ba322b8 100644 --- a/src/api/crm/statistics/funnel.ts +++ b/src/api/crm/statistics/funnel.ts @@ -6,6 +6,12 @@ export interface CrmStatisticFunnelRespVO { winCount: number // 赢单数 } +export interface CrmStatisticsBusinessSummaryByDateRespVO { + time: string // 时间 + businessCreateCount: number // 商机数 + businessDealCount: number // 商机金额 +} + // 客户分析 API export const StatisticFunnelApi = { // 1. 获取销售漏斗统计数据 @@ -21,5 +27,19 @@ export const StatisticFunnelApi = { url: '/crm/statistics-funnel/get-business-end-status-summary', params }) + }, + // 3. 获取新增商机分析(按日期) + getBusinessSummaryByDate: (params: any) => { + return request.get({ + url: '/crm/statistics-funnel/get-business-summary-by-date', + params + }) + }, + // 4. 获取商机列表(按日期) + getBusinessPageByDate: (params: any) => { + return request.get({ + url: '/crm/statistics-funnel/get-business-page-by-date', + params + }) } } diff --git a/src/views/crm/business/index.vue b/src/views/crm/business/index.vue index 793f187c..84e447c0 100644 --- a/src/views/crm/business/index.vue +++ b/src/views/crm/business/index.vue @@ -5,35 +5,43 @@ - 搜索 - 重置 - - 新增 + + + 搜索 + + + + 重置 + + + + 新增 - 导出 + + 导出 @@ -46,8 +54,8 @@ - - + + @@ -97,49 +105,49 @@ width="180px" /> - + - diff --git a/src/views/crm/statistics/funnel/index.vue b/src/views/crm/statistics/funnel/index.vue index dff2b514..b8cddf8d 100644 --- a/src/views/crm/statistics/funnel/index.vue +++ b/src/views/crm/statistics/funnel/index.vue @@ -19,8 +19,24 @@ start-placeholder="开始日期" type="daterange" value-format="YYYY-MM-DD HH:mm:ss" + @change="handleQuery" /> + + + + + - + - 搜索 + 查询 @@ -62,7 +84,9 @@ - + + + @@ -75,10 +99,13 @@ import { useUserStore } from '@/store/modules/user' import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime' import { defaultProps, handleTree } from '@/utils/tree' import FunnelBusiness from './components/FunnelBusiness.vue' +import BusinessSummary from './components/BusinessSummary.vue' +import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' defineOptions({ name: 'CrmStatisticsFunnel' }) const queryParams = reactive({ + interval: 2, // WEEK, 周 deptId: useUserStore().getUser.deptId, userId: undefined, times: [ @@ -100,8 +127,8 @@ const userListByDeptId = computed(() => ) const activeTab = ref('funnelRef') // 活跃标签 -const funnelRef = ref() // 客户地区分布 -const levelRef = ref() // 客户级别 +const funnelRef = ref() // 销售漏斗 +const businessSummaryRef = ref() // 新增商机分析 const sourceRef = ref() // 客户来源 /** 搜索按钮操作 */ @@ -110,8 +137,8 @@ const handleQuery = () => { case 'funnelRef': funnelRef.value?.loadData?.() break - case 'levelRef': - levelRef.value?.loadData?.() + case 'businessSummaryRef': + businessSummaryRef.value?.loadData?.() break case 'sourceRef': sourceRef.value?.loadData?.()