feat: 生产订单支持一次多选 BOM 且各 BOM 独立设置生产数量

- 新增中间表 prod_order_bom(order_id, bom_id, qty),一个订单可挂多个 BOM,每个 BOM 单独设生产数量
- prod_order.qty 改为各 BOM 数量汇总,bom_id 仅作主 BOM 冗余摘要
- 物料需求按 Σ(BOM 单套用量 × 各自生产数量) 跨 BOM 合并聚合,覆盖详情/领料/调入/导出
- 订单表单改为动态多行(BOM 下拉 + 数量输入 + 删除行),列表与导出展示「BOM清单(型号×数量)」
- 导出 Excel 增至 3 个 sheet:订单信息 / BOM清单 / 领料明细
- 修复 _parse_bom_pairs 表单字段名 bom_id[]/qty[] 解析;order_delete 一并级联删除 prod_order_bom
- build_exe.py 增加构建后自动拷贝 dist_pkg→dist(EXE 同目录即数据库所在)

Co-Authored-By: WorkBuddy <workbuddy@tencent.com>
This commit is contained in:
2026-10-26 10:24:25 +08:00
co-authored by WorkBuddy
parent 099496dec9
commit 93f3ef458b
7 changed files with 279 additions and 121 deletions
+11 -1
View File
@@ -32,4 +32,14 @@ args = [
]
print("PyInstaller args:", args)
run(args)
print("BUILD DONE ->", os.path.join(HERE, "dist", "MaterialWMS.exe"))
# 构建产物在 dist_pkg/; 统一拷贝到 dist/ (EXE 同目录即数据库所在, 才是实际发布入口)
built = os.path.join(HERE, "dist_pkg", "MaterialWMS.exe")
target = os.path.join(HERE, "dist", "MaterialWMS.exe")
if os.path.exists(built):
import shutil
os.makedirs(os.path.dirname(target), exist_ok=True)
shutil.copyfile(built, target)
print("COPIED ->", target)
else:
print("WARN: built exe not found at", built)
print("BUILD DONE ->", target)