feat: P0-2 订单BOM计算单+Excel导出(openpyxl)

This commit is contained in:
HHY
2026-09-25 03:09:21 -07:00
parent 8c2bb5e12d
commit d5e3cdbede
10 changed files with 247 additions and 1 deletions
+7
View File
@@ -383,3 +383,10 @@ uv run uvicorn huamenchuang.main:app --reload # 启动,http://localhost:8000
| 报价启用脚本 | POST | `/api/offer-price` | 增加 `use_scripts: true` 或 `scripts: {target: formula}` | 响应加 `scripted[]`(被脚本覆盖的项)、`script_total`(总价是否被脚本直取);行级 `scripted` 标记 |
种子示例脚本 5 条:断桥铝-55系列(frame/mullion/sash)、双层中空玻璃(glass)、标准五金(hardware)。
### 12.16 订单 BOM 与导出(v2.20 新增,P0-生产闭环)
| 接口名称 | 方式 | URL 路径 | 请求参数 | 说明 |
|---|---|---|---|---|
| **订单 BOM 单** | GET | `/api/orders/{id}/bom` | 路径 | 对齐目标站 calcbomOrder;返回 `{bars:[{kind,note,length,qty}], glass_area_m2, sash_count, width_mm, height_mm}`(从 drawing_data 重放算料,不含价格) |
| **订单导出 Excel** | GET | `/api/orders/{id}/export` | 路径 | 对齐 orders/export;xlsx(订单信息+BOM 下料清单+玻璃/五金汇总),`Content-Disposition: attachment` |