Files
shanxia2.0/docs/crm-migration/plans/opportunity/01-overview.md
T
2026-06-01 08:21:21 +08:00

54 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 商机管理模块迁移方案 — 01 概述
> **编写日期**:2026-05-31
> **状态**:实施中
---
## 迁移目标
将原 CRM(`shanxia/crm`)的 **商机管理** 能力完整移植到 shanxia2.0,行为以 Java 实现为准,UI 对齐 Fresh Mint 规范。
## 迁移范围
| 子模块 | 原 CRM 入口 | 说明 |
|--------|-------------|------|
| 商机列表 | `crm/opportunity/index.vue` | 我的/全部视图、筛选、批量操作、列设置 |
| 商机详情 | `crm/opportunity/detail.vue` + `OpportunityDetailDrawer.vue` | 详情页与抽屉 |
| 商机表单 | `components/OpportunityForm.vue` | 新增/编辑 |
| 阶段/赢输单 | `ChangeStageDialog` / `MarkWonDialog` / `MarkLostDialog` | 状态流转 |
| 跟进 | `FollowDialog.vue` | 商机跟进记录 |
| 批量操作 | `BatchUpdateStageDialog` / `BatchUpdateDateDialog` | 批量改阶段/日期 |
| 看板 | `kanban.vue` | 按阶段分列 |
| 漏斗 | `funnel.vue` | 销售漏斗 |
| 统计 | `statistics.vue` | 统计图表 |
## 涉及数据库表
| 表名 | 说明 |
|------|------|
| `crm_opportunity` | 商机主表(门户已有简化版,需增量补字段) |
| `crm_opportunity_follow` | 跟进记录 |
| `crm_opportunity_product` | 商机产品 |
| `crm_opportunity_stage_log` | 阶段变更日志 |
字典已在 `shanxia2.0.sql`:`crm_opportunity_stage`、`crm_opportunity_status`、`crm_opportunity_follow_type`、`crm_opportunity_change_type`、`crm_opportunity_source`。
## 当前 shanxia2.0 状态
| 层级 | 状态 | 处理策略 |
|------|------|----------|
| 前端页面 | 已从原 CRM 拷贝 | step-03 UI 适配 + API 改 POST |
| 前端 API | 门户 stub 版 | 按 clue 模式重写 index.ts |
| 后端 | 仅 list 接口 | 对照 Java 全量重写 |
| DDL | 主表缺字段 + 3 张关联表缺失 | `incremental_crm_opportunity.sql` |
## 原 CRM 源码位置
| 类型 | 路径 |
|------|------|
| 前端 | `shanxia/crm/web/src/views/crm/opportunity/` |
| 前端 API | `shanxia/crm/web/src/api/crm/opportunity/` |
| Java Controller | `CrmOpportunityController.java` 等 |
| Java Service | `CrmOpportunityServiceImpl.java` 等 |