From 769fcd57210aa3b44a4ee8e71d0bd3e128e1c6c9 Mon Sep 17 00:00:00 2001 From: zhangyan Date: Wed, 17 Jun 2026 09:18:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E3=80=8C=E4=B8=8B=E4=B8=80=E6=AD=A5?= =?UTF-8?q?=E3=80=8D=E6=94=B9=E4=B8=BA=E3=80=8C=E9=85=8D=E6=AF=94=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E3=80=8D=EF=BC=8C=E7=82=B9=E5=87=BB=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- .../ratio-scale/02-weighing-packing.html | 80 ++----------------- 1 file changed, 5 insertions(+), 75 deletions(-) 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 bc9189e..6f25d2a 100644 --- a/other-module/canteen-device/ratio-scale/02-weighing-packing.html +++ b/other-module/canteen-device/ratio-scale/02-weighing-packing.html @@ -436,7 +436,7 @@
- +
@@ -745,52 +745,8 @@ event.target.value = ''; } - /* ---- 日期选择器 ---- */ - function initDatePicker() { - var yearSel = document.getElementById('formExpiryYear'); - var monthSel = document.getElementById('formExpiryMonth'); - var daySel = document.getElementById('formExpiryDay'); - var now = new Date(); - var thisYear = now.getFullYear(); - /* 年:今年起往后 3 年 */ - for (var y = thisYear; y <= thisYear + 3; y++) { - var opt = document.createElement('option'); - opt.value = y; opt.textContent = y + ' 年'; - yearSel.appendChild(opt); - } - /* 月:1-12 */ - for (var m = 1; m <= 12; m++) { - var opt = document.createElement('option'); - opt.value = m; opt.textContent = m + ' 月'; - monthSel.appendChild(opt); - } - /* 日:根据年月动态更新 */ - monthSel.onchange = function() { updateDays(); }; - yearSel.onchange = function() { updateDays(); }; - } - function updateDays() { - var year = parseInt(document.getElementById('formExpiryYear').value); - var month = parseInt(document.getElementById('formExpiryMonth').value); - var daySel = document.getElementById('formExpiryDay'); - var curVal = daySel.value; - daySel.innerHTML = ''; - if (!year || !month) return; - var daysInMonth = new Date(year, month, 0).getDate(); - for (var d = 1; d <= daysInMonth; d++) { - var opt = document.createElement('option'); - opt.value = d; opt.textContent = d + ' 日'; - daySel.appendChild(opt); - } - if (parseInt(curVal) <= daysInMonth) daySel.value = curVal; - } - function resetDatePicker() { - document.getElementById('formExpiryYear').value = ''; - document.getElementById('formExpiryMonth').value = ''; - document.getElementById('formExpiryDay').innerHTML = ''; - } - - /* ---- 下一步:打开包装弹窗 ---- */ - function handleNext() { + /* ---- 配比完成 ---- */ + function handlePackDone() { var allDone = currentPack.ingredients.every(function(ing) { var need = ing.weightPerPack * currentPack.packSize; return ing.weighed >= need; @@ -799,35 +755,10 @@ showToast('还有食材未完成称重', 2500, 'error'); return; } - /* 重置弹窗字段 */ - document.getElementById('formPackMethod').value = ''; - resetDatePicker(); - document.getElementById('formTemp').value = ''; - document.getElementById('formDevice').value = ''; - document.getElementById('modalOverlay').classList.add('show'); - } - - /* ---- 关闭弹窗 ---- */ - function closeModal() { - document.getElementById('modalOverlay').classList.remove('show'); - } - - /* ---- 确认包装 ---- */ - function confirmPack() { - var packMethod = document.getElementById('formPackMethod').value; - var expYear = document.getElementById('formExpiryYear').value; - var expMonth = document.getElementById('formExpiryMonth').value; - var expDay = document.getElementById('formExpiryDay').value; - - /* 必填校验 */ - if (!packMethod) { showToast('请选择包装方式', 2000, 'error'); return; } - if (!expYear || !expMonth || !expDay) { showToast('请选择保质期至', 2000, 'error'); return; } - - closeModal(); - showToast('包装信息已确认,返回任务列表', 2500, 'success'); + showToast('配比完成', 1500, 'success'); setTimeout(function() { window.location.href = '01-packing-tasks.html' + (userName ? '?user=' + encodeURIComponent(userName) : ''); - }, 1500); + }, 1000); } /* ---- 清空重量 ---- */ @@ -883,7 +814,6 @@ })(); /* ---- 启动 ---- */ - initDatePicker(); init();