From 36385a74babbfa2ae7b6bdd7e73eaf2b739170c4 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 3 Apr 2024 12:19:09 +0800 Subject: [PATCH] =?UTF-8?q?CRM:=20=E5=AE=8C=E5=96=84=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=94=BB=E5=83=8F=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/statistics/customer.ts | 59 ------- src/api/crm/statistics/portrait.ts | 60 +++++++ src/utils/dict.ts | 2 +- src/views/crm/statistics/customer/index.vue | 78 +++------ .../components/CustomerAddress.vue | 6 +- .../components/CustomerIndustry.vue | 38 ++++- .../components/CustomerLevel.vue | 38 ++++- .../components/CustomerSource.vue | 39 ++++- src/views/crm/statistics/portrait/index.vue | 156 ++++++++++++++++++ 9 files changed, 339 insertions(+), 137 deletions(-) create mode 100644 src/api/crm/statistics/portrait.ts rename src/views/crm/statistics/{customer => portrait}/components/CustomerAddress.vue (96%) rename src/views/crm/statistics/{customer => portrait}/components/CustomerIndustry.vue (74%) rename src/views/crm/statistics/{customer => portrait}/components/CustomerLevel.vue (74%) rename src/views/crm/statistics/{customer => portrait}/components/CustomerSource.vue (74%) create mode 100644 src/views/crm/statistics/portrait/index.vue diff --git a/src/api/crm/statistics/customer.ts b/src/api/crm/statistics/customer.ts index 425264ff..ebb9dfb3 100644 --- a/src/api/crm/statistics/customer.ts +++ b/src/api/crm/statistics/customer.ts @@ -49,36 +49,6 @@ export interface CrmStatisticsCustomerDealCycleByDateRespVO { customerDealCycle: number } -export interface CrmStatisticCustomerBaseRespVO { - customerCount: number - dealCount: number - dealPortion: number -} - -export interface CrmStatisticCustomerIndustryRespVO extends CrmStatisticCustomerBaseRespVO { - industryId: number - industryName: string - industryPortion: number -} - -export interface CrmStatisticCustomerSourceRespVO extends CrmStatisticCustomerBaseRespVO { - source: number - sourceName: string - sourcePortion: number -} - -export interface CrmStatisticCustomerLevelRespVO extends CrmStatisticCustomerBaseRespVO { - level: number - levelName: string - levelPortion: number -} - -export interface CrmStatisticCustomerAreaRespVO extends CrmStatisticCustomerBaseRespVO { - areaId: number - areaName: string - areaPortion: number -} - export interface CrmStatisticsCustomerDealCycleByUserRespVO { ownerUserName: string customerDealCycle: number @@ -142,34 +112,5 @@ export const StatisticsCustomerApi = { url: '/crm/statistics-customer/get-customer-deal-cycle-by-user', params }) - }, - // TODO @puhui999:下面这些拆出去哈; - // 6.1 获取客户行业统计数据 - getCustomerIndustry: (params: any) => { - return request.get({ - url: '/crm/statistics-portrait/get-customer-industry-summary', - params - }) - }, - // 6.1 获取客户来源统计数据 - getCustomerSource: (params: any) => { - return request.get({ - url: '/crm/statistics-portrait/get-customer-source-summary', - params - }) - }, - // 6.1 获取客户行业统计数据 - getCustomerLevel: (params: any) => { - return request.get({ - url: '/crm/statistics-portrait/get-customer-level-summary', - params - }) - }, - // 6.1 获取客户行业统计数据 - getCustomerArea: (params: any) => { - return request.get({ - url: '/crm/statistics-portrait/get-customer-area-summary', - params - }) } } diff --git a/src/api/crm/statistics/portrait.ts b/src/api/crm/statistics/portrait.ts new file mode 100644 index 00000000..c7a25725 --- /dev/null +++ b/src/api/crm/statistics/portrait.ts @@ -0,0 +1,60 @@ +import request from '@/config/axios' + +export interface CrmStatisticCustomerBaseRespVO { + customerCount: number + dealCount: number + dealPortion: string | number +} + +export interface CrmStatisticCustomerIndustryRespVO extends CrmStatisticCustomerBaseRespVO { + industryId: number + industryPortion: string | number +} + +export interface CrmStatisticCustomerSourceRespVO extends CrmStatisticCustomerBaseRespVO { + source: number + sourcePortion: string | number +} + +export interface CrmStatisticCustomerLevelRespVO extends CrmStatisticCustomerBaseRespVO { + level: number + levelPortion: string | number +} + +export interface CrmStatisticCustomerAreaRespVO extends CrmStatisticCustomerBaseRespVO { + areaId: number + areaName: string + areaPortion: string | number +} + +// 客户分析 API +export const StatisticsPortraitApi = { + // 1. 获取客户行业统计数据 + getCustomerIndustry: (params: any) => { + return request.get({ + url: '/crm/statistics-portrait/get-customer-industry-summary', + params + }) + }, + // 2. 获取客户来源统计数据 + getCustomerSource: (params: any) => { + return request.get({ + url: '/crm/statistics-portrait/get-customer-source-summary', + params + }) + }, + // 3. 获取客户级别统计数据 + getCustomerLevel: (params: any) => { + return request.get({ + url: '/crm/statistics-portrait/get-customer-level-summary', + params + }) + }, + // 4. 获取客户地区统计数据 + getCustomerArea: (params: any) => { + return request.get({ + url: '/crm/statistics-portrait/get-customer-area-summary', + params + }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 89f1afd9..a588b9bd 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -137,7 +137,7 @@ export enum DICT_TYPE { INFRA_FILE_STORAGE = 'infra_file_storage', // ========== BPM 模块 ========== - BPM_MODEL_FORM_TYPE = 'bpm_model_category', + BPM_MODEL_FORM_TYPE = 'bpm_model_form_type', BPM_TASK_CANDIDATE_STRATEGY = 'bpm_task_candidate_strategy', BPM_PROCESS_INSTANCE_STATUS = 'bpm_process_instance_status', BPM_TASK_STATUS = 'bpm_task_status', diff --git a/src/views/crm/statistics/customer/index.vue b/src/views/crm/statistics/customer/index.vue index d216a3c8..fe3aa555 100644 --- a/src/views/crm/statistics/customer/index.vue +++ b/src/views/crm/statistics/customer/index.vue @@ -3,22 +3,22 @@ @@ -34,28 +34,34 @@ - + - 搜索 - 重置 + + + 搜索 + + + + 重置 + @@ -64,41 +70,25 @@ - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - @@ -115,10 +105,6 @@ 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 CustomerAddress from './components/CustomerAddress.vue' -import CustomerIndustry from './components/CustomerIndustry.vue' -import CustomerSource from './components/CustomerSource.vue' -import CustomerLevel from './components/CustomerLevel.vue' defineOptions({ name: 'CrmStatisticsCustomer' }) @@ -152,13 +138,6 @@ const conversionStatRef = ref() // 4. 客户转化率分析 // 5. TODO 公海客户分析 // 缺 crm_owner_record 表 TODO @dhb52:可以先做界面 + 接口,接口数据直接写死返回,相当于 mock 出来 const dealCycleRef = ref() // 6. 成交周期分析 -const addressRef = ref() -// 客户级别 -const levelRef = ref() -// 客户来源 -const sourceRef = ref() -// 客户行业 -const industryRef = ref() /** 搜索按钮操作 */ const handleQuery = () => { @@ -178,19 +157,6 @@ const handleQuery = () => { case 'dealCycle': // 成交周期分析 dealCycleRef.value?.loadData?.() break - // TODO @puhui999:这 4 个拆出去哈;独立一个【客户画像】菜单 - case 'addressRef': - addressRef.value?.loadData?.() - break - case 'levelRef': - levelRef.value?.loadData?.() - break - case 'sourceRef': - sourceRef.value?.loadData?.() - break - case 'industryRef': - industryRef.value?.loadData?.() - break } } diff --git a/src/views/crm/statistics/customer/components/CustomerAddress.vue b/src/views/crm/statistics/portrait/components/CustomerAddress.vue similarity index 96% rename from src/views/crm/statistics/customer/components/CustomerAddress.vue rename to src/views/crm/statistics/portrait/components/CustomerAddress.vue index c35638a6..7c23a338 100644 --- a/src/views/crm/statistics/customer/components/CustomerAddress.vue +++ b/src/views/crm/statistics/portrait/components/CustomerAddress.vue @@ -22,8 +22,8 @@ import china from '@/assets/map/json/china.json' import echarts from '@/plugins/echarts' import { CrmStatisticCustomerAreaRespVO, - StatisticsCustomerApi -} from '@/api/crm/statistics/customer' + StatisticsPortraitApi +} from '@/api/crm/statistics/portrait' defineOptions({ name: 'CustomerAddress' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 @@ -102,7 +102,7 @@ const echartsOption2 = reactive({ const loadData = async () => { // 1. 加载统计数据 loading.value = true - const areaList = await StatisticsCustomerApi.getCustomerArea(props.queryParams) + const areaList = await StatisticsPortraitApi.getCustomerArea(props.queryParams) areaStatisticsList.value = areaList.map((item: CrmStatisticCustomerAreaRespVO) => { return { ...item, diff --git a/src/views/crm/statistics/customer/components/CustomerIndustry.vue b/src/views/crm/statistics/portrait/components/CustomerIndustry.vue similarity index 74% rename from src/views/crm/statistics/customer/components/CustomerIndustry.vue rename to src/views/crm/statistics/portrait/components/CustomerIndustry.vue index d505a41b..269c7ce3 100644 --- a/src/views/crm/statistics/customer/components/CustomerIndustry.vue +++ b/src/views/crm/statistics/portrait/components/CustomerIndustry.vue @@ -20,7 +20,11 @@ - + + + @@ -31,9 +35,12 @@