Files
Inventory-Management-System/templates/order_form.html
T
star 5060d027e5 feat: 多工厂/厂间调拨/替代料/流水台账折叠 + 重写 README
- 多工厂(factory 表) + 顶栏工厂下拉过滤, 库存按厂聚合
- 厂间调拨(transfer): 源厂减+目标厂加, 总库存不变, 双向流水对账
- 替代料关系(substitute): 出库/BOM领料/生产领料缺料时提示可替代料
- 流水台账(ledger): 入出按日期合并折叠, 按日期导出同一 Excel
- 生产订单增强: 编辑/删除(级联清关联流水)/调入数量/确认调入=厂间调拨
- 入库新增送货日期字段; 出库物料编码扫码定位
- 重写 README 补全全部模块; .gitignore 排除 dist_pkg/build_pkg/*.db
- 停止跟踪 instance/app.db(运行时自动生成)
2026-09-29 11:17:48 +08:00

34 lines
1.7 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ '编辑生产订单' if o else '新建生产订单' }}{% endblock %}
{% block content %}
<form method="post" class="card form-card" style="max-width:520px"
action="{{ url_for('order_edit', oid=o.id) if o else url_for('order_new') }}">
<h3>{{ '编辑生产订单' if o else '新建生产订单' }}</h3>
<label>订单号 {% if o %}(单号不可重复){% else %}(留空自动生成){% endif %}</label>
<input name="order_no" value="{{ o.order_no if o else '' }}" placeholder="如 WO20260911xxx">
<label>BOM 型号 *</label>
<select name="bom_id" required>
<option value="">-- 选择 BOM --</option>
{% for b in boms %}
<option value="{{ b.id }}" {% if o and o.bom_id == b.id %}selected{% endif %}>{{ b.code }} ({{ b.name or '-' }})</option>
{% endfor %}
</select>
<label>接单量 (台/套) *</label>
<input name="qty" type="number" step="0.01" min="0.01" required value="{{ '%.2f'|format(o.qty) if o else '' }}">
<label>生产工厂</label>
<select name="factory_id">
<option value="">-- 不指定(汇总库存校验)--</option>
{% for f in factories %}
<option value="{{ f.id }}" {% if o and o.factory_id == f.id %}selected{% endif %}>{{ f.code }} · {{ f.name }}</option>
{% endfor %}
</select>
<label>备注</label>
<input name="remark" value="{{ o.remark if o else '' }}" placeholder="选填">
<div class="row-actions">
<button class="primary">{{ '保存修改' if o else '生成订单' }}</button>
<a class="btn" href="{{ url_for('orders') }}">取消</a>
</div>
<p class="small muted">生成后可在订单详情页按 BOM 展开领料需求, 并手动录入每个物料的「调入数量」。</p>
</form>
{% endblock %}