opportunity_management/opportunity.json
yumoqing 2547fad996 sync: local modifications to opportunity_management
- Updated core.py, init.py, opportunity_core.py, mysql.ddl.sql
- Updated UI: base.ui, opportunity_management.ui
- Added: opportunity.json, opportunity_stage_history.json
- Added API files: opportunities CRUD, sales_stages_list, check_tables
- Added UI/DSPY: opportunity_edit, opportunity_list, sales_stages_list
2026-04-28 18:54:47 +08:00

121 lines
3.1 KiB
JSON
Raw Permalink 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.

{
"summary": {
"name": "opportunity",
"description": "商机管理表,存储销售机会的全生命周期信息",
"version": "1.0.0"
},
"fields": {
"id": {
"type": "int",
"primary_key": true,
"auto_increment": true,
"description": "商机ID"
},
"org_id": {
"type": "int",
"not_null": true,
"description": "组织ID用于多租户隔离"
},
"customer_id": {
"type": "int",
"not_null": true,
"description": "客户ID关联客户管理模块"
},
"customer_name": {
"type": "varchar(255)",
"not_null": true,
"description": "客户名称"
},
"title": {
"type": "varchar(255)",
"not_null": true,
"description": "商机标题"
},
"estimated_amount": {
"type": "decimal(15,2)",
"not_null": true,
"description": "预估金额"
},
"current_stage": {
"type": "varchar(50)",
"not_null": true,
"default": "'初步接洽'",
"description": "当前销售阶段"
},
"expected_close_date": {
"type": "date",
"not_null": true,
"description": "预计成交时间"
},
"probability": {
"type": "decimal(5,2)",
"not_null": true,
"default": "0.00",
"description": "成交概率(百分比)"
},
"source": {
"type": "varchar(50)",
"not_null": true,
"default": "'manual'",
"description": "商机来源manual手动录入或 lead线索转化"
},
"owner_id": {
"type": "int",
"not_null": true,
"description": "负责人ID"
},
"owner_name": {
"type": "varchar(100)",
"not_null": true,
"description": "负责人姓名"
},
"description": {
"type": "text",
"description": "商机描述"
},
"created_at": {
"type": "datetime",
"not_null": true,
"default": "CURRENT_TIMESTAMP",
"description": "创建时间"
},
"updated_at": {
"type": "datetime",
"not_null": true,
"default": "CURRENT_TIMESTAMP",
"on_update": "CURRENT_TIMESTAMP",
"description": "更新时间"
},
"status": {
"type": "varchar(20)",
"not_null": true,
"default": "'active'",
"description": "状态active活跃、won成交、lost丢单"
}
},
"indexes": {
"idx_org_customer": ["org_id", "customer_id"],
"idx_org_owner": ["org_id", "owner_id"],
"idx_org_stage": ["org_id", "current_stage"],
"idx_org_status": ["org_id", "status"],
"idx_expected_close": ["org_id", "expected_close_date"]
},
"codes": {
"stages": {
"初步接洽": "初步接触客户,了解基本信息",
"需求确认": "深入了解客户需求和痛点",
"方案报价": "提供解决方案和报价",
"合同谈判": "商务条款和合同细节谈判",
"成交": "签订合同,完成交易"
},
"sources": {
"manual": "手动录入",
"lead": "线索转化"
},
"statuses": {
"active": "活跃",
"won": "成交",
"lost": "丢单"
}
}
}