From d42ad5e1e10b71ef2714c70e5e5a3afde358a513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E5=A3=AE?= Date: Thu, 21 May 2026 09:47:40 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E5=95=86=E6=9C=BA?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97=EF=BC=8C=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=BA=BF=E7=B4=A2=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BA=E5=95=86?= =?UTF-8?q?=E6=9C=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 商机管理页面: - 实现crmStats真实数据计算(商机总数、金额、本月赢单、转化率) - 添加环比变化率计算功能 - 修复金额字段类型转换问题(字符串转数字) - 完善Pipeline View阶段过滤和列显示 - 添加商机搜索、详情查看、编辑和删除功能 - 后端改造: - 移除线索转化自动创建商机的逻辑(业务流程修正) - 新增经销商选择器API(/crm/dealer/portal/select) - 实现经销商列表查询接口 - 新增50条商机测试数据SQL脚本 Co-Authored-By: Claude Opus 4.7 (1M context) --- hzhub-portal-employee/src/api/crm/index.ts | 16 + hzhub-portal-employee/src/api/crm/types.ts | 43 ++ .../src/pages/opportunity/index.vue | 664 +++++++++++++++++- hzhub-system/sql/test_opportunity_data.sql | 121 ++++ .../crm/controller/CrmDealerController.java | 36 + .../hzhub/crm/service/ICrmDealerService.java | 10 + .../service/impl/CrmDealerServiceImpl.java | 14 + .../crm/service/impl/CrmLeadServiceImpl.java | 14 +- 8 files changed, 888 insertions(+), 30 deletions(-) create mode 100644 hzhub-system/sql/test_opportunity_data.sql create mode 100644 hzhub-system/src/main/java/org/hzhub/crm/controller/CrmDealerController.java diff --git a/hzhub-portal-employee/src/api/crm/index.ts b/hzhub-portal-employee/src/api/crm/index.ts index ea3b6b7..552d7dd 100644 --- a/hzhub-portal-employee/src/api/crm/index.ts +++ b/hzhub-portal-employee/src/api/crm/index.ts @@ -5,6 +5,7 @@ */ import type { + CrmDealerVo, CrmLeadBo, CrmLeadFollowBo, CrmLeadFollowVo, @@ -21,6 +22,7 @@ import type { // 导出类型供外部使用 export type { + CrmDealerVo, CrmLeadBo, CrmLeadFollowBo, CrmLeadFollowVo, @@ -139,3 +141,17 @@ export function updateOpportunity(data: CrmOpportunityBo): Promise> { export function deleteOpportunity(opportunityIds: string): Promise> { return request.delete(`/crm/opportunity/${opportunityIds}`).json(); } + +/** + * ======================================== + * CRM 经销商管理模块 API 调用 + * ======================================== + */ + +/** + * 获取经销商选择器列表 + * 用于商机创建、商机分配等场景 + */ +export function getDealerSelectList(keyword?: string): Promise> { + return request.get('/crm/dealer/portal/select', { keyword }).json(); +} diff --git a/hzhub-portal-employee/src/api/crm/types.ts b/hzhub-portal-employee/src/api/crm/types.ts index 28e89d8..b520fd7 100644 --- a/hzhub-portal-employee/src/api/crm/types.ts +++ b/hzhub-portal-employee/src/api/crm/types.ts @@ -217,4 +217,47 @@ export interface TableDataInfo { msg: string; rows: T[]; total: number; +} + +/** + * ======================================== + * CRM 经销商管理模块类型定义 + * ======================================== + */ + +/** + * 经销商视图对象(响应) + */ +export interface CrmDealerVo { + dealerId: number; + tenantId: string; + customerCode?: string; // ERP客户编码 + dealerName: string; // 经销商名称 + dealerCode: string; // 经销商编码 + contactName?: string; // 联系人 + mobile?: string; // 手机 + province?: string; // 省 + city?: string; // 市 + level?: string; // 等级(A/B/C) + levelName?: string; // 等级名称(翻译) + lifecycle?: string; // 生命周期 + lifecycleName?: string; // 生命周期名称(翻译) + signedAt?: string; // 签约时间 + storeCount?: number; // 门店数 + teamSize?: number; // 团队规模 + totalOrderAmount?: number; // 累计订单金额 + totalPaymentAmount?: number; // 累计回款金额 + activityScore?: number; // 活跃评分 + riskScore?: number; // 风险评分 + ownerUserId?: number; // 负责人 + ownerUserName?: string; // 负责人姓名(翻译) + sourceLeadId?: number; // 来源线索ID + status?: string; // 状态 + statusName?: string; // 状态名称(翻译) + createBy: number; + createByName?: string; + createTime: string; + updateBy?: number; + updateByName?: string; + updateTime?: string; } \ No newline at end of file diff --git a/hzhub-portal-employee/src/pages/opportunity/index.vue b/hzhub-portal-employee/src/pages/opportunity/index.vue index c4703ba..d0b1254 100644 --- a/hzhub-portal-employee/src/pages/opportunity/index.vue +++ b/hzhub-portal-employee/src/pages/opportunity/index.vue @@ -1,18 +1,125 @@