From 64af029c86fd0f5f29237be11f7d58c9ba8aca7a Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 11 Apr 2024 15:25:48 +0800 Subject: [PATCH 1/4] =?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 --- .env.local => .env.local-dev | 0 package.json | 6 ++--- src/components/DictSelect/src/DictSelect.vue | 1 - ... => CrmStatisticsPortraitCustomerArea.vue} | 24 +++++++++---------- ...CrmStatisticsPortraitCustomerIndustry.vue} | 7 +++--- ...=> CrmStatisticsPortraitCustomerLevel.vue} | 8 +++---- ...> CrmStatisticsPortraitCustomerSource.vue} | 7 +++--- src/views/crm/statistics/portrait/index.vue | 17 +++++++------ 8 files changed, 34 insertions(+), 36 deletions(-) rename .env.local => .env.local-dev (100%) rename src/views/crm/statistics/portrait/components/{CustomerAddress.vue => CrmStatisticsPortraitCustomerArea.vue} (88%) rename src/views/crm/statistics/portrait/components/{CustomerIndustry.vue => CrmStatisticsPortraitCustomerIndustry.vue} (95%) rename src/views/crm/statistics/portrait/components/{CustomerLevel.vue => CrmStatisticsPortraitCustomerLevel.vue} (94%) rename src/views/crm/statistics/portrait/components/{CustomerSource.vue => CrmStatisticsPortraitCustomerSource.vue} (95%) diff --git a/.env.local b/.env.local-dev similarity index 100% rename from .env.local rename to .env.local-dev diff --git a/package.json b/package.json index 58460358..8fa4e871 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "private": false, "scripts": { "i": "pnpm install", - "dev": "vite --mode local-dev", + "local-server": "vite --mode local-dev", "dev-server": "vite --mode dev", "ts:check": "vue-tsc --noEmit", - "build:local-dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode local-dev", - "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode local-dev", + "build:local": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode local-dev", + "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode dev", "build:test": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode test", "build:stage": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode stage", "build:prod": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode prod", diff --git a/src/components/DictSelect/src/DictSelect.vue b/src/components/DictSelect/src/DictSelect.vue index 54279cec..2d59e23c 100644 --- a/src/components/DictSelect/src/DictSelect.vue +++ b/src/components/DictSelect/src/DictSelect.vue @@ -33,7 +33,6 @@ import { getBoolDictOptions, getIntDictOptions, getStrDictOptions } from '@/util // 接受父组件参数 interface Props { - modelValue?: any // 值 dictType: string // 字典类型 valueType: string // 字典值类型 } diff --git a/src/views/crm/statistics/portrait/components/CustomerAddress.vue b/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerArea.vue similarity index 88% rename from src/views/crm/statistics/portrait/components/CustomerAddress.vue rename to src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerArea.vue index f31c7963..1b5b3b30 100644 --- a/src/views/crm/statistics/portrait/components/CustomerAddress.vue +++ b/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerArea.vue @@ -25,8 +25,7 @@ import { StatisticsPortraitApi } from '@/api/crm/statistics/portrait' -// TODO @puhui999:address 换成 area 会更合适哈, -defineOptions({ name: 'CustomerAddress' }) +defineOptions({ name: 'CustomerArea' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 // 注册地图 @@ -107,22 +106,21 @@ const loadData = async () => { areaStatisticsList.value = areaList.map((item: CrmStatisticCustomerAreaRespVO) => { return { ...item, - areaName: item.areaName // TODO @puhui999:这里最好注释下原因哈 - .replace('维吾尔自治区', '') - .replace('壮族自治区', '') - .replace('回族自治区', '') - .replace('自治区', '') - .replace('省', '') + areaName: item.areaName // TODO @puhui999:这里最好注释下原因哈, 🤣 我从 mall copy 过来的 + // .replace('维吾尔自治区', '') + // .replace('壮族自治区', '') + // .replace('回族自治区', '') + // .replace('自治区', '') + // .replace('省', '') } }) - builderLeftMap() - builderRightMap() + buildLeftMap() + buildRightMap() loading.value = false } defineExpose({ loadData }) -// TODO @puhui999:builder 改成 build 更合理哈 -const builderLeftMap = () => { +const buildLeftMap = () => { let min = 0 let max = 0 echartsOption.series![0].data = areaStatisticsList.value.map((item) => { @@ -134,7 +132,7 @@ const builderLeftMap = () => { echartsOption.visualMap!['max'] = max } -const builderRightMap = () => { +const buildRightMap = () => { let min = 0 let max = 0 echartsOption2.series![0].data = areaStatisticsList.value.map((item) => { diff --git a/src/views/crm/statistics/portrait/components/CustomerIndustry.vue b/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerIndustry.vue similarity index 95% rename from src/views/crm/statistics/portrait/components/CustomerIndustry.vue rename to src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerIndustry.vue index d1f3c173..f41fdd9c 100644 --- a/src/views/crm/statistics/portrait/components/CustomerIndustry.vue +++ b/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerIndustry.vue @@ -39,7 +39,7 @@ import { } from '@/api/crm/statistics/portrait' import { EChartsOption } from 'echarts' import { DICT_TYPE, getDictLabel } from '@/utils/dict' -import { getSumValue } from '@/utils' +import { erpCalculatePercentage, getSumValue } from '@/utils' import { isEmpty } from '@/utils/is' defineOptions({ name: 'CustomerIndustry' }) @@ -185,8 +185,9 @@ const calculateProportion = (sourceList: CrmStatisticCustomerIndustryRespVO[]) = const sumDealCount = getSumValue(list.map((item) => item.dealCount)) list.forEach((item) => { item.industryPortion = - item.customerCount === 0 ? 0 : ((item.customerCount / sumCustomerCount) * 100).toFixed(2) - item.dealPortion = item.dealCount === 0 ? 0 : ((item.dealCount / sumDealCount) * 100).toFixed(2) + item.customerCount === 0 ? 0 : erpCalculatePercentage(item.customerCount, sumCustomerCount) + item.dealPortion = + item.dealCount === 0 ? 0 : erpCalculatePercentage(item.dealCount, sumDealCount) }) } diff --git a/src/views/crm/statistics/portrait/components/CustomerLevel.vue b/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerLevel.vue similarity index 94% rename from src/views/crm/statistics/portrait/components/CustomerLevel.vue rename to src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerLevel.vue index 2f81c0fc..3025ae8b 100644 --- a/src/views/crm/statistics/portrait/components/CustomerLevel.vue +++ b/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerLevel.vue @@ -39,7 +39,7 @@ import { } from '@/api/crm/statistics/portrait' import { EChartsOption } from 'echarts' import { DICT_TYPE, getDictLabel } from '@/utils/dict' -import { getSumValue } from '@/utils' +import { erpCalculatePercentage, getSumValue } from '@/utils' import { isEmpty } from '@/utils/is' defineOptions({ name: 'CustomerSource' }) @@ -184,10 +184,10 @@ const calculateProportion = (levelList: CrmStatisticCustomerLevelRespVO[]) => { const sumCustomerCount = getSumValue(list.map((item) => item.customerCount)) const sumDealCount = getSumValue(list.map((item) => item.dealCount)) list.forEach((item) => { - // TODO @puhui999:可以使用 erpCalculatePercentage 方法 item.levelPortion = - item.customerCount === 0 ? 0 : ((item.customerCount / sumCustomerCount) * 100).toFixed(2) - item.dealPortion = item.dealCount === 0 ? 0 : ((item.dealCount / sumDealCount) * 100).toFixed(2) + item.customerCount === 0 ? 0 : erpCalculatePercentage(item.customerCount, sumCustomerCount) + item.dealPortion = + item.dealCount === 0 ? 0 : erpCalculatePercentage(item.dealCount, sumDealCount) }) } diff --git a/src/views/crm/statistics/portrait/components/CustomerSource.vue b/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerSource.vue similarity index 95% rename from src/views/crm/statistics/portrait/components/CustomerSource.vue rename to src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerSource.vue index af1708fc..2bbc7c2e 100644 --- a/src/views/crm/statistics/portrait/components/CustomerSource.vue +++ b/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerSource.vue @@ -40,7 +40,7 @@ import { import { EChartsOption } from 'echarts' import { DICT_TYPE, getDictLabel } from '@/utils/dict' import { isEmpty } from '@/utils/is' -import { getSumValue } from '@/utils' +import { erpCalculatePercentage, getSumValue } from '@/utils' defineOptions({ name: 'CustomerSource' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 @@ -185,8 +185,9 @@ const calculateProportion = (sourceList: CrmStatisticCustomerSourceRespVO[]) => const sumDealCount = getSumValue(list.map((item) => item.dealCount)) list.forEach((item) => { item.sourcePortion = - item.customerCount === 0 ? 0 : ((item.customerCount / sumCustomerCount) * 100).toFixed(2) - item.dealPortion = item.dealCount === 0 ? 0 : ((item.dealCount / sumDealCount) * 100).toFixed(2) + item.customerCount === 0 ? 0 : erpCalculatePercentage(item.customerCount, sumCustomerCount) + item.dealPortion = + item.dealCount === 0 ? 0 : erpCalculatePercentage(item.dealCount, sumDealCount) }) } diff --git a/src/views/crm/statistics/portrait/index.vue b/src/views/crm/statistics/portrait/index.vue index 88793837..0cbaf221 100644 --- a/src/views/crm/statistics/portrait/index.vue +++ b/src/views/crm/statistics/portrait/index.vue @@ -61,19 +61,19 @@ - + - + - + - + @@ -85,11 +85,10 @@ import * as UserApi from '@/api/system/user' import { useUserStore } from '@/store/modules/user' import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime' import { defaultProps, handleTree } from '@/utils/tree' -// TODO @puhui999:最好命名带上模块名,如:CrmStatisticsPortrait -import CustomerAddress from './components/CustomerAddress.vue' -import CustomerIndustry from './components/CustomerIndustry.vue' -import CustomerSource from './components/CustomerSource.vue' -import CustomerLevel from './components/CustomerLevel.vue' +import CrmStatisticsPortraitCustomerArea from './components/CrmStatisticsPortraitCustomerArea.vue' +import CrmStatisticsPortraitCustomerIndustry from './components/CrmStatisticsPortraitCustomerIndustry.vue' +import CrmStatisticsPortraitCustomerSource from './components/CrmStatisticsPortraitCustomerSource.vue' +import CrmStatisticsPortraitCustomerLevel from './components/CrmStatisticsPortraitCustomerLevel.vue' defineOptions({ name: 'CrmStatisticsPortrait' }) From 2d7bab8adb561c4ed226301cdf4b006027e41b18 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 13 Apr 2024 11:04:56 +0800 Subject: [PATCH 2/4] =?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 --- ...tomerArea.vue => PortraitCustomerArea.vue} | 2 +- ...ustry.vue => PortraitCustomerIndustry.vue} | 2 +- ...merLevel.vue => PortraitCustomerLevel.vue} | 2 +- ...rSource.vue => PortraitCustomerSource.vue} | 2 +- src/views/crm/statistics/portrait/index.vue | 26 +++++++++---------- 5 files changed, 17 insertions(+), 17 deletions(-) rename src/views/crm/statistics/portrait/components/{CrmStatisticsPortraitCustomerArea.vue => PortraitCustomerArea.vue} (98%) rename src/views/crm/statistics/portrait/components/{CrmStatisticsPortraitCustomerIndustry.vue => PortraitCustomerIndustry.vue} (99%) rename src/views/crm/statistics/portrait/components/{CrmStatisticsPortraitCustomerLevel.vue => PortraitCustomerLevel.vue} (99%) rename src/views/crm/statistics/portrait/components/{CrmStatisticsPortraitCustomerSource.vue => PortraitCustomerSource.vue} (99%) diff --git a/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerArea.vue b/src/views/crm/statistics/portrait/components/PortraitCustomerArea.vue similarity index 98% rename from src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerArea.vue rename to src/views/crm/statistics/portrait/components/PortraitCustomerArea.vue index 1b5b3b30..8ccd52c8 100644 --- a/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerArea.vue +++ b/src/views/crm/statistics/portrait/components/PortraitCustomerArea.vue @@ -25,7 +25,7 @@ import { StatisticsPortraitApi } from '@/api/crm/statistics/portrait' -defineOptions({ name: 'CustomerArea' }) +defineOptions({ name: 'PortraitCustomerArea' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 // 注册地图 diff --git a/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerIndustry.vue b/src/views/crm/statistics/portrait/components/PortraitCustomerIndustry.vue similarity index 99% rename from src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerIndustry.vue rename to src/views/crm/statistics/portrait/components/PortraitCustomerIndustry.vue index f41fdd9c..d4269932 100644 --- a/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerIndustry.vue +++ b/src/views/crm/statistics/portrait/components/PortraitCustomerIndustry.vue @@ -42,7 +42,7 @@ import { DICT_TYPE, getDictLabel } from '@/utils/dict' import { erpCalculatePercentage, getSumValue } from '@/utils' import { isEmpty } from '@/utils/is' -defineOptions({ name: 'CustomerIndustry' }) +defineOptions({ name: 'PortraitCustomerIndustry' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 const loading = ref(false) // 加载中 diff --git a/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerLevel.vue b/src/views/crm/statistics/portrait/components/PortraitCustomerLevel.vue similarity index 99% rename from src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerLevel.vue rename to src/views/crm/statistics/portrait/components/PortraitCustomerLevel.vue index 3025ae8b..653feef8 100644 --- a/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerLevel.vue +++ b/src/views/crm/statistics/portrait/components/PortraitCustomerLevel.vue @@ -42,7 +42,7 @@ import { DICT_TYPE, getDictLabel } from '@/utils/dict' import { erpCalculatePercentage, getSumValue } from '@/utils' import { isEmpty } from '@/utils/is' -defineOptions({ name: 'CustomerSource' }) +defineOptions({ name: 'PortraitCustomerLevel' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 const loading = ref(false) // 加载中 diff --git a/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerSource.vue b/src/views/crm/statistics/portrait/components/PortraitCustomerSource.vue similarity index 99% rename from src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerSource.vue rename to src/views/crm/statistics/portrait/components/PortraitCustomerSource.vue index 2bbc7c2e..ade6445d 100644 --- a/src/views/crm/statistics/portrait/components/CrmStatisticsPortraitCustomerSource.vue +++ b/src/views/crm/statistics/portrait/components/PortraitCustomerSource.vue @@ -42,7 +42,7 @@ import { DICT_TYPE, getDictLabel } from '@/utils/dict' import { isEmpty } from '@/utils/is' import { erpCalculatePercentage, getSumValue } from '@/utils' -defineOptions({ name: 'CustomerSource' }) +defineOptions({ name: 'PortraitCustomerSource' }) const props = defineProps<{ queryParams: any }>() // 搜索参数 const loading = ref(false) // 加载中 diff --git a/src/views/crm/statistics/portrait/index.vue b/src/views/crm/statistics/portrait/index.vue index 0cbaf221..71807e17 100644 --- a/src/views/crm/statistics/portrait/index.vue +++ b/src/views/crm/statistics/portrait/index.vue @@ -60,20 +60,20 @@ - - + + - + - + - + @@ -85,10 +85,10 @@ import * as UserApi from '@/api/system/user' import { useUserStore } from '@/store/modules/user' import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime' import { defaultProps, handleTree } from '@/utils/tree' -import CrmStatisticsPortraitCustomerArea from './components/CrmStatisticsPortraitCustomerArea.vue' -import CrmStatisticsPortraitCustomerIndustry from './components/CrmStatisticsPortraitCustomerIndustry.vue' -import CrmStatisticsPortraitCustomerSource from './components/CrmStatisticsPortraitCustomerSource.vue' -import CrmStatisticsPortraitCustomerLevel from './components/CrmStatisticsPortraitCustomerLevel.vue' +import PortraitCustomerArea from './components/PortraitCustomerArea.vue' +import PortraitCustomerIndustry from './components/PortraitCustomerIndustry.vue' +import PortraitCustomerSource from './components/PortraitCustomerSource.vue' +import PortraitCustomerLevel from './components/PortraitCustomerLevel.vue' defineOptions({ name: 'CrmStatisticsPortrait' }) @@ -113,8 +113,8 @@ const userListByDeptId = computed(() => : [] ) -const activeTab = ref('addressRef') // 活跃标签 -const addressRef = ref() // 客户地区分布 +const activeTab = ref('areaRef') // 活跃标签 +const areaRef = ref() // 客户地区分布 const levelRef = ref() // 客户级别 const sourceRef = ref() // 客户来源 const industryRef = ref() // 客户行业 @@ -122,8 +122,8 @@ const industryRef = ref() // 客户行业 /** 搜索按钮操作 */ const handleQuery = () => { switch (activeTab.value) { - case 'addressRef': - addressRef.value?.loadData?.() + case 'areaRef': + areaRef.value?.loadData?.() break case 'levelRef': levelRef.value?.loadData?.() From 3c49ed570a2957d9f8bbda67383f2f3fbdfef7b2 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 14 Apr 2024 00:34:33 +0800 Subject: [PATCH 3/4] =?UTF-8?q?CRM:=20=E5=AE=8C=E5=96=84=E9=94=80=E5=94=AE?= =?UTF-8?q?=E6=BC=8F=E6=96=97=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 | 25 ++++ src/utils/dict.ts | 13 +- .../funnel/components/FunnelBusiness.vue | 135 +++++++++++++++++ src/views/crm/statistics/funnel/index.vue | 138 ++++++++++++++++++ 4 files changed, 305 insertions(+), 6 deletions(-) create mode 100644 src/api/crm/statistics/funnel.ts create mode 100644 src/views/crm/statistics/funnel/components/FunnelBusiness.vue create mode 100644 src/views/crm/statistics/funnel/index.vue diff --git a/src/api/crm/statistics/funnel.ts b/src/api/crm/statistics/funnel.ts new file mode 100644 index 00000000..91093c35 --- /dev/null +++ b/src/api/crm/statistics/funnel.ts @@ -0,0 +1,25 @@ +import request from '@/config/axios' + +export interface CrmStatisticFunnelRespVO { + customerCount: number // 客户数 + businessCount: number // 商机数 + winCount: number // 赢单数 +} + +// 客户分析 API +export const StatisticFunnelApi = { + // 1. 获取销售漏斗统计数据 + getFunnelSummary: (params: any) => { + return request.get({ + url: '/crm/statistics-funnel/get-funnel-summary', + params + }) + }, + // 2. 获取商机结束状态统计 + getBusinessEndStatusSummary: (params: any) => { + return request.get({ + url: '/crm/statistics-funnel/get-business-end-status-summary', + params + }) + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 6b06aa4c..631a40b0 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -197,14 +197,15 @@ export enum DICT_TYPE { // ========== CRM - 客户管理模块 ========== CRM_AUDIT_STATUS = 'crm_audit_status', // CRM 审批状态 CRM_BIZ_TYPE = 'crm_biz_type', // CRM 业务类型 + CRM_BUSINESS_END_STATUS_TYPE = 'crm_business_end_status_type', // CRM 商机结束状态类型 CRM_RECEIVABLE_RETURN_TYPE = 'crm_receivable_return_type', // CRM 回款的还款方式 - CRM_CUSTOMER_INDUSTRY = 'crm_customer_industry', - CRM_CUSTOMER_LEVEL = 'crm_customer_level', - CRM_CUSTOMER_SOURCE = 'crm_customer_source', - CRM_PRODUCT_STATUS = 'crm_product_status', + CRM_CUSTOMER_INDUSTRY = 'crm_customer_industry', // CRM 客户所属行业 + CRM_CUSTOMER_LEVEL = 'crm_customer_level', // CRM 客户级别 + CRM_CUSTOMER_SOURCE = 'crm_customer_source', // CRM 客户来源 + CRM_PRODUCT_STATUS = 'crm_product_status', // CRM 商品状态 CRM_PERMISSION_LEVEL = 'crm_permission_level', // CRM 数据权限的级别 - CRM_PRODUCT_UNIT = 'crm_product_unit', // 产品单位 - CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type', // 跟进方式 + CRM_PRODUCT_UNIT = 'crm_product_unit', // CRM 产品单位 + CRM_FOLLOW_UP_TYPE = 'crm_follow_up_type', // CRM 跟进方式 // ========== ERP - 企业资源计划模块 ========== ERP_AUDIT_STATUS = 'erp_audit_status', // ERP 审批状态 diff --git a/src/views/crm/statistics/funnel/components/FunnelBusiness.vue b/src/views/crm/statistics/funnel/components/FunnelBusiness.vue new file mode 100644 index 00000000..7579cb64 --- /dev/null +++ b/src/views/crm/statistics/funnel/components/FunnelBusiness.vue @@ -0,0 +1,135 @@ + + + diff --git a/src/views/crm/statistics/funnel/index.vue b/src/views/crm/statistics/funnel/index.vue new file mode 100644 index 00000000..dff2b514 --- /dev/null +++ b/src/views/crm/statistics/funnel/index.vue @@ -0,0 +1,138 @@ + + + + From bc95dc2959b08cf6e3f0e658c24e67af7bfef1d9 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 14 Apr 2024 16:31:43 +0800 Subject: [PATCH 4/4] =?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?.()