feat: 多工厂/厂间调拨/替代料/流水台账折叠 + 重写 README

- 多工厂(factory 表) + 顶栏工厂下拉过滤, 库存按厂聚合
- 厂间调拨(transfer): 源厂减+目标厂加, 总库存不变, 双向流水对账
- 替代料关系(substitute): 出库/BOM领料/生产领料缺料时提示可替代料
- 流水台账(ledger): 入出按日期合并折叠, 按日期导出同一 Excel
- 生产订单增强: 编辑/删除(级联清关联流水)/调入数量/确认调入=厂间调拨
- 入库新增送货日期字段; 出库物料编码扫码定位
- 重写 README 补全全部模块; .gitignore 排除 dist_pkg/build_pkg/*.db
- 停止跟踪 instance/app.db(运行时自动生成)
This commit is contained in:
2026-09-29 11:17:48 +08:00
parent 33efc7c846
commit 5060d027e5
22 changed files with 1961 additions and 149 deletions
+49
View File
@@ -0,0 +1,49 @@
{% extends "base.html" %}
{% block title %}厂间调拨记录{% endblock %}
{% block content %}
<div class="toolbar">
<h3 style="margin:0">➡️ 厂间调拨记录</h3>
{% if g.user and g.user.role in ('admin','manager') %}
<a class="btn primary" href="{{ url_for('transfer_new') }}">+ 新建调拨</a>
{% endif %}
</div>
{% if factory %}
<div class="scope-banner">
🔎 当前已选中某工厂,仅显示<b>调出或调入涉及该厂</b>的调拨记录。
<a href="{{ url_for('set_factory') }}" style="display:none"></a>
</div>
{% endif %}
{% if not rows %}
<p class="muted">暂无调拨记录。点击右上角「新建调拨」即可在工厂之间调拨物料。</p>
{% else %}
<table class="tbl">
<thead>
<tr>
<th>调拨单号</th>
<th>调出厂 → 调入厂</th>
<th>物料</th>
<th>数量</th>
<th>业务日期</th>
<th>经手人</th>
<th>备注</th>
</tr>
</thead>
<tbody>
{% for r in rows %}
<tr>
<td>{{ r.t.no }}</td>
<td>{{ r.ff.code if r.ff else '?' }} → {{ r.tf.code if r.tf else '?' }}</td>
<td><a href="{{ url_for('material_detail', mid=r.m.id) }}">{{ r.m.part_number if r.m else r.t.material_id }}</a></td>
<td class="num">{{ '%.2f'|format(r.t.qty) }}</td>
<td>{{ r.t.occur_date }}</td>
<td>{{ r.t.operator or '-' }}</td>
<td>{{ r.t.remark or '-' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}