57 lines
2.5 KiB
Markdown
57 lines
2.5 KiB
Markdown
# 报价单管理 — 04 API 规格
|
||
|
||
> 门户:`POST /web/crm/quote/*`(分享公开:`GET /api/public/crm/quote/share/{shareCode}`)
|
||
> Java 快照:`reference/java/quote/`
|
||
> **状态**:P2 后端 ✅(2026-05-31)
|
||
|
||
## 1. 报价单主接口
|
||
|
||
| # | 门户目标 | Python | 状态 |
|
||
|---|----------|--------|------|
|
||
| 1 | POST `.../list` | `list_quotes` | ✅ |
|
||
| 2 | POST `.../detail` | `get_quote_detail` | ✅ |
|
||
| 3 | POST `.../add` | `create_quote` | ✅ |
|
||
| 4 | POST `.../update` | `update_quote` | ✅ |
|
||
| 5 | POST `.../delete` | `soft_delete_quotes` | ✅ |
|
||
| 6 | POST `.../submit` | `submit_quote` | ✅ |
|
||
| 7 | POST `.../saveTemplate` | `save_template` | ✅ |
|
||
| 8 | POST `.../getTemplate` | `get_template` | ✅ |
|
||
| 9 | POST `.../generatePdf` | `generate_pdf` | ✅ |
|
||
| 10 | POST `.../generateShare` | `generate_share` | ✅ |
|
||
| 11 | GET `/api/public/crm/quote/share/{shareCode}` | `view_by_share_code` | ✅ |
|
||
| 12 | POST `.../accept` | `accept_quote` | ✅ |
|
||
| 13 | POST `.../reject` | `reject_quote` | ✅ |
|
||
| 14 | POST `.../toContract` | `to_contract` | ✅ |
|
||
| 15 | POST `.../newVersion` | `create_new_version` | ✅ |
|
||
| 16 | POST `.../versions` | `query_versions` | ✅ |
|
||
| 17 | POST `.../export` | `QUOTE_EXPORT_COLUMNS` | ✅ |
|
||
| 18 | POST `.../statistics/overview` | `statistics_overview` | ✅ |
|
||
| 19 | POST `.../statistics/status` | `statistics_status` | ✅ |
|
||
| 20 | POST `.../statistics/trend` | `statistics_trend` | ✅ |
|
||
| 22 | POST `.../invalid` | `invalid_quote` | ✅ |
|
||
|
||
## 2. 产品 / 审批 / 分享日志
|
||
|
||
| 模块 | 门户 | Python | 状态 |
|
||
|------|------|--------|------|
|
||
| 产品 list/add/update/delete | `.../product/*` | `quote_product.py` | ✅ |
|
||
| 审批 list/approve/withdraw/refreshNames | `.../approval/*` | `quote_approval.py` | ✅ |
|
||
| 分享日志 list/statistics | `.../shareLog/*` | `quote_share_log.py` | ✅ |
|
||
|
||
## DDL
|
||
|
||
`docs/sql/incremental_crm_quote.sql` — **部署库须手动执行**(依赖 P0 供方、P1 合同 create 已执行更佳)。
|
||
|
||
## 源码
|
||
|
||
| 层 | 路径 |
|
||
|----|------|
|
||
| CRUD 主逻辑 | `backend/app/crud/crm/quote.py` |
|
||
| 产品明细 | `backend/app/crud/crm/quote_product.py` |
|
||
| 审批 | `backend/app/crud/crm/quote_approval.py` |
|
||
| 分享日志 | `backend/app/crud/crm/quote_share_log.py` |
|
||
| PDF | `backend/app/services/crm_quote_pdf.py` |
|
||
| 产品 ID 解析 | `backend/app/crud/crm/product.py` → `resolve_product_id_for_quote_item` |
|
||
| API | `backend/app/api/crm_quote_routes.py` |
|
||
| Schema | `backend/app/schemas/crm/quote.py` |
|