@@ -406,11 +420,9 @@ document.querySelectorAll('.modal-mask').forEach(function(m){m.addEventListener(
/* 格口点击 → 左侧高亮 + 右侧表格行高亮联动 */
function selectSlot(idx){
- /* 左侧格口高亮 */
document.querySelectorAll('.cabinet-slot').forEach(function(s){s.classList.remove('active');});
var slot=document.querySelector('.cabinet-slot[data-slot="'+idx+'"]');
if(slot) slot.classList.add('active');
- /* 右侧表格行高亮 */
document.querySelectorAll('#detailTable tr').forEach(function(r){r.classList.remove('row-active');});
var row=document.querySelector('#detailTable tr[data-slot="'+idx+'"]');
if(row){row.classList.add('row-active');row.scrollIntoView({behavior:'smooth',block:'center'});}
@@ -435,6 +447,26 @@ function showVideo(code,name){
}
function closeVideoModal(){var m=document.getElementById('videoModal');if(m)m.remove();}
+/* 存入净菜弹窗 — 选择净菜订单后回显信息 */
+var orderData={
+ 'JC-2026-0422-007':{name:'土豆丝',spec:'5kg/袋',qty:'20份',weight:'12.5',time:'2026-04-22 08:00'},
+ 'JC-2026-0422-008':{name:'净黄瓜',spec:'3kg/袋',qty:'15份',weight:'9.0',time:'2026-04-22 08:30'},
+ 'JC-2026-0422-009':{name:'宫保鸡丁(餐品包)',spec:'6份/箱',qty:'30份',weight:'18.0',time:'2026-04-22 07:45'}
+};
+function onOrderSelect(sel){
+ var v=sel.value;
+ var area=document.getElementById('orderEchoArea');
+ if(!v){area.style.display='none';return;}
+ var d=orderData[v];
+ if(!d){area.style.display='none';return;}
+ area.style.display='';
+ document.getElementById('echo-name').textContent=d.name;
+ document.getElementById('echo-spec').textContent=d.spec;
+ document.getElementById('echo-qty').textContent=d.qty;
+ document.getElementById('echo-weight').textContent=d.weight+' kg';
+ document.getElementById('echo-time').textContent=d.time;
+}
+
/* 右侧抽屉组件 */
var Drawer={
open:function(title,bodyHtml){
@@ -452,17 +484,64 @@ var Drawer={
setTimeout(function(){o.remove();},200);
}
};
+
+/* 详情抽屉 — 根据类型区分渲染 */
function showDetail(el){
var row=el.closest('tr');
- var table=row.closest('table');
- var headers=table.querySelectorAll('thead th');
var cells=row.querySelectorAll('td');
- var html='
详细信息
';
- for(var i=0;i'+headers[i].textContent.trim()+''+cells[i].innerHTML.trim()+'
';
- }
+ var type=row.getAttribute('data-type');
+ var orderNo=row.getAttribute('data-order')||'—';
+ var traceCode=row.getAttribute('data-trace')||'—';
+ var slotId=cells[0].textContent.trim();
+ var itemName=cells[2].textContent.trim();
+ var typeHtml=cells[3].innerHTML.trim();
+ var initWeight=cells[4].textContent.trim();
+ var curWeight=cells[5].textContent.trim();
+ var operator=cells[6].textContent.trim();
+ var temp=cells[7].textContent.trim();
+ var remain=cells[8].textContent.trim();
+ var storeTime=cells[9].textContent.trim();
+ var status=cells[10].innerHTML.trim();
+
+ /* 基础信息区 */
+ var html='
基础信息
';
+ html+='
格口'+slotId+'
';
+ html+='
';
+ html+='
存放净菜'+itemName+'
';
+ html+='
类型'+typeHtml+'
';
+ html+='
初始重量(kg)'+initWeight+'
';
+ html+='
当前余量(kg)'+curWeight+'
';
+ html+='
操作人'+operator+'
';
+ html+='
温度(℃)'+temp+'
';
+ html+='
保质剩余'+remain+'
';
+ html+='
存入时间'+storeTime+'
';
+ html+='
状态'+status+'
';
html+='
';
- Drawer.open('保温柜详情 — '+cells[0].textContent.trim(),html);
+
+ /* 按类型区分渲染 */
+ if(type==='净菜'){
+ /* 净菜类型:显示溯源码 */
+ html+='
溯源信息
';
+ html+='
溯源码'+traceCode+'
';
+ html+='
';
+ }else if(type==='餐品包'){
+ /* 餐品包类型:显示食材明细表 */
+ html+='
食材明细
';
+ html+='
';
+ html+='| 溯源码 | ';
+ html+='食材名称 | ';
+ html+='分类 | ';
+ html+='每份用量 | ';
+ html+='合计用量 |
';
+ html+='';
+ html+='| NC-JD-0422-01 | 鸡丁 | 肉禽类 | 150g | 2.25kg |
';
+ html+='| NC-HS-0422-02 | 花生米 | 干果类 | 30g | 0.45kg |
';
+ html+='| NC-GJ-0422-03 | 干辣椒 | 调味料 | 10g | 0.15kg |
';
+ html+='| NC-HC-0422-04 | 黄瓜丁 | 蔬菜类 | 80g | 1.20kg |
';
+ html+='
';
+ }
+
+ Drawer.open('保温柜详情 — '+slotId,html);
}