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

82 lines
3.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">
<h1>电子元件库存管理 v1.0</h1>
<a class="btn" href="{{ url_for('scan_page') }}">扫码/搜索</a>
</header>
<main class="container">
<h2>容器列表</h2>
{% for key, meta in box_types.items() %}
<section class="group-panel panel">
<div class="group-title-row">
<h3>{{ meta.label }}</h3>
<span class="group-desc">{{ meta.default_desc }}</span>
</div>
<form class="new-box-form" method="post" action="{{ url_for('create_box') }}">
<input type="hidden" name="box_type" value="{{ key }}">
<input type="text" name="name" placeholder="新增盒子名称" required>
<input type="text" name="slot_prefix" placeholder="前缀(如A/B/C)">
<input type="number" name="start_number" min="0" value="1" placeholder="起始序号">
<input type="text" name="description" placeholder="备注(可选)">
<button class="btn" type="submit">新增盒子</button>
</form>
<section class="box-list">
{% for item in groups[key] %}
<article class="box-card">
<h4>{{ item.box.name }}</h4>
<p>{{ item.box.description or '暂无描述' }}</p>
<p>编号前缀: {{ item.box.slot_prefix }} | 范围: {{ item.slot_range }}</p>
<p>已启用: {{ item.used_count }}/{{ item.box.slot_capacity }}</p>
<div class="card-actions">
<a class="btn" href="{{ url_for('view_box', box_id=item.box.id) }}">进入列表</a>
<form method="post" action="{{ url_for('delete_box', box_id=item.box.id) }}" onsubmit="return confirm('确认删除盒子及内部全部记录吗?')">
<button class="btn btn-danger" type="submit">删除</button>
</form>
</div>
<details class="box-overview">
<summary>概览(已启用序号和名称)</summary>
{% if item.overview_rows %}
<ul>
{% for row in item.overview_rows %}
<li>{{ row.slot_code }} - {{ row.name }} ({{ row.part_no }})</li>
{% endfor %}
</ul>
{% else %}
<p>暂无启用记录</p>
{% endif %}
</details>
<details class="box-overview">
<summary>设置(改名/前缀/起始号)</summary>
<form class="new-box-form compact" method="post" action="{{ url_for('update_box', box_id=item.box.id) }}">
<input type="text" name="name" value="{{ item.box.name }}" required>
<input type="text" name="slot_prefix" value="{{ item.box.slot_prefix }}" required>
<input type="number" name="start_number" min="0" value="{{ item.box.start_number }}" required>
<input type="text" name="description" value="{{ item.box.description or '' }}">
<button class="btn" type="submit">保存设置</button>
</form>
</details>
</article>
{% else %}
<p>当前分类还没有盒子,先新增一个。</p>
{% endfor %}
</section>
</section>
{% endfor %}
</main>
</body>
</html>