feat: 来料过秤页面清单列表增加表头,优化重量展示
- 添加表头:食材名称、应取量、实取量、状态 - 应取量/实取量只显示数字,表头标明含义 - 状态列统一显示"待称重"/"已完成" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
373c5f3d49
commit
b1c5a6cd5c
@@ -225,6 +225,19 @@
|
||||
}
|
||||
.batch-list__title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.8); }
|
||||
.batch-list__count { font-size: 12px; color: rgba(255,255,255,0.4); }
|
||||
/* 表头 */
|
||||
.batch-list__columns {
|
||||
display: flex; align-items: center; padding: 0 12px 8px;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.08);
|
||||
}
|
||||
.batch-col {
|
||||
font-size: 11px; color: rgba(255,255,255,0.4); white-space: nowrap;
|
||||
}
|
||||
.batch-col--name { flex: 1; }
|
||||
.batch-col--required { width: 70px; text-align: right; }
|
||||
.batch-col--actual { width: 70px; text-align: right; }
|
||||
.batch-col--status { width: 60px; text-align: center; }
|
||||
|
||||
.batch-list {
|
||||
flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
|
||||
scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
|
||||
@@ -244,11 +257,6 @@
|
||||
border: 1px dashed rgba(250,173,22,0.2);
|
||||
}
|
||||
.batch-item--pending .batch-item__name { color: rgba(255,255,255,0.6); }
|
||||
.batch-item__status {
|
||||
font-size: 11px; font-weight: 500; white-space: nowrap; min-width: 48px; text-align: center;
|
||||
}
|
||||
.batch-item__status--pending { color: #faad14; }
|
||||
.batch-item__status--done { color: #52c41a; }
|
||||
@keyframes slideIn {
|
||||
from { opacity: 0; transform: translateX(20px); }
|
||||
to { opacity: 1; transform: translateX(0); }
|
||||
@@ -263,13 +271,20 @@
|
||||
.batch-item__trace {
|
||||
font-size: 11px; color: rgba(74,144,217,0.8); font-family: "Courier New", monospace;
|
||||
}
|
||||
.batch-item__weight {
|
||||
font-size: 14px; font-weight: 600; color: #52c41a; white-space: nowrap;
|
||||
.batch-item__actual {
|
||||
font-size: 14px; font-weight: 600; color: #52c41a; white-space: nowrap; width: 70px; text-align: right;
|
||||
}
|
||||
.batch-item__actual--pending {
|
||||
color: rgba(255,255,255,0.2);
|
||||
}
|
||||
.batch-item__required {
|
||||
font-size: 12px; color: rgba(255,255,255,0.5); white-space: nowrap;
|
||||
min-width: 70px; text-align: right;
|
||||
font-size: 13px; color: rgba(255,255,255,0.6); white-space: nowrap; width: 70px; text-align: right;
|
||||
}
|
||||
.batch-item__status {
|
||||
font-size: 11px; font-weight: 500; white-space: nowrap; width: 60px; text-align: center;
|
||||
}
|
||||
.batch-item__status--pending { color: #faad14; }
|
||||
.batch-item__status--done { color: #52c41a; }
|
||||
.batch-item__del {
|
||||
width: 26px; height: 26px; border-radius: 6px; border: none; cursor: pointer;
|
||||
font-size: 12px; display: flex; align-items: center; justify-content: center;
|
||||
@@ -418,6 +433,13 @@
|
||||
<span class="batch-list__title">本批次清单</span>
|
||||
<span class="batch-list__count" id="listCount">共 0 条</span>
|
||||
</div>
|
||||
<!-- 表头 -->
|
||||
<div class="batch-list__columns">
|
||||
<span class="batch-col batch-col--name">食材名称</span>
|
||||
<span class="batch-col batch-col--required">应取量</span>
|
||||
<span class="batch-col batch-col--actual">实取量</span>
|
||||
<span class="batch-col batch-col--status">状态</span>
|
||||
</div>
|
||||
<div class="batch-list" id="batchList">
|
||||
<div class="batch-empty" id="emptyState">
|
||||
<div class="batch-empty__icon">📭</div>
|
||||
@@ -834,14 +856,12 @@
|
||||
var el = document.createElement('div');
|
||||
el.className = 'batch-item' + (item.done ? '' : ' batch-item--pending');
|
||||
|
||||
var requiredHtml = item.requiredWeight !== null ? item.requiredWeight.toFixed(1) + '斤' : '--';
|
||||
var actualHtml = item.done ? item.weight.toFixed(2) + '斤' : '--';
|
||||
var statusHtml = item.done
|
||||
? '<span class="batch-item__status batch-item__status--done">✓ ' + item.weight.toFixed(2) + '斤</span>'
|
||||
? '<span class="batch-item__status batch-item__status--done">已完成</span>'
|
||||
: '<span class="batch-item__status batch-item__status--pending">待称重</span>';
|
||||
|
||||
var weightHtml = item.done
|
||||
? '<div class="batch-item__weight">+' + item.weight.toFixed(2) + '斤</div>'
|
||||
: '<div class="batch-item__weight" style="color:rgba(255,255,255,0.2)">--</div>';
|
||||
|
||||
var traceHtml = item.trace
|
||||
? '<div class="batch-item__trace">' + item.trace + '</div>'
|
||||
: '';
|
||||
@@ -852,8 +872,8 @@
|
||||
'<div class="batch-item__name">' + item.name + '</div>' +
|
||||
traceHtml +
|
||||
'</div>' +
|
||||
'<div class="batch-item__required">应 ' + (item.requiredWeight !== null ? item.requiredWeight.toFixed(1) + '斤' : '--') + '</div>' +
|
||||
weightHtml +
|
||||
'<div class="batch-item__required">' + requiredHtml + '</div>' +
|
||||
'<div class="batch-item__actual' + (item.done ? '' : ' batch-item__actual--pending') + '">' + actualHtml + '</div>' +
|
||||
statusHtml;
|
||||
|
||||
list.appendChild(el);
|
||||
|
||||
Reference in New Issue
Block a user