- Flask + SQLAlchemy 物料/入库/出库/BOM/生产订单全模块管理 - PyInstaller 打包为单文件 EXE (双击运行, 自动建库) - 物料维度: 入库总数量 / 消耗总数量 / 逐次入库流水(含时间) - BOM 详情展示组成物料的规格型号与单套用量 - 支持 Altium / 嘉立创 BOM 批量导入(文本与 Excel 双通道) - 内置端到端验证脚本(tools/_exe_util.py 等, 清理进程树防残留)
32 lines
1.2 KiB
HTML
32 lines
1.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}库存报表{% endblock %}
|
|
{% block content %}
|
|
<div class="toolbar no-print">
|
|
<h3 style="margin:0">库存报表 ({{ today }})</h3>
|
|
<div>
|
|
<button class="btn" onclick="window.print()">🖨 打印</button>
|
|
<a class="btn primary" href="{{ url_for('export_inventory') }}">⬇ 导出 Excel</a>
|
|
</div>
|
|
</div>
|
|
<table class="tbl">
|
|
<thead><tr><th>物料编号</th><th>型号/规格</th><th>单位</th><th>在库数量</th><th>安全库存</th><th>状态</th></tr></thead>
|
|
<tbody>
|
|
{% for r in rows %}
|
|
<tr class="{{ 'row-danger' if r.status=='danger' else ('row-warn' if r.status=='warn') }}">
|
|
<td>{{ r.m.part_number }}</td>
|
|
<td>{{ r.m.manufacturer or '-' }}</td>
|
|
<td>{{ r.m.unit }}</td>
|
|
<td class="num">{{ '%.2f'|format(r.stock) }}</td>
|
|
<td class="num">{{ '%.2f'|format(r.m.safety_stock or 0) }}</td>
|
|
<td><span class="badge {{ r.status }}">{{ '库存为负' if r.status=='danger' else ('低于安全库存' if r.status=='warn' else '正常') }}</span></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<style media="print">
|
|
.topbar, .no-print { display: none !important; }
|
|
body { background:#fff; }
|
|
.tbl { box-shadow:none; }
|
|
</style>
|
|
{% endblock %}
|