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

65 lines
1.9 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>扫码/搜索元件</h1>
<a class="btn btn-light" href="{{ url_for('index') }}">返回首页</a>
</header>
<main class="container">
<section class="panel">
<form method="get" action="{{ url_for('scan_page') }}" class="search-row" id="scan-search-form">
<input id="scan-input" type="text" name="q" placeholder="输入或扫码料号/名称" value="{{ keyword }}">
<button class="btn" type="submit">搜索</button>
</form>
<p class="hint">扫码枪通常会自动输入后回车,可直接触发搜索。</p>
</section>
<section class="panel">
<h2>搜索结果</h2>
{% if keyword and results %}
<div class="table-wrap">
<table>
<thead>
<tr>
<th>料号</th>
<th>名称</th>
<th>库存</th>
<th>位置</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% for row in results %}
{% set c = row.component %}
<tr>
<td>{{ c.part_no }}</td>
<td>{{ c.name }}</td>
<td>{{ c.quantity }}</td>
<td>{{ row.box_name }} / {{ row.slot_code }}</td>
<td>{% if c.is_enabled %}启用{% else %}停用{% endif %}</td>
<td><a href="{{ url_for('edit_component', box_id=c.box_id, slot=c.slot_index) }}">编辑</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% elif keyword %}
<p>未找到关键词 "{{ keyword }}" 的元件。</p>
{% else %}
<p>请输入关键词开始搜索。</p>
{% endif %}
</section>
</main>
<script src="{{ url_for('static', filename='js/scanner.js') }}"></script>
</body>
</html>