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 @@