feat: 贴标秤术语统一(吐标→打印) + 净菜类型字段(贴标秤&组配秤)
贴标秤: - 全模块"吐标"统一为"打印"(待吐标/已吐标/重新吐标 → 待打印/已打印/重新打印) - 01-orders 已完成订单净菜包行状态"已贴标"→"已打印"(订单整体状态保留) - 02-labeling 净菜包列表 meta 区新增"净菜类型"(尺寸·形状·刀工) 组配秤 v2.2.0: - 02-weighing-packing 食材行新增"净菜类型"项,与净菜加工秤加工规格格式一致 - 净菜类显示切法规格,菜品类显示"—" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
da06b4fa94
commit
65372009fe
@@ -114,7 +114,7 @@
|
||||
<div class="main-content">
|
||||
<!-- Tab 切换 -->
|
||||
<div class="tabs">
|
||||
<div class="tab active" data-filter="pending" onclick="switchTab('pending', this)">待吐标 <span class="tab__count" id="pendingCount">0</span></div>
|
||||
<div class="tab active" data-filter="pending" onclick="switchTab('pending', this)">待打印 <span class="tab__count" id="pendingCount">0</span></div>
|
||||
<div class="tab" data-filter="done" onclick="switchTab('done', this)">已贴标 <span class="tab__count" id="doneCount">0</span></div>
|
||||
</div>
|
||||
<!-- 任务列表 -->
|
||||
@@ -142,7 +142,7 @@
|
||||
/* 当前 Tab */
|
||||
var currentFilter = 'pending';
|
||||
|
||||
/* 模拟数据:待吐标订单(来自配比秤已完成配比的订单) */
|
||||
/* 模拟数据:待打印订单(来自配比秤已完成配比的订单) */
|
||||
var mockData = [
|
||||
{
|
||||
orderNo: 'PO-20260625-001',
|
||||
@@ -219,7 +219,7 @@
|
||||
var allDone = pack.ingredients.every(function(ing) {
|
||||
return ing.weighed >= ing.weightPerPack * pack.packSize;
|
||||
});
|
||||
return allDone ? { text: '已贴标', cls: 'status-tag--done' } : { text: '待吐标', cls: 'status-tag--wait' };
|
||||
return allDone ? { text: '已贴标', cls: 'status-tag--done' } : { text: '待打印', cls: 'status-tag--wait' };
|
||||
}
|
||||
|
||||
/* 渲染任务列表 */
|
||||
@@ -273,8 +273,8 @@
|
||||
|
||||
order.mealPacks.forEach(function(pack) {
|
||||
var packStatus = currentFilter === 'pending'
|
||||
? { text: '待吐标', cls: 'status-tag--wait' }
|
||||
: { text: '已贴标', cls: 'status-tag--done' };
|
||||
? { text: '待打印', cls: 'status-tag--wait' }
|
||||
: { text: '已打印', cls: 'status-tag--done' };
|
||||
var totalNeed = 0;
|
||||
var totalWeighed = 0;
|
||||
pack.ingredients.forEach(function(ing) {
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
.item-row__status { font-size: 10px; flex-shrink: 0; }
|
||||
.item-row__action { flex-shrink: 0; display: flex; gap: 6px; }
|
||||
|
||||
/* 吐标按钮 */
|
||||
/* 打印按钮 */
|
||||
.label-btn {
|
||||
padding: 4px 12px; border: 1px solid rgba(82,196,26,0.3); background: rgba(82,196,26,0.1);
|
||||
color: #52c41a; border-radius: 5px; font-size: 11px; font-weight: 500; cursor: pointer;
|
||||
@@ -402,8 +402,8 @@
|
||||
orderNo: 'PO-20260625-001',
|
||||
orderType: 'internal',
|
||||
items: [
|
||||
{ type: '净菜包', packName: '土豆丝', packSize: 3, packSpec: '500g', weightPerPack: 500, weighed: 1500, icon: '🥔' },
|
||||
{ type: '净菜包', packName: '胡萝卜丝', packSize: 3, packSpec: '500g', weightPerPack: 500, weighed: 1500, icon: '🥕' },
|
||||
{ type: '净菜包', packName: '土豆丝', packSize: 3, packSpec: '500g', cutSpec: '20mm*1mm*1mm · 细丝 · 平刀', weightPerPack: 500, weighed: 1500, icon: '🥔' },
|
||||
{ type: '净菜包', packName: '胡萝卜丝', packSize: 3, packSpec: '500g', cutSpec: '20mm*1mm*1mm · 细丝 · 平刀', weightPerPack: 500, weighed: 1500, icon: '🥕' },
|
||||
{ type: '餐品净菜包', packName: '宫保鸡丁套餐', packSize: 2, packSpec: '大份800g', weightPerPack: 800, weighed: 1600, icon: '🍱' }
|
||||
]
|
||||
},
|
||||
@@ -411,7 +411,7 @@
|
||||
orderNo: 'PO-20260625-002',
|
||||
orderType: 'external',
|
||||
items: [
|
||||
{ type: '净菜包', packName: '白菜丝', packSize: 2, packSpec: '1000g', weightPerPack: 1000, weighed: 2000, icon: '🥬' },
|
||||
{ type: '净菜包', packName: '白菜丝', packSize: 2, packSpec: '1000g', cutSpec: '50mm*30mm*30mm · 宽段 · 平刀', weightPerPack: 1000, weighed: 2000, icon: '🥬' },
|
||||
{ type: '餐品净菜包', packName: '鱼香肉丝套餐', packSize: 2, packSpec: '大份800g', weightPerPack: 800, weighed: 1600, icon: '🍱' }
|
||||
]
|
||||
},
|
||||
@@ -448,6 +448,7 @@
|
||||
packName: item.packName,
|
||||
packSize: item.packSize,
|
||||
packSpec: item.packSpec,
|
||||
cutSpec: item.cutSpec,
|
||||
weightPerPack: item.weightPerPack,
|
||||
weighed: item.weighed,
|
||||
icon: item.icon,
|
||||
@@ -495,12 +496,12 @@
|
||||
document.getElementById('btnNext').disabled = !allDone;
|
||||
}
|
||||
|
||||
/* ---- 检查是否全部完成(所有项都已吐标) ---- */
|
||||
/* ---- 检查是否全部完成(所有项都已打印) ---- */
|
||||
function checkAllDone() {
|
||||
return allItems.every(function(item) { return item.labeled; });
|
||||
}
|
||||
|
||||
/* ---- 渲染贴标清单(净菜包和餐品净菜包统一用待吐标/已吐标) ---- */
|
||||
/* ---- 渲染贴标清单(净菜包和餐品净菜包统一用待打印/已打印) ---- */
|
||||
function renderItemList() {
|
||||
var body = document.getElementById('itemListBody');
|
||||
body.innerHTML = '';
|
||||
@@ -512,13 +513,13 @@
|
||||
|
||||
row.className = 'item-row' + (isMeal ? ' item-row--meal' : '');
|
||||
|
||||
/* 状态:统一用待吐标/已吐标 */
|
||||
/* 状态:统一用待打印/已打印 */
|
||||
var labeledTag = item.labeled
|
||||
? '<span class="status-tag status-tag--labeled">已吐标</span>'
|
||||
: '<span class="status-tag status-tag--wait">待吐标</span>';
|
||||
? '<span class="status-tag status-tag--labeled">已打印</span>'
|
||||
: '<span class="status-tag status-tag--wait">待打印</span>';
|
||||
|
||||
/* 按钮:统一用吐标/重新吐标 */
|
||||
var labelBtnText = item.labeled ? '重新吐标' : '吐标';
|
||||
/* 按钮:统一用打印/重新打印 */
|
||||
var labelBtnText = item.labeled ? '重新打印' : '打印';
|
||||
var labelBtnCls = item.labeled ? 'label-btn label-btn--done' : 'label-btn';
|
||||
var typeTagCls = isMeal ? 'item-row__type-tag--meal' : 'item-row__type-tag--veg';
|
||||
|
||||
@@ -532,13 +533,13 @@
|
||||
? '<span class="item-card__data-value">' + item.packName + '</span>'
|
||||
: '<span class="item-card__data-value item-card__data-value--dash">--</span>';
|
||||
|
||||
/* 按钮逻辑:净菜包无手动吐标按钮(秤重确认时自动吐标),餐品净菜包手动吐标 */
|
||||
/* 按钮逻辑:净菜包无手动打印按钮(秤重确认时自动打印),餐品净菜包手动打印 */
|
||||
var actionHtml;
|
||||
if (isMeal) {
|
||||
actionHtml = '<button class="' + labelBtnCls + '" onclick="handleSpitLabel(' + idx + ')">' + labelBtnText + '</button>';
|
||||
} else {
|
||||
if (item.labeled) {
|
||||
actionHtml = '<button class="' + labelBtnCls + '" onclick="handleSpitLabel(' + idx + ')">重新吐标</button>';
|
||||
actionHtml = '<button class="' + labelBtnCls + '" onclick="handleSpitLabel(' + idx + ')">重新打印</button>';
|
||||
} else {
|
||||
actionHtml = '';
|
||||
}
|
||||
@@ -553,6 +554,7 @@
|
||||
'</div>' +
|
||||
'<div class="item-card__meta">' +
|
||||
'<div class="item-card__meta-item"><span class="item-card__meta-label">包装规格:</span><span class="item-card__meta-value">' + (item.packSpec || '—') + '</span></div>' +
|
||||
'<div class="item-card__meta-item"><span class="item-card__meta-label">净菜类型:</span><span class="item-card__meta-value">' + (isMeal ? '—' : (item.cutSpec || '—')) + '</span></div>' +
|
||||
'</div>' +
|
||||
'<div class="item-card__data">' +
|
||||
'<div class="item-card__data-item"><span class="item-card__data-label">餐品:</span>' + mealDisplay + '</div>' +
|
||||
@@ -566,14 +568,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
/* ---- 吐标(餐品净菜包手动触发 / 净菜包重新吐标) ---- */
|
||||
/* ---- 打印(餐品净菜包手动触发 / 净菜包重新打印) ---- */
|
||||
function handleSpitLabel(idx) {
|
||||
var item = allItems[idx];
|
||||
var wasLabeled = item.labeled;
|
||||
item.labeled = true;
|
||||
renderItemList();
|
||||
updateTaskStatus();
|
||||
showToast(item.packName + (wasLabeled ? ' 已重新吐标' : ' 已吐标'), 1500, 'success');
|
||||
showToast(item.packName + (wasLabeled ? ' 已重新打印' : ' 已打印'), 1500, 'success');
|
||||
}
|
||||
|
||||
/* ---- 触发识别(点击相机覆盖层) ---- */
|
||||
@@ -674,7 +676,7 @@
|
||||
|
||||
var modalWeight = parseFloat(document.getElementById('modalWeight').textContent) || 0;
|
||||
allItems[matchedIdx].weighed = modalWeight;
|
||||
/* 秤重确认后自动吐标 */
|
||||
/* 秤重确认后自动打印 */
|
||||
allItems[matchedIdx].labeled = true;
|
||||
|
||||
document.getElementById('scaleWeightValue').textContent = allItems[matchedIdx].weighed.toFixed(2);
|
||||
@@ -701,7 +703,7 @@
|
||||
/* ---- 贴标完成 ---- */
|
||||
function handleLabelDone() {
|
||||
if (!checkAllDone()) {
|
||||
showToast('还有项目未完成吐标', 2000, 'error');
|
||||
showToast('还有项目未完成打印', 2000, 'error');
|
||||
return;
|
||||
}
|
||||
showToast('贴标完成,正在返回订单列表...', 1500, 'success');
|
||||
|
||||
@@ -512,7 +512,7 @@
|
||||
'<div style="text-align:center"><span class="pack-size-tag">' + pack.packSize + '</span></div>' +
|
||||
'<div class="parent-weight parent-weight--done">' + totalNeed + ' g</div>' +
|
||||
'<div class="parent-weight parent-weight--done">' + totalWeighed + ' g</div>' +
|
||||
'<div style="text-align:center"><span class="status-tag status-tag--done">已吐标</span></div>';
|
||||
'<div style="text-align:center"><span class="status-tag status-tag--done">已打印</span></div>';
|
||||
tableBody.appendChild(parentRow);
|
||||
});
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
### 功能说明
|
||||
- 接收配比秤已完成配比的订单(含净菜包和餐品净菜包)
|
||||
- 净菜包:通过摄像头识别+候选选择+秤重确认弹窗完成秤重
|
||||
- 餐品净菜包:每份用量显示"--",后方有"吐标"按钮,吐完标状态显示"已吐标",按钮可重复点击
|
||||
- 餐品净菜包:每份用量显示"--",后方有"打印"按钮,打印完状态显示"已打印",按钮可重复点击
|
||||
- 贴标清单:餐品净菜包按餐品维度展示(不按食材展开),份数/需/已称按实际显示
|
||||
- 贴标完成总按钮:所有净菜包秤重完成且所有餐品净菜包已吐标后可点击,点击后返回订单列表
|
||||
- 贴标完成总按钮:所有净菜包秤重完成且所有餐品净菜包已打印后可点击,点击后返回订单列表
|
||||
- 已贴标Tab可查看历史记录及操作人信息
|
||||
|
||||
### 设计规范
|
||||
@@ -29,9 +29,16 @@
|
||||
|
||||
### 修改
|
||||
- `01-orders.html` — 左上角"退出"改为"返回",点击跳转菜单页;页面标题"贴标订单"改为"贴标任务"
|
||||
- `02-labeling.html` — 所有秤重状态统一为待吐标/已吐标;净菜包吐标由秤重弹窗确认自动触发(无手动吐标按钮);餐品净菜包保持手动吐标/重新吐标按钮;列表新增"餐品"字段(餐品净菜包显示餐品名称,净菜包显示--);所有"重新吐标"按钮可重复点击
|
||||
- `02-labeling.html` — 所有秤重状态统一为待打印/已打印;净菜包打印由秤重弹窗确认自动触发(无手动打印按钮);餐品净菜包保持手动打印/重新打印按钮;列表新增"餐品"字段(餐品净菜包显示餐品名称,净菜包显示--);所有"重新打印"按钮可重复点击
|
||||
- `index.html` — "贴标订单"改为"贴标任务",新增"贴标历史"菜单按钮
|
||||
|
||||
## 2026-06-25 | 术语统一与净菜类型字段
|
||||
|
||||
### 修改
|
||||
- 全模块"吐标"→"打印"术语统一(待吐标/已吐标/重新吐标 → 待打印/已打印/重新打印,含按钮文字、注释、CHANGELOG)
|
||||
- `01-orders.html` — 已完成订单下净菜包行状态由"已贴标"改为"已打印"(订单整体状态标签保留"已贴标")
|
||||
- `02-labeling.html` — 净菜包列表项 meta 区新增"净菜类型"字段(尺寸·形状·刀工,如 `20mm*1mm*1mm · 细丝 · 平刀`),餐品净菜包显示"—"
|
||||
|
||||
### 新增页面
|
||||
- `03-history.html` — 贴标历史页(4:3横屏,参考组配秤组配历史的显示逻辑:日视图/本周切换、日期条、搜索框、统计行;参考贴标秤任务列表的表单结构:订单号+类型+完成时间+操作人+表格行)
|
||||
|
||||
|
||||
@@ -601,9 +601,9 @@
|
||||
orderType: 'internal',
|
||||
mealPacks: [
|
||||
{ type: '餐品净菜包', packName: '宫保鸡丁套餐', packSize: 3, packSpec: '大份800g', ingredients: [
|
||||
{ name: '土豆丝', icon: '🥔', weightPerPack: 300, weighed: 0 },
|
||||
{ name: '胡萝卜丝', icon: '🥕', weightPerPack: 250, weighed: 0 },
|
||||
{ name: '黄瓜片', icon: '🥒', weightPerPack: 250, weighed: 0 }
|
||||
{ name: '土豆丝', icon: '🥔', cutSpec: '20mm*1mm*1mm · 细丝 · 平刀', weightPerPack: 300, weighed: 0 },
|
||||
{ name: '胡萝卜丝', icon: '🥕', cutSpec: '20mm*1mm*1mm · 细丝 · 平刀', weightPerPack: 250, weighed: 0 },
|
||||
{ name: '黄瓜片', icon: '🥒', cutSpec: '30mm*30mm*3mm · 圆片 · 平刀', weightPerPack: 250, weighed: 0 }
|
||||
], seasonings: [
|
||||
{ name: '油', icon: '🛢', cellIdx: 0, weightPerPack: 50, weighed: 0 },
|
||||
{ name: '盐', icon: '🧂', cellIdx: 1, weightPerPack: 5, weighed: 0 },
|
||||
@@ -620,8 +620,8 @@
|
||||
orderType: 'external',
|
||||
mealPacks: [
|
||||
{ type: '餐品净菜包', packName: '鱼香肉丝套餐', packSize: 2, packSpec: '大份800g', ingredients: [
|
||||
{ name: '白菜丝', icon: '🥬', weightPerPack: 400, weighed: 0 },
|
||||
{ name: '胡萝卜丝', icon: '🥕', weightPerPack: 400, weighed: 0 }
|
||||
{ name: '白菜丝', icon: '🥬', cutSpec: '50mm*30mm*30mm · 宽段 · 平刀', weightPerPack: 400, weighed: 0 },
|
||||
{ name: '胡萝卜丝', icon: '🥕', cutSpec: '20mm*1mm*1mm · 细丝 · 平刀', weightPerPack: 400, weighed: 0 }
|
||||
], seasonings: [
|
||||
{ name: '油', icon: '🛢', cellIdx: 0, weightPerPack: 40, weighed: 0 },
|
||||
{ name: '盐', icon: '🧂', cellIdx: 1, weightPerPack: 4, weighed: 0 },
|
||||
@@ -734,6 +734,7 @@
|
||||
return {
|
||||
name: ing.name,
|
||||
icon: ing.icon,
|
||||
cutSpec: ing.cutSpec,
|
||||
weightPerPack: ing.weightPerPack,
|
||||
weighed: ing.weighed,
|
||||
packSize: currentPack.packSize
|
||||
@@ -829,6 +830,7 @@
|
||||
'<div class="item-card__data-item"><span class="item-card__data-label">份数</span><span class="item-card__data-value">' + ing.packSize + '</span></div>' +
|
||||
'<div class="item-card__data-item"><span class="item-card__data-label">应称</span><span class="item-card__data-value">' + need + 'g</span></div>' +
|
||||
'<div class="item-card__data-item"><span class="item-card__data-label">已称</span><span class="item-card__data-value ' + actualClass + '">' + ing.weighed + 'g</span></div>' +
|
||||
'<div class="item-card__data-item"><span class="item-card__data-label">净菜类型</span><span class="item-card__data-value">' + (ing.cutSpec || '—') + '</span></div>' +
|
||||
'</div>';
|
||||
|
||||
body.appendChild(row);
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
# 净菜组配秤 CHANGELOG
|
||||
|
||||
## [2.2.0] - 2026-06-25
|
||||
|
||||
### 组配作业页新增净菜类型
|
||||
- `02-weighing-packing.html` — 食材行数据行新增"净菜类型"项(尺寸·形状·刀工,如 `20mm*1mm*1mm · 细丝 · 平刀`),与净菜加工秤加工规格格式一致
|
||||
- 净菜类食材(丝/片/段)显示实际切法规格;菜品类食材(番茄炒蛋/凉拌黄瓜等)显示"—"
|
||||
- 数据层 ingredients 增加 `cutSpec` 字段,扁平化时传递
|
||||
|
||||
## [2.1.0] - 2026-06-25
|
||||
|
||||
### 组配记录页对齐组配任务页
|
||||
|
||||
Reference in New Issue
Block a user