diff --git a/web-admin/nutrition/din-data-consume.html b/web-admin/nutrition/din-data-consume.html index f21b71d..cb8a5fe 100644 --- a/web-admin/nutrition/din-data-consume.html +++ b/web-admin/nutrition/din-data-consume.html @@ -93,6 +93,30 @@ thead th:last-child,tbody td.td-actions{position:sticky;right:0;background:#fff; thead th:last-child{background:#FAFAFA;} tbody tr:hover td.td-actions{background:#F8FBFF;} +/* 页面信息栏 */ +.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;} + + +/* 弹窗样式 */ +.cascader{position:relative;display:inline-block;} +.cascader__trigger{display:flex;align-items:center;gap:4px;padding:6px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:#fff;cursor:pointer;font-size:var(--font-sm);min-width:140px;justify-content:space-between;} +.cascader__trigger:hover{border-color:var(--primary);} +.cascader__arrow{font-size:10px;color:var(--text-placeholder);transition:transform .2s;} +.cascader.open .cascader__arrow{transform:rotate(180deg);} +.cascader__panel{display:none;position:absolute;top:100%;left:0;margin-top:4px;background:#fff;border-radius:var(--radius-md);box-shadow:var(--shadow-md);border:1px solid var(--border);z-index:100;white-space:nowrap;} +.cascader.open .cascader__panel{display:flex;} +.cascader__col{min-width:120px;max-height:240px;overflow-y:auto;padding:4px 0;border-right:1px solid var(--border);} +.cascader__col:last-child{border-right:none;} +.cascader__col-item{padding:6px 16px;cursor:pointer;font-size:var(--font-sm);color:var(--text-primary);} +.cascader__col-item:hover{background:var(--background);} +.cascader__col-item.active{color:var(--primary);background:var(--primary-light);} + /* 弹窗样式 */ .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.closing{animation:modalFadeOut .2s ease forwards;} @@ -188,6 +212,23 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
+ +
+
+ 消费管理 + 2026-05-20 · 数据实时更新 +
+
+ + +
+
+ +
@@ -222,15 +263,17 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
-
-
+
+
+
全部
+
-
-
+
+
~
@@ -239,8 +282,7 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- - +
@@ -251,15 +293,15 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- + - - - - - - + + + + + +
流水号员工部门订单来源餐次消费类型消费金额支付方式支付状态关联营养评分账实一致异常标签日结状态交易后余额消费时间操作
流水号姓名/编号单位/部门订单来源餐次消费类型消费金额实际支付金额支付方式支付状态关联营养评分账实一致异常标签交易后余额消费时间操作
TX-20260421-001张伟(EMP001)研发部点餐午餐午餐消费¥22.00余额支付成功88分已对账已日结¥234.5011:02交易明细 餐品明细
TX-20260421-002李娜(EMP002)市场部点餐午餐午餐消费¥18.00余额支付成功92分已对账已日结¥86.2011:08交易明细 餐品明细
TX-20260421-003王磊(EMP003)运营部餐线午餐午餐消费¥28.00微信支付成功68分待对账短时多笔未日结11:15交易明细 餐品明细
TX-20260421-004赵敏(EMP004)财务部账户账户充值+¥100.00微信支付成功已对账已日结¥356.8009:30交易明细 餐品明细
TX-20260421-005陈刚(EMP005)人事部餐线早餐早餐消费¥12.00余额支付成功85分已对账已日结¥142.6007:45交易明细 餐品明细
TX-20260421-006刘芳(EMP006)市场部点餐午餐退款+¥18.00原路退回已退款76分差异退款频繁未日结¥68.4010:20交易明细 餐品明细
TX-20260421-001张伟(EMP001)总部机关/研发部点餐午餐消费¥22.00¥22.00余额支付成功88分已对账¥234.502026-04-21 11:02交易明细 餐品明细
TX-20260421-002李娜(EMP002)总部机关/市场部点餐午餐消费¥18.00¥18.00余额支付成功92分已对账¥86.202026-04-21 11:08交易明细 餐品明细
TX-20260421-003王磊(EMP003)总部机关/运营部餐线午餐消费¥28.00¥25.20微信支付成功68分待对账短时多笔2026-04-21 11:15交易明细 餐品明细
TX-20260421-004赵敏(EMP004)总部机关/财务部账户充值+¥100.00¥100.00微信支付成功已对账¥356.802026-04-21 09:30交易明细 餐品明细
TX-20260421-005陈刚(EMP005)总部机关/人事部餐线早餐消费¥12.00¥12.00余额支付成功85分已对账¥142.602026-04-21 07:45交易明细 餐品明细
TX-20260421-006刘芳(EMP006)总部机关/市场部点餐午餐退款+¥18.00¥18.00原路退回已退款76分差异退款频繁¥68.402026-04-21 10:20交易明细 餐品明细
@@ -280,6 +322,9 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} 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');})(); +/* 日期默认今天 */ +(function(){var d=document.getElementById('filterDate');if(d){var t=new Date();d.value=t.getFullYear()+'-'+String(t.getMonth()+1).padStart(2,'0')+'-'+String(t.getDate()).padStart(2,'0');}})(); + /* ========== 弹窗基础 ========== */ const Modal = { open(title, bodyHtml) { @@ -303,33 +348,33 @@ const Modal = { /* ========== 消费数据 ========== */ const consumeData = { - 'TX-20260421-001': { txId:'TX-20260421-001', user:'张伟(EMP001)', dept:'研发部', type:'午餐消费', pay:'余额支付', amount:'¥22.00', time:'2026-04-21 11:02:35', status:'成功', preBal:'¥256.50', postBal:'¥234.50', orderId:'ORD-20260421-001', mealId:'MEAL-20260421-001', operator:'系统自动', remark:'—', + 'TX-20260421-001': { txId:'TX-20260421-001', user:'张伟(EMP001)', dept:'总部机关/研发部', source:'点餐', mealTime:'午餐', type:'消费', pay:'余额支付', amount:'¥22.00', actualPay:'¥22.00', time:'2026-04-21 11:02:35', status:'成功', score:'88分', reconcile:'已对账', abnormal:'—', preBal:'¥256.50', postBal:'¥234.50', orderId:'ORD-20260421-001', mealId:'MEAL-20260421-001', operator:'系统自动', remark:'—', dishes:[ { code:'DISH-001', name:'宫保鸡丁', weight:'0.18kg', price:'¥14/份', total:'¥14.00' }, { code:'DISH-012', name:'米饭', weight:'0.25kg', price:'¥2/份', total:'¥2.00' }, { code:'DISH-008', name:'紫菜蛋花汤', weight:'0.30kg', price:'¥6/份', total:'¥6.00' }, ]}, - 'TX-20260421-002': { txId:'TX-20260421-002', user:'李娜(EMP002)', dept:'市场部', type:'午餐消费', pay:'余额支付', amount:'¥18.00', time:'2026-04-21 11:08:12', status:'成功', preBal:'¥104.20', postBal:'¥86.20', orderId:'ORD-20260421-002', mealId:'MEAL-20260421-002', operator:'系统自动', remark:'—', + 'TX-20260421-002': { txId:'TX-20260421-002', user:'李娜(EMP002)', dept:'总部机关/市场部', source:'点餐', mealTime:'午餐', type:'消费', pay:'余额支付', amount:'¥18.00', actualPay:'¥18.00', time:'2026-04-21 11:08:12', status:'成功', score:'92分', reconcile:'已对账', abnormal:'—', preBal:'¥104.20', postBal:'¥86.20', orderId:'ORD-20260421-002', mealId:'MEAL-20260421-002', operator:'系统自动', remark:'—', dishes:[ { code:'DISH-003', name:'清蒸鱼', weight:'0.15kg', price:'¥12/份', total:'¥12.00' }, { code:'DISH-012', name:'米饭', weight:'0.25kg', price:'¥2/份', total:'¥2.00' }, { code:'DISH-015', name:'炒时蔬', weight:'0.20kg', price:'¥4/份', total:'¥4.00' }, ]}, - 'TX-20260421-003': { txId:'TX-20260421-003', user:'王磊(EMP003)', dept:'运营部', type:'午餐消费', pay:'微信支付', amount:'¥28.00', time:'2026-04-21 11:15:48', status:'成功', preBal:'—', postBal:'—', orderId:'ORD-20260421-003', mealId:'MEAL-20260421-003', operator:'系统自动', remark:'—', + 'TX-20260421-003': { txId:'TX-20260421-003', user:'王磊(EMP003)', dept:'总部机关/运营部', source:'餐线', mealTime:'午餐', type:'消费', pay:'微信支付', amount:'¥28.00', actualPay:'¥25.20', time:'2026-04-21 11:15:48', status:'成功', score:'68分', reconcile:'待对账', abnormal:'短时多笔', preBal:'—', postBal:'—', orderId:'ORD-20260421-003', mealId:'MEAL-20260421-003', operator:'系统自动', remark:'—', dishes:[ { code:'DISH-005', name:'红烧肉', weight:'0.22kg', price:'¥16/份', total:'¥16.00' }, { code:'DISH-012', name:'米饭', weight:'0.25kg', price:'¥2/份', total:'¥2.00' }, { code:'DISH-009', name:'番茄炒蛋', weight:'0.18kg', price:'¥8/份', total:'¥8.00' }, { code:'DISH-012', name:'酸辣汤', weight:'0.30kg', price:'¥2/份', total:'¥2.00' }, ]}, - 'TX-20260421-004': { txId:'TX-20260421-004', user:'赵敏(EMP004)', dept:'财务部', type:'账户充值', pay:'微信支付', amount:'+¥100.00', time:'2026-04-21 09:30:22', status:'成功', preBal:'¥256.80', postBal:'¥356.80', orderId:'—', mealId:'—', operator:'系统自动', remark:'—', dishes:[] }, - 'TX-20260421-005': { txId:'TX-20260421-005', user:'陈刚(EMP005)', dept:'人事部', type:'早餐消费', pay:'余额支付', amount:'¥12.00', time:'2026-04-21 07:45:10', status:'成功', preBal:'¥154.60', postBal:'¥142.60', orderId:'ORD-20260421-005', mealId:'MEAL-20260421-005', operator:'系统自动', remark:'—', + 'TX-20260421-004': { txId:'TX-20260421-004', user:'赵敏(EMP004)', dept:'总部机关/财务部', source:'账户', mealTime:'—', type:'充值', pay:'微信支付', amount:'+¥100.00', actualPay:'¥100.00', time:'2026-04-21 09:30:22', status:'成功', score:'—', reconcile:'已对账', abnormal:'—', preBal:'¥256.80', postBal:'¥356.80', orderId:'—', mealId:'—', operator:'系统自动', remark:'—', dishes:[] }, + 'TX-20260421-005': { txId:'TX-20260421-005', user:'陈刚(EMP005)', dept:'总部机关/人事部', source:'餐线', mealTime:'早餐', type:'消费', pay:'余额支付', amount:'¥12.00', actualPay:'¥12.00', time:'2026-04-21 07:45:10', status:'成功', score:'85分', reconcile:'已对账', abnormal:'—', preBal:'¥154.60', postBal:'¥142.60', orderId:'ORD-20260421-005', mealId:'MEAL-20260421-005', operator:'系统自动', remark:'—', dishes:[ { code:'DISH-020', name:'小米粥', weight:'0.35kg', price:'¥5/份', total:'¥5.00' }, { code:'DISH-022', name:'煎蛋', weight:'0.08kg', price:'¥3/份', total:'¥3.00' }, { code:'DISH-025', name:'凉拌黄瓜', weight:'0.15kg', price:'¥4/份', total:'¥4.00' }, ]}, - 'TX-20260421-006': { txId:'TX-20260421-006', user:'刘芳(EMP006)', dept:'市场部', type:'退款', pay:'原路退回', amount:'+¥18.00', time:'2026-04-21 10:20:05', status:'已退款', preBal:'¥50.40', postBal:'¥68.40', orderId:'ORD-20260421-006', mealId:'MEAL-20260421-006', operator:'客服张丽', remark:'用户申请退款', + 'TX-20260421-006': { txId:'TX-20260421-006', user:'刘芳(EMP006)', dept:'总部机关/市场部', source:'点餐', mealTime:'午餐', type:'退款', pay:'原路退回', amount:'+¥18.00', actualPay:'¥18.00', time:'2026-04-21 10:20:05', status:'已退款', score:'76分', reconcile:'差异', abnormal:'退款频繁', preBal:'¥50.40', postBal:'¥68.40', orderId:'ORD-20260421-006', mealId:'MEAL-20260421-006', operator:'客服张丽', remark:'用户申请退款', dishes:[ { code:'DISH-003', name:'清蒸鱼', weight:'0.15kg', price:'¥12/份', total:'¥12.00' }, { code:'DISH-015', name:'炒时蔬', weight:'0.20kg', price:'¥4/份', total:'¥4.00' }, @@ -342,7 +387,7 @@ function showDishDetail(txId) { const d = consumeData[txId]; if (!d) return; const infoHtml = `
- 交易流水号:${d.txId} + 流水号:${d.txId} 就餐记录号:${d.mealId} 用户:${d.user} 时间:${d.time} @@ -360,15 +405,25 @@ function showTransDetail(txId) { const d = consumeData[txId]; if (!d) return; const statusTag = d.status === '成功' ? '成功' : '已退款'; + const typeMap = {'消费':'tag-green','充值':'tag-blue','退款':'tag-red'}; + const typeTag = `${d.type}`; const html = `
-
交易流水号${d.txId}
-
交易类型${d.type}
+
流水号${d.txId}
+
姓名/编号${d.user}
+
单位/部门${d.dept}
+
订单来源${d.source}
+
餐次${d.mealTime}
+
消费类型${typeTag}
+
消费金额${d.amount}
+
实际支付金额${d.actualPay}
支付方式${d.pay}
-
交易金额${d.amount}
-
交易时间${d.time}
-
交易状态${statusTag}
+
支付状态${statusTag}
+
关联营养评分${d.score}
+
账实一致${d.reconcile}
+
异常标签${d.abnormal}
交易前余额${d.preBal}
交易后余额${d.postBal}
+
消费时间${d.time}
关联订单${d.orderId}
关联就餐记录${d.mealId}
操作员${d.operator}
@@ -377,6 +432,58 @@ function showTransDetail(txId) { Modal.open('交易明细 — ' + txId, html); } +/* ========== 级联选择器 ========== */ +var CASCADER_DATA={ + '总部机关':['运维部','后勤部','研发部','市场部','运营部','财务部','人事部','行政部','销售部'], + '物业中心':['安保部','保洁部','绿化部','维修部'], + '外部单位':['访客组','合作方'] +}; +var cascaderEl=document.getElementById('cascaderDept'); +var cascaderLeft=document.getElementById('cascaderLeft'); +var cascaderRight=document.getElementById('cascaderRight'); +var selectedUnit='',selectedDept=''; + +function renderCascaderLeft(){ + var html='
全部
'; + Object.keys(CASCADER_DATA).forEach(function(u){ + html+='
'+u+'
'; + }); + cascaderLeft.innerHTML=html; + cascaderLeft.querySelectorAll('.cascader__col-item').forEach(function(item){ + item.onclick=function(e){e.stopPropagation();selectUnit(this.dataset.val);}; + }); +} +function renderCascaderRight(){ + if(!selectedUnit){cascaderRight.innerHTML='';return;} + var depts=CASCADER_DATA[selectedUnit]||[]; + var html='
全部
'; + depts.forEach(function(d){ + html+='
'+d+'
'; + }); + cascaderRight.innerHTML=html; + cascaderRight.querySelectorAll('.cascader__col-item').forEach(function(item){ + item.onclick=function(e){e.stopPropagation();selectDept(this.dataset.val);}; + }); +} +function selectUnit(val){ + selectedUnit=val;selectedDept=''; + renderCascaderLeft();renderCascaderRight(); + if(!val){updateCascaderText();closeCascader();} +} +function selectDept(val){ + selectedDept=val;renderCascaderRight();updateCascaderText();closeCascader(); +} +function updateCascaderText(){ + var txt=selectedUnit?(selectedDept?selectedUnit+'/'+selectedDept:selectedUnit):'全部'; + cascaderEl.querySelector('.cascader__text').textContent=txt; +} +function toggleCascader(){ + var isOpen=cascaderEl.classList.contains('open'); + if(isOpen){closeCascader();}else{renderCascaderLeft();renderCascaderRight();cascaderEl.classList.add('open');} +} +function closeCascader(){cascaderEl.classList.remove('open');} +document.addEventListener('click',function(e){if(!cascaderEl.contains(e.target))closeCascader();}); + /* ========== 事件绑定 ========== */ (function bindEvents() { document.querySelectorAll('tbody tr').forEach(row => { diff --git a/web-admin/nutrition/din-order-pickup.html b/web-admin/nutrition/din-order-pickup.html index ecc25b4..9167b70 100644 --- a/web-admin/nutrition/din-order-pickup.html +++ b/web-admin/nutrition/din-order-pickup.html @@ -159,6 +159,16 @@ tbody tr:hover td.td-actions{background:#F8FBFF;} .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;} +/* 页面信息栏 */ +.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;} + + /* 个性模型 */ .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;} @@ -244,13 +254,28 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
+ +
+
+ 取餐管理 + 2026-05-20 · 数据实时更新 +
+
+ + +
+
+
-
-
+
@@ -273,18 +298,18 @@ tbody tr:hover td.td-actions{background:#F8FBFF;}
- + - - - - - - - - - + + + + + + + + +
就餐记录号姓名员工编号单位部门餐次取餐方式取餐类型人员类别取餐开始时间取餐结束时间取餐总数量营养评分操作
就餐记录号姓名员工编号单位部门餐次取餐方式取餐类型人员类别取餐开始时间取餐结束时间取餐总数量总金额营养评分操作
M-20260428-001张伟EMP001长庆油田研发部午餐点餐取餐正常取餐会员11:0211:083件88分查看用户信息
M-20260428-002李娜EMP002长庆油田市场部午餐点餐取餐正常取餐会员11:0811:143件92分查看用户信息
M-20260428-003王磊EMP003长庆油田运营部午餐餐线取餐正常取餐非会员11:1511:202件68分查看用户信息
M-20260428-004赵敏EMP004长庆油田财务部午餐档口+餐线正常取餐会员11:2211:303件94分查看用户信息
M-20260428-005陈刚EMP005长庆油田人事部早餐餐线取餐正常取餐非会员07:4807:553件85分查看用户信息
M-20260428-006刘芳EMP006长庆油田市场部午餐外卖/外带正常取餐会员11:4511:482件90分查看用户信息
SP-001-001张运维EMP101长庆油田运维部午餐余量取餐余量取餐员工14:0514:061件查看用户信息
SP-001-003王保安长庆油田安保部午餐余量取餐余量取餐工作人员14:1014:111件查看用户信息
M-20260428-007林教授外部单位外部访客午餐点餐取餐正常取餐外部人员12:1012:183件86分查看用户信息
M-20260428-001张伟EMP001长庆油田研发部午餐点餐取餐正常取餐会员11:0211:083件¥22.0088分查看用户信息
M-20260428-002李娜EMP002长庆油田市场部午餐点餐取餐正常取餐会员11:0811:143件¥18.0092分查看用户信息
M-20260428-003王磊EMP003长庆油田运营部午餐餐线取餐正常取餐非会员11:1511:202件¥28.0068分查看用户信息
M-20260428-004赵敏EMP004长庆油田财务部午餐档口+餐线正常取餐会员11:2211:303件¥25.5094分查看用户信息
M-20260428-005陈刚EMP005长庆油田人事部早餐餐线取餐正常取餐非会员07:4807:553件¥12.0085分查看用户信息
M-20260428-006刘芳EMP006长庆油田市场部午餐外卖/外带正常取餐会员11:4511:482件¥15.8090分查看用户信息
SP-001-001张运维EMP101长庆油田运维部午餐余量取餐余量取餐员工14:0514:061件¥5.00查看用户信息
SP-001-003王保安长庆油田安保部午餐余量取餐余量取餐工作人员14:1014:111件¥5.00查看用户信息
M-20260428-007林教授外部单位外部访客午餐点餐取餐正常取餐外部人员12:1012:183件¥26.5086分查看用户信息
@@ -528,43 +553,43 @@ document.querySelectorAll('tbody tr').forEach(row => { /* ========== 取餐详情弹窗 ========== */ const mealData = { 'M-20260428-001': [ - { name:'清炒生菜', type:'秤', weight:133.0, cal:24.6, carb:1.6, fat:1.4, protein:2.2 }, - { name:'西红柿鸡蛋', type:'秤', weight:114.0, cal:94.5, carb:4.7, fat:5.1, protein:8.4 }, - { name:'辣子鸡丁', type:'秤', weight:79.0, cal:92.5, carb:3.3, fat:4.6, protein:9.8 } + { name:'清炒生菜', type:'秤', weight:133.0, price:6.00, cal:24.6, carb:1.6, fat:1.4, protein:2.2 }, + { name:'西红柿鸡蛋', type:'秤', weight:114.0, price:8.00, cal:94.5, carb:4.7, fat:5.1, protein:8.4 }, + { name:'辣子鸡丁', type:'秤', weight:79.0, price:8.00, cal:92.5, carb:3.3, fat:4.6, protein:9.8 } ], 'M-20260428-002': [ - { name:'藜麦沙拉', type:'秤', weight:150.0, cal:68.0, carb:12.5, fat:1.8, protein:3.2 }, - { name:'清蒸鲈鱼', type:'秤', weight:120.0, cal:112.0, carb:0.5, fat:4.2, protein:18.6 }, - { name:'蒜蓉西兰花', type:'秤', weight:95.0, cal:32.0, carb:4.1, fat:1.2, protein:2.8 } + { name:'藜麦沙拉', type:'秤', weight:150.0, price:6.00, cal:68.0, carb:12.5, fat:1.8, protein:3.2 }, + { name:'清蒸鲈鱼', type:'秤', weight:120.0, price:8.00, cal:112.0, carb:0.5, fat:4.2, protein:18.6 }, + { name:'蒜蓉西兰花', type:'秤', weight:95.0, price:4.00, cal:32.0, carb:4.1, fat:1.2, protein:2.8 } ], 'M-20260428-003': [ - { name:'红烧肉', type:'秤', weight:85.0, cal:210.5, carb:5.2, fat:15.3, protein:12.1 }, - { name:'米饭', type:'秤', weight:200.0, cal:232.0, carb:50.8, fat:0.6, protein:4.6 } + { name:'红烧肉', type:'秤', weight:85.0, price:16.00, cal:210.5, carb:5.2, fat:15.3, protein:12.1 }, + { name:'米饭', type:'秤', weight:200.0, price:12.00, cal:232.0, carb:50.8, fat:0.6, protein:4.6 } ], 'M-20260428-004': [ - { name:'宫保鸡丁', type:'秤', weight:110.0, cal:145.0, carb:8.2, fat:7.5, protein:12.3 }, - { name:'番茄牛腩', type:'秤', weight:130.0, cal:125.0, carb:6.8, fat:5.2, protein:14.5 }, - { name:'杂粮饭', type:'秤', weight:180.0, cal:198.0, carb:42.0, fat:1.2, protein:5.8 } + { name:'宫保鸡丁', type:'秤', weight:110.0, price:9.50, cal:145.0, carb:8.2, fat:7.5, protein:12.3 }, + { name:'番茄牛腩', type:'秤', weight:130.0, price:10.00, cal:125.0, carb:6.8, fat:5.2, protein:14.5 }, + { name:'杂粮饭', type:'秤', weight:180.0, price:6.00, cal:198.0, carb:42.0, fat:1.2, protein:5.8 } ], 'M-20260428-005': [ - { name:'小米粥', type:'秤', weight:250.0, cal:115.0, carb:24.5, fat:0.8, protein:2.4 }, - { name:'煎蛋', type:'秤', weight:60.0, cal:90.0, carb:0.6, fat:7.0, protein:6.3 }, - { name:'全麦馒头', type:'秤', weight:80.0, cal:176.0, carb:35.2, fat:1.5, protein:6.8 } + { name:'小米粥', type:'秤', weight:250.0, price:4.00, cal:115.0, carb:24.5, fat:0.8, protein:2.4 }, + { name:'煎蛋', type:'秤', weight:60.0, price:3.00, cal:90.0, carb:0.6, fat:7.0, protein:6.3 }, + { name:'全麦馒头', type:'秤', weight:80.0, price:5.00, cal:176.0, carb:35.2, fat:1.5, protein:6.8 } ], 'M-20260428-006': [ - { name:'鸡胸肉沙拉', type:'秤', weight:180.0, cal:145.0, carb:5.2, fat:3.8, protein:22.5 }, - { name:'玉米浓汤', type:'秤', weight:200.0, cal:88.0, carb:16.0, fat:2.1, protein:2.8 } + { name:'鸡胸肉沙拉', type:'秤', weight:180.0, price:10.80, cal:145.0, carb:5.2, fat:3.8, protein:22.5 }, + { name:'玉米浓汤', type:'秤', weight:200.0, price:5.00, cal:88.0, carb:16.0, fat:2.1, protein:2.8 } ], 'SP-001-001': [ - { name:'余量套餐A', type:'秤', weight:220.0, cal:185.0, carb:28.0, fat:4.5, protein:9.2 } + { name:'余量套餐A', type:'秤', weight:220.0, price:5.00, cal:185.0, carb:28.0, fat:4.5, protein:9.2 } ], 'SP-001-003': [ - { name:'余量套餐B', type:'秤', weight:195.0, cal:168.0, carb:25.5, fat:3.8, protein:8.5 } + { name:'余量套餐B', type:'秤', weight:195.0, price:5.00, cal:168.0, carb:25.5, fat:3.8, protein:8.5 } ], 'M-20260428-007': [ - { name:'糖醋里脊', type:'秤', weight:95.0, cal:178.0, carb:14.2, fat:8.5, protein:11.8 }, - { name:'蛋花汤', type:'秤', weight:200.0, cal:35.0, carb:1.2, fat:1.5, protein:3.8 }, - { name:'米饭', type:'秤', weight:180.0, cal:208.8, carb:45.7, fat:0.5, protein:4.1 } + { name:'糖醋里脊', type:'秤', weight:95.0, price:12.00, cal:178.0, carb:14.2, fat:8.5, protein:11.8 }, + { name:'蛋花汤', type:'秤', weight:200.0, price:5.50, cal:35.0, carb:1.2, fat:1.5, protein:3.8 }, + { name:'米饭', type:'秤', weight:180.0, price:9.00, cal:208.8, carb:45.7, fat:0.5, protein:4.1 } ] }; @@ -583,6 +608,7 @@ function showMealDetail(row) { const items = mealData[recordId] || []; const totalWeight = items.reduce((s, i) => s + i.weight, 0); + const totalPrice = items.reduce((s, i) => s + i.price, 0); const totalCal = items.reduce((s, i) => s + i.cal, 0); const totalCarb = items.reduce((s, i) => s + i.carb, 0); const totalFat = items.reduce((s, i) => s + i.fat, 0); @@ -605,6 +631,7 @@ function showMealDetail(row) { const tableRows = items.map(i => ` ${i.name} + ¥${i.price.toFixed(2)} ${i.weight.toFixed(1)} ${i.cal.toFixed(1)} ${i.carb.toFixed(1)} @@ -614,6 +641,7 @@ function showMealDetail(row) { const summaryRow = ` 合计 + ¥${totalPrice.toFixed(2)} ${totalWeight.toFixed(1)}克 ${totalCal.toFixed(1)}千卡 ${totalCarb.toFixed(1)}克 @@ -624,7 +652,7 @@ function showMealDetail(row) { const tableHtml = `
餐品列表
- + ${tableRows}${summaryRow}
餐品名称重量(克)热量(千卡)碳水化合物(克)脂肪(克)蛋白质(克)
餐品名称金额重量(克)热量(千卡)碳水化合物(克)脂肪(克)蛋白质(克)
`; diff --git a/web-admin/nutrition/din-user-mgmt.html b/web-admin/nutrition/din-user-mgmt.html index 2eae07d..346818c 100644 --- a/web-admin/nutrition/din-user-mgmt.html +++ b/web-admin/nutrition/din-user-mgmt.html @@ -259,6 +259,47 @@ tbody td.td-actions{overflow:visible;} .face-upload__preview{display:none;width:280px;text-align:center;} .face-upload__preview img{width:160px;height:160px;border-radius:50%;object-fit:cover;border:3px solid var(--primary);margin-bottom:12px;} .face-upload__preview-actions{display:flex;gap:8px;justify-content:center;} +/* 新增用户表单 */ +.add-user-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.45);z-index:1000;display:none;align-items:center;justify-content:center;animation:modalFadeIn .2s ease;} +.add-user-overlay.show{display:flex;} +.add-user-modal{background:#fff;border-radius:8px;width:640px;max-height:85vh;display:flex;flex-direction:column;box-shadow:0 12px 48px rgba(0,0,0,.15);animation:modalSlideIn .25s ease;} +.add-user-modal .modal-body{overflow-y:auto;} +.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;} +/* Toast */ +.toast{position:fixed;top:80px;left:50%;transform:translateX(-50%) translateY(-20px);background:rgba(0,0,0,0.75);color:#fff;padding:10px 24px;border-radius:var(--radius-md);font-size:var(--font-sm);opacity:0;pointer-events:none;transition:all .3s;z-index:2000;} +.toast.show{opacity:1;transform:translateX(-50%) translateY(0);} +/* 开通会员弹窗 */ +.vip-search-wrap{position:relative;margin-bottom:20px;} +.vip-search-wrap input{width:100%;height:40px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px 0 36px;font-size:var(--font-sm);outline:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none'%3E%3Ccircle cx='6' cy='6' r='4.5' stroke='%23999' stroke-width='1.2'/%3E%3Cpath d='M9.5 9.5L12.5 12.5' stroke='%23999' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 12px center;} +.vip-search-wrap input:focus{border-color:var(--primary);} +.vip-dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;background:#fff;border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);max-height:240px;overflow-y:auto;z-index:50;display:none;} +.vip-dropdown.show{display:block;} +.vip-dropdown__item{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:8px;padding:10px 16px;cursor:pointer;font-size:var(--font-sm);border-bottom:1px solid #f5f5f5;transition:background .1s;} +.vip-dropdown__item:last-child{border-bottom:none;} +.vip-dropdown__item:hover{background:#F8FBFF;} +.vip-dropdown__item.selected{background:var(--primary-light);} +.vip-dropdown__head{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:8px;padding:8px 16px;font-size:var(--font-xs);color:var(--text-placeholder);border-bottom:1px solid var(--border);} +.vip-user-card{background:#f8fafc;border-radius:var(--radius-md);padding:16px 20px;display:none;gap:16px;align-items:center;} +.vip-user-card.show{display:flex;} +.vip-user-card__avatar{width:48px;height:48px;border-radius:50%;background:var(--primary);display:flex;align-items:center;justify-content:center;color:#fff;font-size:20px;font-weight:600;flex-shrink:0;} +.vip-user-card__info{display:flex;flex-direction:column;gap:4px;flex:1;} +.vip-user-card__name{font-size:var(--font-base);font-weight:600;color:var(--text-primary);} +.vip-user-card__meta{font-size:var(--font-sm);color:var(--text-secondary);} +.modal.vip-modal{width:560px;min-height:360px;} +.modal.level-modal{width:600px;} +.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);} +.level-detail{display:grid;grid-template-columns:1fr 1fr;gap:16px 24px;} +.level-detail__item{display:flex;flex-direction:column;gap:4px;} +.level-detail__item.full{grid-column:1/-1;} +.level-detail__label{font-size:var(--font-xs);color:var(--text-secondary);} +.level-detail__value{font-size:var(--font-sm);color:var(--text-primary);} @@ -391,7 +432,7 @@ tbody td.td-actions{overflow:visible;}
全部
-
+
@@ -411,14 +452,14 @@ tbody td.td-actions{overflow:visible;} 姓名员工/用户编号性别年龄单位部门BMI活动水平人员类别饮食禁忌状态操作 - 张伟EMP003男38—22.9中度活动会员正常详情 编辑 更多 ▾ - 李娜EMP001女34—19.8轻度活动会员高钠正常详情 编辑 更多 ▾ - 王磊EMP002男41—26.8久坐非会员高脂预警详情 编辑 更多 ▾ - 赵敏EMP004女36—18.8轻度活动会员高糖正常详情 编辑 更多 ▾ - 陈刚EMP005男29—21.4重度活动非会员正常详情 编辑 更多 ▾ - 刘芳EMP006女32—20.6中度活动会员正常详情 编辑 更多 ▾ - 孙磊EMP007男45—24.3久坐非会员高钠预警详情 编辑 更多 ▾ - 钱芳EMP008女27—17.9轻度活动会员正常详情 编辑 更多 ▾ + 张伟EMP003男38—22.9中度活动会员用户正常详情 编辑 更多 ▾ + 李娜EMP001女34—19.8轻度活动会员用户高钠正常详情 编辑 更多 ▾ + 王磊EMP002男41—26.8久坐普通用户高脂预警详情 编辑 更多 ▾ + 赵敏EMP004女36—18.8轻度活动会员用户高糖正常详情 编辑 更多 ▾ + 陈刚EMP005男29—21.4重度活动普通用户正常详情 编辑 更多 ▾ + 刘芳EMP006女32—20.6中度活动会员用户正常详情 编辑 更多 ▾ + 孙磊EMP007男45—24.3久坐普通用户高钠预警详情 编辑 更多 ▾ + 钱芳EMP008女27—17.9轻度活动会员用户正常详情 编辑 更多 ▾ 张运维EMP009男35总部机关/运维部23.5中度活动员工正常详情 编辑 更多 ▾ 李后勤EMP010男42总部机关/后勤部25.1中度活动员工正常详情 编辑 更多 ▾ 王保安WK003男48—24.8重度活动工作人员正常详情 编辑 更多 ▾ @@ -446,16 +487,16 @@ tbody td.td-actions{overflow:visible;}
-
+
+
+
-
-
@@ -466,15 +507,15 @@ tbody td.td-actions{overflow:visible;}
- + - - - - - - + + + + + +
会员卡号姓名/工号部门会员等级当前积分累计消费(元)本月消费开通日期有效期至最近活跃会员状态操作
会员卡号姓名用户编号会员等级当前积分累计消费(元)本月消费开通日期有效期至最近活跃会员状态操作
MB-202401-001张伟(EMP001)研发部钻石8,62812,860¥1,2862024-01-152027-01-142026-04-28 11:32正常查看 编辑
MB-202405-008李娜(EMP002)市场部金卡3,2864,820¥6822024-05-082027-05-072026-04-28 12:08正常查看 编辑
MB-202508-015赵敏(EMP004)财务部银卡1,4202,180¥4862025-08-122027-08-112026-04-28 11:30正常查看 编辑
MB-202510-026刘芳(EMP006)市场部银卡9861,520¥3202025-10-202027-10-192026-04-28 11:48正常查看 编辑
MB-202312-003孙磊(EMP010)研发部金卡5,1207,860¥02023-12-082026-12-072026-04-15 12:20即将到期查看 编辑
MB-202402-005周明(EMP008)运营部钻石12,48616,820¥02024-02-102027-02-092026-03-28 12:15休眠查看 编辑
MB-202401-001张伟EMP001钻石8,62812,860¥1,2862024-01-152027-01-142026-04-28 11:32正常查看 编辑
MB-202405-008李娜EMP002金卡3,2864,820¥6822024-05-082027-05-072026-04-28 12:08正常查看 编辑
MB-202508-015赵敏EMP004银卡1,4202,180¥4862025-08-122027-08-112026-04-28 11:30正常查看 编辑
MB-202510-026刘芳EMP006银卡9861,520¥3202025-10-202027-10-192026-04-28 11:48正常查看 编辑
MB-202312-003孙磊EMP010金卡5,1207,860¥02023-12-082026-12-072026-04-15 12:20即将到期查看 编辑
MB-202402-005周明EMP008钻石12,48616,820¥02024-02-102027-02-092026-03-28 12:15休眠查看 编辑
@@ -499,7 +540,7 @@ tbody td.td-actions{overflow:visible;}
- +
@@ -511,10 +552,10 @@ tbody td.td-actions{overflow:visible;} 等级编号等级名称升级条件(累计消费)积分倍数点餐折扣取餐特权专属权益当前人数状态操作 - LV-01普通会员注册即可1.0x无折扣常规基础点餐功能794启用查看 编辑 - LV-02银卡会员累计消费 ¥1,000+1.2x9.8折常规生日券 ¥10、月度营养报告186启用查看 编辑 - LV-03金卡会员累计消费 ¥3,000+1.5x9.5折优先取餐生日券 ¥30、AI营养周报、专属客服218启用查看 编辑 - LV-04钻石会员累计消费 ¥10,000+2.0x9.0折专属窗口专属营养师、VIP定制菜单、季度体检券82启用查看 编辑 + LV-01普通会员注册即可1.0x无折扣常规基础点餐功能794启用查看 编辑 + LV-02银卡会员累计消费 ¥1,000+1.2x9.8折常规生日券 ¥10、月度营养报告186启用查看 编辑 + LV-03金卡会员累计消费 ¥3,000+1.5x9.5折优先取餐生日券 ¥30、AI营养周报、专属客服218启用查看 编辑 + LV-04钻石会员累计消费 ¥10,000+2.0x9.0折专属窗口专属营养师、VIP定制菜单、季度体检券82启用查看 编辑
@@ -527,6 +568,83 @@ tbody td.td-actions{overflow:visible;}
+ +
+
+ + + +
+
+ +
\ No newline at end of file