- models.Inbound 增加 delivery_date 列(可空, 默认 None) - 入库单笔录入表单新增「送货日期」输入(默认当天, 可改供应商实际到货日); 出库不受影响 - 物料明细页入库流水新增「送货日期」列展示 - seed_admin 增加幂等补列: 旧库启动时自动 ALTER TABLE inbound ADD COLUMN delivery_date, 开发/EXE 均兼容 - 教程补充送货日期字段说明 (注: instance/app.db 已本地补列, 但未纳入本次提交; dist/app.db 为运行库已 gitignore)
71 lines
2.8 KiB
HTML
71 lines
2.8 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}物料明细 {{ m.part_number }}{% endblock %}
|
|
{% block content %}
|
|
<div class="toolbar">
|
|
<h3 style="margin:0">物料明细 · {{ m.part_number }}</h3>
|
|
<div>
|
|
<a class="btn" href="{{ url_for('materials') }}">← 返回物料列表</a>
|
|
<a class="btn" href="{{ url_for('material_edit', mid=m.id) }}">编辑</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card" style="margin-bottom:16px">
|
|
<table class="tbl" style="box-shadow:none">
|
|
<tbody>
|
|
<tr><th style="width:120px">物料编号</th><td>{{ m.part_number }}</td>
|
|
<th style="width:120px">型号 / 规格</th><td>{{ m.manufacturer or '-' }}</td></tr>
|
|
<tr><th>单位</th><td>{{ m.unit }}</td>
|
|
<th>安全库存</th><td class="num">{{ '%.2f'|format(m.safety_stock or 0) }}</td></tr>
|
|
<tr><th>备注</th><td colspan="3">{{ m.note or '-' }}</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="stats">
|
|
<div class="stat"><div class="num">{{ '%.2f'|format(stock) }}</div><div class="lbl">当前在库</div></div>
|
|
<div class="stat"><div class="num">{{ '%.2f'|format(inb_total) }}</div><div class="lbl">入库总数量</div></div>
|
|
<div class="stat"><div class="num">{{ '%.2f'|format(out_total) }}</div><div class="lbl">消耗总数量</div></div>
|
|
</div>
|
|
|
|
<h3>入库流水(每次入库时间 / 数量)</h3>
|
|
<table class="tbl">
|
|
<thead><tr><th>入库日期</th><th>送货日期</th><th>录入时间</th><th>数量</th><th>批次号</th><th>来源 / 供应商</th><th>经手人</th><th>备注</th></tr></thead>
|
|
<tbody>
|
|
{% for r in inbounds %}
|
|
<tr>
|
|
<td>{{ r.occur_date }}</td>
|
|
<td>{{ r.delivery_date or '-' }}</td>
|
|
<td class="small muted">{{ r.created_at.strftime('%Y-%m-%d %H:%M') if r.created_at else '-' }}</td>
|
|
<td class="num">{{ '%.2f'|format(r.qty) }}</td>
|
|
<td>{{ r.batch_no or '-' }}</td>
|
|
<td>{{ r.source or '-' }}</td>
|
|
<td>{{ r.operator or '-' }}</td>
|
|
<td>{{ r.remark or '-' }}</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="8" class="muted">暂无入库记录</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3>出库 / 消耗流水</h3>
|
|
<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 outbounds %}
|
|
<tr>
|
|
<td>{{ r.occur_date }}</td>
|
|
<td class="small muted">{{ r.created_at.strftime('%Y-%m-%d %H:%M') if r.created_at else '-' }}</td>
|
|
<td class="num">{{ '%.2f'|format(r.qty) }}</td>
|
|
<td>{{ r.purpose or '-' }}</td>
|
|
<td>{{ r.order_ref or '-' }}</td>
|
|
<td>{{ r.operator or '-' }}</td>
|
|
<td>{{ r.remark or '-' }}</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr><td colspan="7" class="muted">暂无出库记录</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endblock %}
|