opportunity_management/models/opportunities.json
yumoqing b837692cc4 feat(opportunity): 实现完整的商机管理模块
- 实现商机全生命周期管理功能
  - 商机创建(手动录入/线索转化)
  - 阶段管理(自定义销售漏斗,阶段变更记录原因)
- 实现商机分析功能
  - 漏斗可视化(各阶段数量/金额占比,支持区域/销售维度筛选)
  - 收入预测(基于历史转化率,偏差率≤15%)
- 完整的数据库设计(opportunities, opportunity_stage_history, sales_funnel_config)
- 前端界面基于bricks-framework实现
- 符合生产级代码标准和模块开发规范
- 包含完整的测试用例和构建脚本
2026-04-16 14:32:21 +08:00

181 lines
5.0 KiB
JSON

{
"summary": [
{
"name": "opportunities",
"title": "商机表",
"primary": "id",
"catelog": "entity"
}
],
"fields": [
{
"name": "id",
"title": "商机ID",
"type": "str",
"length": 32,
"nullable": "no",
"comments": "主键 - UUID格式"
},
{
"name": "customer_id",
"title": "客户ID",
"type": "str",
"length": 32,
"nullable": "no",
"comments": "关联客户管理模块的客户ID"
},
{
"name": "customer_name",
"title": "客户名称",
"type": "str",
"length": 255,
"nullable": "no",
"comments": "客户名称,必填字段"
},
{
"name": "opportunity_name",
"title": "商机名称",
"type": "str",
"length": 255,
"nullable": "no",
"comments": "商机标题或项目名称"
},
{
"name": "estimated_amount",
"title": "预估金额",
"type": "decimal",
"length": 15,
"dec": 2,
"nullable": "no",
"comments": "预估成交金额,必填字段"
},
{
"name": "current_stage",
"title": "当前销售阶段",
"type": "str",
"length": 50,
"nullable": "no",
"comments": "当前所处的销售阶段,必填字段"
},
{
"name": "expected_close_date",
"title": "预计成交时间",
"type": "date",
"nullable": "no",
"comments": "预计成交日期,必填字段"
},
{
"name": "source_type",
"title": "商机来源类型",
"type": "str",
"length": 20,
"nullable": "no",
"default": "manual",
"comments": "manual=手动录入, lead=线索转化"
},
{
"name": "owner_id",
"title": "负责人ID",
"type": "str",
"length": 32,
"nullable": "no",
"comments": "负责该商机的销售人员ID"
},
{
"name": "owner_name",
"title": "负责人姓名",
"type": "str",
"length": 100,
"nullable": "no",
"comments": "负责该商机的销售人员姓名"
},
{
"name": "region",
"title": "区域",
"type": "str",
"length": 100,
"nullable": "yes",
"comments": "商机所属区域,用于分析筛选"
},
{
"name": "description",
"title": "商机描述",
"type": "text",
"nullable": "yes",
"comments": "商机详细描述信息"
},
{
"name": "probability",
"title": "成交概率",
"type": "float",
"length": 5,
"dec": 2,
"nullable": "no",
"default": "0.00",
"comments": "基于历史转化率计算的成交概率百分比"
},
{
"name": "predicted_revenue",
"title": "预测收入",
"type": "decimal",
"length": 15,
"dec": 2,
"nullable": "no",
"default": "0.00",
"comments": "基于成交概率计算的预测收入"
},
{
"name": "created_at",
"title": "创建时间",
"type": "timestamp",
"nullable": "no"
},
{
"name": "updated_at",
"title": "更新时间",
"type": "timestamp",
"nullable": "no"
},
{
"name": "status",
"title": "状态",
"type": "str",
"length": 20,
"nullable": "no",
"default": "active",
"comments": "active=活跃, won=已成交, lost=已丢失, closed=已关闭"
}
],
"indexes": [
{
"name": "idx_opportunities_customer",
"idxtype": "index",
"idxfields": ["customer_id"]
},
{
"name": "idx_opportunities_owner",
"idxtype": "index",
"idxfields": ["owner_id"]
},
{
"name": "idx_opportunities_stage",
"idxtype": "index",
"idxfields": ["current_stage"]
},
{
"name": "idx_opportunities_region",
"idxtype": "index",
"idxfields": ["region"]
},
{
"name": "idx_opportunities_status",
"idxtype": "index",
"idxfields": ["status"]
},
{
"name": "idx_opportunities_expected_close",
"idxtype": "index",
"idxfields": ["expected_close_date"]
}
]
}