diff --git a/web-admin/nutrition/din-data-benefit.html b/web-admin/nutrition/din-data-benefit.html index ea5e139..90711ae 100644 --- a/web-admin/nutrition/din-data-benefit.html +++ b/web-admin/nutrition/din-data-benefit.html @@ -117,6 +117,15 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} .loss-bar__fill{height:100%;border-radius:9px;transition:width .4s;} .loss-bar__val{width:60px;font-weight:500;} .loss-tip{background:#FFF7E6;border:1px solid #FFE58F;border-radius:var(--radius-sm);padding:10px 14px;font-size:var(--font-sm);color:#D48806;margin-top:12px;display:flex;align-items:flex-start;gap:6px;} +/* 页面信息栏 */ +.page-header-bar{display:flex;align-items:center;justify-content:space-between;background:#fff;border-radius:var(--radius-md);padding:16px 24px;margin-bottom:16px;box-shadow:var(--shadow-sm);} +.page-header-bar__left{display:flex;align-items:center;gap:12px;} +.page-header-bar__title{font-size:var(--font-lg);font-weight:700;color:var(--text-primary);} +.page-header-bar__meta{font-size:var(--font-sm);color:var(--text-placeholder);} +.page-header-bar__right{display:flex;align-items:center;gap:12px;} +.page-header-bar__right label{font-size:var(--font-sm);color:var(--text-secondary);white-space:nowrap;} +.page-header-bar__right .canteen-select{height:36px;border:2px solid var(--primary);border-radius:var(--radius-sm);padding:0 32px 0 14px;font-size:var(--font-sm);color:var(--primary);font-weight:500;outline:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231890FF'/%3E%3C/svg%3E") no-repeat right 12px center;appearance:none;cursor:pointer;min-width:140px;} + /* 食材成本明细弹窗 */ .cost-header{display:flex;gap:24px;margin-bottom:16px;font-size:var(--font-sm);} .cost-header span{color:var(--text-secondary);} @@ -129,6 +138,21 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} .cost-summary{display:flex;justify-content:flex-end;gap:24px;padding:12px 16px;background:#FAFAFA;border-radius:0 0 var(--radius-md) var(--radius-md);font-size:var(--font-sm);} .cost-summary span{color:var(--text-secondary);} .cost-summary strong{color:var(--primary);margin-left:4px;} +/* 级联选择器 */ +.cascade-picker{position:relative;} +.cascade-trigger{height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 28px 0 12px;font-size:var(--font-sm);background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 10px center;cursor:pointer;display:flex;align-items:center;white-space:nowrap;color:var(--text-placeholder);min-width:120px;} +.cascade-trigger.has-value{color:var(--text-primary);} +.cascade-panel{display:none;position:fixed;z-index:200;background:#fff;border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-md);width:320px;} +.cascade-panel.show{display:flex;} +.cascade-col{width:50%;max-height:240px;overflow-y:auto;} +.cascade-col+.cascade-col{border-left:1px solid #f0f0f0;} +.cascade-col__title{font-size:var(--font-xs);color:var(--text-placeholder);padding:8px 12px;border-bottom:1px solid #f0f0f0;position:sticky;top:0;background:#fff;} +.cascade-opt{padding:7px 12px;font-size:var(--font-xs);cursor:pointer;transition:background .15s;display:flex;align-items:center;justify-content:space-between;} +.cascade-opt:hover{background:#F8FBFF;} +.cascade-opt.active{background:var(--primary-light);color:var(--primary);font-weight:500;} +.cascade-opt .arrow-r{font-size:10px;color:var(--text-placeholder);} +/* 重置按钮 */ +.btn-reset{background:#fff;color:var(--text-secondary);border:1px solid var(--border);}.btn-reset:hover{color:var(--danger);border-color:var(--danger);} @@ -196,9 +220,25 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
+ +
+
+ 食材效益 + 2026-05-20 · 数据实时更新 +
+
+ + +
+
+
-
📅
2026-04
统计周期
+
📅
2026-05
统计周期
💰
¥26.4万
餐材总采购金额
📈
¥12.6万
毛利总额
🗑️
¥1.5万
损耗金额
@@ -217,11 +257,20 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
-
+
+
+
全部
+
+
+
+
+
+
+
@@ -233,14 +282,14 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- + - - - - - - + + + + + +
统计日期食材编号食材名称所属分类供应商采购量(kg)采购单价(元/kg)采购总金额实际使用量(kg)损耗量(kg)损耗金额损耗率预警等级损耗原因操作
统计日期食材编号食材名称所属分类供应商采购量(kg)采购单价(元/kg)采购总金额实际使用量(kg)损耗量(kg)损耗金额损耗率预警等级操作
2026-04-22ING-001大白菜蔬菜类绿源农业620¥1.8¥1,11660515¥272.4%加工损耗损耗明细
2026-04-22ING-002菠菜蔬菜类绿源农业380¥2.5¥95034535¥87.59.2%储存变质损耗明细
2026-04-21ING-003猪肉(五花)肉禽类旺旺肉业480¥26¥12,48046218¥4683.8%加工损耗损耗明细
2026-04-21ING-004鸡胸肉肉禽类旺旺肉业320¥20¥6,40030812¥2403.8%加工损耗损耗明细
2026-04-20ING-005鲫鱼水产类东海水产280¥24¥6,72024832¥76811.4%过期未用损耗明细
2026-04-20ING-006虾仁水产类东海水产120¥68¥8,1601164¥2723.3%加工损耗损耗明细
2026-04-22ING-001大白菜蔬菜类绿源农业620¥1.8¥1,11660515¥272.4%损耗明细
2026-04-22ING-002菠菜蔬菜类绿源农业380¥2.5¥95034535¥87.59.2%损耗明细
2026-04-21ING-003猪肉(五花)肉禽类旺旺肉业480¥26¥12,48046218¥4683.8%损耗明细
2026-04-21ING-004鸡胸肉肉禽类旺旺肉业320¥20¥6,40030812¥2403.8%损耗明细
2026-04-20ING-005鲫鱼水产类东海水产280¥24¥6,72024832¥76811.4%损耗明细
2026-04-20ING-006虾仁水产类东海水产120¥68¥8,1601164¥2723.3%损耗明细
@@ -257,6 +306,7 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
+
@@ -296,7 +346,6 @@ const Modal={ overlay.innerHTML=``; document.body.appendChild(overlay); overlay.addEventListener('click',e=>{if(e.target===overlay)Modal.close();}); @@ -311,7 +360,7 @@ const Modal={ }; /* ===== 损耗明细弹窗 ===== */ -function showLossDetail(row){ +function showLossDetail(row,reasonText){ /* 从表格行中读取数据 */ const cells=row.querySelectorAll('td'); const date=cells[0].textContent.trim(); @@ -327,7 +376,7 @@ function showLossDetail(row){ const lossAmt=cells[10].textContent.trim(); const lossRate=cells[11].textContent.trim(); const level=cells[12].textContent.trim(); - const reason=cells[13].textContent.trim(); + const reason=reasonText||''; const html=`
@@ -351,10 +400,8 @@ function showLossDetail(row){
损耗金额${lossAmt}
损耗率${lossRate}
预警等级${level}
-
损耗原因${reason}
-
-
⚠️ 建议:${reason==='过期未用'?'加强库存先进先出管理,缩短采购周期,减少积压。':reason==='储存变质'?'检查冷链温控设备,优化储存条件,缩短库存周转天数。':'优化加工切配流程,加强厨师技能培训,减少边角料浪费。'}
`; + `; Modal.open('损耗明细 — '+name,html); } @@ -430,7 +477,7 @@ document.querySelectorAll('.tab-panel').forEach((panel,tabIdx)=>{ panel.querySelectorAll('tbody tr').forEach(row=>{ row.querySelectorAll('.td-actions .link').forEach(link=>{ if(tabIdx===0 && link.textContent.includes('损耗明细')){ - link.addEventListener('click',()=>showLossDetail(row)); + link.addEventListener('click',()=>showLossDetail(row,link.getAttribute('data-reason')||'')); } if(tabIdx===1 && link.textContent.includes('食材成本明细')){ link.addEventListener('click',()=>showCostDetail(row)); @@ -438,6 +485,65 @@ document.querySelectorAll('.tab-panel').forEach((panel,tabIdx)=>{ }); }); }); + +/* ===== 食材分类级联选择器 ===== */ +var BENEFIT_CATEGORIES={'蔬菜类':['叶菜类','根茎类','瓜果类','菌菇类','豆荚类'],'肉禽类':['猪肉','牛肉','羊肉','鸡肉','鸭肉'],'水产类':['淡水鱼','海水鱼','虾蟹','贝类'],'蛋类':['鸡蛋','鸭蛋','鹅蛋'],'豆制品类':['大豆','豆腐','豆浆'],'粮油类':['大米','面粉','食用油'],'调味品类':['酱料','香辛料','调味汁']}; +var benefitL1Active=''; +function toggleBenefitCascade(){ + var panel=document.getElementById('benefitCascadePanel'); + var open=!panel.classList.contains('show'); + if(open){ + var rect=document.getElementById('benefitCascadeTrigger').getBoundingClientRect(); + panel.style.left=rect.left+'px'; + panel.style.top=(rect.bottom+4)+'px'; + benefitL1Active='';renderBenefitL1();document.getElementById('benefitCascadeL2').innerHTML=''; + } + panel.classList.toggle('show',open); +} +function renderBenefitL1(){ + var col=document.getElementById('benefitCascadeL1'); + var html='
一级分类
'; + html+='
全部分类
'; + for(var k in BENEFIT_CATEGORIES){html+='
'+k+'
';} + col.innerHTML=html; +} +function renderBenefitL2(l1){ + var col=document.getElementById('benefitCascadeL2'); + if(!l1){col.innerHTML='';return;} + var subs=BENEFIT_CATEGORIES[l1]||[]; + var html='
二级分类
'; + html+='
全部'+l1+'
'; + subs.forEach(function(s){html+='
'+s+'
';}); + col.innerHTML=html; +} +function hoverBenefitL1(l1){ + benefitL1Active=l1; + document.querySelectorAll('#benefitCascadeL1 .cascade-opt').forEach(function(el,i){ + if(i===0) el.classList.toggle('active',!l1); + else el.classList.toggle('active',el.textContent.replace('›','').trim()===l1); + }); + renderBenefitL2(l1); +} +function selectBenefitCascade(l1,l2){ + var trig=document.getElementById('benefitCascadeTrigger'); + if(!l1){trig.textContent='全部';trig.classList.remove('has-value');} + else if(!l2){trig.textContent=l1;trig.classList.add('has-value');} + else{trig.textContent=l1+' / '+l2;trig.classList.add('has-value');} + document.getElementById('benefitCascadePanel').classList.remove('show'); +} +document.addEventListener('click',function(e){if(!e.target.closest('#benefitCategoryPicker'))document.getElementById('benefitCascadePanel').classList.remove('show');}); + +/* ===== 重置筛选 ===== */ +function resetFilter(tabIdx){ + var panel=document.querySelectorAll('.tab-panel')[tabIdx]; + if(!panel)return; + panel.querySelectorAll('.filter-select').forEach(function(s){s.selectedIndex=0;}); + panel.querySelectorAll('.filter-input[type="date"]').forEach(function(inp){inp.value='';}); + if(tabIdx===0){ + var trig=document.getElementById('benefitCascadeTrigger'); + trig.textContent='全部';trig.classList.remove('has-value'); + } +} \ No newline at end of file diff --git a/web-admin/nutrition/din-data-nutri.html b/web-admin/nutrition/din-data-nutri.html index 0203073..2890b83 100644 --- a/web-admin/nutrition/din-data-nutri.html +++ b/web-admin/nutrition/din-data-nutri.html @@ -83,6 +83,7 @@ tbody tr:hover{background:#F8FBFF;} .tag-orange{background:#FFF7E6;color:var(--warning);} .tag-red{background:#FFF1F0;color:var(--danger);} .tag-gray{background:#F5F5F5;color:#999;} +.tag-purple{background:#F9F0FF;color:#722ED1;} .link{color:var(--primary);cursor:pointer;font-size:var(--font-sm);}.link:hover{color:#40a9ff;} .pagination{display:flex;align-items:center;justify-content:flex-end;padding:16px 24px;gap:8px;border-top:1px solid var(--border);} .pagination span{font-size:var(--font-sm);color:var(--text-secondary);} @@ -96,6 +97,7 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} /* 弹窗样式 */ .modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.45);z-index:1000;display:flex;align-items:center;justify-content:center;animation:modalFadeIn .2s ease;} +.modal-overlay.layer{z-index:1010;background:rgba(0,0,0,.3);} .modal-overlay.closing{animation:modalFadeOut .2s ease forwards;} @keyframes modalFadeIn{from{opacity:0}to{opacity:1}} @keyframes modalFadeOut{from{opacity:1}to{opacity:0}} @@ -192,30 +194,30 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} .pyramid__legend-values{display:flex;gap:24px;color:var(--text-secondary);} .pyramid__legend-values strong{color:var(--text-primary);} -/* 餐品明细(溯源关联)弹窗 */ -.dish-modal{width:980px;} -.dish-header-info{display:flex;align-items:center;gap:24px;padding:14px 20px;background:#f8fafc;border-radius:var(--radius-md);margin-bottom:16px;font-size:var(--font-sm);flex-wrap:wrap;} +/* 餐品明细弹窗 */ +.dish-modal{width:900px;} +.dish-header-info{display:flex;align-items:center;gap:24px;padding:14px 20px;background:#f8fafc;border-radius:var(--radius-md);margin-bottom:20px;font-size:var(--font-sm);} .dish-header-info__item{display:flex;align-items:center;gap:6px;} .dish-header-info__label{color:var(--text-secondary);} .dish-header-info__value{color:var(--text-primary);font-weight:500;} -.dish-tip{display:flex;align-items:center;gap:8px;padding:10px 16px;background:var(--primary-light);border-radius:var(--radius-sm);margin-bottom:16px;font-size:var(--font-sm);color:var(--primary);} -.dish-tip svg{flex-shrink:0;} .dish-table{width:100%;border-collapse:collapse;font-size:var(--font-sm);margin-bottom:16px;} .dish-table thead th{background:#FAFAFA;padding:10px 12px;text-align:left;color:var(--text-secondary);font-weight:500;border-bottom:1px solid var(--border);white-space:nowrap;} .dish-table tbody td{padding:12px 12px;border-bottom:1px solid var(--border);color:var(--text-primary);white-space:nowrap;} .dish-table tbody tr:last-child td{border-bottom:none;} .dish-table tbody tr:hover{background:#F8FBFF;} -.dish-table .td-num{font-variant-numeric:tabular-nums;} .dish-table .td-code{color:var(--text-secondary);font-family:monospace;font-size:12px;} +.dish-table .td-num{text-align:right;font-family:monospace;} .dish-trace-link{color:var(--primary);cursor:pointer;font-size:var(--font-sm);display:inline-flex;align-items:center;gap:4px;}.dish-trace-link:hover{color:#40a9ff;} /* 底部汇总 */ -.dish-summary{display:flex;align-items:center;gap:32px;padding:16px 20px;background:#f8fafc;border-radius:var(--radius-md);font-size:var(--font-sm);} +.dish-summary{display:flex;align-items:center;gap:32px;padding:16px 20px;background:#f8fafc;border-radius:var(--radius-md);font-size:var(--font-sm);margin-top:8px;} .dish-summary__item{display:flex;align-items:baseline;gap:6px;} .dish-summary__label{color:var(--text-secondary);} .dish-summary__value{font-size:var(--font-lg);font-weight:700;color:var(--text-primary);} .dish-summary__value.blue{color:var(--primary);} .dish-summary__value.green{color:var(--success);} .dish-summary__value.orange{color:var(--warning);} +.dish-tip{display:flex;align-items:center;gap:6px;margin-top:16px;padding:10px 14px;background:#FFF7E6;border-radius:var(--radius-sm);font-size:var(--font-sm);color:var(--warning);} +.dish-tip svg{flex-shrink:0;} /* 营养师工作台弹窗 */ .wb-modal{width:1060px;} @@ -264,6 +266,21 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} .wb-plan__pct{font-size:11px;color:var(--text-secondary);margin-bottom:8px;} .wb-plan__items{font-size:12px;color:var(--text-secondary);line-height:1.9;} .wb-plan__actions{display:flex;gap:6px;margin-top:10px;} +/* 周选择器:日期范围覆盖原生文字 */ +.week-picker{position:relative;display:inline-block;} +.week-picker .filter-input{min-width:200px;color:transparent;} +.week-picker .filter-input::-webkit-datetime-edit{color:transparent;} +.week-picker__label{position:absolute;left:12px;top:50%;transform:translateY(-50%);font-size:var(--font-sm);color:var(--text-primary);pointer-events:none;white-space:nowrap;} + +/* 页面信息栏 */ +.page-header-bar{display:flex;align-items:center;justify-content:space-between;background:#fff;border-radius:var(--radius-md);padding:16px 24px;margin-bottom:16px;box-shadow:var(--shadow-sm);} +.page-header-bar__left{display:flex;align-items:center;gap:12px;} +.page-header-bar__title{font-size:var(--font-lg);font-weight:700;color:var(--text-primary);} +.page-header-bar__meta{font-size:var(--font-sm);color:var(--text-placeholder);} +.page-header-bar__right{display:flex;align-items:center;gap:12px;} +.page-header-bar__right label{font-size:var(--font-sm);color:var(--text-secondary);white-space:nowrap;} +.page-header-bar__right .canteen-select{height:36px;border:2px solid var(--primary);border-radius:var(--radius-sm);padding:0 32px 0 14px;font-size:var(--font-sm);color:var(--primary);font-weight:500;outline:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231890FF'/%3E%3C/svg%3E") no-repeat right 12px center;appearance:none;cursor:pointer;min-width:140px;} + /* 建议卡片 */ .wb-adv{border:1px solid var(--border);border-radius:6px;padding:10px 12px;margin-bottom:8px;} .wb-adv.ai{background:#f0f7ff;} @@ -293,6 +310,76 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} .wb-adv-input{width:100%;min-height:70px;padding:8px;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:var(--font-sm);resize:vertical;outline:none;font-family:inherit;} .wb-adv-input:focus{border-color:var(--primary);} .wb-adv-btns{display:flex;gap:6px;margin-top:8px;margin-bottom:12px;} +/* 二级弹窗表单 */ +.wb-form-modal{width:520px;} +.wb-form{display:flex;flex-direction:column;gap:16px;} +.wb-form-row{display:flex;align-items:flex-start;gap:12px;} +.wb-form-row__label{width:80px;flex-shrink:0;font-size:var(--font-sm);color:var(--text-secondary);line-height:32px;text-align:right;} +.wb-form-row__label::after{content:'';} /* placeholder for required marker */ +.wb-form-row__label.required::after{content:' *';color:var(--danger);} +.wb-form-row__body{flex:1;min-width:0;} +.wb-form-input{width:100%;height:32px;padding:0 10px;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:var(--font-sm);outline:none;box-sizing:border-box;font-family:inherit;} +.wb-form-input:focus{border-color:var(--primary);} +.wb-form-select{width:100%;height:32px;padding:0 10px;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:var(--font-sm);outline:none;background:#fff;cursor:pointer;font-family:inherit;} +.wb-form-select:focus{border-color:var(--primary);} +.wb-form-textarea{width:100%;min-height:80px;padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius-sm);font-size:var(--font-sm);outline:none;resize:vertical;font-family:inherit;box-sizing:border-box;line-height:1.6;} +.wb-form-textarea:focus{border-color:var(--primary);} +.wb-form-date{width:160px;} +.wb-form-date-range{display:flex;align-items:center;gap:8px;} +.wb-form-date-range span{color:var(--text-secondary);font-size:var(--font-sm);} +.wb-form-tags{display:flex;flex-wrap:wrap;gap:6px;} +.wb-form-tags__add{display:flex;align-items:center;gap:4px;height:28px;padding:0 10px;border:1px dashed var(--border);border-radius:var(--radius-sm);font-size:12px;color:var(--text-secondary);cursor:pointer;background:none;} +.wb-form-tags__add:hover{border-color:var(--primary);color:var(--primary);} +.wb-form-tag{display:flex;align-items:center;gap:4px;height:28px;padding:0 10px;background:var(--primary-light);color:var(--primary);border-radius:var(--radius-sm);font-size:12px;} +.wb-form-tag__close{cursor:pointer;font-size:14px;line-height:1;opacity:.6;} +.wb-form-tag__close:hover{opacity:1;} +.wb-form-radio-group{display:flex;gap:16px;height:32px;align-items:center;} +.wb-form-radio{display:flex;align-items:center;gap:4px;font-size:var(--font-sm);color:var(--text-primary);cursor:pointer;} +.wb-form-checkbox-group{display:flex;flex-wrap:wrap;gap:8px 16px;padding:6px 0;} +.wb-form-checkbox{display:flex;align-items:center;gap:5px;font-size:var(--font-sm);color:var(--text-primary);cursor:pointer;padding:4px 10px;border:1px solid var(--border);border-radius:var(--radius-sm);transition:all .15s;} +.wb-form-checkbox:has(input:checked){background:var(--primary-light);border-color:var(--primary);color:var(--primary);font-weight:500;} +.wb-form-checkbox input{width:14px;height:14px;accent-color:var(--primary);} +.wb-form-hint{font-size:11px;color:var(--text-placeholder);margin-top:4px;} +/* 历史用餐明细表格 */ +.meal-history-table{width:100%;border-collapse:collapse;font-size:var(--font-sm);} +.meal-history-table thead th{background:#FAFAFA;padding:10px 12px;text-align:left;color:var(--text-secondary);font-weight:500;border-bottom:1px solid var(--border);} +.meal-history-table tbody td{padding:12px;color:var(--text-primary);border-bottom:1px solid #f0f0f0;} +.meal-history-table tbody tr:last-child td{border-bottom:none;} +.meal-history-table tbody tr:hover{background:#F8FBFF;} +.score-tag{display:inline-block;padding:2px 8px;border-radius:4px;font-size:var(--font-sm);font-weight:600;} +.score-green{color:#52C41A;background:#F6FFED;} +.score-orange{color:#FA8C16;background:#FFF7E6;} +/* 菜品偏好 */ +.dish-pref-section{display:flex;flex-direction:column;gap:12px;} +.dish-pref-item__label{font-size:var(--font-xs);color:var(--text-secondary);margin-bottom:6px;} +.dish-pref-item__tags{display:flex;gap:6px;flex-wrap:wrap;} +.dish-tag{display:inline-block;padding:2px 10px;border-radius:4px;font-size:var(--font-xs);color:#52C41A;background:#F6FFED;border:1px solid #B7EB8F;} +.dish-pref-item__value{font-size:var(--font-sm);color:var(--text-primary);} +.dish-pref-item__big{font-size:var(--font-base);font-weight:600;color:var(--text-primary);} +/* 妈妈味道 */ +.mom-section{background:#FFF8F0;border-radius:var(--radius-md);padding:12px 16px;} +.mom-header{display:flex;align-items:center;gap:10px;margin-bottom:10px;} +.mom-header__icon{font-size:22px;} +.mom-header__title{font-size:var(--font-sm);font-weight:600;color:var(--text-primary);} +.mom-header__sub{font-size:var(--font-xs);color:#FA8C16;margin-top:2px;} +.mom-header__tags{display:flex;gap:6px;flex-wrap:wrap;} +.mom-tag{display:inline-block;padding:2px 10px;border-radius:4px;font-size:var(--font-xs);color:#FA8C16;background:#FFF7E6;border:1px solid #FFD591;} +/* 个性模型 */ +.model-section{background:#E6F7FF;border-radius:var(--radius-md);padding:12px 16px;margin-bottom:16px;} +.model-header{display:flex;align-items:center;gap:10px;margin-bottom:10px;} +.model-header__icon{font-size:22px;} +.model-header__title{font-size:var(--font-sm);font-weight:600;color:var(--primary);} +.model-header__sub{font-size:var(--font-xs);color:var(--text-secondary);margin-top:2px;} +.model-header__tags{display:flex;gap:6px;flex-wrap:wrap;} +.model-tag{display:inline-block;padding:2px 10px;border-radius:4px;font-size:var(--font-xs);color:var(--primary);background:#fff;border:1px solid #91D5FF;} +.model-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px 20px;margin-bottom:16px;} +.model-item__label{font-size:var(--font-xs);color:var(--text-secondary);margin-bottom:4px;} +.model-item__big{font-size:var(--font-base);font-weight:600;color:var(--text-primary);} +.model-item__value{font-size:var(--font-sm);} +.risk-tag{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;font-size:var(--font-xs);font-weight:500;} +.risk-safe{background:#F6FFED;color:#52C41A;border:1px solid #B7EB8F;} +.risk-warn{background:#FFF7E6;color:#FA8C16;border:1px solid #FFD591;} +.model-footer{font-size:var(--font-xs);color:var(--text-secondary);padding:10px 12px;background:#F5F7FA;border-radius:var(--radius-sm);} @@ -360,6 +447,24 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
+ + +
+
+ 营养管理 + 2026-05-20 · 数据实时更新 +
+
+ + +
+
+ +
946人
今日达标人数
@@ -379,21 +484,17 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
-
-
+
+
-
+
-
-
-
+
- -
@@ -403,14 +504,14 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- + - - - - - - + + + + + +
员工部门统计日期餐次订单来源实际热量(kcal)推荐热量(kcal)蛋白质(g)脂肪(g)碳水(g)钠(mg)对比昨日营养评分营养等级异常预警操作
就餐记录号姓名/编号单位/部门统计日期餐次订单来源实际热量(kcal)推荐热量(kcal)蛋白质(g)脂肪(g)碳水(g)钠(mg)对比昨日营养评分营养等级营养达标状态异常预警操作
张伟(EMP001)研发部2026-04-28午餐点餐2,1562,25078.372.1285.41,820↑+2分88分营养明细 餐品明细 查看用户信息
李娜(EMP002)市场部2026-04-28午餐点餐1,8421,80065.258.7241.32,180→持平76分钠持续偏高营养明细 餐品明细 查看用户信息
王磊(EMP003)运营部2026-04-28午餐餐线2,6802,25095.698.2312.12,560↓-3分62分热量+脂肪+钠均超标营养明细 餐品明细 查看用户信息
赵敏(EMP004)财务部2026-04-28午餐餐线1,7201,80058.452.3228.61,650↑+1分92分营养明细 餐品明细 查看用户信息
陈刚(EMP005)人事部2026-04-28早餐餐线2,0502,25072.168.4270.21,980→持平84分营养明细 餐品明细 查看用户信息
刘芳(EMP006)市场部2026-04-28午餐点餐1,4801,80048.642.1198.51,420↓-2分70分热量长期不达标营养明细 餐品明细 查看用户信息
M-20260428-001张伟(EMP001)采油一厂/研发部2026-04-28午餐点餐2,1562,25078.372.1285.41,820↑+2分88分达标营养明细 餐品明细 查看用户信息
M-20260428-002李娜(EMP002)采油二厂/市场部2026-04-28午餐点餐1,8421,80065.258.7241.32,180→持平76分超标钠持续偏高营养明细 餐品明细 查看用户信息
M-20260428-003王磊(EMP003)采油三厂/运营部2026-04-28午餐餐线2,6802,25095.698.2312.12,560↓-3分62分超标热量+脂肪+钠均超标营养明细 餐品明细 查看用户信息
M-20260428-004赵敏(EMP004)第五采气厂/财务部2026-04-28午餐餐线1,7201,80058.452.3228.61,650↑+1分92分达标营养明细 餐品明细 查看用户信息
M-20260428-005陈刚(EMP005)油气工艺所/人事部2026-04-28早餐餐线2,0502,25072.168.4270.21,980→持平84分达标营养明细 餐品明细 查看用户信息
M-20260428-006刘芳(EMP006)采油二厂/市场部2026-04-28午餐点餐1,4801,80048.642.1198.51,420↓-2分70分超标热量长期不达标营养明细 餐品明细 查看用户信息
@@ -421,20 +522,16 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
-
-
-
+
+
+
-
-
-
+
- -
@@ -444,36 +541,34 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- + - - - - + + + + + +
员工部门统计日期统计范围订单来源日总热量(kcal)推荐热量(kcal)蛋白质(g)脂肪(g)碳水(g)钠(mg)对比昨日营养评分营养等级异常预警操作
就餐记录号姓名/编号单位/部门统计日期订单来源日总热量(kcal)推荐热量(kcal)蛋白质(g)脂肪(g)碳水(g)钠(mg)对比昨日营养评分营养等级营养达标状态异常预警操作
张伟(EMP001)研发部2026-04-28全餐次点餐2,1862,25076.870.9281.61,790↑+1.2%86分营养明细 餐品明细 查看用户信息
李娜(EMP002)市场部2026-04-28全餐次点餐1,8641,80064.657.8238.22,140↓-0.8%74分钠连续超标营养明细 餐品明细 查看用户信息
王磊(EMP003)运营部2026-04-28全餐次餐线2,6422,25093.495.1308.82,510↑+2.6%60分三项持续超标营养明细 餐品明细 查看用户信息
赵敏(EMP004)财务部2026-04-28全餐次餐线1,7461,80057.651.4226.31,620↑+0.6%90分营养明细 餐品明细 查看用户信息
M-20260428-001张伟(EMP001)采油一厂/研发部2026-04-28点餐2,1862,25076.870.9281.61,790↑+1.2%86分达标营养明细 餐品明细 查看用户信息
M-20260428-002李娜(EMP002)采油二厂/市场部2026-04-28点餐1,8641,80064.657.8238.22,140↓-0.8%74分超标钠连续超标营养明细 餐品明细 查看用户信息
M-20260428-003王磊(EMP003)采油三厂/运营部2026-04-28餐线2,6422,25093.495.1308.82,510↑+2.6%60分超标三项持续超标营养明细 餐品明细 查看用户信息
M-20260428-004赵敏(EMP004)第五采气厂/财务部2026-04-28餐线1,7461,80057.651.4226.31,620↑+0.6%90分达标营养明细 餐品明细 查看用户信息
M-20260428-005陈刚(EMP005)油气工艺所/人事部2026-04-28餐线2,0502,25072.168.4270.21,980→持平84分达标营养明细 餐品明细 查看用户信息
M-20260428-006刘芳(EMP006)采油二厂/市场部2026-04-28点餐1,4801,80048.642.1198.51,420↓-2.1%70分超标热量长期不达标营养明细 餐品明细 查看用户信息
- +
-
-
-
+
+
+
-
-
-
+
2026-05-18 ~ 2026-05-24
- -
@@ -483,34 +578,35 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- + - - - - + + + + + +
员工部门统计周统计范围订单来源周均热量(kcal)周均推荐热量(kcal)周均蛋白质(g)周均脂肪(g)周均碳水(g)周均钠(mg)对比上周营养评分营养等级异常预警操作
就餐记录号姓名/编号单位/部门统计周订单来源周均热量(kcal)推荐热量(kcal)蛋白质(g)脂肪(g)碳水(g)钠(mg)对比上周营养评分营养等级营养达标状态异常预警操作
张伟(EMP001)研发部2026年第18周全餐次点餐2,1862,25076.870.9281.61,790↑+1.2%86分营养明细 餐品明细 查看用户信息
李娜(EMP002)市场部2026年第18周全餐次点餐1,8641,80064.657.8238.22,140↓-0.8%74分钠连续超标营养明细 餐品明细 查看用户信息
王磊(EMP003)运营部2026年第18周全餐次餐线2,6422,25093.495.1308.82,510↑+2.6%60分三项持续超标营养明细 餐品明细 查看用户信息
赵敏(EMP004)财务部2026年第18周全餐次餐线1,7461,80057.651.4226.31,620↑+0.6%90分营养明细 餐品明细 查看用户信息
M-20260428-001张伟(EMP001)采油一厂/研发部2026年第18周点餐2,1862,25076.870.9281.61,790↑+1.2%86分达标营养明细 餐品明细 查看用户信息
M-20260428-002李娜(EMP002)采油二厂/市场部2026年第18周点餐1,8641,80064.657.8238.22,140↓-0.8%74分超标钠连续超标营养明细 餐品明细 查看用户信息
M-20260428-003王磊(EMP003)采油三厂/运营部2026年第18周餐线2,6422,25093.495.1308.82,510↑+2.6%60分超标三项持续超标营养明细 餐品明细 查看用户信息
M-20260428-004赵敏(EMP004)第五采气厂/财务部2026年第18周餐线1,7461,80057.651.4226.31,620↑+0.6%90分达标营养明细 餐品明细 查看用户信息
M-20260428-005陈刚(EMP005)油气工艺所/人事部2026年第18周餐线2,0502,25072.168.4270.21,980→持平84分达标营养明细 餐品明细 查看用户信息
M-20260428-006刘芳(EMP006)采油二厂/市场部2026年第18周点餐1,4801,80048.642.1198.51,420↓-2.1%70分超标热量长期不达标营养明细 餐品明细 查看用户信息
- +
-
-
-
+
+
+
-
+
- @@ -521,16 +617,16 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- + - - - - - - - - + + + + + + + +
用户部门人员类别慢病标签近30日评分评分趋势最近异常风险等级干预状态营养师最近跟进操作
姓名/编号单位/部门人员类别慢病标签近30日评分评分趋势最近异常风险等级干预状态最近跟进跟进营养师操作
张伟(EMP001)研发部会员86分↑ 稳中有升已稳定林营养师2026-04-26🍽️ 营养管理 查看用户信息
李娜(EMP002)市场部会员高血压74分→ 持平钠超标跟进中林营养师2026-05-08🍽️ 营养管理 查看用户信息
王磊(EMP003)运营部非会员高血脂60分↓ 下降热量+脂肪+钠跟进中周营养师2026-05-10🍽️ 营养管理 查看用户信息
赵敏(EMP004)财务部会员糖尿病90分↑ 改善跟进中林营养师2026-05-09🍽️ 营养管理 查看用户信息
陈刚(EMP005)人事部非会员84分→ 持平未跟进🍽️ 营养管理 查看用户信息
刘芳(EMP006)市场部会员70分↓ 轻度下降热量长期不达标跟进中周营养师2026-05-07🍽️ 营养管理 查看用户信息
孙磊(EMP010)行政部非会员高血压·高尿酸64分↓ 下降钠+尿酸需复诊周营养师2026-05-05🍽️ 营养管理 查看用户信息
钱芳(EMP011)销售部会员BMI偏低82分↑ 改善跟进中林营养师2026-05-06🍽️ 营养管理 查看用户信息
张伟(EMP001)采油一厂/研发部会员用户86分↑ 稳中有升已稳定2026-04-26林营养师🍽️ 营养管理 查看用户信息
李娜(EMP002)采油二厂/市场部会员用户高血压74分→ 持平钠超标跟进中2026-05-08林营养师🍽️ 营养管理 查看用户信息
王磊(EMP003)采油三厂/运营部员工高血脂60分↓ 下降热量+脂肪+钠跟进中2026-05-10周营养师🍽️ 营养管理 查看用户信息
赵敏(EMP004)第五采气厂/财务部会员用户糖尿病90分↑ 改善跟进中2026-05-09林营养师🍽️ 营养管理 查看用户信息
陈刚(EMP005)油气工艺所/人事部普通用户84分→ 持平未跟进🍽️ 营养管理 查看用户信息
刘芳(EMP006)采油二厂/市场部会员用户70分↓ 轻度下降热量长期不达标跟进中2026-05-07周营养师🍽️ 营养管理 查看用户信息
孙磊(EMP010)数质中心/行政部工作人员高血压·高尿酸64分↓ 下降钠+尿酸需复诊2026-05-05周营养师🍽️ 营养管理 查看用户信息
钱芳(EMP011)供水公司/销售部外部人员BMI偏低82分↑ 改善跟进中2026-05-06林营养师🍽️ 营养管理 查看用户信息
@@ -545,6 +641,20 @@ function switchTab(idx){document.querySelectorAll('.page-tab').forEach((t,i)=>t. function toggleSubgroup(header){header.parentElement.classList.toggle('open');} (function(){var active=document.querySelector('.sidebar-item.active');if(!active)return;var sub=active.closest('.sidebar-subgroup');if(sub)sub.classList.add('open');})(); +/* 周选择器:变更时更新覆盖层日期范围 */ +document.querySelectorAll('.week-range-input').forEach(function(input){ + input.addEventListener('change',function(){ + var v=this.value; if(!v)return; + var parts=v.split('-W'), year=parseInt(parts[0]), week=parseInt(parts[1]); + var d=new Date(year,0,4); + d.setDate(d.getDate()-(d.getDay()||7)+1+(week-1)*7); + var mon=d.toISOString().slice(0,10); + var sun=new Date(d); sun.setDate(sun.getDate()+6); + var label=this.parentElement.querySelector('.week-picker__label'); + if(label) label.textContent=mon+' ~ '+sun.toISOString().slice(0,10); + }); +}); + /* ========== 弹窗基础 ========== */ const Modal = { open(title, bodyHtml, extraClass, footerHtml) { @@ -560,7 +670,24 @@ const Modal = { document.body.appendChild(overlay); }, close() { - const o = document.querySelector('.modal-overlay'); + const o = document.querySelector('.modal-overlay:not(.layer)'); + if (!o) return; + o.classList.add('closing'); + setTimeout(() => o.remove(), 200); + }, + openLayer(title, bodyHtml, extraClass, footerHtml) { + const overlay = document.createElement('div'); + overlay.className = 'modal-overlay layer'; + overlay.innerHTML = ``; + overlay.addEventListener('click', e => { if (e.target === overlay) Modal.closeLayer(); }); + document.body.appendChild(overlay); + }, + closeLayer() { + const o = document.querySelector('.modal-overlay.layer'); if (!o) return; o.classList.add('closing'); setTimeout(() => o.remove(), 200); @@ -569,34 +696,58 @@ const Modal = { /* ========== 十维档案 ========== */ const userProfiles = { - '张伟': { dept:'研发部', age:38, gender:'男', height:'175cm', weight:'72kg', bmi:'22.9', activity:'中度活动', + '张伟': { dept:'公司机关/研发部', age:32, gender:'男', height:'175cm', weight:'72kg', bmi:'23.5', activity:'中等', disease:'无', chronic:'无', medicine:'无', family:'高血压(父)', examDate:'2026-03-15', bp:'125/80', glucose:'5.2', lipid:'正常', uric:'380', liver:'正常', kidney:'正常', taste:'偏辣', region:'川菜、湘菜', taboo:'无', allergy:'花生', exercise:'6000步/日', weightTrend:'稳定', bodyFat:'18%', heartRate:'68', sleep:'7.5h', stress:'低', source:'智能手环', - meals30:'58次', hotDish:'宫保鸡丁、番茄牛腩', avgCal:'680kcal', nutriRate:'88%', - favDish:'宫保鸡丁、清炒西兰花', recDish:'三文鱼沙拉', avoidDish:'油炸花生', topRate:'番茄牛腩(4.8)', repurchase:'宫保鸡丁', - hometown:'四川成都', momTag:'麻辣鲜香', momList:'回锅肉、麻婆豆腐', memory:'妈妈的回锅肉', recTry:'水煮鱼', - modelVer:'v2.3', modelTime:'2026-04-20', recCal:'2100kcal', nutriFocus:'蛋白质+膳食纤维', risk:'无', tags:'运动达人、川菜爱好者', confidence:'92%' }, - '李娜': { dept:'市场部', age:34, gender:'女', height:'163cm', weight:'52kg', bmi:'19.8', activity:'轻度活动', + meals30:'86次', hotDish:'宫保鸡丁、番茄牛腩', avgCal:'2,186 kcal/天', nutriRate:'88%', + proteinRate:'92%', highFatRate:'8%', preferMeal:'午餐', lastMeal:'2026-04-28 午餐', + mealHistory:[ + {date:'2026-04-28',meal:'午餐',dishes:'清蒸鱼、炒西兰花、米饭、紫菜蛋花汤',cal:'832 kcal',score:95}, + {date:'2026-04-28',meal:'早餐',dishes:'小米粥、卤蛋、凉拌黄瓜',cal:'380 kcal',score:92}, + {date:'2026-04-27',meal:'午餐',dishes:'杂粮饭、清蒸鱼、蒜蓉菠菜',cal:'798 kcal',score:94}, + {date:'2026-04-26',meal:'午餐',dishes:'米饭、宫保鸡丁、炒西兰花、汤',cal:'906 kcal',score:86}, + {date:'2026-04-25',meal:'晚餐',dishes:'杂粮饭、清蒸鱼、炒时蔬',cal:'716 kcal',score:96} + ], + favDish:'宫保鸡丁、清炒西兰花、杂粮饭', recDish:'三文鱼沙拉、蒜蓉菠菜', avoidDish:'油炸花生', topRate:'宫保鸡丁(94分)', repurchase:'宫保鸡丁(近30日18次)', + hometown:'四川成都', momTag:'麻辣、红油、鲜香', momList:'回锅肉、麻婆豆腐、水煮鱼', memory:'从小常吃妈妈做的回锅肉,奠定了麻辣口味偏好。', recTry:'川味水煮鱼套餐(已上架一号食堂)', + modelVer:'v2.3', modelTime:'2026-04-20', recCal:'2,250 kcal', nutriFocus:'蛋白质+膳食纤维', risk:'无风险', tags:'清淡偏好、中度活动、无慢病', confidence:'94%', nextUpdate:'2026-05-28' }, + '李娜': { dept:'采油二厂/市场部', age:28, gender:'女', height:'163cm', weight:'52kg', bmi:'19.6', activity:'轻度', disease:'无', chronic:'无', medicine:'无', family:'糖尿病(母)', examDate:'2026-02-20', bp:'110/70', glucose:'4.8', lipid:'正常', uric:'290', liver:'正常', kidney:'正常', taste:'清淡', region:'粤菜、日料', taboo:'无', allergy:'海鲜(虾蟹)', exercise:'4000步/日', weightTrend:'稳定', bodyFat:'22%', heartRate:'72', sleep:'7h', stress:'中', source:'手机计步', - meals30:'52次', hotDish:'蒸鱼、蔬菜沙拉', avgCal:'520kcal', nutriRate:'92%', - favDish:'清蒸鲈鱼、藜麦沙拉', recDish:'牛油果吐司', avoidDish:'麻辣火锅', topRate:'藜麦沙拉(4.9)', repurchase:'清蒸鲈鱼', - hometown:'广东广州', momTag:'鲜甜清润', momList:'老火靓汤、白切鸡', memory:'周末的煲汤', recTry:'椰子鸡', - modelVer:'v2.3', modelTime:'2026-04-18', recCal:'1650kcal', nutriFocus:'钙+铁+维生素D', risk:'注意糖摄入', tags:'轻食主义、养生达人', confidence:'95%' } + meals30:'52次', hotDish:'清蒸鲈鱼、藜麦沙拉', avgCal:'1,650 kcal/天', nutriRate:'92%', + proteinRate:'95%', highFatRate:'5%', preferMeal:'午餐', lastMeal:'2026-04-28 午餐', + mealHistory:[ + {date:'2026-04-28',meal:'午餐',dishes:'藜麦沙拉、清蒸鲈鱼、蒜蓉西兰花',cal:'680 kcal',score:96}, + {date:'2026-04-28',meal:'早餐',dishes:'牛油果吐司、酸奶、水果',cal:'420 kcal',score:94}, + {date:'2026-04-27',meal:'午餐',dishes:'三文鱼沙拉、杂粮饭、蔬菜汤',cal:'720 kcal',score:97}, + {date:'2026-04-26',meal:'午餐',dishes:'清蒸鲈鱼、藜麦饭、凉拌木耳',cal:'650 kcal',score:95}, + {date:'2026-04-25',meal:'晚餐',dishes:'蔬菜沙拉、鸡胸肉、全麦面包',cal:'580 kcal',score:93} + ], + favDish:'清蒸鲈鱼、藜麦沙拉、杂粮饭', recDish:'蒜蓉菠菜、紫菜蛋花汤', avoidDish:'暂无', topRate:'清蒸鱼(96分)', repurchase:'清蒸鱼(近30日21次)', + hometown:'广东广州', momTag:'清炖、甜咸适中、河鲜', momList:'松鼠桂鱼、响油鳝糊、腌笃鲜', memory:'从小常吃妈妈做的清炖鱼,奠定了清淡口味偏好。', recTry:'苏式清蒸鱼套餐(已上架二号食堂)', + modelVer:'v2.3', modelTime:'2026-04-18', recCal:'1,650 kcal', nutriFocus:'钙+铁+维生素D', risk:'注意糖摄入', tags:'轻食主义、养生达人、低糖饮食', confidence:'95%', nextUpdate:'2026-05-28' } }; const defaultProfile = { dept:'—', age:30, gender:'—', height:'170cm', weight:'65kg', bmi:'22.5', activity:'中等', disease:'无', chronic:'无', medicine:'无', family:'无', examDate:'2026-01-10', bp:'120/78', glucose:'5.0', lipid:'正常', uric:'350', liver:'正常', kidney:'正常', taste:'适中', region:'不限', taboo:'无', allergy:'无', exercise:'5000步/日', weightTrend:'稳定', bodyFat:'20%', heartRate:'70', sleep:'7h', stress:'低', source:'手动录入', - meals30:'45次', hotDish:'家常菜', avgCal:'600kcal', nutriRate:'78%', - favDish:'红烧肉、西红柿炒蛋', recDish:'杂粮饭套餐', avoidDish:'无', topRate:'红烧肉(4.5)', repurchase:'西红柿炒蛋', - hometown:'—', momTag:'家常味', momList:'红烧肉', memory:'—', recTry:'—', - modelVer:'v2.3', modelTime:'2026-04-15', recCal:'1900kcal', nutriFocus:'均衡', risk:'无', tags:'普通用户', confidence:'80%' }; + meals30:'45次', hotDish:'家常菜', avgCal:'1,900 kcal/天', nutriRate:'78%', + proteinRate:'80%', highFatRate:'12%', preferMeal:'午餐', lastMeal:'2026-04-28 午餐', + mealHistory:[ + {date:'2026-04-28',meal:'午餐',dishes:'红烧肉、米饭、炒青菜、蛋花汤',cal:'856 kcal',score:82}, + {date:'2026-04-27',meal:'午餐',dishes:'西红柿炒蛋、米饭、紫菜汤',cal:'720 kcal',score:85}, + {date:'2026-04-26',meal:'午餐',dishes:'糖醋里脊、米饭、炒时蔬',cal:'880 kcal',score:80}, + {date:'2026-04-25',meal:'午餐',dishes:'红烧肉、杂粮饭、凉拌黄瓜',cal:'810 kcal',score:84}, + {date:'2026-04-24',meal:'午餐',dishes:'宫保鸡丁、米饭、番茄蛋汤',cal:'790 kcal',score:86} + ], + favDish:'红烧肉、西红柿炒蛋、炒青菜', recDish:'杂粮饭套餐、蒸南瓜', avoidDish:'暂无', topRate:'红烧肉(90分)', repurchase:'西红柿炒蛋(近30日15次)', + hometown:'—', momTag:'家常、咸鲜、炖煮', momList:'红烧肉、炖排骨、西红柿炒蛋', memory:'小时候最爱妈妈做的红烧肉,是家的味道。', recTry:'家常红烧肉套餐(已上架一号食堂)', + modelVer:'v2.3', modelTime:'2026-04-15', recCal:'1,900 kcal', nutriFocus:'均衡', risk:'无风险', tags:'家常口味、中度活动、无慢病', confidence:'80%', nextUpdate:'2026-05-28' }; const tabDefs = [ { key:'basic', label:'静态基础' },{ key:'disease', label:'疾病信息' },{ key:'physical', label:'体检信息' }, @@ -606,16 +757,95 @@ const tabDefs = [ function buildProfileHTML(name, p) { const panels = { - basic: `
姓名${name}
部门${p.dept}
年龄${p.age}岁
性别${p.gender}
身高${p.height}
体重${p.weight}
BMI${p.bmi}
活动水平${p.activity}
`, - disease: `
疾病史${p.disease}
慢病分级${p.chronic}
用药情况${p.medicine}
家族病史${p.family}
`, - physical: `
体检日期${p.examDate}
血压${p.bp} mmHg
空腹血糖${p.glucose} mmol/L
血脂${p.lipid}
尿酸${p.uric} μmol/L
肝功能${p.liver}
肾功能${p.kidney}
`, - taste: `
口味偏好${p.taste}
地域菜系${p.region}
`, - taboo: `
饮食禁忌${p.taboo}
过敏原${p.allergy}
`, - dynamic: `
日均运动量${p.exercise}
体重趋势${p.weightTrend}
体脂率${p.bodyFat}
静息心率${p.heartRate} bpm
平均睡眠${p.sleep}
压力指数${p.stress}
数据来源${p.source}
`, - meal: `
近30日就餐${p.meals30}
常点菜品${p.hotDish}
平均热量${p.avgCal}
营养达标率${p.nutriRate}
`, - dish: `
常点菜品${p.favDish}
系统推荐${p.recDish}
忌口菜品${p.avoidDish}
评分最高${p.topRate}
复购冠军${p.repurchase}
`, - mom: `
家乡${p.hometown}
妈妈味道标签${p.momTag}
思乡菜清单${p.momList}
关联记忆${p.memory}
推荐尝试${p.recTry}
`, - model: `
模型版本${p.modelVer}
生成时间${p.modelTime}
推荐热量${p.recCal}
营养侧重${p.nutriFocus}
风险预警${p.risk}
个性标签${p.tags}
模型置信度${p.confidence}
` + basic: `
+
姓名${name}
+
部门${p.dept}
+
年龄${p.age}岁
+
性别${p.gender}
+
身高${p.height}
+
体重${p.weight}
+
BMI${p.bmi}
+
活动水平${p.activity}
+
`, + disease: `
+
疾病史${p.disease}
+
慢病分级${p.chronic}
+
用药情况${p.medicine}
+
家族病史${p.family}
+
`, + physical: `
+
体检日期${p.examDate}
+
血压${p.bp} mmHg
+
空腹血糖${p.glucose} mmol/L
+
血脂${p.lipid}
+
尿酸${p.uric} μmol/L
+
肝功能${p.liver}
+
肾功能${p.kidney}
+
`, + taste: `
+
口味偏好${p.taste}
+
地域菜系${p.region}
+
`, + taboo: `
+
饮食禁忌${p.taboo}
+
过敏原${p.allergy}
+
`, + dynamic: `
+
日均运动量${p.exercise}
+
体重趋势${p.weightTrend}
+
体脂率${p.bodyFat}
+
静息心率${p.heartRate} bpm
+
平均睡眠${p.sleep}
+
压力指数${p.stress}
+
数据来源${p.source}
+
`, + meal: `
+
近30日就餐次数${p.meals30}
+
最常点菜品${p.hotDish}
+
平均热量摄入${p.avgCal}
+
蛋白质达标率${p.proteinRate}
+
高脂餐占比${p.highFatRate}
+
偏好餐次${p.preferMeal}
+
+
最近一次就餐${p.lastMeal}
+
📋 最近用餐明细(${p.mealHistory.length}条)
+ + + ${p.mealHistory.map(h => '').join('')} +
日期餐次菜品热量营养评分
'+h.date+''+h.meal+''+h.dishes+''+h.cal+''+h.score+'分
`, + dish: `
+
常点菜品
${p.favDish.split('、').map(d=>''+d+'').join('')}
+
系统推荐
${p.recDish.split('、').map(d=>''+d+'').join('')}
+
忌口菜品
${p.avoidDish||'暂无'}
+
评分最高
${p.topRate}
+
复购冠军
${p.repurchase}
+
`, + mom: `
+
+
🐱
+
家乡:${p.hometown}
从童年记忆中沉淀的味觉偏好与情感连接
+
+
${p.momTag.split('、').map(t=>''+t+'').join('')}
+
+
+
思乡菜清单
${p.momList.split('、').map(d=>''+d+'').join('')}
+
关联记忆
${p.memory}
+
推荐尝试
${p.recTry}
+
`, + model: `
+
+
🤖
+
${name} 的个性化营养模型
${p.modelVer} · 生成于 ${p.modelTime} · 置信度 ${p.confidence}
+
+
${p.tags.split('、').map(t=>''+t+'').join('')}
+
+
+
推荐每日热量
${p.recCal}
+
营养侧重
${p.nutriFocus}
+
风险预警
${p.risk==='无风险'?'✅ ':''} ${p.risk}
+
下次模型更新
${p.nextUpdate}
+
+ ` }; const tabs = tabDefs.map((t, i) => `
${t.label}
`).join(''); const panelsHtml = tabDefs.map((t, i) => `
${panels[t.key]}
`).join(''); @@ -778,16 +1008,10 @@ function showNutriDetail() { function buildDishDetailHTML() { const headerInfo = `
用户:张伟(EMP001)
-
统计范围:2026-04-28 午餐
-
消费合计:¥22.00
-
营养评分:88分
+
日期:2026-04-28
+
餐次:午餐
+
来源:点餐
`; - - const tip = `
- - 点击「食材溯源链路」按钮可在链路可视化中查看该餐品对应的食材溯源链路 -
`; - const table = ` @@ -796,33 +1020,39 @@ function buildDishDetailHTML() {
餐品编码菜品重量热量(kcal)蛋白质碳水脂肪单价超标状态食材溯源
DM-CSHU炒时蔬80g382.1g5.2g1.2g180mg¥8.00正常🔗 食材溯源链路
`; - const summary = `
总热量:856 kcal
热量达成率:43%
消费合计:¥22.00
营养评分:88分
`; - - return headerInfo + tip + table + summary; + const tip = `
+ + 点击"食材溯源链路"可查看该菜品从采购到出餐的完整追溯信息 +
`; + return headerInfo + table + summary + tip; } function showDishDetail() { - Modal.open('溯源关联 — 张伟(EMP001) · 2026-04-28 午餐', buildDishDetailHTML(), 'dish-modal'); + Modal.open('餐品明细 — 张伟(EMP001) · 2026-04-28 午餐', buildDishDetailHTML(), 'dish-modal'); } /* ========== 营养师工作台弹窗 ========== */ const wbData = { - user:'张伟(EMP001)', dept:'研发部', personType:'会员', age:38, gender:'男', bmi:'22.9', diseaseLabel:'无', + user:'张伟(EMP001)', dept:'采油一厂/研发部', personType:'会员', age:38, gender:'男', bmi:'22.9', diseaseLabel:'无', avgScore30:86, riskLevel:'低', interventionStatus:'已稳定', nutritionist:'林营养师', lastFollowUp:'2026-04-26', scoreTrend:[82,84,85,86,88,87,86], - warnings:[], + warnings:[ + { type:'钠摄入超标', severity:'高', evidence:'近7日钠摄入均值达 3200mg/日,超出推荐上限(2000mg)60%。合并高血压病史,需立即干预。', triggeredAt:'2026-05-18 09:15', notified:true }, + { type:'脂肪比例偏高', severity:'中', evidence:'近14日脂肪供能比达 38%,超出推荐范围(20%~30%)。建议减少油炸食品和红肉摄入。', triggeredAt:'2026-05-16 14:30', notified:true }, + { type:'蛋白质摄入不足', severity:'低', evidence:'近7日蛋白质日均摄入 42g,低于推荐值(65g)。建议增加优质蛋白(鱼、蛋、豆制品)。', triggeredAt:'2026-05-20 10:00', notified:false } + ], plans:[ { goal:'维持当前营养均衡水平', period:'2026-04-01 ~ 2026-09-30', progress:65, items:['每日蛋白质保持 ≥75g','深色蔬菜每日 ≥250g','红肉每周 ≤3 次'], status:'进行中' } ], advices:[ - { time:'2026-04-26', author:'林营养师', content:'本月各项指标稳定,继续保持当前饮食结构。下次复评 2026-05-26。', isAi:false }, - { time:'2026-04-15', author:'AI 助手', content:'检测到脂肪摄入连续 3 日偏高,建议减少红肉频次。', isAi:true } + { time:'2026-04-26 12:23', author:'林营养师', content:'本月各项指标稳定,继续保持当前饮食结构。下次复评 2026-05-26。', isAi:false }, + { time:'2026-04-15 12:23', author:'林营养师', content:'检测到脂肪摄入连续 3 日偏高,建议减少红肉频次。', isAi:false } ], followUps:[ { time:'2026-04-26 14:30', who:'林营养师', topic:'月度复评', content:'电话沟通,用户反馈饮食习惯无变化,BMI 维持 22.9。', feedback:'满意' }, @@ -867,8 +1097,8 @@ function buildWorkbenchHTML() {
BMI
${a.bmi}
慢病标签
${a.diseaseLabel}
人员类别
${a.personType}
-
负责营养师
${a.nutritionist}
-
最近跟进
${a.lastFollowUp}
+
最近跟进时间
${a.lastFollowUp}
+
跟进营养师
${a.nutritionist}
干预状态
${a.interventionStatus}
`; @@ -885,20 +1115,27 @@ function buildWorkbenchHTML() { `; }).join('') : '
当前无疾病预警
'; - const warnHtml = `
预警列表(${a.warnings.length})
${warnList}`; + const warnHtml = `
预警列表(${a.warnings.length})
${warnList}`; /* ② 营养规划 */ const planList = a.plans.length - ? a.plans.map(p => `
-
🎯 ${p.goal}${p.status}
+ ? a.plans.map((p, pi) => { + const isClosed = p.status === '已结束'; + const editBtn = isClosed ? '' : ``; + const closeBtn = isClosed ? '' : ``; + const delBtn = ``; + const tagCls = isClosed ? 'tag-gray' : 'tag-blue'; + return `
+
🎯 ${p.goal}${p.status}
⏱ ${p.period}
完成进度 ${p.progress}%
${p.items.map(i => `
· ${i}
`).join('')}
-
-
`).join('') +
${editBtn}${closeBtn}${delBtn}
+
`; + }).join('') : '
📋
暂无营养规划
'; - const planHtml = `
营养规划(${a.plans.length})
${planList}`; + const planHtml = `
营养规划(${a.plans.length})
${planList}`; /* ③ 营养建议 */ const advList = a.advices.map(ad => { @@ -924,7 +1161,7 @@ function buildWorkbenchHTML() { `).join('')}` : '
暂无跟进记录
'; - const followHtml = `
跟进时间轴(${a.followUps.length})
${followList}`; + const followHtml = `
跟进时间轴(${a.followUps.length})
${followList}`; /* 右侧面板 */ const right = `
@@ -955,11 +1192,204 @@ function showWorkbench() { Modal.open('🍽️ 营养师工作台 — ' + wbData.user, buildWorkbenchHTML(), 'wb-modal', footer); } +/* ========== 新增预警弹窗(叠层) ========== */ +function showAddWarning() { + const html = `
+
+ +
+ +
+
+
+ +
+
+ + + +
+
+
+
+ +
+ +
+
+
+ +
+
+ + + + + + + + +
+
+
+
`; + const footer = ``; + Modal.openLayer('新增预警 — ' + wbData.user, html, 'wb-form-modal', footer); +} + +/* ========== 新建/编辑规划弹窗(叠层) ========== */ +function showAddPlan(editData) { + const isEdit = !!editData; + const goal = isEdit ? editData.goal : ''; + const dateStart = isEdit ? editData.period.split(' ~ ')[0] : '2026-05-21'; + const dateEnd = isEdit ? editData.period.split(' ~ ')[1] : '2026-08-21'; + const items = isEdit ? editData.items.join('\n') : ''; + const progress = isEdit ? editData.progress : 0; + const html = `
+
+ +
+ +
+
+
+ +
+
+ + + +
+
建议周期 1~6 个月,到期可续期或结案
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + ${progress}% +
+
+
+
`; + const btnText = isEdit ? '保存修改' : '创建规划'; + const title = isEdit ? '编辑营养规划 — ' + wbData.user : '新建营养规划 — ' + wbData.user; + const footer = ``; + Modal.openLayer(title, html, 'wb-form-modal', footer); +} + +function showEditPlan(idx) { + showAddPlan(wbData.plans[idx]); +} + +function confirmClosePlan(btn) { + if (confirm('是否结束此次营养规划?')) { + var plan = btn.closest('.wb-plan'); + var tag = plan.querySelector('.tag'); + if (tag) { tag.textContent = '已结束'; tag.className = 'tag tag-gray'; } + var bar = plan.querySelector('.wb-plan__bar-fill'); + if (bar) bar.style.width = '100%'; + var pct = plan.querySelector('.wb-plan__pct strong'); + if (pct) pct.textContent = '100%'; + /* 移除编辑和结案按钮,保留删除 */ + var editBtn = plan.querySelector('.wb-plan__actions button:first-child'); + if (editBtn && editBtn.textContent === '编辑') editBtn.remove(); + btn.remove(); + } +} + +function confirmDeletePlan(btn) { + if (confirm('确定删除此营养规划?删除后不可恢复。')) { + btn.closest('.wb-plan').remove(); + } +} + +/* ========== 新建跟进弹窗 ========== */ +function showAddFollowUp() { + const html = `
+
+ +
+ +
+
+
+ +
+
+ + + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + + + +
+
+
+
+ +
+ +
设置后将在到期当天自动提醒
+
+
+
`; + const footer = ``; + Modal.openLayer('新建跟进记录 — ' + wbData.user, html, 'wb-form-modal', footer); +} + /* ========== 四个 Tab 列表事件绑定 ========== */ document.querySelectorAll('.tab-panel').forEach((panel, tabIdx) => { panel.querySelectorAll('tbody tr').forEach(row => { const links = row.querySelectorAll('.td-actions .link'); - const nameCell = row.querySelector('td:first-child'); + /* Tab0/1/2 姓名在第2列,Tab3 姓名在第1列 */ + const nameCell = tabIdx < 3 ? row.querySelector('td:nth-child(2)') : row.querySelector('td:first-child'); if (!nameCell) return; const rawName = nameCell.textContent.trim(); const userName = rawName.replace(/\(.*\)/, '').trim(); diff --git a/web-admin/nutrition/din-model-llm.html b/web-admin/nutrition/din-model-llm.html index 269ec84..2c41bdd 100644 --- a/web-admin/nutrition/din-model-llm.html +++ b/web-admin/nutrition/din-model-llm.html @@ -98,6 +98,17 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} .log-table tbody td{padding:12px 16px;font-size:var(--font-sm);color:var(--text-primary);border-bottom:1px solid var(--border);} .log-table tbody tr:last-child td{border-bottom:none;} .log-table tbody tr:hover{background:#F8FBFF;} +/* 新增模型弹窗表单 */ +.add-form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px;} +.add-form-item{display:flex;flex-direction:column;gap:6px;} +.add-form-item label{font-size:var(--font-sm);color:var(--text-secondary);font-weight:500;} +.add-form-item label .req{color:var(--danger);margin-left:2px;} +.add-form-item input,.add-form-item select{height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px;font-size:var(--font-sm);outline:none;background:#fff;width:100%;} +.add-form-item input:focus,.add-form-item select:focus{border-color:var(--primary);} +.add-form-item select{padding-right:28px;appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 10px center;cursor:pointer;} +.add-form-item textarea{width:100%;border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px 12px;font-size:var(--font-sm);outline:none;resize:vertical;min-height:60px;font-family:inherit;} +.add-form-item textarea:focus{border-color:var(--primary);} +.dyn-modal.model-modal{width:640px;} @@ -168,15 +179,15 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
-
-
+
+
- +
@@ -186,11 +197,11 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- + - - - + + +
模型编号模型名称提供商版本接入方式使用场景月调用量(次)月消耗Token月费用平均响应(ms)错误率超时率状态操作
模型编号模型名称API_KEYAPI_URL供应商版本接入方式使用场景月调用量(次)月消耗Token月费用平均响应(ms)错误率超时率状态操作
LLM-001豆包字节跳动Doubao-pro-32kAPI调用小程序AI营养顾问68,24042.6万¥2,1403200.12%0.08%在用调试日志
LLM-002DeepSeek-V3深度求索v3-20250324API调用管理端智能助手54,82038.2万¥1,7202800.08%0.05%在用调试日志
LLM-003文心一言百度ERNIE-4.0API调用小程序AI营养顾问00¥0备用调试日志
LLM-001豆包sk-****8a3fhttps://api.doubao.com/v1字节跳动Doubao-pro-32kAPI调用小程序AI营养顾问68,24042.6万¥2,1403200.12%0.08%启用编辑 调试日志
LLM-002DeepSeek-V3sk-****d2e1https://api.deepseek.com/v1深度求索v3-20250324API调用管理端智能助手54,82038.2万¥1,7202800.08%0.05%启用编辑 调试日志
LLM-003文心一言sk-****f5c9https://aip.baidubce.com/rpc百度ERNIE-4.0API调用小程序AI营养顾问00¥0停用编辑 调试日志
@@ -224,6 +235,32 @@ const DynModal={ } }; +/* ===== 接入新模型弹窗 ===== */ +function openAddModel(){ + const html=` +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`; + const footer=''; + DynModal.open('接入新模型',html,footer,'model-modal'); +} + /* ===== 调试日志数据(模拟) ===== */ const debugLogData={ 'LLM-001':[ @@ -253,8 +290,8 @@ function showDebugLog(row){ const cells=row.querySelectorAll('td'); const modelCode=cells[0].textContent.trim(); const modelName=cells[1].textContent.trim(); - const provider=cells[2].textContent.trim(); - const version=cells[3].textContent.trim(); + const provider=cells[4].textContent.trim(); + const version=cells[5].textContent.trim(); const records=debugLogData[modelCode]||[]; const statusTag=s=>s==='成功'?'tag-green':s==='超时'?'tag-orange':'tag-red'; @@ -279,7 +316,7 @@ function showDebugLog(row){
模型编号:${modelCode} 模型名称:${modelName} - 提供商:${provider} + 供应商:${provider} 版本:${version}
${tableHtml}`; @@ -287,12 +324,56 @@ function showDebugLog(row){ DynModal.open('调试日志 — '+modelName,html,'','log-modal'); } +/* ===== 编辑模型弹窗 ===== */ +function openEditModel(row){ + const cells=row.querySelectorAll('td'); + const modelCode=cells[0].textContent.trim(); + const modelName=cells[1].textContent.trim(); + const apiKey=cells[2].textContent.trim(); + const apiUrl=cells[3].textContent.trim(); + const provider=cells[4].textContent.trim(); + const version=cells[5].textContent.trim(); + const accessWay=cells[6].textContent.trim(); + const scene=cells[7].textContent.trim(); + const statusText=cells[14].textContent.trim(); + + const providers=['字节跳动','深度求索','百度','阿里云','OpenAI','其他']; + const accessWays=['API调用','SDK接入','私有化部署']; + const selOpt=(opts,cur)=>opts.map(o=>`${o}`).join(''); + + const html=` +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`; + const footer=''; + DynModal.open('编辑模型 — '+modelName,html,footer,'model-modal'); +} + /* ===== 事件绑定 ===== */ document.querySelectorAll('tbody tr').forEach(row=>{ row.querySelectorAll('.td-actions .link').forEach(link=>{ if(link.textContent.includes('调试日志')){ link.addEventListener('click',()=>showDebugLog(row)); } + if(link.textContent.includes('编辑')){ + link.addEventListener('click',()=>openEditModel(row)); + } }); }); diff --git a/web-admin/nutrition/din-model-small.html b/web-admin/nutrition/din-model-small.html index 4c02a69..05498c9 100644 --- a/web-admin/nutrition/din-model-small.html +++ b/web-admin/nutrition/din-model-small.html @@ -119,6 +119,15 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} .test-result__title{font-size:var(--font-sm);color:var(--success);font-weight:600;margin-bottom:8px;} .test-result__content{font-size:var(--font-base);color:var(--text-primary);line-height:1.6;} .test-result__score{font-size:var(--font-lg);font-weight:700;color:var(--success);} +/* 新增模型表单 */ +.add-form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px;} +.add-form-item{display:flex;flex-direction:column;gap:6px;} +.add-form-item label{font-size:var(--font-sm);color:var(--text-secondary);font-weight:500;} +.add-form-item label .req{color:var(--danger);margin-left:2px;} +.add-form-item input,.add-form-item select{height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px;font-size:var(--font-sm);outline:none;background:#fff;width:100%;} +.add-form-item input:focus,.add-form-item select:focus{border-color:var(--primary);} +.add-form-item select{padding-right:28px;appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 10px center;cursor:pointer;} +.dyn-modal.model-modal{width:640px;} @@ -197,7 +206,7 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- +
@@ -358,6 +367,33 @@ function showOnlineTest(row){ DynModal.open('在线测试 — '+modelName,html,'','test-modal'); } +/* ===== 新增模型弹窗 ===== */ +function openAddModel(){ + const html=` +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`; + const footer=''; + DynModal.open('新增模型',html,footer,'model-modal'); +} + /* ===== 事件绑定 ===== */ document.querySelectorAll('tbody tr').forEach(row=>{ row.querySelectorAll('.td-actions .link').forEach(link=>{ diff --git a/web-admin/nutrition/din-order-line.html b/web-admin/nutrition/din-order-line.html index c8e9571..3bb503d 100644 --- a/web-admin/nutrition/din-order-line.html +++ b/web-admin/nutrition/din-order-line.html @@ -303,12 +303,12 @@ tbody tr:hover td:last-child{background:#F8FBFF;} 日期食堂餐线名称餐次秤台编号秤台状态称台类型上餐类型开机时间上餐时间餐品名称餐品单价应收金额实时重量(kg)累计取餐重量累计上餐生重(kg)累计上餐重量最高温度最低温度保鲜时间取餐人次取餐视频上餐视频操作 - 2026-05-19一号食堂A区早餐线早餐00022号秤正常单称开餐06:5007:28小米粥¥5¥1,60012.69.8kg14.212.6kg68℃55℃09:30320人▶ 取餐▶ 上餐详情 编辑 - 2026-05-19二号食堂B区早餐线早餐00023号秤正常双称开餐06:5507:35燕麦粥¥4¥1,1448.46.2kg9.68.4kg65℃55℃09:30286人▶ 取餐▶ 上餐详情 编辑 - 2026-05-19一号食堂A区中餐线中餐00025号秤正常单称开餐10:3011:30宫保鸡丁¥14¥6,80438.231.6kg44.038.2kg75℃71℃13:30486人▶ 取餐▶ 上餐详情 编辑 - 2026-05-19一号食堂B区中餐线中餐00026号秤正常双称开餐10:3511:38红烧肉¥16¥6,59242.638.4kg48.542.6kg72℃68℃13:30412人▶ 取餐▶ 上餐详情 编辑 - 2026-05-19二号食堂C区快餐线中餐00027号秤无网络单称加餐10:4012:12番茄炒蛋¥8¥1,02416.814.2kg18.616.8kg74℃70℃13:30128人▶ 取餐▶ 上餐详情 编辑 - 2026-05-19三号食堂D区晚餐线晚餐00028号秤未开机双称待上餐———————————19:30———详情 编辑 + 2026-05-19一号食堂A区早餐线早餐00022号秤正常单称开餐06:5007:28小米粥¥5¥1,60012.69.8kg14.212.6kg68℃55℃09:30320人▶ 取餐▶ 上餐详情 + 2026-05-19二号食堂B区早餐线早餐00023号秤正常双称开餐06:5507:35燕麦粥¥4¥1,1448.46.2kg9.68.4kg65℃55℃09:30286人▶ 取餐▶ 上餐详情 + 2026-05-19一号食堂A区中餐线中餐00025号秤正常单称开餐10:3011:30宫保鸡丁¥14¥6,80438.231.6kg44.038.2kg75℃71℃13:30486人▶ 取餐▶ 上餐详情 + 2026-05-19一号食堂B区中餐线中餐00026号秤正常双称开餐10:3511:38红烧肉¥16¥6,59242.638.4kg48.542.6kg72℃68℃13:30412人▶ 取餐▶ 上餐详情 + 2026-05-19二号食堂C区快餐线中餐00027号秤无网络单称加餐10:4012:12番茄炒蛋¥8¥1,02416.814.2kg18.616.8kg74℃70℃13:30128人▶ 取餐▶ 上餐详情 + 2026-05-19三号食堂D区晚餐线晚餐00028号秤未开机双称待上餐———————————19:30———详情 @@ -347,13 +347,13 @@ tbody tr:hover td:last-child{background:#F8FBFF;} 汇总———84道1,2861,540¥58,4205,612人229g——3次— - 2026-05-19一号食堂A区中餐线中餐12道256312¥14,2801,140人225g78℃68℃0次详情 编辑 - 2026-05-19一号食堂B区中餐线中餐10道218268¥12,640980人222g76℃66℃1次详情 编辑 - 2026-05-19一号食堂A区早餐线早餐8道148182¥7,400980人151g70℃55℃0次详情 编辑 - 2026-05-18一号食堂A区中餐线中餐12道248304¥13,8601,100人226g77℃67℃0次详情 编辑 - 2026-05-18一号食堂B区中餐线中餐10道210258¥12,180960人219g75℃65℃1次详情 编辑 - 2026-05-18二号食堂B区早餐线早餐8道142176¥7,100920人154g69℃54℃0次详情 编辑 - 2026-05-17一号食堂A区中餐线中餐11道212260¥11,860960人221g76℃66℃1次详情 编辑 + 2026-05-19一号食堂A区中餐线中餐12道256312¥14,2801,140人225g78℃68℃0次详情 + 2026-05-19一号食堂B区中餐线中餐10道218268¥12,640980人222g76℃66℃1次详情 + 2026-05-19一号食堂A区早餐线早餐8道148182¥7,400980人151g70℃55℃0次详情 + 2026-05-18一号食堂A区中餐线中餐12道248304¥13,8601,100人226g77℃67℃0次详情 + 2026-05-18一号食堂B区中餐线中餐10道210258¥12,180960人219g75℃65℃1次详情 + 2026-05-18二号食堂B区早餐线早餐8道142176¥7,100920人154g69℃54℃0次详情 + 2026-05-17一号食堂A区中餐线中餐11道212260¥11,860960人221g76℃66℃1次详情 @@ -389,12 +389,12 @@ tbody tr:hover td:last-child{background:#F8FBFF;} 汇总———————84道¥58,4201,2861,7201,540——5,612人229g3次— - 2026-05-19一号食堂A区早餐线早餐00022号秤正常单称开餐8道¥7,40014818618270℃55℃980人151g0次详情 编辑 - 2026-05-19二号食堂B区早餐线早餐00023号秤正常双称开餐6道¥4,8609211810868℃54℃720人128g0次详情 编辑 - 2026-05-19一号食堂A区中餐线中餐00025号秤正常单称开餐12道¥14,28025634231278℃68℃1,140人225g0次详情 编辑 - 2026-05-19一号食堂B区中餐线中餐00026号秤正常双称开餐10道¥12,64021829426876℃66℃980人222g1次详情 编辑 - 2026-05-19二号食堂C区快餐线中餐00027号秤无网络单称加餐6道¥4,8209212812074℃70℃516人178g2次详情 编辑 - 2026-05-19三号食堂D区晚餐线晚餐00028号秤未开机双称待上餐—————————0次详情 编辑 + 2026-05-19一号食堂A区早餐线早餐00022号秤正常单称开餐8道¥7,40014818618270℃55℃980人151g0次详情 + 2026-05-19二号食堂B区早餐线早餐00023号秤正常双称开餐6道¥4,8609211810868℃54℃720人128g0次详情 + 2026-05-19一号食堂A区中餐线中餐00025号秤正常单称开餐12道¥14,28025634231278℃68℃1,140人225g0次详情 + 2026-05-19一号食堂B区中餐线中餐00026号秤正常双称开餐10道¥12,64021829426876℃66℃980人222g1次详情 + 2026-05-19二号食堂C区快餐线中餐00027号秤无网络单称加餐6道¥4,8209212812074℃70℃516人178g2次详情 + 2026-05-19三号食堂D区晚餐线晚餐00028号秤未开机双称待上餐—————————0次详情 diff --git a/web-admin/nutrition/din-terminal.html b/web-admin/nutrition/din-terminal.html index 82ceb33..05b1014 100644 --- a/web-admin/nutrition/din-terminal.html +++ b/web-admin/nutrition/din-terminal.html @@ -129,6 +129,15 @@ tbody tr:hover{background:#F8FBFF;} .fault-table tbody tr:last-child td{border-bottom:none;} .fault-table tbody tr:hover{background:#F8FBFF;} .fault-empty{text-align:center;padding:40px 0;color:var(--text-placeholder);font-size:var(--font-sm);} +/* 页面信息栏 */ +.page-header-bar{display:flex;align-items:center;justify-content:space-between;background:#fff;border-radius:var(--radius-md);padding:16px 24px;margin-bottom:16px;box-shadow:var(--shadow-sm);} +.page-header-bar__left{display:flex;align-items:center;gap:12px;} +.page-header-bar__title{font-size:var(--font-lg);font-weight:700;color:var(--text-primary);} +.page-header-bar__meta{font-size:var(--font-sm);color:var(--text-placeholder);} +.page-header-bar__right{display:flex;align-items:center;gap:12px;} +.page-header-bar__right label{font-size:var(--font-sm);color:var(--text-secondary);white-space:nowrap;} +.page-header-bar__right .canteen-select{height:36px;border:2px solid var(--primary);border-radius:var(--radius-sm);padding:0 32px 0 14px;font-size:var(--font-sm);color:var(--primary);font-weight:500;outline:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%231890FF'/%3E%3C/svg%3E") no-repeat right 12px center;appearance:none;cursor:pointer;min-width:140px;} + /* 确认弹窗 */ .confirm-modal{width:420px;} .confirm-icon{display:flex;align-items:center;justify-content:center;margin-bottom:16px;} @@ -202,6 +211,24 @@ tbody tr:hover{background:#F8FBFF;}
+ + +
+
+ 终端管理 + 2026-05-20 · 数据实时更新 +
+
+ + +
+
+ +
🖥️
32
设备总数
@@ -212,11 +239,9 @@ tbody tr:hover{background:#F8FBFF;}
-
-
-
-
-
+
+
+
@@ -235,14 +260,14 @@ tbody tr:hover{background:#F8FBFF;}
- + - - - - - - + + + + + +
设备编号SN序列号设备名称设备类型厂家品牌所在区域地理位置责任人网络类型IP地址/设备ID固件版本安装日期在线状态设备健康评分今日使用次数最近心跳时间运行天数累计时长(分钟)最近维护时间故障记录数操作
设备编号设备名称设备类型厂家品牌责任人网络类型IP地址/设备ID固件版本安装日期在线状态设备健康评分今日使用次数最近心跳时间运行天数累计时长(分钟)最近维护时间故障记录数操作
DEV-001SN-A001-20241号点餐屏点餐屏海康威视A区A区入口-东侧张运维WiFi192.168.1.101v3.2.12024-08-15在线98分4862026-04-22 11:30:22615362,4002026-03-202故障记录 远程重启
DEV-002SN-A002-2024智能取餐柜-01智能取餐柜海尔智家A区A区取餐区-1号位李运维有线192.168.1.102v2.8.02024-08-15在线100分3122026-04-22 11:30:18615498,7202026-04-010故障记录 远程重启
DEV-003SN-B001-20242号点餐屏点餐屏海康威视B区B区入口-西侧张运维WiFi192.168.1.103v3.2.12024-10-01在线92分3982026-04-22 11:30:25568298,8002026-04-101故障记录 远程重启
DEV-004SN-B002-2024智能取餐柜-02智能取餐柜海尔智家B区B区取餐区-1号位李运维有线192.168.1.104v2.7.32024-10-01离线0分02026-04-22 09:18:44568423,6002026-04-153故障记录 远程重启
DEV-005SN-A003-2022餐线秤台-00025餐线秤台大华技术A区A区餐线-1号位王运维有线DEV-00025v1.5.22022-06-10在线99分1,2802026-04-22 11:30:201,4121,016,6402026-03-010故障记录 远程重启
DEV-006SN-C001-2023体脂秤-01体脂秤华为智选C区健身区入口-南侧张运维WiFi192.168.1.106v2.1.02023-12-01故障45分02026-04-22 10:55:0887378,5402026-02-281故障记录 远程重启
DEV-0011号点餐屏点餐屏海康威视张运维WiFi192.168.1.101v3.2.12024-08-15在线98分4862026-04-22 11:30:22615362,4002026-03-202故障记录 远程重启
DEV-002智能取餐柜-01智能取餐柜海尔智家李运维有线192.168.1.102v2.8.02024-08-15在线100分3122026-04-22 11:30:18615498,7202026-04-010故障记录 远程重启
DEV-0032号点餐屏点餐屏海康威视张运维WiFi192.168.1.103v3.2.12024-10-01在线92分3982026-04-22 11:30:25568298,8002026-04-101故障记录 远程重启
DEV-004智能取餐柜-02智能取餐柜海尔智家李运维有线192.168.1.104v2.7.32024-10-01离线0分02026-04-22 09:18:44568423,6002026-04-153故障记录 远程重启
DEV-005餐线秤台-00025餐线秤台大华技术王运维有线DEV-00025v1.5.22022-06-10在线99分1,2802026-04-22 11:30:201,4121,016,6402026-03-010故障记录 远程重启
DEV-006体脂秤-01体脂秤华为智选张运维WiFi192.168.1.106v2.1.02023-12-01故障45分02026-04-22 10:55:0887378,5402026-02-281故障记录 远程重启
@@ -259,15 +284,14 @@ tbody tr:hover{background:#F8FBFF;}
+
${tableHtml}`; - DynModal.open('故障记录 — '+devName,html,'','fault-modal'); + DynModal.open('故障记录 — '+devName,html,'','fault-modal'); +} + +/* ===== 新增故障记录弹窗(覆盖在原弹窗上) ===== */ +function showAddFault(devCode){ + const overlay=document.createElement('div'); + overlay.className='modal-overlay fault-add-overlay'; + overlay.style.zIndex='10001'; + overlay.innerHTML=` + `; + document.body.appendChild(overlay); + setTimeout(()=>overlay.classList.add('active'),10); +} +function closeFaultAdd(){ + const el=document.querySelector('.fault-add-overlay'); + if(el){el.classList.remove('active');setTimeout(()=>el.remove(),200);} +} +function toggleRepairFields(){ + const val=document.getElementById('faultStatusSel').value; + const isRepaired=val==='已修复'; + const handlerEl=document.querySelector('#repairHandler label'); + const timeEl=document.querySelector('#repairTime label'); + const remarkEl=document.querySelector('#repairRemark label'); + handlerEl.innerHTML=isRepaired?'维护人*':'维护人'; + timeEl.innerHTML=isRepaired?'维护时间*':'维护时间'; + remarkEl.innerHTML=isRepaired?'维护说明*':'维护说明'; } /* ===== 远程重启确认弹窗 ===== */ diff --git a/web-admin/nutrition/doc/CHANGELOG.md b/web-admin/nutrition/doc/CHANGELOG.md index a507b01..e04f8a0 100644 --- a/web-admin/nutrition/doc/CHANGELOG.md +++ b/web-admin/nutrition/doc/CHANGELOG.md @@ -1,5 +1,45 @@ # 营养用餐管理端 CHANGELOG +## [2026-05-22] + +### 增强 — 营养用餐模块多页面交互优化 + +- **`din-data-nutri.html`** 营养管理数据 + - 新增页面信息栏(标题 + 食堂切换下拉,canteen-select 高亮样式) + - 新增周选择器(week-picker):覆盖原生日期文字,显示友好的周范围标签 + - 餐品明细弹窗重构:宽度调整为 900px,移除顶部提示条,底部汇总区移至表格下方,新增 `.dish-tip` 警告样式(橙色背景) + - 新增二级弹窗表单样式(wb-form-modal / wb-form-row / wb-form-input 等),支持营养师工作台内嵌表单 + - 新增 `.modal-overlay.layer` 层叠弹窗样式(z-index:1010) + - 新增 `.tag-purple` 标签色 + +- **`din-data-benefit.html`** 食材效益 + - 新增页面信息栏(标题 + 食堂切换下拉) + - 食材分类筛选改为二级级联选择器(cascade-picker),支持一级/二级联动选择 + - 新增「↻ 重置」按钮(btn-reset 样式) + - 表格移除「损耗原因」列 + - 统计周期数据更新为 2026-05 + +- **`din-model-llm.html`** 大模型管理 + - 表格新增「API_KEY」「API_URL」列,「提供商」改为「供应商」 + - 状态标签由「在用/备用」改为「启用/停用」 + - 操作列新增「编辑」链接 + - 新增「接入新模型」弹窗(含模型名称/供应商/API_KEY/API_URL/版本/接入方式/使用场景/初始状态字段) + - 新增「编辑模型」弹窗(预填当前行数据,支持修改所有字段) + - 调试日志弹窗适配新列索引(provider 从第3列改为第5列) + +- **`din-model-small.html`** 小模型管理 + - 新增「新增模型」弹窗(含模型名称/类型/版本/部署方式/使用场景/初始状态字段) + - 新增弹窗表单通用样式(add-form-row / add-form-item) + +- **`din-terminal.html`** 终端管理 + - 新增页面信息栏(标题 + 食堂切换下拉) + - 筛选栏重构:「设备名称/编号」拆分为两个独立输入框,移除「所在区域」「厂家品牌」「责任人」筛选项 + - 表格列精简:移除「SN序列号」「所在区域」「地理位置」列 + - 新增设备弹窗表单字段调整:「SN序列号」改为「设备编号」,新增「型号」字段,移除「所在区域」「地理位置」 + +- **`din-order-line.html`** 餐线管理 + - 三个 Tab(秤台实时/餐线汇总/秤台汇总)操作列统一移除「编辑」链接,仅保留「详情」 + ## [2026-05-20] ### 增强 — 健康生产模块交互重构与食堂切换