feat:增强框类型管理和搜索功能
- 引入基于 JSON 的框类型覆盖,允许动态更新标签、描述和前缀。 - 增加了一种可调节容量的定制盒型。 - 实现了应用和保存盒子类型覆盖的函数。 - 更新仪表盘,显示按箱型分组的库存低库存商品。 - 创建了一个新的搜索页面,方便快速访问具有增强搜索功能的组件。 - 用搜索页面取代扫描页面,将出站功能直接集成到搜索结果中。 - 改进的界面元素,提升导航和用户体验,包括新增按钮和样式。 - 移除过时的 scanner.js 文件并将其功能集成到搜索页面。 - 更新了各种模板,以反映新的搜索和框类型管理功能。
This commit is contained in:
@@ -3,32 +3,83 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>分类总览</title>
|
||||
<title>仓库概览</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<header class="hero">
|
||||
<div>
|
||||
<h1>分类总览</h1>
|
||||
<p>将容器拆分为独立界面,避免长页面翻找</p>
|
||||
<h1>仓库概览</h1>
|
||||
<p>先看关键指标与待补货,再进入对应分类处理</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<a class="btn" href="{{ url_for('type_page', box_type='custom') }}#quick-add">添加容器</a>
|
||||
<a class="btn btn-light" href="{{ url_for('search_page') }}">快速搜索</a>
|
||||
<a class="btn btn-light" href="{{ url_for('stats_page') }}">统计页</a>
|
||||
<a class="btn" href="{{ url_for('scan_page') }}">扫码/搜索</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container">
|
||||
{% if error %}
|
||||
<p class="alert">{{ error }}</p>
|
||||
{% endif %}
|
||||
{% if notice %}
|
||||
<p class="notice">{{ notice }}</p>
|
||||
{% endif %}
|
||||
|
||||
<section class="metrics-grid">
|
||||
<article class="metric-card">
|
||||
<p class="metric-title">容器总数</p>
|
||||
<p class="metric-value">{{ stats.box_count }}</p>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<p class="metric-title">启用元件</p>
|
||||
<p class="metric-value">{{ stats.active_items }}</p>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<p class="metric-title">待补货元件</p>
|
||||
<p class="metric-value">{{ stats.low_stock_count }}</p>
|
||||
</article>
|
||||
<article class="metric-card">
|
||||
<p class="metric-title">近7天净变动</p>
|
||||
<p class="metric-value">{% if stats.period_net_change_7d > 0 %}+{% endif %}{{ stats.period_net_change_7d }}</p>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="metrics-grid">
|
||||
{% for item in type_cards %}
|
||||
<article class="metric-card type-card">
|
||||
<p class="metric-title">{{ item.label }}</p>
|
||||
<div class="type-card-head">
|
||||
<p class="metric-title">{{ item.label }}</p>
|
||||
<a class="type-card-more" href="{{ url_for('edit_container_type', box_type=item.key) }}" aria-label="编辑容器属性" title="编辑容器属性">...</a>
|
||||
</div>
|
||||
<p class="metric-value">{{ item.count }}</p>
|
||||
<p class="hint">{{ item.desc }}</p>
|
||||
<p class="hint">容器 {{ item.count }} 个 | 启用元件 {{ item.item_count }} 种 | 总库存 {{ item.quantity }}</p>
|
||||
<a class="btn" href="{{ item.url }}">进入分类</a>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
||||
<section class="panel side-low-stock" id="overview-low-stock">
|
||||
<h2>低库存元器件</h2>
|
||||
{% for group in low_stock_groups %}
|
||||
<h3>{{ group['label'] }}({{ group['items']|length }})</h3>
|
||||
<ul class="side-low-stock-list">
|
||||
{% for item in group['items'] %}
|
||||
<li>
|
||||
<div>
|
||||
<strong>{{ item.name }}</strong>
|
||||
<p class="hint">{{ item.part_no }} | {{ item.box_name }} / {{ item.slot_code }} | 数量 {{ item.quantity }}</p>
|
||||
</div>
|
||||
<a class="btn btn-light" href="{{ item.edit_url }}">编辑</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="muted">当前分类没有低库存元器件。</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user