diff --git a/other-module/canteen-device/ratio-scale/01-packing-tasks.html b/other-module/canteen-device/ratio-scale/01-packing-tasks.html
index 341258c..1d0e4a9 100644
--- a/other-module/canteen-device/ratio-scale/01-packing-tasks.html
+++ b/other-module/canteen-device/ratio-scale/01-packing-tasks.html
@@ -166,67 +166,62 @@
/* 当前 Tab 筛选 */
var currentFilter = 'pending';
- /* 模拟数据:每任务只有1个餐品净菜包 */
+ /* 模拟数据:一个任务包含多个餐品净菜包 */
var mockData = [
{
- orderNo: 'PO-20260616-001',
- expectedArrival: '11:30',
taskNo: 'T-001',
- mealPack: {
- packName: '宫保鸡丁套餐',
- packSize: 3,
- notes: '少辣',
- ingredients: [
- { name: '土豆丝', icon: '🥔', iconClass: 'child-icon--potato', weightPerPack: 500, weighed: 750 },
- { name: '胡萝卜丝', icon: '🥕', iconClass: 'child-icon--carrot', weightPerPack: 500, weighed: 1500 },
- { name: '黄瓜片', icon: '🥒', iconClass: 'child-icon--cucumber', weightPerPack: 500, weighed: 0 },
- { name: '大葱丝', icon: '🧅', iconClass: 'child-icon--green-onion', weightPerPack: 500, weighed: 0 },
- { name: '紫洋葱丝', icon: '🧅', iconClass: 'child-icon--onion', weightPerPack: 500, weighed: 0 }
- ]
- }
+ mealPacks: [
+ {
+ packName: '宫保鸡丁套餐',
+ packSize: 3,
+ notes: '少辣',
+ ingredients: [
+ { name: '土豆丝', icon: '🥔', iconClass: 'child-icon--potato', weightPerPack: 500, weighed: 750 },
+ { name: '胡萝卜丝', icon: '🥕', iconClass: 'child-icon--carrot', weightPerPack: 500, weighed: 1500 },
+ { name: '黄瓜片', icon: '🥒', iconClass: 'child-icon--cucumber', weightPerPack: 500, weighed: 0 },
+ { name: '大葱丝', icon: '🧅', iconClass: 'child-icon--green-onion', weightPerPack: 500, weighed: 0 },
+ { name: '紫洋葱丝', icon: '🧅', iconClass: 'child-icon--onion', weightPerPack: 500, weighed: 0 }
+ ]
+ },
+ {
+ packName: '鱼香肉丝套餐',
+ packSize: 2,
+ notes: '',
+ ingredients: [
+ { name: '胡萝卜丝', icon: '🥕', iconClass: 'child-icon--carrot', weightPerPack: 750, weighed: 0 },
+ { name: '白菜丝', icon: '🥬', iconClass: 'child-icon--cabbage', weightPerPack: 1000, weighed: 0 },
+ { name: '土豆丝', icon: '🥔', iconClass: 'child-icon--potato', weightPerPack: 500, weighed: 0 }
+ ]
+ }
+ ]
},
{
- orderNo: 'PO-20260616-002',
- expectedArrival: '12:00',
taskNo: 'T-002',
- mealPack: {
- packName: '鱼香肉丝套餐',
- packSize: 2,
- notes: '',
- ingredients: [
- { name: '胡萝卜丝', icon: '🥕', iconClass: 'child-icon--carrot', weightPerPack: 750, weighed: 0 },
- { name: '白菜丝', icon: '🥬', iconClass: 'child-icon--cabbage', weightPerPack: 1000, weighed: 0 },
- { name: '土豆丝', icon: '🥔', iconClass: 'child-icon--potato', weightPerPack: 500, weighed: 0 }
- ]
- }
+ mealPacks: [
+ {
+ packName: '番茄炒蛋套餐',
+ packSize: 4,
+ notes: '',
+ ingredients: [
+ { name: '西红柿块', icon: '🍅', iconClass: 'child-icon--tomato', weightPerPack: 750, weighed: 3000 },
+ { name: '鸡蛋', icon: '🥚', iconClass: 'child-icon--egg', weightPerPack: 500, weighed: 2000 }
+ ]
+ }
+ ]
},
{
- orderNo: 'PO-20260616-003',
- expectedArrival: '14:30',
taskNo: 'T-003',
- mealPack: {
- packName: '番茄炒蛋套餐',
- packSize: 4,
- notes: '',
- ingredients: [
- { name: '西红柿块', icon: '🍅', iconClass: 'child-icon--tomato', weightPerPack: 750, weighed: 3000 },
- { name: '鸡蛋', icon: '🥚', iconClass: 'child-icon--egg', weightPerPack: 500, weighed: 2000 }
- ]
- }
- },
- {
- orderNo: 'PO-20260616-004',
- expectedArrival: '16:00',
- taskNo: 'T-004',
- mealPack: {
- packName: '凉拌黄瓜套餐',
- packSize: 5,
- notes: '多放蒜',
- ingredients: [
- { name: '黄瓜条', icon: '🥒', iconClass: 'child-icon--cucumber', weightPerPack: 750, weighed: 3750 },
- { name: '小番茄', icon: '🍅', iconClass: 'child-icon--tomato', weightPerPack: 250, weighed: 1250 }
- ]
- }
+ mealPacks: [
+ {
+ packName: '凉拌黄瓜套餐',
+ packSize: 5,
+ notes: '多放蒜',
+ ingredients: [
+ { name: '黄瓜条', icon: '🥒', iconClass: 'child-icon--cucumber', weightPerPack: 750, weighed: 3750 },
+ { name: '小番茄', icon: '🍅', iconClass: 'child-icon--tomato', weightPerPack: 250, weighed: 1250 }
+ ]
+ }
+ ]
}
];
@@ -246,6 +241,13 @@
});
}
+ /* 判断任务是否有待称重项 */
+ function hasPendingTask(task) {
+ return task.mealPacks.some(function(pack) {
+ return hasPendingPack(pack);
+ });
+ }
+
/* 渲染任务列表 */
function renderTaskList() {
var container = document.getElementById('taskListContainer');
@@ -254,79 +256,69 @@
var pendingCount = 0;
var doneCount = 0;
- mockData.forEach(function(order) {
- var pack = order.mealPack;
- var hasPending = hasPendingPack(pack);
- if (hasPending) pendingCount++; else doneCount++;
+ mockData.forEach(function(task) {
+ var taskHasPending = hasPendingTask(task);
+ if (taskHasPending) pendingCount++; else doneCount++;
var taskCard = document.createElement('div');
taskCard.className = 'task-card';
- /* 合并行:订单号 + 任务号 + 期望到货 + 状态 + 去称重 */
+ /* 任务头部:任务号 + 状态 */
var header = document.createElement('div');
header.className = 'task-card__header';
header.innerHTML =
- '订单号:' + order.orderNo + '' +
- '任务号:' + order.taskNo + '' +
- '⏰ 期望到货:' + order.expectedArrival + '' +
- '' + (hasPending ? '待称重' : '已完成') + '' +
- (hasPending
- ? ''
- : '');
+ '任务号' + task.taskNo + '' +
+ '' + (taskHasPending ? '待称重' : '已完成') + '';
taskCard.appendChild(header);
- /* 表格头(6列) */
- var tableHead = document.createElement('div');
- tableHead.className = 'item-table__head';
- tableHead.innerHTML = '
名称
每份用量
打包规格
所需总重
已称
状态
';
- taskCard.appendChild(tableHead);
+ /* 每个餐品净菜包为独立区块 */
+ task.mealPacks.forEach(function(pack) {
+ var packHasPending = hasPendingPack(pack);
+ var packStatus = getPackStatus(pack);
- /* 表格体 */
- var tableBody = document.createElement('div');
- tableBody.className = 'item-table__body';
+ /* 包标题行 */
+ var packHeader = document.createElement('div');
+ packHeader.className = 'item-parent-row';
+ packHeader.style.borderTop = '1px solid rgba(255,255,255,0.06)';
+ var totalNeed = 0;
+ var totalWeighed = 0;
+ pack.ingredients.forEach(function(ing) {
+ totalNeed += ing.weightPerPack * pack.packSize;
+ totalWeighed += ing.weighed;
+ });
+ totalNeed = Math.round(totalNeed * 100) / 100;
+ totalWeighed = Math.round(totalWeighed * 100) / 100;
+ var weightClass = totalWeighed >= totalNeed ? 'parent-weight--done' : '';
+ var hasPendingBtn = packHasPending ? '' : ' disabled';
+ packHeader.innerHTML =
+ '' +
+ '—
' +
+ '' + pack.packSize + ' 份
' +
+ '需 ' + totalNeed + ' 克
' +
+ '已 ' + totalWeighed + ' 克
' +
+ '' + packStatus.text + '' +
+ '
';
+ taskCard.appendChild(packHeader);
- var packStatus = getPackStatus(pack);
- var totalNeed = 0;
- var totalWeighed = 0;
- pack.ingredients.forEach(function(ing) {
- totalNeed += ing.weightPerPack * pack.packSize;
- totalWeighed += ing.weighed;
- });
- totalNeed = Math.round(totalNeed * 100) / 100;
- totalWeighed = Math.round(totalWeighed * 100) / 100;
- var weightClass = totalWeighed >= totalNeed ? 'parent-weight--done' : '';
+ /* 食材子行 */
+ pack.ingredients.forEach(function(ing) {
+ var need = Math.round(ing.weightPerPack * pack.packSize * 100) / 100;
+ var isDone = ing.weighed >= need;
+ var childWeightClass = isDone ? 'child-weight--done' : '';
- /* 主行:餐品净菜包 */
- var parentRow = document.createElement('div');
- parentRow.className = 'item-parent-row';
- parentRow.innerHTML =
- '' +
- '—
' +
- '' + pack.packSize + ' 份
' +
- '需 ' + totalNeed + ' 克
' +
- '已 ' + totalWeighed + ' 克
' +
- '' + packStatus.text + '
';
- tableBody.appendChild(parentRow);
-
- /* 子行:每种食材 */
- pack.ingredients.forEach(function(ing) {
- var need = Math.round(ing.weightPerPack * pack.packSize * 100) / 100;
- var isDone = ing.weighed >= need;
- var childWeightClass = isDone ? 'child-weight--done' : '';
-
- var childRow = document.createElement('div');
- childRow.className = 'item-child-row';
- childRow.innerHTML =
- '' + ing.icon + '
' + ing.name + ' ' +
- '' + ing.weightPerPack + ' 克
' +
- '×
' +
- '' + need + ' 克
' +
- '' + ing.weighed + ' 克
' +
- '' + (isDone ? '已完成' : '待称重') + '
';
- tableBody.appendChild(childRow);
+ var childRow = document.createElement('div');
+ childRow.className = 'item-child-row';
+ childRow.innerHTML =
+ '' + ing.icon + '
' + ing.name + ' ' +
+ '' + ing.weightPerPack + ' 克
' +
+ '×
' +
+ '' + need + ' 克
' +
+ '' + ing.weighed + ' 克
' +
+ '' + (isDone ? '已完成' : '待称重') + '
';
+ taskCard.appendChild(childRow);
+ });
});
- taskCard.appendChild(tableBody);
container.appendChild(taskCard);
});
@@ -342,19 +334,18 @@
el.classList.add('active');
document.querySelectorAll('.task-card').forEach(function(card) {
- var packBtn = card.querySelector('.task-card__pack-btn');
- var hasPending = packBtn && !packBtn.disabled;
+ var anyEnabled = card.querySelector('.task-card__pack-btn:not([disabled])');
if (filter === 'pending') {
- card.style.display = hasPending ? 'block' : 'none';
+ card.style.display = anyEnabled ? 'block' : 'none';
} else {
- card.style.display = hasPending ? 'none' : 'block';
+ card.style.display = anyEnabled ? 'none' : 'block';
}
});
}
/* 去称重 */
- function handleWeigh(taskNo, orderNo, packName) {
- var target = '02-weighing-packing.html?task=' + taskNo + '&pack=' + encodeURIComponent(packName) + '&order=' + encodeURIComponent(orderNo);
+ function handleWeigh(taskNo, packName) {
+ var target = '02-weighing-packing.html?task=' + taskNo + '&pack=' + encodeURIComponent(packName);
if (userName) target += '&user=' + encodeURIComponent(userName);
window.location.href = target;
}
diff --git a/other-module/canteen-device/ratio-scale/02-weighing-packing.html b/other-module/canteen-device/ratio-scale/02-weighing-packing.html
index 87ed460..7d9cc46 100644
--- a/other-module/canteen-device/ratio-scale/02-weighing-packing.html
+++ b/other-module/canteen-device/ratio-scale/02-weighing-packing.html
@@ -266,53 +266,14 @@
cursor: not-allowed; box-shadow: none;
}
- /* 弹窗遮罩 */
- .modal-overlay {
- position: fixed; inset: 0; background: rgba(0,0,0,0.65);
- display: none; align-items: center; justify-content: center;
- z-index: 999;
+ /* 任务下餐品净菜包列表 */
+ .task-packs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
+ .task-pack-tag {
+ font-size: 11px; padding: 3px 10px; border-radius: 4px;
+ background: rgba(114,46,209,0.1); color: rgba(255,255,255,0.6);
+ border: 1px solid rgba(114,46,209,0.2);
}
- .modal-overlay.show { display: flex; }
-
- /* 弹窗卡片 */
- .modal {
- background: #1a2b4a; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08);
- width: 580px; padding: 24px 28px 20px;
- box-shadow: 0 16px 48px rgba(0,0,0,0.5);
- }
- .modal__title { font-size: 16px; font-weight: 600; margin-bottom: 18px; color: #fff; }
- .modal__form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
- .modal__form-group { display: flex; flex-direction: column; gap: 4px; }
- .modal__form-group--full { grid-column: 1 / -1; }
- .modal__label { font-size: 11px; color: rgba(255,255,255,0.5); }
- .modal__label .required { color: #ff4d4f; margin-left: 2px; }
- .modal__input, .modal__select {
- padding: 8px 12px; background: #121832;
- border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
- color: #fff; font-size: 13px; outline: none;
- transition: border-color 0.2s;
- }
- .modal__input:focus, .modal__select:focus { border-color: #4a90d9; }
- .modal__input::placeholder { color: rgba(255,255,255,0.2); }
- /* 自定义日期选择器(三列下拉) */
- .date-picker { display: flex; gap: 6px; }
- .date-picker .modal__select { flex: 1; }
- .modal__select option { background: #1a2b4a; color: #fff; }
- .modal__actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
- .modal__btn {
- padding: 8px 24px; border-radius: 8px; font-size: 13px; font-weight: 500;
- cursor: pointer; border: none; transition: all 0.2s;
- }
- .modal__btn--cancel {
- background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
- }
- .modal__btn--cancel:hover { background: rgba(255,255,255,0.1); color: #fff; }
- .modal__btn--confirm {
- background: #4a90d9; color: #fff;
- }
- .modal__btn--confirm:hover { background: #3a7bc8; }
-
- /* Toast 提示 */
+ .task-pack-tag--current { color: #722ed1; background: rgba(114,46,209,0.2); border-color: rgba(114,46,209,0.4); }
.toast {
position: fixed; top: 60px; left: 50%; transform: translateX(-50%) translateY(-20px);
background: rgba(0,0,0,0.85); color: #fff; padding: 12px 28px; border-radius: 8px;
@@ -399,21 +360,13 @@
@@ -436,7 +389,7 @@
-
+
@@ -444,48 +397,6 @@
-
-
-