Files
star 5a6f4ea4df feat: 新增备料(采购下单)功能模块,含清空清单
- 独立采购备料清单:选 BOM + 输入套数一键生成计划(计划数量 = 单套用量 × 套数),可手工增删改、导出 Excel

- 备料与生产订单完全解耦,仅记录计划数量、不记账(不产生任何出入库流水)

- 新增「清空清单」功能(/prepare/clear,JS 二次确认 + 操作日志),按当前工厂范围清空

- 配套:PrepPlan 模型、缺口(计划-库存)实时计算、库存随工厂切换过滤
2026-10-19 15:09:20 +08:00

55 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}物料入库系统{% endblock %}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<header class="topbar">
<div class="brand">📦 物料入库系统 <span class="ver">M1+M2+M3</span></div>
<form class="factory-switch" method="post" action="{{ url_for('set_factory') }}">
<label for="facSel">工厂</label>
<select id="facSel" name="factory_id" onchange="this.form.submit()">
<option value="all">全部工厂(汇总)</option>
{% for f in factories %}
<option value="{{ f.id }}" {% if current_factory_id == f.id %}selected{% endif %}>{{ f.code }} · {{ f.name }}</option>
{% endfor %}
</select>
</form>
<nav>
<a href="{{ url_for('dashboard') }}">库存看板</a>
<a href="{{ url_for('materials') }}">物料</a>
<a href="{{ url_for('inbound') }}">入库</a>
<a href="{{ url_for('outbound') }}">出库</a>
<a href="{{ url_for('ledger') }}">流水</a>
{% if g.user and g.user.role in ('admin','manager') %}
<a href="{{ url_for('boms') }}">BOM</a>
<a href="{{ url_for('orders') }}">生产订单</a>
<a href="{{ url_for('prepare') }}">备料</a>
<a href="{{ url_for('report') }}">报表</a>
<a href="{{ url_for('logs') }}">日志</a>
<a href="{{ url_for('factories') }}">工厂</a>
<a href="{{ url_for('transfers') }}">调拨</a>
<a href="{{ url_for('substitutes') }}">替代料</a>
{% endif %}
{% if g.user and g.user.role == 'admin' %}
<a href="{{ url_for('users') }}">用户</a>
{% endif %}
{% if g.user %}<span class="who">{{ g.user.display_name or g.user.username }} ({{ g.user.role }})</span>
<a href="{{ url_for('logout') }}">退出</a>{% endif %}
</nav>
</header>
<main>
{% with msgs = get_flashed_messages(with_categories=true) %}
{% for cat, msg in msgs %}
<div class="flash {{ cat }}">{{ msg }}</div>
{% endfor %}
{% endwith %}
{% block content %}{% endblock %}
{% block scripts %}{% endblock %}
</main>
</body>
</html>