Files
inventory/templates/edit.html
wangbeihong 22147a1c03 feat:增强箱子管理功能与界面优化
- 新增箱子重命名与删除功能
- 引入新箱子前缀与起始编号配置
- 在首页展示箱子编号范围
- 添加概览按钮,快速查看已启用的物品及其名称
- 实现组件的启用/禁用功能
- 更新数据库结构,新增箱子与组件字段
- 优化箱子与组件管理界面,改进表单与表格展示
- 在索引页面增加箱子详细信息概览区域
- 增强扫描与搜索功能,优化结果显示效果
2026-03-08 02:48:24 +08:00

65 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.0">
<title>编辑元件</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<header class="hero slim">
<h1>{{ box.name }} - 编号 {{ slot_code }}</h1>
<a class="btn btn-light" href="{{ url_for('view_box', box_id=box.id) }}">返回宫格</a>
</header>
<main class="container">
{% if error %}
<p class="alert">{{ error }}</p>
{% endif %}
<form class="panel form-grid" method="post">
<label>
料号 *
<input type="text" name="part_no" required value="{{ component.part_no if component else '' }}">
</label>
<label>
名称 *
<input type="text" name="name" required value="{{ component.name if component else '' }}">
</label>
<label>
规格
<input type="text" name="specification" value="{{ component.specification if component else '' }}">
</label>
<label>
数量
<input type="number" name="quantity" min="0" value="{{ component.quantity if component else 0 }}">
</label>
<label>
位置备注
<input type="text" name="location" value="{{ component.location if component else '' }}">
</label>
<label class="full">
<input type="checkbox" name="is_enabled" value="1" {% if component is none or component.is_enabled %}checked{% endif %}>
启用该位
</label>
<label class="full">
备注
<textarea name="note" rows="3">{{ component.note if component else '' }}</textarea>
</label>
<div class="actions full">
<button class="btn" type="submit" name="action" value="save">保存</button>
{% if component %}
{% if component.is_enabled %}
<button class="btn btn-light" type="submit" name="action" value="toggle_disable">停用</button>
{% else %}
<button class="btn btn-light" type="submit" name="action" value="toggle_enable">启用</button>
{% endif %}
<button class="btn btn-danger" type="submit" name="action" value="delete" onclick="return confirm('确认清空该格子吗?')">删除</button>
{% endif %}
</div>
</form>
</main>
</body>
</html>