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

177 lines
7.8 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "TabPanel",
"options": {
"tabs": [
{
"title": "商机列表",
"id": "opportunities_tab"
},
{
"title": "销售阶段配置",
"id": "stages_tab"
},
{
"title": "商机分析",
"id": "analysis_tab"
}
]
},
"subwidgets": [
{
"id": "opportunities_tab_content",
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "DataGrid",
"options": {
"url": "{{entire_url('opportunities.json')}}",
"height": "100%",
"width": "100%",
"toolbar": true,
"search": true,
"export": true
},
"binds": [
{
"wid": "self",
"event": "row_selected",
"actiontype": "script",
"target": "self",
"script": "console.log('Selected opportunity:', event.params);"
}
]
}
]
},
{
"id": "stages_tab_content",
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "DataGrid",
"options": {
"url": "{{entire_url('sales_stages.json')}}",
"height": "100%",
"width": "100%",
"toolbar": true,
"search": false,
"export": true
}
}
]
},
{
"id": "analysis_tab_content",
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "50px"
},
"subwidgets": [
{
"widgettype": "Form",
"options": {
"fields": [
{
"uitype": "str",
"name": "region_filter",
"label": "区域筛选",
"placeholder": "选择区域"
},
{
"uitype": "str",
"name": "owner_filter",
"label": "销售筛选",
"placeholder": "选择销售人员"
},
{
"uitype": "button",
"name": "apply_filter",
"label": "应用筛选"
}
],
"inline": true
},
"binds": [
{
"wid": "apply_filter",
"event": "click",
"actiontype": "script",
"target": "self",
"script": "const region = document.querySelector('[name=\"region_filter\"]').value;\nconst owner = document.querySelector('[name=\"owner_filter\"]').value;\n// 这里会触发漏斗图和预测数据的更新\nconsole.log('Applying filters:', {region, owner});"
}
]
}
]
},
{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "calc(100% - 60px)"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "50%"
},
"subwidgets": [
{
"widgettype": "Pie",
"options": {
"title": "各阶段商机数量占比",
"dataurl": "/api/opportunity/stage-counts",
"datamethod": "GET"
}
},
{
"widgettype": "Bar",
"options": {
"title": "各阶段商机金额占比",
"dataurl": "/api/opportunity/stage-amounts",
"datamethod": "GET"
}
}
]
},
{
"widgettype": "Line",
"options": {
"title": "成交预测 vs 实际成交",
"dataurl": "/api/opportunity/prediction-accuracy",
"datamethod": "GET",
"height": "50%"
}
}
]
}
]
}
]
}
]
}