Files
Inventory-Management-System/templates/orders.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.5 KiB
HTML

{% extends "base.html" %}
{% block title %}生产订单{% endblock %}
{% block content %}
<div class="toolbar">
<h3 style="margin:0">生产订单 ({{ data|length }})</h3>
<a class="btn primary" href="{{ url_for('order_new') }}">+ 新建订单</a>
</div>
<table class="tbl">
<thead><tr><th>订单号</th><th>BOM</th><th>接单量</th><th>生产工厂</th><th>状态</th><th>经手人</th><th>操作</th></tr></thead>
<tbody>
{% for d in data %}
<tr>
<td>{{ d.o.order_no }}</td>
<td>{{ d.bom.code if d.bom else '-' }} ({{ d.bom.name if d.bom else '' }})</td>
<td class="num">{{ '%.2f'|format(d.o.qty) }}</td>
<td>{{ d.factory.code if d.factory else '未指定' }}</td>
<td><span class="badge {{ 'ok' if d.o.status=='picked' else 'warn' }}">{{ '已领料' if d.o.status=='picked' else '待领料' }}</span></td>
<td>{{ d.o.operator or '-' }}</td>
<td class="row-actions">
<a href="{{ url_for('order_detail', oid=d.o.id) }}">查看</a>
<a href="{{ url_for('order_edit', oid=d.o.id) }}">编辑</a>
<form method="post" action="{{ url_for('order_delete', oid=d.o.id) }}" style="display:inline"
onsubmit="return confirm('确认删除生产订单 {{ d.o.order_no }}? 关联出入库流水将保留。');">
<button class="link-danger" type="submit">删除</button>
</form>
</td>
</tr>
{% else %}
<tr><td colspan="7" class="muted">还没有生产订单</td></tr>
{% endfor %}
</tbody>
</table>
{% endblock %}