Files
Inventory-Management-System/templates/order_form.html
T

35 lines
1.9 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ '编辑生产订单' if o else '新建生产订单' }}{% endblock %}
{% block content %}
<form method="post" class="card form-card" style="max-width:520px"
action="{{ url_for('order_edit', oid=o.id) if o else url_for('order_new') }}"
{% if o %}onsubmit="return confirm('保存将把该订单冲销回「刚下单」状态(撤销已调入/领料流水、清空调入计划),确认继续?');"{% endif %}>
<h3>{{ '编辑生产订单' if o else '新建生产订单' }}</h3>
<label>订单号 {% if o %}(单号不可重复){% else %}(留空自动生成){% endif %}</label>
<input name="order_no" value="{{ o.order_no if o else '' }}" placeholder="如 WO20260911xxx">
<label>BOM 型号 *</label>
<select name="bom_id" required>
<option value="">-- 选择 BOM --</option>
{% for b in boms %}
<option value="{{ b.id }}" {% if o and o.bom_id == b.id %}selected{% endif %}>{{ b.code }} ({{ b.name or '-' }})</option>
{% endfor %}
</select>
<label>接单量 (台/套) *</label>
<input name="qty" type="number" step="0.01" min="0.01" required value="{{ '%.2f'|format(o.qty) if o else '' }}">
<label>生产工厂</label>
<select name="factory_id">
<option value="">-- 不指定(汇总库存校验)--</option>
{% for f in factories %}
<option value="{{ f.id }}" {% if o and o.factory_id == f.id %}selected{% endif %}>{{ f.code }} · {{ f.name }}</option>
{% endfor %}
</select>
<label>备注</label>
<input name="remark" value="{{ o.remark if o else '' }}" placeholder="选填">
<div class="row-actions">
<button class="primary">{{ '保存修改' if o else '生成订单' }}</button>
<a class="btn" href="{{ url_for('orders') }}">取消</a>
</div>
<p class="small muted">生成后可在订单详情页按 BOM 展开领料需求, 并手动录入每个物料的「调入数量」。</p>
</form>
{% endblock %}