Files
inventory/templates/scan.html
wangbeihong 0a54bfd5aa feat:增强模板的用户界面和功能
- 在 scanner.js 中为用户操作添加了 toast 通知。
- 更新 box.html 以包含额外的导航选项和改进的布局。
- 增强 edit.html,提供更清晰的说明和改进表单的可访问性。
- 修改了 error.html,以提供有关输入错误的用户指导。
- 改进了 index.html,以优化导航并添加了关键指标显示。
- 增强了 scan.html,优化了搜索输入和操作按钮。
- 引入了 stats.html,用于详细的库存统计和趋势。
- 创建了 types.html,用于分类概述库存类型。
2026-03-10 01:34:02 +08:00

74 lines
2.3 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">
<div>
<h1>扫码 / 搜索</h1>
<p>一步输入,直达元件位置与库存状态</p>
</div>
<div class="hero-actions">
<a class="btn btn-light" href="{{ url_for('stats_page') }}">统计页</a>
<a class="btn btn-light" href="{{ url_for('index') }}">返回首页</a>
</div>
</header>
<main class="container">
<section class="panel">
<div class="card-actions" aria-hidden="true">
<svg class="icon" viewBox="0 0 24 24"><path d="M4 7V4h3"/><path d="M20 7V4h-3"/><path d="M4 17v3h3"/><path d="M20 17v3h-3"/><path d="M8 12h8"/></svg>
</div>
<form method="get" action="{{ url_for('scan_page') }}" class="search-row" id="scan-search-form">
<input id="scan-input" type="search" name="q" placeholder="输入或扫码料号/名称" value="{{ keyword }}" aria-label="搜索关键字">
<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 class="btn btn-light" 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>