feat: 配比秤增加订单类型标签,加工秤去掉冗余按钮
- ratio-scale/01: 新增内供/外售订单类型标签(蓝/橙),移除任务号及每份用量列(8→7列) - clean-veg-ratio-scale/01: 去掉刷新、保存、保存并继续按钮及相关逻辑 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c94658f083
commit
0f3566f990
@@ -24,13 +24,6 @@
|
||||
.page-title {
|
||||
font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85);
|
||||
}
|
||||
.refresh-btn {
|
||||
margin-left: 16px; padding: 5px 12px; font-size: 11px;
|
||||
background: rgba(74,144,217,0.1); border: 1px solid rgba(74,144,217,0.25);
|
||||
border-radius: 6px; color: #4a90d9; cursor: pointer;
|
||||
transition: all 0.2s; font-family: inherit; display: flex; align-items: center; gap: 4px;
|
||||
}
|
||||
.refresh-btn:hover { background: rgba(74,144,217,0.2); border-color: #4a90d9; }
|
||||
.user-info {
|
||||
margin-left: auto; font-size: 12px; color: rgba(255,255,255,0.5); display: flex; align-items: center; gap: 6px;
|
||||
}
|
||||
@@ -197,23 +190,6 @@
|
||||
}
|
||||
.fetch-task-btn:hover { background: rgba(74,144,217,0.12); border-color: #4a90d9; }
|
||||
|
||||
.bottom-bar {
|
||||
display: flex; align-items: center; justify-content: flex-end; gap: 12px;
|
||||
padding: 10px 0; flex-shrink: 0;
|
||||
}
|
||||
.bottom-bar__btn {
|
||||
padding: 9px 24px; border-radius: 8px; font-size: 13px; font-weight: 600;
|
||||
cursor: pointer; transition: all 0.2s; font-family: inherit; border: none;
|
||||
}
|
||||
.bottom-bar__btn--save {
|
||||
background: rgba(74,144,217,0.12); color: #4a90d9;
|
||||
border: 1px solid rgba(74,144,217,0.25);
|
||||
}
|
||||
.bottom-bar__btn--save:hover { background: rgba(74,144,217,0.2); border-color: #4a90d9; }
|
||||
.bottom-bar__btn--continue {
|
||||
background: #4a90d9; color: #fff;
|
||||
}
|
||||
.bottom-bar__btn--continue:hover { background: #5ba0e9; }
|
||||
|
||||
/* 搜索区 */
|
||||
.search-section { flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; }
|
||||
@@ -310,7 +286,6 @@
|
||||
<div class="top-bar">
|
||||
<a class="back-btn" id="backBtn" href="javascript:void(0)">◀ 返回</a>
|
||||
<span class="page-title">净菜加工</span>
|
||||
<button class="refresh-btn" onclick="handleRefresh()">🔄 刷新</button>
|
||||
<div class="user-info">
|
||||
<div class="avatar" id="userAvatar">赵</div>
|
||||
<span id="userName">赵六</span>
|
||||
@@ -364,11 +339,6 @@
|
||||
<button class="fetch-task-btn" onclick="handleFetchTask()">📥 获取任务</button>
|
||||
<div class="food-cards" id="foodCards"></div>
|
||||
|
||||
<!-- 底部操作栏 -->
|
||||
<div class="bottom-bar">
|
||||
<button class="bottom-bar__btn bottom-bar__btn--save" onclick="handleSave()">保存</button>
|
||||
<button class="bottom-bar__btn bottom-bar__btn--continue" onclick="handleSaveContinue()">保存并继续</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -549,26 +519,6 @@
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
// ---- 刷新:模拟获取加工任务最新重量 ----(顶部刷新按钮)
|
||||
function handleRefresh() {
|
||||
showToast('正在获取加工数据...', 800);
|
||||
setTimeout(function() {
|
||||
if (acceptedFoods.length === 0) {
|
||||
// 无数据时重新初始化
|
||||
acceptedFoods = mockFoods.map(function(f) {
|
||||
foodIdCounter++;
|
||||
return { id: foodIdCounter, name: f.name, size: f.size, shape: f.shape, blade: f.blade, target: f.target, processed: f.processed, arrivalTime: f.arrivalTime, icon: f.icon };
|
||||
});
|
||||
renderFoodCards();
|
||||
showToast('加工任务已刷新', 1200);
|
||||
return;
|
||||
}
|
||||
var f = acceptedFoods[Math.floor(Math.random() * acceptedFoods.length)];
|
||||
var detectedWeight = parseFloat((Math.random() * 2 + 0.3).toFixed(1));
|
||||
showWeightModal(f, detectedWeight);
|
||||
}, 800);
|
||||
}
|
||||
|
||||
// ---- 模拟识别(AI识别 → 弹窗确认重量) ----
|
||||
function simulateRecognize() {
|
||||
var statusDot = document.querySelector('.status-dot');
|
||||
@@ -716,27 +666,6 @@
|
||||
closeWeightModal();
|
||||
}
|
||||
|
||||
// ---- 保存(跳转菜单页) ----
|
||||
function handleSave() {
|
||||
window.location.href = '01-menu.html?user=' + encodeURIComponent(currentUser.name) + '&uid=' + currentUser.id;
|
||||
}
|
||||
|
||||
// ---- 保存并继续(重置为初始数据) ----
|
||||
function handleSaveContinue() {
|
||||
showToast('保存成功', 1500);
|
||||
acceptedFoods = mockFoods.map(function(f) {
|
||||
foodIdCounter++;
|
||||
return { id: foodIdCounter, name: f.name, size: f.size, shape: f.shape, blade: f.blade, target: f.target, processed: f.processed, arrivalTime: f.arrivalTime, icon: f.icon };
|
||||
});
|
||||
renderFoodCards();
|
||||
document.getElementById('candidateEmpty').style.display = 'flex';
|
||||
document.getElementById('candidateList').innerHTML = '';
|
||||
document.getElementById('searchInput').value = '';
|
||||
document.getElementById('searchResults').innerHTML = '';
|
||||
document.getElementById('foodStatusText').textContent = '就绪,等待净菜放置';
|
||||
document.querySelector('.status-dot').className = 'status-dot status-dot--ready';
|
||||
}
|
||||
|
||||
// ---- 退出登录 ----
|
||||
function handleLogout() {
|
||||
window.location.href = '00-welcome.html';
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# 净菜加工秤 CHANGELOG
|
||||
|
||||
## [2026-06-17] refactor: 去掉保存/保存并继续/刷新按钮
|
||||
|
||||
### 删除
|
||||
- **01-accept.html**:移除顶部「刷新」按钮、底部「保存」及「保存并继续」按钮及相关 CSS/JS 逻辑
|
||||
- 删除 `handleRefresh()`、`handleSave()`、`handleSaveContinue()` 三个函数
|
||||
|
||||
---
|
||||
|
||||
## [2026-06-16] refactor: 模块整体重构,聚焦净菜验收单一功能
|
||||
|
||||
### 变更
|
||||
|
||||
@@ -59,16 +59,16 @@
|
||||
.task-card__pack-btn:hover { background: #5ba0e9; }
|
||||
.task-card__pack-btn:disabled { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); cursor: not-allowed; }
|
||||
|
||||
/* 表格头(8列) */
|
||||
/* 表格头(7列) */
|
||||
.item-table__head {
|
||||
display: grid; grid-template-columns: 1fr 0.6fr 0.55fr 0.6fr 0.5fr 0.65fr 0.6fr 50px; gap: 8px;
|
||||
display: grid; grid-template-columns: 1fr 0.65fr 0.6fr 0.5fr 0.65fr 0.6fr 50px; gap: 8px;
|
||||
padding: 6px 16px; background: rgba(0,0,0,0.2); font-size: 11px; color: rgba(255,255,255,0.4); font-weight: 500;
|
||||
}
|
||||
.item-table__body { display: flex; flex-direction: column; }
|
||||
|
||||
/* 餐品净菜包主行 */
|
||||
.item-parent-row {
|
||||
display: grid; grid-template-columns: 1fr 0.6fr 0.55fr 0.6fr 0.5fr 0.65fr 0.6fr 50px; gap: 8px;
|
||||
display: grid; grid-template-columns: 1fr 0.65fr 0.6fr 0.5fr 0.65fr 0.6fr 50px; gap: 8px;
|
||||
padding: 10px 16px; border-top: 1px solid rgba(255,255,255,0.04); align-items: center;
|
||||
background: rgba(74,144,217,0.06);
|
||||
}
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
/* 食材子行 */
|
||||
.item-child-row {
|
||||
display: grid; grid-template-columns: 1fr 0.6fr 0.55fr 0.6fr 0.5fr 0.65fr 0.6fr 50px; gap: 8px;
|
||||
display: grid; grid-template-columns: 1fr 0.65fr 0.6fr 0.5fr 0.65fr 0.6fr 50px; gap: 8px;
|
||||
padding: 8px 16px 8px 48px; border-top: 1px solid rgba(255,255,255,0.03);
|
||||
align-items: center; transition: background 0.2s;
|
||||
}
|
||||
@@ -116,6 +116,9 @@
|
||||
.status-badge { font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 500; display: inline-block; }
|
||||
.status-badge--pending { background: rgba(250,173,22,0.15); color: #faad16; }
|
||||
.status-badge--done { background: rgba(82,196,26,0.15); color: #52c41a; }
|
||||
.order-type-tag { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 500; white-space: nowrap; }
|
||||
.order-type-tag--internal { background: rgba(74,144,217,0.15); color: #4a90d9; }
|
||||
.order-type-tag--external { background: rgba(250,140,22,0.15); color: #fa8c16; }
|
||||
.status-tag {
|
||||
display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 10px;
|
||||
}
|
||||
@@ -170,6 +173,7 @@
|
||||
var mockData = [
|
||||
{
|
||||
orderNo: 'PO-20260616-001',
|
||||
orderType: 'internal',
|
||||
expectedArrival: '11:30',
|
||||
taskNo: 'T-001',
|
||||
mealPacks: [
|
||||
@@ -186,6 +190,7 @@
|
||||
},
|
||||
{
|
||||
orderNo: 'PO-20260616-002',
|
||||
orderType: 'external',
|
||||
expectedArrival: '12:00',
|
||||
taskNo: 'T-002',
|
||||
mealPacks: [
|
||||
@@ -199,6 +204,7 @@
|
||||
},
|
||||
{
|
||||
orderNo: 'PO-20260616-003',
|
||||
orderType: 'internal',
|
||||
expectedArrival: '14:30',
|
||||
taskNo: 'T-003',
|
||||
mealPacks: [
|
||||
@@ -209,6 +215,7 @@
|
||||
},
|
||||
{
|
||||
orderNo: 'PO-20260616-004',
|
||||
orderType: 'external',
|
||||
expectedArrival: '16:00',
|
||||
taskNo: 'T-004',
|
||||
mealPacks: [
|
||||
@@ -255,9 +262,11 @@
|
||||
/* 合并行:订单号 + 任务号 + 期望到货 + 状态 + 去配比 */
|
||||
var header = document.createElement('div');
|
||||
header.className = 'task-card__header';
|
||||
var orderTypeLabel = order.orderType === 'internal' ? '内供订单' : '外售订单';
|
||||
var orderTypeCls = order.orderType === 'internal' ? 'order-type-tag--internal' : 'order-type-tag--external';
|
||||
header.innerHTML =
|
||||
'<span class="task-card__order-info"><span class="task-card__order-info__label">订单号:</span><span class="task-card__order-info__value">' + order.orderNo + '</span></span>' +
|
||||
'<span class="task-card__order-info"><span class="task-card__order-info__label">任务号:</span><span class="task-card__order-info__value">' + order.taskNo + '</span></span>' +
|
||||
'<span class="order-type-tag ' + orderTypeCls + '">' + orderTypeLabel + '</span>' +
|
||||
'<span class="task-card__arrival">⏰ 期望到货:<span class="task-card__arrival__time">' + order.expectedArrival + '</span></span>' +
|
||||
'<span class="task-card__status"><span class="status-badge ' + (orderAllDone ? 'status-badge--done' : 'status-badge--pending') + '">' + (orderAllDone ? '已完成' : '待配比') + '</span></span>' +
|
||||
(orderAllDone
|
||||
@@ -265,10 +274,10 @@
|
||||
: '<button class="task-card__pack-btn" onclick="handleWeigh(\'' + order.taskNo + '\',\'' + order.orderNo + '\')">去配比</button>');
|
||||
taskCard.appendChild(header);
|
||||
|
||||
/* 表格头(8列) */
|
||||
/* 表格头(7列) */
|
||||
var tableHead = document.createElement('div');
|
||||
tableHead.className = 'item-table__head';
|
||||
tableHead.innerHTML = '<div>名称</div><div style="text-align:center">净菜/餐品</div><div style="text-align:center">包装规格</div><div style="text-align:center">每份用量</div><div style="text-align:center">打包份数</div><div style="text-align:right">所需总重</div><div style="text-align:right">已称</div><div style="text-align:center">状态</div>';
|
||||
tableHead.innerHTML = '<div>名称</div><div style="text-align:center">净菜/餐品</div><div style="text-align:center">包装规格</div><div style="text-align:center">打包份数</div><div style="text-align:right">所需总重</div><div style="text-align:right">已称</div><div style="text-align:center">状态</div>';
|
||||
taskCard.appendChild(tableHead);
|
||||
|
||||
/* 表格体 */
|
||||
@@ -294,7 +303,6 @@
|
||||
'<div class="parent-name"><div class="parent-icon">📦</div><span class="parent-name__text">' + pack.packName + '</span></div>' +
|
||||
'<div style="text-align:center;font-size:12px;color:' + (pack.type === '餐品净菜包' ? '#faad16' : '#4a90d9') + '">' + pack.type + '</div>' +
|
||||
'<div style="text-align:center;font-size:12px;color:rgba(255,255,255,0.55)">' + (pack.packSpec || '—') + '</div>' +
|
||||
'<div class="parent-weight" style="text-align:center">' + (pack.type === '餐品净菜包' ? '—' : pack.ingredients[0].weightPerPack + ' 克') + '</div>' +
|
||||
'<div style="text-align:center"><span class="pack-size-tag">' + pack.packSize + '</span></div>' +
|
||||
'<div class="parent-weight ' + weightClass + '">需 ' + totalNeed + ' 克</div>' +
|
||||
'<div class="parent-weight ' + weightClass + '">已 ' + totalWeighed + ' 克</div>' +
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
# 净菜配比秤 CHANGELOG
|
||||
|
||||
## [1.3.1] - 2026-06-17
|
||||
|
||||
### 新增
|
||||
- **订单类型标签**:任务卡片头新增「内供订单」/「外售订单」标签(蓝色/橙色区分)
|
||||
|
||||
### 调整
|
||||
- **列表页(01)**:卡片头移除「任务号」字段,改为订单类型标签
|
||||
- **列表页(01)**:表格移除「每份用量」列,8列→7列;列宽重新分配
|
||||
|
||||
---
|
||||
|
||||
## [1.3.0] - 2026-06-17
|
||||
|
||||
### 重构
|
||||
|
||||
Reference in New Issue
Block a user