feat: 库存管理系统 MaterialWMS 初始版本
- Flask + SQLAlchemy 物料/入库/出库/BOM/生产订单全模块管理 - PyInstaller 打包为单文件 EXE (双击运行, 自动建库) - 物料维度: 入库总数量 / 消耗总数量 / 逐次入库流水(含时间) - BOM 详情展示组成物料的规格型号与单套用量 - 支持 Altium / 嘉立创 BOM 批量导入(文本与 Excel 双通道) - 内置端到端验证脚本(tools/_exe_util.py 等, 清理进程树防残留)
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{{ '编辑 BOM' if b else '新增 BOM' }}{% endblock %}
|
||||
{% block content %}
|
||||
<form method="post" class="card form-card" style="max-width:640px">
|
||||
<h3>{{ '编辑 BOM' if b else '新增 BOM' }}</h3>
|
||||
<label>BOM 型号 *</label>
|
||||
<input name="code" value="{{ b.code if b else '' }}" required {% if b %}readonly{% endif %}>
|
||||
<label>名称</label>
|
||||
<input name="name" value="{{ b.name if b else '' }}">
|
||||
<label>备注</label>
|
||||
<input name="note" value="{{ b.note if b else '' }}">
|
||||
|
||||
<h3>组成物料 (单套用量)</h3>
|
||||
<div id="items">
|
||||
{% for it in items %}
|
||||
<div class="item-row" style="display:flex;gap:8px;margin-bottom:6px">
|
||||
<input name="pn" placeholder="物料编号" value="{{ it.pn }}" style="flex:2">
|
||||
<input name="qty" type="number" step="0.01" min="0" placeholder="单套用量" value="{{ it.qty }}" style="flex:1">
|
||||
<button type="button" class="del" onclick="this.parentNode.remove()">✕</button>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="item-row" style="display:flex;gap:8px;margin-bottom:6px">
|
||||
<input name="pn" placeholder="物料编号" style="flex:2">
|
||||
<input name="qty" type="number" step="0.01" min="0" placeholder="单套用量" style="flex:1">
|
||||
<button type="button" class="del" onclick="this.parentNode.remove()">✕</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<button type="button" class="btn" onclick="addRow()">+ 添加一行</button>
|
||||
<div class="row-actions"><button class="primary">保存</button></div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function addRow(){
|
||||
const d=document.createElement('div');
|
||||
d.className='item-row';
|
||||
d.style='display:flex;gap:8px;margin-bottom:6px';
|
||||
d.innerHTML='<input name="pn" placeholder="物料编号" style="flex:2">'+
|
||||
'<input name="qty" type="number" step="0.01" min="0" placeholder="单套用量" style="flex:1">'+
|
||||
'<button type="button" class="del" onclick="this.parentNode.remove()">✕</button>';
|
||||
document.getElementById('items').appendChild(d);
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user