feat: 库存管理系统 MaterialWMS 初始版本
- Flask + SQLAlchemy 物料/入库/出库/BOM/生产订单全模块管理 - PyInstaller 打包为单文件 EXE (双击运行, 自动建库) - 物料维度: 入库总数量 / 消耗总数量 / 逐次入库流水(含时间) - BOM 详情展示组成物料的规格型号与单套用量 - 支持 Altium / 嘉立创 BOM 批量导入(文本与 Excel 双通道) - 内置端到端验证脚本(tools/_exe_util.py 等, 清理进程树防残留)
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
{% 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></tr></thead>
|
||||
<tbody>
|
||||
{% for r in inbounds %}
|
||||
<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.batch_no or '-' }}</td>
|
||||
<td>{{ r.source 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>
|
||||
|
||||
<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 %}
|
||||
Reference in New Issue
Block a user