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

67 lines
2.9 KiB
JSON

{
"tblname": "opportunities",
"title": "商机管理",
"params": {
"sortby": ["created_at desc"],
"logined_userid": "owner_id",
"confidential_fields": [],
"editor": {
"binds": [
{
"wid": "estimated_amount",
"event": "changed",
"actiontype": "script",
"target": "predicted_revenue",
"script": "const amount = parseFloat(widget.getValue()) || 0;\nconst probability = parseFloat(document.getElementById('probability')?.value) || 0;\nconst predicted = (amount * probability / 100).toFixed(2);\ndocument.getElementById('predicted_revenue').value = predicted;"
},
{
"wid": "probability",
"event": "changed",
"actiontype": "script",
"target": "predicted_revenue",
"script": "const amount = parseFloat(document.getElementById('estimated_amount')?.value) || 0;\nconst probability = parseFloat(widget.getValue()) || 0;\nconst predicted = (amount * probability / 100).toFixed(2);\ndocument.getElementById('predicted_revenue').value = predicted;"
}
]
},
"browserfields": {
"exclouded": ["id", "customer_id", "owner_id", "created_at", "updated_at"],
"alters": {
"current_stage": {
"uitype": "code",
"data": [
{"value": "初步接洽", "text": "初步接洽"},
{"value": "需求确认", "text": "需求确认"},
{"value": "方案报价", "text": "方案报价"},
{"value": "合同谈判", "text": "合同谈判"},
{"value": "成交", "text": "成交"}
]
},
"source_type": {
"uitype": "code",
"data": [
{"value": "manual", "text": "手动录入"},
{"value": "lead", "text": "线索转化"}
]
},
"status": {
"uitype": "code",
"data": [
{"value": "active", "text": "活跃"},
{"value": "won", "text": "已成交"},
{"value": "lost", "text": "已丢失"},
{"value": "closed", "text": "已关闭"}
]
}
}
},
"editexclouded": ["id", "customer_id", "owner_id", "created_at", "updated_at", "predicted_revenue"],
"subtables": [
{
"field": "opportunity_id",
"title": "阶段变更历史",
"url": "{{entire_url(opportunity_stage_history)}}",
"subtable": "opportunity_stage_history"
}
]
}
}