初次提交项目
This commit is contained in:
61
templates/scan.html
Normal file
61
templates/scan.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<!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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for c in results %}
|
||||
<tr>
|
||||
<td>{{ c.part_no }}</td>
|
||||
<td>{{ c.name }}</td>
|
||||
<td>{{ c.quantity }}</td>
|
||||
<td>盒 {{ c.box_id }} / 格 {{ c.slot_index }}</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>
|
||||
Reference in New Issue
Block a user