Compare commits
2
Commits
70cbe278c5
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cacb3e01d5 | ||
|
|
ccc24d787c |
@@ -46,14 +46,26 @@ body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei
|
||||
.filter-input{height:36px;min-width:110px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px;font-size:var(--font-sm);color:var(--text-primary);outline:none;}
|
||||
.filter-input:focus{border-color:var(--primary);}
|
||||
.filter-date{height:36px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 8px;font-size:var(--font-sm);color:var(--text-primary);outline:none;}
|
||||
/* 单位部门级联筛选 */
|
||||
.org-wrap{position:relative;display:inline-block;}
|
||||
.org-trigger{height:36px;min-width:130px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 28px 0 12px;font-size:var(--font-sm);color:var(--text-primary);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 8px center;cursor:pointer;display:flex;align-items:center;user-select:none;white-space:nowrap;}
|
||||
.org-trigger.open,.org-trigger:hover{border-color:var(--primary);}
|
||||
.org-panel{display:none;position:absolute;top:36px;left:0;z-index:310;background:#fff;border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);width:380px;}
|
||||
.org-panel.open{display:flex;}
|
||||
.org-col{flex:1;overflow-y:auto;max-height:200px;border-right:1px solid var(--border);}
|
||||
.org-col:last-child{border-right:none;}
|
||||
.org-col__title{padding:6px 12px;font-size:var(--font-sm);color:var(--text-placeholder);background:#FAFAFA;border-bottom:1px solid var(--border);font-weight:500;}
|
||||
.org-item{padding:8px 12px;font-size:var(--font-sm);color:var(--text-primary);cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:4px;}
|
||||
.org-item:hover{background:#F0F8FF;color:var(--primary);}
|
||||
.org-item.active{background:var(--primary-light);color:var(--primary);font-weight:500;}
|
||||
.btn{height:36px;padding:0 16px;border-radius:var(--radius-sm);font-size:var(--font-sm);cursor:pointer;border:none;transition:all .2s;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
|
||||
.btn-primary{background:var(--primary);color:#fff;}.btn-primary:hover{background:#40a9ff;}
|
||||
.btn-default{background:#fff;color:var(--text-primary);border:1px solid var(--border);}.btn-default:hover{color:var(--primary);border-color:var(--primary);}
|
||||
.btn-link{background:none;color:var(--primary);padding:0 4px;height:auto;}.btn-link:hover{color:#40a9ff;}
|
||||
.tab-bar{display:flex;gap:4px;margin-top:16px;background:#fff;border-radius:var(--radius-md) var(--radius-md) 0 0;box-shadow:var(--shadow-sm);padding:6px 16px 0;}
|
||||
.tab-item{padding:10px 18px;font-size:var(--font-sm);color:var(--text-secondary);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;}
|
||||
.tab-bar{display:flex;gap:4px;margin:0 0 16px;background:#fff;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);padding:6px 16px;}
|
||||
.tab-item{padding:10px 18px;font-size:var(--font-sm);color:var(--text-secondary);cursor:pointer;border-bottom:2px solid transparent;}
|
||||
.tab-item.active{color:var(--primary);border-bottom-color:var(--primary);font-weight:600;}
|
||||
.table-card{background:#fff;border-radius:0 0 var(--radius-md) var(--radius-md);box-shadow:var(--shadow-sm);overflow:hidden;}
|
||||
.table-card{background:#fff;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);overflow:hidden;margin-top:16px;}
|
||||
.table-card__head{display:flex;align-items:center;justify-content:flex-start;padding:12px 16px;border-bottom:1px solid var(--border);}
|
||||
.table-card__title{font-size:var(--font-sm);font-weight:600;}
|
||||
.table-card__content{overflow-x:auto;-webkit-overflow-scrolling:touch;}
|
||||
@@ -133,35 +145,65 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
<!-- 主内容 -->
|
||||
<main class="main">
|
||||
|
||||
<!-- [交互] TAB:设备分配记录 / 床位分配记录 -->
|
||||
<div class="tab-bar">
|
||||
<div class="tab-item active" id="tabDev" onclick="switchTab('dev')">设备分配记录</div>
|
||||
<div class="tab-item" id="tabEmp" onclick="switchTab('emp')">床位分配记录</div>
|
||||
</div>
|
||||
|
||||
<!-- [交互] 筛选栏:字段组随 TAB 切换显隐 -->
|
||||
<div class="filter-bar">
|
||||
<!-- 设备分配记录筛选组 -->
|
||||
<div id="fgrpDev" style="display:contents;">
|
||||
<div class="filter-item">
|
||||
<label>设备所属单位</label>
|
||||
<select class="filter-select" id="filterUnit" onchange="onFilterUnit()" style="min-width:120px;"><option value="">全部单位</option></select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>设备所属部门</label>
|
||||
<select class="filter-select" id="filterDepart" onchange="renderAll()" style="min-width:130px;"><option value="">全部部门</option></select>
|
||||
<label>所属单位部门</label>
|
||||
<div class="org-wrap" id="orgWrap">
|
||||
<div class="org-trigger" id="orgTrigger" onclick="toggleOrg()">全部单位/部门</div>
|
||||
<div class="org-panel" id="orgPanel">
|
||||
<div class="org-col" id="unitCol">
|
||||
<div class="org-col__title">单位</div>
|
||||
<div class="org-item active" onclick="selectUnit(this,'')">全部单位/部门</div>
|
||||
</div>
|
||||
<div class="org-col" id="deptCol">
|
||||
<div class="org-col__title">部门</div>
|
||||
<div class="org-item active" onclick="selectDept(this,'')">全部部门</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>设备编号</label>
|
||||
<input class="filter-input" id="filterDevCode" placeholder="如:HC-" oninput="renderAll()">
|
||||
<input class="filter-input" id="filterDevCode" placeholder="请输入" oninput="renderAll()">
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>分配形式</label>
|
||||
<label>分配类型</label>
|
||||
<select class="filter-select" id="filterType" onchange="renderAll()" style="min-width:100px;">
|
||||
<option value="">全部</option><option value="1">宿舍</option><option value="2">床位</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>宿舍名称</label>
|
||||
<input class="filter-input" id="filterHostel" placeholder="如:101室" oninput="renderAll()">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 床位分配记录筛选组 -->
|
||||
<div id="fgrpEmp" style="display:none;">
|
||||
<div class="filter-item">
|
||||
<label>所属单位部门</label>
|
||||
<div class="org-wrap" id="empOrgWrap">
|
||||
<div class="org-trigger" id="empOrgTrigger" onclick="toggleEmpOrg()">全部单位/部门</div>
|
||||
<div class="org-panel" id="empOrgPanel">
|
||||
<div class="org-col" id="empUnitCol">
|
||||
<div class="org-col__title">单位</div>
|
||||
<div class="org-item active" onclick="selectEmpUnit(this,'')">全部单位/部门</div>
|
||||
</div>
|
||||
<div class="org-col" id="empDeptCol">
|
||||
<div class="org-col__title">部门</div>
|
||||
<div class="org-item active" onclick="selectEmpDept(this,'')">全部部门</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>所属站点</label>
|
||||
<select class="filter-select" id="filterEStation" onchange="renderAll()" style="min-width:140px;"><option value="">全部站点</option></select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>所属楼栋</label>
|
||||
<select class="filter-select" id="filterEBuilding" onchange="onFilterEBuilding()" style="min-width:180px;"><option value="">全部楼栋</option></select>
|
||||
@@ -170,6 +212,10 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
<label>所属宿舍</label>
|
||||
<select class="filter-select" id="filterEDorm" onchange="renderAll()" style="min-width:110px;"><option value="">全部宿舍</option></select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>床位编号</label>
|
||||
<input class="filter-input" id="filterEBed" placeholder="请输入床位编号" oninput="renderAll()">
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>员工姓名</label>
|
||||
<input class="filter-input" id="filterEName" placeholder="请输入员工姓名" oninput="renderAll()">
|
||||
@@ -179,11 +225,7 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
<input class="filter-input" id="filterENo" placeholder="请输入员工编号" oninput="renderAll()">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 公共筛选:床位名称 + 分配日期 -->
|
||||
<div class="filter-item">
|
||||
<label>床位名称</label>
|
||||
<input class="filter-input" id="filterBed" placeholder="如:101-1" oninput="renderAll()" style="min-width:100px;">
|
||||
</div>
|
||||
<!-- 公共筛选:分配日期 -->
|
||||
<div class="filter-item">
|
||||
<label>分配日期</label>
|
||||
<input class="filter-date" type="date" id="filterFrom" value="2026-01-01" onchange="renderAll()">
|
||||
@@ -197,12 +239,6 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
</div>
|
||||
|
||||
|
||||
<!-- [交互] TAB:设备分配记录 / 床位分配记录 -->
|
||||
<div class="tab-bar">
|
||||
<div class="tab-item active" id="tabDev" onclick="switchTab('dev')">设备分配记录</div>
|
||||
<div class="tab-item" id="tabEmp" onclick="switchTab('emp')">床位分配记录</div>
|
||||
</div>
|
||||
|
||||
<div class="table-card">
|
||||
<div class="table-card__head">
|
||||
<div style="display:flex;gap:8px;">
|
||||
@@ -233,21 +269,31 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
|
||||
<script>
|
||||
var unitDeparts={'采油一厂':['樊学作业区','麻子山作业区'],'采油二厂':['桐园作业区','姬圪台作业区'],'第四采油厂':['西峰作业区'],'采气一厂':['靖边气田']};
|
||||
var depStations={'樊学作业区':['樊学站点基地'],'麻子山作业区':['麻子山站点'],'桐园作业区':['桐园站点基地'],'姬圪台作业区':['姬圪台站点'],'西峰作业区':['西峰基地'],'靖边气田':['靖边气田站点']};
|
||||
function stationOf(r){return (depStations[r.depart]||[])[0]||'';}
|
||||
/* 楼栋→站点/单位/部门映射,与「床位信息」页口径一致 */
|
||||
var buildingMeta={
|
||||
'樊学倒班宿舍1号楼':{station:'樊学站点基地',unit:'采油一厂',depart:'樊学作业区'},
|
||||
'麻子山倒班宿舍楼':{station:'麻子山站点',unit:'采油一厂',depart:'麻子山作业区'},
|
||||
'桐园倒班宿舍1号楼':{station:'桐园站点基地',unit:'采油二厂',depart:'桐园作业区'},
|
||||
'西峰基地综合宿舍楼':{station:'西峰基地',unit:'第四采油厂',depart:'西峰作业区'},
|
||||
'靖边气田倒班宿舍楼':{station:'靖边气田站点',unit:'采气一厂',depart:'靖边气田'}
|
||||
};
|
||||
var curTab='dev';
|
||||
/* 设备分配记录:含换绑历史(解除日期非空即历史) */
|
||||
var devRecords=[
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-01',type:2,space:'樊学倒班宿舍1号楼 · 101-1',bind:'2026-03-05',unbind:''},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-02',type:2,space:'樊学倒班宿舍1号楼 · 101-2',bind:'2026-03-05',unbind:''},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-03',type:2,space:'樊学倒班宿舍1号楼 · 102-1',bind:'2026-03-05',unbind:''},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-03',type:2,space:'樊学倒班宿舍1号楼 · 201-1',bind:'2026-04-02',unbind:'2026-04-08'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-04',type:1,space:'樊学倒班宿舍1号楼 · 101室',bind:'2026-03-05',unbind:''},
|
||||
{unit:'采油一厂',depart:'麻子山作业区',code:'HC-MZ-01',type:1,space:'麻子山倒班宿舍楼 · 101室',bind:'2026-03-19',unbind:''},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'HC-TY-01',type:2,space:'桐园倒班宿舍1号楼 · 301-1',bind:'2026-04-10',unbind:''},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'HC-TY-02',type:1,space:'桐园倒班宿舍1号楼 · 201室',bind:'2026-04-10',unbind:''},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-01',type:2,space:'西峰基地综合宿舍楼 · 301-1',bind:'2026-05-12',unbind:''},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-02',type:2,space:'西峰基地综合宿舍楼 · 302-1',bind:'2026-05-12',unbind:''},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-03',type:1,space:'西峰基地综合宿舍楼 · 402室',bind:'2026-05-12',unbind:''},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'HC-JB-01',type:2,space:'靖边气田倒班宿舍楼 · 401-1',bind:'2026-06-24',unbind:''}
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10001',type:2,space:'樊学倒班宿舍1号楼 · 101-1',bind:'2026-03-05',unbind:''},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10002',type:2,space:'樊学倒班宿舍1号楼 · 101-2',bind:'2026-03-05',unbind:''},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10003',type:2,space:'樊学倒班宿舍1号楼 · 102-1',bind:'2026-03-05',unbind:''},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10003',type:2,space:'樊学倒班宿舍1号楼 · 201-1',bind:'2026-04-02',unbind:'2026-04-08'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10004',type:1,space:'樊学倒班宿舍1号楼 · 101室',bind:'2026-03-05',unbind:''},
|
||||
{unit:'采油一厂',depart:'麻子山作业区',code:'10005',type:1,space:'麻子山倒班宿舍楼 · 101室',bind:'2026-03-19',unbind:''},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'10006',type:2,space:'桐园倒班宿舍1号楼 · 301-1',bind:'2026-04-10',unbind:''},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'10007',type:1,space:'桐园倒班宿舍1号楼 · 201室',bind:'2026-04-10',unbind:''},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10008',type:2,space:'西峰基地综合宿舍楼 · 301-1',bind:'2026-05-12',unbind:''},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10009',type:2,space:'西峰基地综合宿舍楼 · 302-1',bind:'2026-05-12',unbind:''},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10010',type:1,space:'西峰基地综合宿舍楼 · 402室',bind:'2026-05-12',unbind:''},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'10011',type:2,space:'靖边气田倒班宿舍楼 · 401-1',bind:'2026-06-24',unbind:''}
|
||||
];
|
||||
/* 床位分配记录:当前生效+历史换宿/退住 */
|
||||
var empRecords=[
|
||||
@@ -268,17 +314,71 @@ var empRecords=[
|
||||
{bed:'201-2',dorm:'201室',building:'桐园倒班宿舍1号楼',name:'赵万福',no:'CQ033096',org:'采油二厂',depart:'桐园作业区',bind:'2026-03-01',unbind:'2026-04-09'}
|
||||
];
|
||||
/* 列结构与老系统一致:无「当前状态」列 */
|
||||
function headDev(){return '<tr><th style="width:56px;">序号</th><th>设备所属单位</th><th>设备所属部门</th><th style="min-width:100px;">设备编号</th><th>分配形式</th><th style="min-width:230px;">宿舍/床位名称</th><th>分配日期</th><th>解除日期</th></tr>';}
|
||||
function headEmp(){return '<tr><th style="width:56px;">序号</th><th style="min-width:90px;">床位编号</th><th>所属宿舍</th><th style="min-width:180px;">所属楼栋</th><th>分配员工</th><th>员工编号</th><th style="min-width:120px;">员工单位</th><th style="min-width:150px;">员工部门</th><th>分配日期</th><th>解除日期</th></tr>';}
|
||||
function headDev(){return '<tr><th style="width:56px;">序号</th><th style="min-width:100px;">设备编号</th><th style="min-width:160px;">所属单位部门</th><th>分配类型</th><th style="min-width:230px;">宿舍/床位信息</th><th style="min-width:120px;">所属站点</th><th>分配日期</th><th>解绑日期</th></tr>';}
|
||||
function headEmp(){return '<tr><th style="width:56px;">序号</th><th style="min-width:90px;">床位编号</th><th>所属宿舍</th><th style="min-width:180px;">所属楼栋</th><th style="min-width:120px;">所属站点</th><th style="min-width:160px;">所属单位部门</th><th>分配员工</th><th>员工编号</th><th style="min-width:120px;">员工单位</th><th style="min-width:150px;">员工部门</th><th>分配日期</th><th>解除日期</th></tr>';}
|
||||
function inRange(d){var f=document.getElementById('filterFrom').value,t=document.getElementById('filterTo').value;return (!f||d>=f)&&(!t||d<=t);}
|
||||
function onFilterUnit(){
|
||||
var u=document.getElementById('filterUnit').value;
|
||||
var depSel=document.getElementById('filterDepart');
|
||||
var deps=u?unitDeparts[u]:Object.keys(unitDeparts).reduce(function(a,u2){return a.concat(unitDeparts[u2]);},[]);
|
||||
var uniq=[];deps.forEach(function(x){if(uniq.indexOf(x)<0)uniq.push(x);});
|
||||
depSel.innerHTML='<option value="">全部部门</option>'+uniq.map(function(d){return '<option>'+d+'</option>';}).join('');
|
||||
/* [交互] 单位部门级联筛选 */
|
||||
var selUnit='',selDept='';
|
||||
function toggleOrg(){
|
||||
document.getElementById('orgPanel').classList.toggle('open');
|
||||
document.getElementById('orgTrigger').classList.toggle('open');
|
||||
}
|
||||
function selectUnit(elem,unitName){
|
||||
document.querySelectorAll('#unitCol .org-item').forEach(function(i){i.classList.remove('active');});
|
||||
elem.classList.add('active');
|
||||
selUnit=unitName;
|
||||
var html='<div class="org-col__title">部门</div><div class="org-item active" onclick="selectDept(this,\'\')">全部部门</div>';
|
||||
(unitDeparts[unitName]||[]).forEach(function(d){html+='<div class="org-item" onclick="selectDept(this,\''+d+'\')">'+d+'</div>';});
|
||||
document.getElementById('deptCol').innerHTML=html;
|
||||
selDept='';
|
||||
renderAll();
|
||||
}
|
||||
function selectDept(elem,deptName){
|
||||
document.querySelectorAll('#deptCol .org-item').forEach(function(i){i.classList.remove('active');});
|
||||
elem.classList.add('active');
|
||||
selDept=deptName;
|
||||
document.getElementById('orgTrigger').textContent=(selUnit||'全部单位')+' / '+(selDept||'全部部门');
|
||||
renderAll();
|
||||
}
|
||||
function resetOrg(){
|
||||
selUnit='';selDept='';
|
||||
document.getElementById('orgTrigger').textContent='全部单位/部门';
|
||||
document.getElementById('orgPanel').classList.remove('open');
|
||||
document.getElementById('orgTrigger').classList.remove('open');
|
||||
document.querySelectorAll('#unitCol .org-item').forEach(function(i,idx){i.classList.toggle('active',idx===0);});
|
||||
document.getElementById('deptCol').innerHTML='<div class="org-col__title">部门</div><div class="org-item active" onclick="selectDept(this,\'\')">全部部门</div>';
|
||||
}
|
||||
/* [交互] 床位分配记录:所属单位部门级联筛选 */
|
||||
var selEmpUnit='',selEmpDept='';
|
||||
function toggleEmpOrg(){
|
||||
document.getElementById('empOrgPanel').classList.toggle('open');
|
||||
document.getElementById('empOrgTrigger').classList.toggle('open');
|
||||
}
|
||||
function selectEmpUnit(elem,unitName){
|
||||
document.querySelectorAll('#empUnitCol .org-item').forEach(function(i){i.classList.remove('active');});
|
||||
elem.classList.add('active');
|
||||
selEmpUnit=unitName;
|
||||
var html='<div class="org-col__title">部门</div><div class="org-item active" onclick="selectEmpDept(this,\'\')">全部部门</div>';
|
||||
(unitDeparts[unitName]||[]).forEach(function(d){html+='<div class="org-item" onclick="selectEmpDept(this,\''+d+'\')">'+d+'</div>';});
|
||||
document.getElementById('empDeptCol').innerHTML=html;
|
||||
selEmpDept='';
|
||||
renderAll();
|
||||
}
|
||||
function selectEmpDept(elem,deptName){
|
||||
document.querySelectorAll('#empDeptCol .org-item').forEach(function(i){i.classList.remove('active');});
|
||||
elem.classList.add('active');
|
||||
selEmpDept=deptName;
|
||||
document.getElementById('empOrgTrigger').textContent=(selEmpUnit||'全部单位')+' / '+(selEmpDept||'全部部门');
|
||||
renderAll();
|
||||
}
|
||||
function resetEmpOrg(){
|
||||
selEmpUnit='';selEmpDept='';
|
||||
document.getElementById('empOrgTrigger').textContent='全部单位/部门';
|
||||
document.getElementById('empOrgPanel').classList.remove('open');
|
||||
document.getElementById('empOrgTrigger').classList.remove('open');
|
||||
document.querySelectorAll('#empUnitCol .org-item').forEach(function(i,idx){i.classList.toggle('active',idx===0);});
|
||||
document.getElementById('empDeptCol').innerHTML='<div class="org-col__title">部门</div><div class="org-item active" onclick="selectEmpDept(this,\'\')">全部部门</div>';
|
||||
}
|
||||
var buildings=[];empRecords.forEach(function(r){if(buildings.indexOf(r.building)<0)buildings.push(r.building);});
|
||||
function onFilterEBuilding(){
|
||||
var b=document.getElementById('filterEBuilding').value;
|
||||
@@ -289,31 +389,34 @@ function onFilterEBuilding(){
|
||||
function renderAll(){
|
||||
var rows='';
|
||||
if(curTab==='dev'){
|
||||
var u=document.getElementById('filterUnit').value,d=document.getElementById('filterDepart').value,kc=document.getElementById('filterDevCode').value.trim().toUpperCase();
|
||||
var tp=document.getElementById('filterType').value,hs=document.getElementById('filterHostel').value.trim(),bd=document.getElementById('filterBed').value.trim();
|
||||
var kc=document.getElementById('filterDevCode').value.trim().toUpperCase();
|
||||
var tp=document.getElementById('filterType').value;
|
||||
var list=devRecords.filter(function(r){
|
||||
return (!u||r.unit===u)&&(!d||r.depart===d)&&(!kc||r.code.toUpperCase().indexOf(kc)>=0)
|
||||
&&(!tp||String(r.type)===tp)&&(!hs||r.space.indexOf(hs)>=0)&&(!bd||r.space.indexOf(bd)>=0)&&inRange(r.bind);
|
||||
return (!selUnit||r.unit===selUnit)&&(!selDept||r.depart===selDept)&&(!kc||r.code.toUpperCase().indexOf(kc)>=0)
|
||||
&&(!tp||String(r.type)===tp)&&inRange(r.bind);
|
||||
});
|
||||
rows=list.map(function(r,i){
|
||||
return '<tr><td>'+(i+1)+'</td><td>'+r.unit+'</td><td>'+r.depart+'</td><td style="font-family:monospace;font-weight:500;">'+r.code+'</td>'
|
||||
return '<tr><td>'+(i+1)+'</td><td style="font-family:monospace;font-weight:500;">'+r.code+'</td><td>'+r.unit+' / '+r.depart+'</td>'
|
||||
+'<td><span class="badge '+(r.type===1?'badge--info':'badge--success')+'">'+(r.type===1?'宿舍':'床位')+'</span></td>'
|
||||
+'<td>'+r.space+'</td><td>'+r.bind+'</td><td>'+(r.unbind||'-')+'</td></tr>';
|
||||
+'<td>'+r.space+'</td><td>'+stationOf(r)+'</td><td>'+r.bind+'</td><td>'+(r.unbind||'-')+'</td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="8">没有符合条件的分配记录</td></tr>';
|
||||
document.getElementById('thead').innerHTML=headDev();
|
||||
document.getElementById('totalTip').textContent='共 '+list.length+' 条 · 未解除 '+list.filter(function(r){return !r.unbind;}).length+' 条';
|
||||
}else{
|
||||
var b2=document.getElementById('filterEBuilding').value,d2=document.getElementById('filterEDorm').value;
|
||||
var en=document.getElementById('filterEName').value.trim(),eo=document.getElementById('filterENo').value.trim().toUpperCase();
|
||||
var bd2=document.getElementById('filterBed').value.trim();
|
||||
var b2=document.getElementById('filterEBuilding').value,d2=document.getElementById('filterEDorm').value,s2=document.getElementById('filterEStation').value;
|
||||
var en=document.getElementById('filterEName').value.trim(),eo=document.getElementById('filterENo').value.trim().toUpperCase(),bd=document.getElementById('filterEBed').value.trim();
|
||||
var list2=empRecords.filter(function(r){
|
||||
return (!b2||r.building===b2)&&(!d2||r.dorm===d2)&&(!en||r.name.indexOf(en)>=0)
|
||||
&&(!eo||r.no.toUpperCase().indexOf(eo)>=0)&&(!bd2||r.bed.indexOf(bd2)>=0)&&inRange(r.bind);
|
||||
var m=buildingMeta[r.building]||{};
|
||||
return (!selEmpUnit||m.unit===selEmpUnit)&&(!selEmpDept||m.depart===selEmpDept)&&(!s2||m.station===s2)
|
||||
&&(!b2||r.building===b2)&&(!d2||r.dorm===d2)&&(!bd||r.bed.indexOf(bd)>=0)&&(!en||r.name.indexOf(en)>=0)
|
||||
&&(!eo||r.no.toUpperCase().indexOf(eo)>=0)&&inRange(r.bind);
|
||||
});
|
||||
rows=list2.map(function(r,i){
|
||||
var m=buildingMeta[r.building]||{};
|
||||
return '<tr><td>'+(i+1)+'</td><td style="font-family:monospace;font-weight:500;">'+r.bed+'</td><td>'+r.dorm+'</td><td>'+r.building+'</td>'
|
||||
+'<td>'+(m.station||'')+'</td><td>'+(m.unit?m.unit+' / '+m.depart:'')+'</td>'
|
||||
+'<td>'+r.name+'</td><td>'+r.no+'</td><td>'+r.org+'</td><td>'+r.depart+'</td><td>'+r.bind+'</td><td>'+(r.unbind||'-')+'</td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="10">没有符合条件的分配记录</td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="12">没有符合条件的分配记录</td></tr>';
|
||||
document.getElementById('thead').innerHTML=headEmp();
|
||||
document.getElementById('totalTip').textContent='共 '+list2.length+' 条 · 未解除 '+list2.filter(function(r){return !r.unbind;}).length+' 条';
|
||||
}
|
||||
@@ -329,8 +432,9 @@ function switchTab(t){
|
||||
renderAll();
|
||||
}
|
||||
function resetFilter(){
|
||||
['filterUnit','filterDepart','filterType','filterEBuilding','filterEDorm'].forEach(function(id){document.getElementById(id).value='';});
|
||||
['filterDevCode','filterHostel','filterEName','filterENo','filterBed'].forEach(function(id){document.getElementById(id).value='';});
|
||||
resetOrg();resetEmpOrg();
|
||||
['filterType','filterEStation','filterEBuilding','filterEDorm'].forEach(function(id){document.getElementById(id).value='';});
|
||||
['filterDevCode','filterEBed','filterEName','filterENo'].forEach(function(id){document.getElementById(id).value='';});
|
||||
document.getElementById('filterFrom').value='2026-01-01';document.getElementById('filterTo').value='2026-09-07';
|
||||
renderAll();
|
||||
}
|
||||
@@ -350,9 +454,19 @@ function showToast(msg){
|
||||
var t=document.getElementById('toast');t.textContent=msg;t.classList.add('show');
|
||||
clearTimeout(t._timer);t._timer=setTimeout(function(){t.classList.remove('show');},2200);
|
||||
}
|
||||
document.getElementById('filterUnit').innerHTML='<option value="">全部单位</option>'+Object.keys(unitDeparts).map(function(u){return '<option>'+u+'</option>';}).join('');
|
||||
/* [交互] 点击面板外部关闭下拉 */
|
||||
document.addEventListener('click',function(e){
|
||||
var ow=document.getElementById('orgWrap');
|
||||
if(ow&&!ow.contains(e.target)){document.getElementById('orgPanel').classList.remove('open');document.getElementById('orgTrigger').classList.remove('open');}
|
||||
var ow2=document.getElementById('empOrgWrap');
|
||||
if(ow2&&!ow2.contains(e.target)){document.getElementById('empOrgPanel').classList.remove('open');document.getElementById('empOrgTrigger').classList.remove('open');}
|
||||
});
|
||||
document.getElementById('unitCol').insertAdjacentHTML('beforeend',Object.keys(unitDeparts).map(function(u){return '<div class="org-item" onclick="selectUnit(this,\''+u+'\')">'+u+'</div>';}).join(''));
|
||||
document.getElementById('empUnitCol').insertAdjacentHTML('beforeend',Object.keys(unitDeparts).map(function(u){return '<div class="org-item" onclick="selectEmpUnit(this,\''+u+'\')">'+u+'</div>';}).join(''));
|
||||
document.getElementById('filterEBuilding').innerHTML='<option value="">全部楼栋</option>'+buildings.map(function(b){return '<option>'+b+'</option>';}).join('');
|
||||
onFilterUnit();onFilterEBuilding();
|
||||
var allStations=Object.keys(depStations).reduce(function(a,k){return a.concat(depStations[k]);},[]);
|
||||
document.getElementById('filterEStation').innerHTML='<option value="">全部站点</option>'+allStations.map(function(s){return '<option>'+s+'</option>';}).join('');
|
||||
onFilterEBuilding();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -39,12 +39,24 @@ body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei
|
||||
.sidebar-group.open .sidebar-group__items{display:block;}
|
||||
.sidebar-item--sub{padding-left:44px;}
|
||||
.main{margin-left:240px;margin-top:56px;padding:24px;min-height:calc(100vh - 56px);}
|
||||
.filter-bar{background:#fff;padding:16px 24px;display:flex;align-items:center;gap:16px;flex-wrap:wrap;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);}
|
||||
.filter-item{display:flex;align-items:center;gap:8px;}
|
||||
.filter-bar{background:#fff;padding:12px 16px;display:flex;align-items:center;gap:12px;flex-wrap:nowrap;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);}
|
||||
.filter-item{display:flex;align-items:center;gap:6px;flex-shrink:0;}
|
||||
.filter-item label{font-size:var(--font-sm);color:var(--text-secondary);white-space:nowrap;}
|
||||
.filter-select{height:36px;min-width:140px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 28px 0 12px;font-size:var(--font-sm);color:var(--text-primary);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 8px center;cursor:pointer;outline:none;appearance:none;-webkit-appearance:none;}
|
||||
.filter-input{height:36px;min-width:120px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 12px;font-size:var(--font-sm);color:var(--text-primary);outline:none;}
|
||||
.filter-input:focus{border-color:var(--primary);}
|
||||
/* 单位部门级联筛选 */
|
||||
.org-wrap{position:relative;display:inline-block;}
|
||||
.org-trigger{height:36px;min-width:130px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 28px 0 12px;font-size:var(--font-sm);color:var(--text-primary);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 8px center;cursor:pointer;display:flex;align-items:center;user-select:none;white-space:nowrap;}
|
||||
.org-trigger.open,.org-trigger:hover{border-color:var(--primary);}
|
||||
.org-panel{display:none;position:absolute;top:36px;left:0;z-index:310;background:#fff;border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);width:380px;}
|
||||
.org-panel.open{display:flex;}
|
||||
.org-col{flex:1;overflow-y:auto;max-height:200px;border-right:1px solid var(--border);}
|
||||
.org-col:last-child{border-right:none;}
|
||||
.org-col__title{padding:6px 12px;font-size:var(--font-sm);color:var(--text-placeholder);background:#FAFAFA;border-bottom:1px solid var(--border);font-weight:500;}
|
||||
.org-item{padding:8px 12px;font-size:var(--font-sm);color:var(--text-primary);cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:4px;}
|
||||
.org-item:hover{background:#F0F8FF;color:var(--primary);}
|
||||
.org-item.active{background:var(--primary-light);color:var(--primary);font-weight:500;}
|
||||
.btn{height:36px;padding:0 16px;border-radius:var(--radius-sm);font-size:var(--font-sm);cursor:pointer;border:none;transition:all .2s;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
|
||||
.btn-primary{background:var(--primary);color:#fff;}.btn-primary:hover{background:#40a9ff;}
|
||||
.btn-default{background:#fff;color:var(--text-primary);border:1px solid var(--border);}.btn-default:hover{color:var(--primary);border-color:var(--primary);}
|
||||
@@ -91,6 +103,15 @@ tbody tr:hover td:last-child{background:#F8FBFF;}
|
||||
.form-control{height:32px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 10px;font-size:var(--font-sm);color:var(--text-primary);outline:none;width:100%;}
|
||||
.form-control:focus{border-color:var(--primary);}
|
||||
select.form-control{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;appearance:none;-webkit-appearance:none;padding-right:28px;cursor:pointer;}
|
||||
/* [交互] 搜索下拉(新增/编辑床位):楼栋显示名称+站点,宿舍显示名称 */
|
||||
.search-select{position:relative;}
|
||||
.search-select__panel{display:none;position:absolute;top:34px;left:0;right:0;z-index:320;background:#fff;border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);max-height:240px;overflow-y:auto;}
|
||||
.search-select__panel.open{display:block;}
|
||||
.search-select__item{padding:8px 12px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px;}
|
||||
.search-select__item:hover{background:#F0F8FF;}
|
||||
.search-select__item .ss-name{color:var(--text-primary);font-weight:500;}
|
||||
.search-select__item .ss-org{color:var(--text-placeholder);font-size:var(--font-xs);}
|
||||
.search-select__empty{padding:16px 12px;text-align:center;color:var(--text-placeholder);font-size:var(--font-sm);}
|
||||
.upload-box{border:1px dashed var(--border);border-radius:var(--radius-md);padding:28px 16px;text-align:center;color:var(--text-placeholder);font-size:var(--font-sm);cursor:pointer;transition:all .2s;background:#FAFAFA;}
|
||||
.upload-box:hover{border-color:var(--primary);color:var(--primary);background:#F0F8FF;}
|
||||
.upload-box svg{display:block;margin:0 auto 8px;}
|
||||
@@ -160,34 +181,52 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
<!-- [交互] 筛选栏:楼栋→宿舍级联 -->
|
||||
<div class="filter-bar">
|
||||
<div class="filter-item">
|
||||
<label>床位编号</label>
|
||||
<input class="filter-input" id="filterBed" placeholder="请输入床位编号" oninput="renderTable()" style="min-width:110px;">
|
||||
<label>所属单位部门</label>
|
||||
<div class="org-wrap" id="orgWrap">
|
||||
<div class="org-trigger" id="orgTrigger" onclick="toggleOrg()">全部单位/部门</div>
|
||||
<div class="org-panel" id="orgPanel">
|
||||
<div class="org-col" id="unitCol">
|
||||
<div class="org-col__title">单位</div>
|
||||
<div class="org-item active" onclick="selectUnit(this,'')">全部单位/部门</div>
|
||||
</div>
|
||||
<div class="org-col" id="deptCol">
|
||||
<div class="org-col__title">部门</div>
|
||||
<div class="org-item active" onclick="selectDept(this,'')">全部部门</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>所属站点</label>
|
||||
<select class="filter-select" id="filterStation" onchange="renderTable()" style="min-width:120px;">
|
||||
<option value="">全部站点</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>所属楼栋</label>
|
||||
<select class="filter-select" id="filterBuilding" onchange="onFilterBuilding()" style="min-width:180px;">
|
||||
<select class="filter-select" id="filterBuilding" onchange="onFilterBuilding()" style="min-width:160px;">
|
||||
<option value="">全部楼栋</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>所属宿舍</label>
|
||||
<select class="filter-select" id="filterDorm" onchange="renderTable()" style="min-width:110px;">
|
||||
<select class="filter-select" id="filterDorm" onchange="renderTable()" style="min-width:90px;">
|
||||
<option value="">全部宿舍</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>是否分配员工</label>
|
||||
<select class="filter-select" id="filterAlloc" onchange="renderTable()" style="min-width:100px;">
|
||||
<select class="filter-select" id="filterAlloc" onchange="renderTable()" style="min-width:90px;">
|
||||
<option value="">全部</option><option value="1">是</option><option value="0">否</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>员工姓名</label>
|
||||
<input class="filter-input" id="filterEmpName" placeholder="请输入员工姓名" oninput="renderTable()" style="min-width:110px;">
|
||||
<input class="filter-input" id="filterEmpName" placeholder="请输入员工姓名" oninput="renderTable()" style="min-width:100px;">
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>员工编号</label>
|
||||
<input class="filter-input" id="filterEmpNo" placeholder="请输入员工编号" oninput="renderTable()" style="min-width:110px;">
|
||||
<input class="filter-input" id="filterEmpNo" placeholder="请输入员工编号" oninput="renderTable()" style="min-width:100px;">
|
||||
</div>
|
||||
<button class="btn btn-primary" onclick="renderTable();showToast('查询完成')">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><circle cx="6" cy="6" r="4.5" stroke="#fff" stroke-width="1.3"/><path d="M9.5 9.5L13 13" stroke="#fff" stroke-width="1.3" stroke-linecap="round"/></svg>查询
|
||||
@@ -204,8 +243,6 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
</button>
|
||||
<button class="btn btn-primary" onclick="openImport()"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M2 10v2h10v-2M7 9V2M4.5 4.5L7 2l2.5 2.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>批量导入数据</button>
|
||||
<button class="btn btn-default" onclick="openTaskRecord('import')"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><rect x="2" y="2" width="10" height="10" rx="1.5" stroke="currentColor" stroke-width="1.4"/><path d="M4 5h6M4 7.5h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>查看导入任务</button>
|
||||
<button class="btn btn-primary" onclick="openAllocImport()"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M2 10v2h10v-2M7 9V2M4.5 4.5L7 2l2.5 2.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>批量导入分配数据</button>
|
||||
<button class="btn btn-default" onclick="openTaskRecord('alloc')"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><rect x="2" y="2" width="10" height="10" rx="1.5" stroke="currentColor" stroke-width="1.4"/><path d="M4 5h6M4 7.5h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>查看分配导入任务</button>
|
||||
<button class="btn btn-primary" onclick="showToast('床位列表已导出(演示)')"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M2 10v2h10v-2M7 2v7M4.5 6.5L7 9l2.5-2.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>导出列表数据</button>
|
||||
<button class="btn btn-danger" onclick="batchDelete()">批量删除</button>
|
||||
</div>
|
||||
@@ -215,8 +252,8 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:40px;"><input type="checkbox" id="ckAll" onchange="toggleAll(this)"></th>
|
||||
<th style="width:56px;">序号</th><th style="min-width:100px;">床位编号</th><th style="min-width:180px;">所属楼栋</th><th style="min-width:90px;">所属宿舍</th>
|
||||
<th>是否分配员工</th><th>员工姓名</th><th>员工编号</th><th style="min-width:110px;">员工联系方式</th><th style="min-width:100px;">床头设备</th><th style="width:170px;">操作</th>
|
||||
<th style="width:56px;">序号</th><th style="min-width:100px;">床位编号</th><th style="min-width:90px;">所属宿舍</th><th style="min-width:180px;">所属楼栋</th><th style="min-width:120px;">所属站点</th><th style="min-width:160px;">所属单位部门</th>
|
||||
<th>是否分配员工</th><th>员工姓名</th><th>员工编号</th><th style="min-width:110px;">员工联系方式</th><th style="min-width:110px;">床头设备编号</th><th style="width:170px;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody"></tbody>
|
||||
@@ -233,11 +270,17 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
<div class="form-row">
|
||||
<div class="form-item">
|
||||
<span class="form-label"><span class="req">*</span> 所属楼栋</span>
|
||||
<select class="form-control" id="eBuilding" onchange="onEditBuilding()"><option value="">请选择楼栋</option></select>
|
||||
<div class="search-select" id="eBuildingSearch">
|
||||
<input class="form-control" id="eBuilding" placeholder="请输入楼栋名称搜索" autocomplete="off" oninput="onBuildingInput()" onfocus="onBuildingFocus()">
|
||||
<div class="search-select__panel" id="buildingPanel"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<span class="form-label"><span class="req">*</span> 所属宿舍</span>
|
||||
<select class="form-control" id="eDorm"><option value="">请先选择楼栋</option></select>
|
||||
<div class="search-select" id="eDormSearch">
|
||||
<input class="form-control" id="eDorm" placeholder="请输入宿舍名称搜索" autocomplete="off" oninput="onDormInput()" onfocus="onDormFocus()">
|
||||
<div class="search-select__panel" id="dormPanel"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
@@ -257,11 +300,17 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
<div class="modal__title">批量导入数据</div>
|
||||
<div class="form-item">
|
||||
<span class="form-label"><span class="req">*</span> 所属楼栋</span>
|
||||
<select class="form-control" id="iBuilding" onchange="onImportBuilding()"><option value="">请选择楼栋</option></select>
|
||||
<div class="search-select" id="iBuildingSearch">
|
||||
<input class="form-control" id="iBuilding" placeholder="请输入楼栋名称搜索" autocomplete="off" oninput="onImportBuildingInput()" onfocus="onImportBuildingFocus()">
|
||||
<div class="search-select__panel" id="iBuildingPanel"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<span class="form-label">所属宿舍(留空则按模板内宿舍列挂接)</span>
|
||||
<select class="form-control" id="iDorm"><option value="">全部宿舍</option></select>
|
||||
<div class="search-select" id="iDormSearch">
|
||||
<input class="form-control" id="iDorm" placeholder="请输入宿舍名称搜索" autocomplete="off" oninput="onImportDormInput()" onfocus="onImportDormFocus()">
|
||||
<div class="search-select__panel" id="iDormPanel"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<span class="form-label"><span class="req">*</span> 上传文件</span>
|
||||
@@ -280,28 +329,7 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- [交互] 分配导入:按员工编号+床位编号批量绑定 -->
|
||||
<div class="modal-mask" id="allocImportMask">
|
||||
<div class="modal">
|
||||
<div class="modal__title">批量导入分配数据</div>
|
||||
<div class="form-item">
|
||||
<span class="form-label"><span class="req">*</span> 上传文件</span>
|
||||
<div class="upload-box" onclick="showToast('已选择文件:床位分配-模板.xlsx')">
|
||||
<svg width="26" height="26" viewBox="0 0 26 26" fill="none"><path d="M13 17V6m0 0L8.5 10.5M13 6l4.5 4.5" stroke="#999" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 18v2.5A1.5 1.5 0 0 0 5.5 22h15a1.5 1.5 0 0 0 1.5-1.5V18" stroke="#999" stroke-width="1.6" stroke-linecap="round"/></svg>
|
||||
点击上传 Excel 文件(.xlsx)
|
||||
</div>
|
||||
</div>
|
||||
<div style="font-size:var(--font-xs);color:var(--text-placeholder);margin-bottom:4px;">
|
||||
<a href="javascript:void(0)" style="color:var(--primary);text-decoration:none;" onclick="showToast('模板下载中…')">下载导入模板</a> · 模板列:员工编号 / 床位编号;导入成功即建立床位-员工分配关系
|
||||
</div>
|
||||
<div class="modal__footer">
|
||||
<button class="btn btn-default" onclick="closeAllocImport()">取消</button>
|
||||
<button class="btn btn-primary" onclick="doAllocImport()">开始导入</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- [交互] 导入/分配导入:异步任务列表 -->
|
||||
<!-- [交互] 导入任务:异步任务列表 -->
|
||||
<div class="modal-mask" id="taskMask">
|
||||
<div class="modal--wide">
|
||||
<div class="modal__title" id="taskTitle">床位导入任务</div>
|
||||
@@ -382,7 +410,17 @@ var assigns={
|
||||
'靖边气田倒班宿舍楼|401-1':'CQ036441','靖边气田倒班宿舍楼|401-2':'CQ029905'
|
||||
};
|
||||
/* 床位→床头设备(key同上) */
|
||||
var bedDevices={'樊学倒班宿舍1号楼|101-1':'HC-FX-01','樊学倒班宿舍1号楼|101-2':'HC-FX-02','樊学倒班宿舍1号楼|102-1':'HC-FX-03','桐园倒班宿舍1号楼|301-1':'HC-TY-01','西峰基地综合宿舍楼|301-1':'HC-XF-01','西峰基地综合宿舍楼|302-1':'HC-XF-02','靖边气田倒班宿舍楼|401-1':'HC-JB-01'};
|
||||
var bedDevices={'樊学倒班宿舍1号楼|101-1':'10001','樊学倒班宿舍1号楼|101-2':'10002','樊学倒班宿舍1号楼|102-1':'10003','桐园倒班宿舍1号楼|301-1':'10006','西峰基地综合宿舍楼|301-1':'10008','西峰基地综合宿舍楼|302-1':'10009','靖边气田倒班宿舍楼|401-1':'10011'};
|
||||
/* 单位→部门→站点三级映射与楼栋归属,与「楼栋信息」「宿舍信息」页口径一致 */
|
||||
var unitDeparts={'采油一厂':['樊学作业区','麻子山作业区'],'采油二厂':['桐园作业区','姬圪台作业区'],'第四采油厂':['西峰作业区'],'采气一厂':['靖边气田']};
|
||||
var depStations={'樊学作业区':['樊学站点基地'],'麻子山作业区':['麻子山站点'],'桐园作业区':['桐园站点基地'],'姬圪台作业区':['姬圪台站点'],'西峰作业区':['西峰基地'],'靖边气田':['靖边气田站点']};
|
||||
var buildingMeta={
|
||||
'樊学倒班宿舍1号楼':{station:'樊学站点基地',unit:'采油一厂',depart:'樊学作业区'},
|
||||
'麻子山倒班宿舍楼':{station:'麻子山站点',unit:'采油一厂',depart:'麻子山作业区'},
|
||||
'桐园倒班宿舍1号楼':{station:'桐园站点基地',unit:'采油二厂',depart:'桐园作业区'},
|
||||
'西峰基地综合宿舍楼':{station:'西峰基地',unit:'第四采油厂',depart:'西峰作业区'},
|
||||
'靖边气田倒班宿舍楼':{station:'靖边气田站点',unit:'采气一厂',depart:'靖边气田'}
|
||||
};
|
||||
var beds=[];
|
||||
dormMeta.forEach(function(d){
|
||||
for(var nn=1;nn<=d.beds;nn++){
|
||||
@@ -393,9 +431,11 @@ dormMeta.forEach(function(d){
|
||||
var pageNo=1,pageSize=10;
|
||||
function uniqBuildings(){var bs=[];dormMeta.forEach(function(d){if(bs.indexOf(d.building)<0)bs.push(d.building);});return bs;}
|
||||
function initFilters(){
|
||||
var unitHtml=Object.keys(unitDeparts).map(function(u){return '<div class="org-item" onclick="selectUnit(this,\''+u+'\')">'+u+'</div>';}).join('');
|
||||
document.getElementById('unitCol').insertAdjacentHTML('beforeend',unitHtml);
|
||||
document.getElementById('filterBuilding').innerHTML='<option value="">全部楼栋</option>'+uniqBuildings().map(function(b){return '<option>'+b+'</option>';}).join('');
|
||||
document.getElementById('eBuilding').innerHTML='<option value="">请选择楼栋</option>'+uniqBuildings().map(function(b){return '<option>'+b+'</option>';}).join('');
|
||||
document.getElementById('iBuilding').innerHTML='<option value="">请选择楼栋</option>'+uniqBuildings().map(function(b){return '<option>'+b+'</option>';}).join('');
|
||||
var allStations=Object.keys(depStations).reduce(function(a,k){return a.concat(depStations[k]);},[]);
|
||||
document.getElementById('filterStation').innerHTML='<option value="">全部站点</option>'+allStations.map(function(s){return '<option>'+s+'</option>';}).join('');
|
||||
}
|
||||
function dormOptionsHtml(b,cur){
|
||||
var ds=[];dormMeta.forEach(function(d){if((!b||d.building===b)&&ds.indexOf(d.name)<0)ds.push(d.name);});
|
||||
@@ -407,12 +447,45 @@ function onFilterBuilding(){
|
||||
renderTable();
|
||||
}
|
||||
function empOf(no){for(var i=0;i<empPool.length;i++){if(empPool[i].no===no)return empPool[i];}return null;}
|
||||
/* [交互] 单位部门级联筛选 */
|
||||
var selUnit='',selDept='';
|
||||
function toggleOrg(){
|
||||
document.getElementById('orgPanel').classList.toggle('open');
|
||||
document.getElementById('orgTrigger').classList.toggle('open');
|
||||
}
|
||||
function selectUnit(elem,unitName){
|
||||
document.querySelectorAll('#unitCol .org-item').forEach(function(i){i.classList.remove('active');});
|
||||
elem.classList.add('active');
|
||||
selUnit=unitName;
|
||||
var html='<div class="org-col__title">部门</div><div class="org-item active" onclick="selectDept(this,\'\')">全部部门</div>';
|
||||
(unitDeparts[unitName]||[]).forEach(function(d){html+='<div class="org-item" onclick="selectDept(this,\''+d+'\')">'+d+'</div>';});
|
||||
document.getElementById('deptCol').innerHTML=html;
|
||||
selDept='';
|
||||
renderTable();
|
||||
}
|
||||
function selectDept(elem,deptName){
|
||||
document.querySelectorAll('#deptCol .org-item').forEach(function(i){i.classList.remove('active');});
|
||||
elem.classList.add('active');
|
||||
selDept=deptName;
|
||||
document.getElementById('orgTrigger').textContent=(selUnit||'全部单位')+' / '+(selDept||'全部部门');
|
||||
renderTable();
|
||||
}
|
||||
function resetOrg(){
|
||||
selUnit='';selDept='';
|
||||
document.getElementById('orgTrigger').textContent='全部单位/部门';
|
||||
document.getElementById('orgPanel').classList.remove('open');
|
||||
document.getElementById('orgTrigger').classList.remove('open');
|
||||
document.querySelectorAll('#unitCol .org-item').forEach(function(i,idx){i.classList.toggle('active',idx===0);});
|
||||
document.getElementById('deptCol').innerHTML='<div class="org-col__title">部门</div><div class="org-item active" onclick="selectDept(this,\'\')">全部部门</div>';
|
||||
}
|
||||
function filtered(){
|
||||
var b=document.getElementById('filterBuilding').value,d=document.getElementById('filterDorm').value,kc=document.getElementById('filterBed').value.trim();
|
||||
var b=document.getElementById('filterBuilding').value,d=document.getElementById('filterDorm').value,s=document.getElementById('filterStation').value;
|
||||
var a=document.getElementById('filterAlloc').value,en=document.getElementById('filterEmpName').value.trim(),eo=document.getElementById('filterEmpNo').value.trim().toUpperCase();
|
||||
return beds.filter(function(r){
|
||||
var key=r.building+'|'+r.code,e=assigns[key]?empOf(assigns[key]):null;
|
||||
return (!b||r.building===b)&&(!d||r.dorm===d)&&(!kc||r.code.indexOf(kc)>=0)
|
||||
var meta=buildingMeta[r.building]||{};
|
||||
return (!selUnit||meta.unit===selUnit)&&(!selDept||meta.depart===selDept)&&(!s||meta.station===s)
|
||||
&&(!b||r.building===b)&&(!d||r.dorm===d)
|
||||
&&(a===''||String(assigns[key]?1:0)===a)
|
||||
&&(!en||(e&&e.name.indexOf(en)>=0))&&(!eo||(assigns[key]&&assigns[key].indexOf(eo)>=0));
|
||||
});
|
||||
@@ -424,14 +497,15 @@ function renderTable(){
|
||||
var slice=list.slice((pageNo-1)*pageSize,pageNo*pageSize);
|
||||
document.getElementById('tbody').innerHTML=slice.map(function(r){
|
||||
var i=beds.indexOf(r),key=r.building+'|'+r.code,no=assigns[key],e=no?empOf(no):null;
|
||||
var meta=buildingMeta[r.building]||{};
|
||||
return '<tr><td><input type="checkbox" class="rowCk" value="'+i+'" onchange="syncAllCk()"></td>'
|
||||
+'<td>'+(i+1)+'</td><td style="font-family:monospace;font-weight:500;">'+r.code+'</td><td>'+r.building+'</td><td>'+r.dorm+'</td>'
|
||||
+'<td>'+(i+1)+'</td><td style="font-family:monospace;font-weight:500;">'+r.code+'</td><td>'+r.dorm+'</td><td>'+r.building+'</td><td>'+(meta.station||'')+'</td><td>'+(meta.unit?meta.unit+' / '+meta.depart:'')+'</td>'
|
||||
+(e?'<td><span class="badge badge--success">是</span></td><td>'+e.name+'</td><td>'+e.no+'</td><td>'+e.phone+'</td>'
|
||||
:'<td><span class="badge badge--muted">否</span></td><td>-</td><td>-</td><td>-</td>')
|
||||
+'<td style="font-family:monospace;">'+(bedDevices[key]||'-')+'</td>'
|
||||
+'<td>'+(e?'<button class="btn btn-link--danger" onclick="askUnassign(\''+key+'\')">解除分配</button>':'<button class="btn btn-link" onclick="openAlloc(\''+key+'\',\''+r.code+'\')">分配员工</button>')
|
||||
+'<button class="btn btn-link" onclick="openEdit('+i+')">编辑</button><button class="btn btn-link--danger" onclick="askDelete('+i+')">删除</button></td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="11">没有符合条件的床位</td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="13">没有符合条件的床位</td></tr>';
|
||||
document.getElementById('totalTip').textContent='共 '+list.length+' 床 · 已分配 '+Object.keys(assigns).length+' · 第 '+pageNo+'/'+pages+' 页';
|
||||
document.getElementById('ckAll').checked=false;
|
||||
}
|
||||
@@ -439,7 +513,7 @@ function gotoPage(d){
|
||||
var pages=Math.max(1,Math.ceil(filtered().length/pageSize));
|
||||
pageNo=Math.min(pages,Math.max(1,pageNo+d));renderTable();
|
||||
}
|
||||
function resetFilter(){['filterBuilding','filterDorm','filterAlloc'].forEach(function(id){document.getElementById(id).value='';});['filterBed','filterEmpName','filterEmpNo'].forEach(function(id){document.getElementById(id).value='';});onFilterBuilding();}
|
||||
function resetFilter(){resetOrg();['filterStation','filterBuilding','filterDorm','filterAlloc'].forEach(function(id){document.getElementById(id).value='';});['filterEmpName','filterEmpNo'].forEach(function(id){document.getElementById(id).value='';});onFilterBuilding();}
|
||||
/* [交互] 复选框与批量删除 */
|
||||
function toggleAll(ck){document.querySelectorAll('.rowCk').forEach(function(c){c.checked=ck.checked;});}
|
||||
function syncAllCk(){
|
||||
@@ -457,29 +531,63 @@ function batchDelete(){
|
||||
batchAskDelete();
|
||||
}
|
||||
/* [交互] 新增/编辑床位 */
|
||||
var editIdx=-1;
|
||||
function onEditBuilding(){
|
||||
var b=document.getElementById('eBuilding').value;
|
||||
document.getElementById('eDorm').innerHTML='<option value="">请选择宿舍</option>'+dormOptionsHtml(b);
|
||||
var editIdx=-1,selBuilding='',selDorm='';
|
||||
function onBuildingInput(){selBuilding='';selDorm='';document.getElementById('eDorm').value='';renderBuildingPanel();}
|
||||
function onBuildingFocus(){renderBuildingPanel();}
|
||||
function renderBuildingPanel(){
|
||||
var q=document.getElementById('eBuilding').value.trim();
|
||||
var list=uniqBuildings().filter(function(b){return !q||b.indexOf(q)>=0;});
|
||||
document.getElementById('buildingPanel').innerHTML=list.map(function(b){
|
||||
var meta=buildingMeta[b]||{};
|
||||
return '<div class="search-select__item" onclick="pickBuilding(\''+b+'\')"><span class="ss-name">'+b+'</span><span class="ss-org">'+(meta.station||'')+'</span></div>';
|
||||
}).join('')||'<div class="search-select__empty">未查询到楼栋</div>';
|
||||
document.getElementById('buildingPanel').classList.add('open');
|
||||
}
|
||||
function pickBuilding(name){
|
||||
selBuilding=name;
|
||||
document.getElementById('eBuilding').value=name;
|
||||
selDorm='';document.getElementById('eDorm').value='';
|
||||
document.getElementById('buildingPanel').classList.remove('open');
|
||||
}
|
||||
function onDormInput(){selDorm='';renderDormPanel();}
|
||||
function onDormFocus(){renderDormPanel();}
|
||||
function renderDormPanel(){
|
||||
var q=document.getElementById('eDorm').value.trim();
|
||||
var list=(selBuilding?dormMeta.filter(function(d){return d.building===selBuilding;}):[]).filter(function(d){return !q||d.name.indexOf(q)>=0;});
|
||||
document.getElementById('dormPanel').innerHTML=list.map(function(d){
|
||||
return '<div class="search-select__item" onclick="pickDorm(\''+d.name+'\')"><span class="ss-name">'+d.name+'</span></div>';
|
||||
}).join('')||'<div class="search-select__empty">'+(selBuilding?'未查询到宿舍':'请先选择楼栋')+'</div>';
|
||||
document.getElementById('dormPanel').classList.add('open');
|
||||
}
|
||||
function pickDorm(name){
|
||||
selDorm=name;
|
||||
document.getElementById('eDorm').value=name;
|
||||
document.getElementById('dormPanel').classList.remove('open');
|
||||
}
|
||||
function openEdit(i){
|
||||
editIdx=i;
|
||||
document.getElementById('editTitle').textContent=i<0?'新增床位信息':'编辑床位信息';
|
||||
if(i>=0){
|
||||
var r=beds[i];
|
||||
document.getElementById('eBuilding').value=r.building;onEditBuilding();
|
||||
document.getElementById('eDorm').innerHTML='<option value="">请选择宿舍</option>'+dormOptionsHtml(r.building,r.dorm);
|
||||
selBuilding=r.building;selDorm=r.dorm;
|
||||
document.getElementById('eBuilding').value=r.building;
|
||||
document.getElementById('eDorm').value=r.dorm;
|
||||
document.getElementById('eCode').value=r.code;
|
||||
}else{
|
||||
document.getElementById('eBuilding').value='';onEditBuilding();
|
||||
selBuilding='';selDorm='';
|
||||
document.getElementById('eBuilding').value='';
|
||||
document.getElementById('eDorm').value='';
|
||||
document.getElementById('eCode').value='';
|
||||
}
|
||||
document.getElementById('buildingPanel').classList.remove('open');
|
||||
document.getElementById('dormPanel').classList.remove('open');
|
||||
document.getElementById('editMask').classList.add('open');
|
||||
}
|
||||
function closeEdit(){document.getElementById('editMask').classList.remove('open');}
|
||||
function saveEdit(){
|
||||
var b=document.getElementById('eBuilding').value,d=document.getElementById('eDorm').value,c=document.getElementById('eCode').value.trim();
|
||||
if(!b||!d||!c){showToast('请完整填写带 * 的必填项');return;}
|
||||
var b=selBuilding||document.getElementById('eBuilding').value.trim(),d=selDorm||document.getElementById('eDorm').value.trim(),c=document.getElementById('eCode').value.trim();
|
||||
var dormOk=dormMeta.some(function(x){return x.building===b&&x.name===d;});
|
||||
if(!b||!buildingMeta[b]||!d||!dormOk||!c){showToast('请完整填写带 * 的必填项');return;}
|
||||
var dup=beds.some(function(r,i){return i!==editIdx&&r.building===b&&r.dorm===d&&r.code===c;});
|
||||
if(dup){showToast('该宿舍下已存在同名床位编号');return;}
|
||||
if(editIdx<0){beds.push({code:c,building:b,dorm:d});showToast('床位已新增');}
|
||||
@@ -496,27 +604,62 @@ function saveEdit(){
|
||||
closeEdit();pageNo=1;renderTable();
|
||||
}
|
||||
/* [交互] 导入 */
|
||||
function openImport(){document.getElementById('importMask').classList.add('open');}
|
||||
function closeImport(){document.getElementById('importMask').classList.remove('open');}
|
||||
function onImportBuilding(){
|
||||
var b=document.getElementById('iBuilding').value;
|
||||
document.getElementById('iDorm').innerHTML='<option value="">全部宿舍</option>'+dormOptionsHtml(b);
|
||||
var selImportBuilding='',selImportDorm='';
|
||||
function onImportBuildingInput(){selImportBuilding='';selImportDorm='';document.getElementById('iDorm').value='';renderImportBuildingPanel();}
|
||||
function onImportBuildingFocus(){renderImportBuildingPanel();}
|
||||
function renderImportBuildingPanel(){
|
||||
var q=document.getElementById('iBuilding').value.trim();
|
||||
var list=uniqBuildings().filter(function(b){return !q||b.indexOf(q)>=0;});
|
||||
document.getElementById('iBuildingPanel').innerHTML=list.map(function(b){
|
||||
var meta=buildingMeta[b]||{};
|
||||
return '<div class="search-select__item" onclick="pickImportBuilding(\''+b+'\')"><span class="ss-name">'+b+'</span><span class="ss-org">'+(meta.station||'')+'</span></div>';
|
||||
}).join('')||'<div class="search-select__empty">未查询到楼栋</div>';
|
||||
document.getElementById('iBuildingPanel').classList.add('open');
|
||||
}
|
||||
function pickImportBuilding(name){
|
||||
selImportBuilding=name;
|
||||
document.getElementById('iBuilding').value=name;
|
||||
selImportDorm='';document.getElementById('iDorm').value='';
|
||||
document.getElementById('iBuildingPanel').classList.remove('open');
|
||||
}
|
||||
function onImportDormInput(){selImportDorm='';renderImportDormPanel();}
|
||||
function onImportDormFocus(){renderImportDormPanel();}
|
||||
function renderImportDormPanel(){
|
||||
var q=document.getElementById('iDorm').value.trim();
|
||||
var list=selImportBuilding?dormMeta.filter(function(d){return d.building===selImportBuilding;}):[];
|
||||
list=list.filter(function(d){return !q||d.name.indexOf(q)>=0;});
|
||||
var html=(selImportBuilding&&!q)?'<div class="search-select__item" onclick="pickImportDorm(\'\')"><span class="ss-name">全部宿舍</span></div>':'';
|
||||
html+=list.map(function(d){
|
||||
return '<div class="search-select__item" onclick="pickImportDorm(\''+d.name+'\')"><span class="ss-name">'+d.name+'</span></div>';
|
||||
}).join('');
|
||||
if(!html)html='<div class="search-select__empty">'+(selImportBuilding?'未查询到宿舍':'请先选择楼栋')+'</div>';
|
||||
document.getElementById('iDormPanel').innerHTML=html;
|
||||
document.getElementById('iDormPanel').classList.add('open');
|
||||
}
|
||||
function pickImportDorm(name){
|
||||
selImportDorm=name;
|
||||
document.getElementById('iDorm').value=name;
|
||||
document.getElementById('iDormPanel').classList.remove('open');
|
||||
}
|
||||
function openImport(){
|
||||
selImportBuilding='';selImportDorm='';
|
||||
document.getElementById('iBuilding').value='';
|
||||
document.getElementById('iDorm').value='';
|
||||
document.getElementById('iBuildingPanel').classList.remove('open');
|
||||
document.getElementById('iDormPanel').classList.remove('open');
|
||||
document.getElementById('importMask').classList.add('open');
|
||||
}
|
||||
function closeImport(){document.getElementById('importMask').classList.remove('open');}
|
||||
function doImport(){
|
||||
if(!document.getElementById('iBuilding').value){showToast('请先选择所属楼栋');return;}
|
||||
if(!selImportBuilding){showToast('请先选择所属楼栋');return;}
|
||||
closeImport();showToast('导入任务已提交,请到「查看导入任务」查看结果');
|
||||
}
|
||||
/* [交互] 分配导入 */
|
||||
function openAllocImport(){document.getElementById('allocImportMask').classList.add('open');}
|
||||
function closeAllocImport(){document.getElementById('allocImportMask').classList.remove('open');}
|
||||
function doAllocImport(){closeAllocImport();showToast('分配导入任务已提交,请到「查看分配导入任务」查看结果');}
|
||||
/* [交互] 导入/分配导入任务(异步任务演示) */
|
||||
/* [交互] 导入任务(异步任务演示) */
|
||||
var taskRecords={
|
||||
import:[['床位清单-模板.xlsx','2026-09-05 17:15:08','成功:新增 8 床'],['床位清单-8月.xlsx','2026-08-20 09:55:17','成功:新增 12 床']],
|
||||
alloc:[['床位分配-模板.xlsx','2026-09-06 11:20:34','成功:绑定 12 条、失败 0 条'],['床位分配-8月.xlsx','2026-08-22 15:03:49','成功:绑定 20 条、失败 2 条']]
|
||||
import:[['床位清单-模板.xlsx','2026-09-05 17:15:08','成功:新增 8 床'],['床位清单-8月.xlsx','2026-08-20 09:55:17','成功:新增 12 床']]
|
||||
};
|
||||
function openTaskRecord(type){
|
||||
var titleMap={import:'床位导入任务',alloc:'分配导入任务'};
|
||||
var titleMap={import:'床位导入任务'};
|
||||
document.getElementById('taskTitle').textContent=titleMap[type];
|
||||
var head='<thead><tr><th>文件名称</th><th>时间</th><th>状态</th><th>操作</th></tr></thead>';
|
||||
var rows=taskRecords[type].map(function(r){
|
||||
@@ -601,6 +744,19 @@ function showToast(msg){
|
||||
var t=document.getElementById('toast');t.textContent=msg;t.classList.add('show');
|
||||
clearTimeout(t._timer);t._timer=setTimeout(function(){t.classList.remove('show');},2200);
|
||||
}
|
||||
/* [交互] 点击面板外部关闭下拉 */
|
||||
document.addEventListener('click',function(e){
|
||||
var ow=document.getElementById('orgWrap');
|
||||
if(ow&&!ow.contains(e.target)){document.getElementById('orgPanel').classList.remove('open');document.getElementById('orgTrigger').classList.remove('open');}
|
||||
var bs=document.getElementById('eBuildingSearch');
|
||||
if(bs&&!bs.contains(e.target)){document.getElementById('buildingPanel').classList.remove('open');}
|
||||
var ds=document.getElementById('eDormSearch');
|
||||
if(ds&&!ds.contains(e.target)){document.getElementById('dormPanel').classList.remove('open');}
|
||||
var ibs=document.getElementById('iBuildingSearch');
|
||||
if(ibs&&!ibs.contains(e.target)){document.getElementById('iBuildingPanel').classList.remove('open');}
|
||||
var ids=document.getElementById('iDormSearch');
|
||||
if(ids&&!ids.contains(e.target)){document.getElementById('iDormPanel').classList.remove('open');}
|
||||
});
|
||||
initFilters();onFilterBuilding();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -365,27 +365,27 @@ var buildings=[
|
||||
/* [交互] 宿舍数量下钻演示数据:按楼栋名挂宿舍清单,列与宿舍信息页一致 */
|
||||
var bldDorms={
|
||||
'樊学倒班宿舍1号楼':[
|
||||
{name:'301室',beds:6,manager:'石维国',mobile:'13991203457',alloc:1,dev:'BC-2026-0031'},
|
||||
{name:'302室',beds:4,manager:'曲志明',mobile:'13991203458',alloc:1,dev:'BC-2026-0032'},
|
||||
{name:'301室',beds:6,manager:'石维国',mobile:'13991203457',alloc:1,dev:'30001'},
|
||||
{name:'302室',beds:4,manager:'曲志明',mobile:'13991203458',alloc:1,dev:'30002'},
|
||||
{name:'305室',beds:6,manager:'李怀安',mobile:'13991203459',alloc:0,dev:'—'}
|
||||
],
|
||||
'麻子山倒班宿舍楼':[
|
||||
{name:'201室',beds:4,manager:'高建民',mobile:'13991345013',alloc:1,dev:'BC-2026-0015'},
|
||||
{name:'201室',beds:4,manager:'高建民',mobile:'13991345013',alloc:1,dev:'30003'},
|
||||
{name:'204室',beds:4,manager:'杨立强',mobile:'13991345014',alloc:0,dev:'—'}
|
||||
],
|
||||
'桐园倒班宿舍1号楼':[
|
||||
{name:'401室',beds:8,manager:'白吉增',mobile:'13991567209',alloc:1,dev:'BC-2026-0021'},
|
||||
{name:'402室',beds:6,manager:'师振峰',mobile:'13991567210',alloc:1,dev:'BC-2026-0022'},
|
||||
{name:'401室',beds:8,manager:'白吉增',mobile:'13991567209',alloc:1,dev:'30004'},
|
||||
{name:'402室',beds:6,manager:'师振峰',mobile:'13991567210',alloc:1,dev:'30005'},
|
||||
{name:'406室',beds:6,manager:'冯志清',mobile:'13991567211',alloc:0,dev:'—'}
|
||||
],
|
||||
'西峰基地综合宿舍楼':[
|
||||
{name:'101室',beds:4,manager:'康维桢',mobile:'13991784321',alloc:1,dev:'BC-2026-0008'},
|
||||
{name:'102室',beds:4,manager:'邵瑞庭',mobile:'13991784322',alloc:1,dev:'BC-2026-0009'},
|
||||
{name:'101室',beds:4,manager:'康维桢',mobile:'13991784321',alloc:1,dev:'30006'},
|
||||
{name:'102室',beds:4,manager:'邵瑞庭',mobile:'13991784322',alloc:1,dev:'30007'},
|
||||
{name:'201室',beds:6,manager:'卢翰文',mobile:'13991784323',alloc:0,dev:'—'},
|
||||
{name:'202室',beds:6,manager:'崔秉章',mobile:'13991784324',alloc:1,dev:'BC-2026-0010'}
|
||||
{name:'202室',beds:6,manager:'崔秉章',mobile:'13991784324',alloc:1,dev:'30008'}
|
||||
],
|
||||
'靖边气田倒班宿舍楼':[
|
||||
{name:'501室',beds:4,manager:'戴文渊',mobile:'13991923746',alloc:1,dev:'BC-2026-0003'},
|
||||
{name:'501室',beds:4,manager:'戴文渊',mobile:'13991923746',alloc:1,dev:'30009'},
|
||||
{name:'503室',beds:4,manager:'田广润',mobile:'13991923747',alloc:0,dev:'—'}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei
|
||||
.sidebar-group.open .sidebar-group__items{display:block;}
|
||||
.sidebar-item--sub{padding-left:44px;}
|
||||
.main{margin-left:240px;margin-top:56px;padding:24px;min-height:calc(100vh - 56px);}
|
||||
.filter-bar{background:#fff;padding:16px 24px;display:flex;align-items:center;gap:16px;flex-wrap:wrap;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);}
|
||||
.filter-bar{background:#fff;padding:16px 24px;display:flex;align-items:center;gap:8px;flex-wrap:nowrap;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);}
|
||||
.filter-item{display:flex;align-items:center;gap:8px;}
|
||||
.filter-item label{font-size:var(--font-sm);color:var(--text-secondary);white-space:nowrap;}
|
||||
.filter-select{height:36px;min-width:120px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 28px 0 12px;font-size:var(--font-sm);color:var(--text-primary);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 8px center;cursor:pointer;outline:none;appearance:none;-webkit-appearance:none;}
|
||||
@@ -49,10 +49,10 @@ body{font-family:-apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei
|
||||
.btn-primary{background:var(--primary);color:#fff;}.btn-primary:hover{background:#40a9ff;}
|
||||
.btn-default{background:#fff;color:var(--text-primary);border:1px solid var(--border);}.btn-default:hover{color:var(--primary);border-color:var(--primary);}
|
||||
.btn-link{background:none;color:var(--primary);padding:0 4px;height:auto;}.btn-link:hover{color:#40a9ff;}
|
||||
.tab-bar{display:flex;gap:4px;margin-top:16px;background:#fff;border-radius:var(--radius-md) var(--radius-md) 0 0;box-shadow:var(--shadow-sm);padding:6px 16px 0;}
|
||||
.tab-item{padding:10px 18px;font-size:var(--font-sm);color:var(--text-secondary);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;}
|
||||
.tab-bar{display:flex;gap:4px;margin-bottom:16px;background:#fff;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);padding:8px 16px;}
|
||||
.tab-item{padding:10px 18px;font-size:var(--font-sm);color:var(--text-secondary);cursor:pointer;border-bottom:2px solid transparent;}
|
||||
.tab-item.active{color:var(--primary);border-bottom-color:var(--primary);font-weight:600;}
|
||||
.table-card{background:#fff;border-radius:0 0 var(--radius-md) var(--radius-md);box-shadow:var(--shadow-sm);overflow:hidden;}
|
||||
.table-card{background:#fff;border-radius:var(--radius-md);box-shadow:var(--shadow-sm);overflow:hidden;}
|
||||
.table-card__head{display:flex;align-items:center;justify-content:flex-start;padding:12px 16px;border-bottom:1px solid var(--border);}
|
||||
.table-card__title{font-size:var(--font-sm);font-weight:600;}
|
||||
.table-card__ops{display:flex;align-items:center;gap:8px;}
|
||||
@@ -95,6 +95,8 @@ tbody tr:hover td:last-child{background:#F8FBFF;}
|
||||
/* 工单详情:呼叫类型+阶段标签+处置状态 */
|
||||
.ct-head{display:flex;align-items:center;gap:10px;font-size:var(--font-base);font-weight:600;margin-bottom:14px;}
|
||||
.ct-head .st{font-size:var(--font-sm);font-weight:400;color:var(--text-secondary);}
|
||||
.ct-head__title{display:flex;align-items:center;gap:8px;}
|
||||
.ct-head__status{margin-left:auto;display:flex;align-items:center;gap:6px;font-size:var(--font-sm);font-weight:400;color:var(--text-secondary);white-space:nowrap;}
|
||||
.info-card{border-radius:var(--radius-sm);padding:12px 14px;display:grid;grid-template-columns:1fr 1fr;gap:8px 18px;}
|
||||
.info-card--blue{background:#F0F8FF;border:1px solid #D6E9FF;}
|
||||
.info-card--grey{background:#FAFAFA;border:1px solid var(--border);}
|
||||
@@ -161,37 +163,39 @@ tbody tr:hover td:last-child{background:#F8FBFF;}
|
||||
<!-- 主内容 -->
|
||||
<main class="main">
|
||||
|
||||
<!-- [交互] TAB 切换呼入/呼出记录 -->
|
||||
<div class="tab-bar">
|
||||
<div class="tab-item active" id="tabIn" onclick="switchTab('in')">员工呼叫</div>
|
||||
<div class="tab-item" id="tabOut" onclick="switchTab('out')">终端呼叫</div>
|
||||
</div>
|
||||
|
||||
<!-- [交互] 筛选栏:员工呼入/终端呼出各自独立一组条件,切换 TAB 时整组替换 -->
|
||||
<div class="filter-bar">
|
||||
<div id="fgrpIn" style="display:contents;">
|
||||
<div class="filter-item"><label>员工姓名</label><input class="filter-input" id="inName" placeholder="姓名" oninput="renderAll()"></div>
|
||||
<div class="filter-item"><label>员工编号</label><input class="filter-input" id="inNo" placeholder="如:CQ021578" oninput="renderAll()"></div>
|
||||
<div class="filter-item"><label>主呼设备</label><input class="filter-input" id="inDev" placeholder="如:HC-FX" oninput="renderAll()"></div>
|
||||
<div class="filter-item"><label>呼叫形式</label>
|
||||
<select class="filter-select" id="inType" onchange="renderAll()" style="min-width:110px;"><option value="">全部</option><option>宿舍呼叫</option><option>床位呼叫</option></select>
|
||||
<div class="filter-item"><label>呼叫设备编号</label><input class="filter-input" id="inDev" placeholder="请输入" oninput="renderAll()" style="width:80px;min-width:80px;"></div>
|
||||
<div class="filter-item"><label>员工姓名</label><input class="filter-input" id="inName" placeholder="请输入" oninput="renderAll()" style="width:72px;min-width:72px;"></div>
|
||||
<div class="filter-item"><label>员工编号</label><input class="filter-input" id="inNo" placeholder="请输入" oninput="renderAll()" style="width:92px;min-width:92px;"></div>
|
||||
<div class="filter-item"><label>呼叫类型</label>
|
||||
<select class="filter-select" id="inType" onchange="renderAll()" style="width:86px;min-width:86px;"><option value="">全部</option><option>宿舍呼叫</option><option>床位呼叫</option></select>
|
||||
</div>
|
||||
<div class="filter-item"><label>呼叫状态</label>
|
||||
<select class="filter-select" id="inStatus" onchange="renderAll()" style="min-width:100px;"><option value="">全部</option><option>已接通</option><option>未接通</option></select>
|
||||
<select class="filter-select" id="inStatus" onchange="renderAll()" style="width:76px;min-width:76px;"><option value="">全部</option><option>已接通</option><option>未接通</option></select>
|
||||
</div>
|
||||
<div class="filter-item"><label>救助状态</label>
|
||||
<select class="filter-select" id="inRescue" onchange="renderAll()" style="min-width:110px;"><option value="">全部</option><option>等待处理</option><option>处理中</option><option>处理完成</option></select>
|
||||
<select class="filter-select" id="inRescue" onchange="renderAll()" style="width:86px;min-width:86px;"><option value="">全部</option><option>待处理</option><option>已完成</option></select>
|
||||
</div>
|
||||
</div>
|
||||
<div id="fgrpOut" style="display:none;">
|
||||
<div class="filter-item"><label>主呼设备</label><input class="filter-input" id="outFrom" placeholder="如:HD-FX" oninput="renderAll()"></div>
|
||||
<div class="filter-item"><label>被呼设备</label><input class="filter-input" id="outTo" placeholder="如:HC-FX" oninput="renderAll()"></div>
|
||||
<div class="filter-item"><label>呼叫形式</label>
|
||||
<select class="filter-select" id="outType" onchange="renderAll()" style="min-width:110px;"><option value="">全部</option><option>语音呼叫</option><option>视频呼叫</option><option>一键呼叫</option></select>
|
||||
</div>
|
||||
<div class="filter-item"><label>呼叫设备编号</label><input class="filter-input" id="outFrom" placeholder="请输入" oninput="renderAll()" style="width:92px;min-width:92px;"></div>
|
||||
<div class="filter-item"><label>呼叫状态</label>
|
||||
<select class="filter-select" id="outStatus" onchange="renderAll()" style="min-width:110px;"><option value="">全部</option><option>已接听</option><option>未接听</option><option>已挂断</option></select>
|
||||
<select class="filter-select" id="outStatus" onchange="renderAll()" style="width:86px;min-width:86px;"><option value="">全部</option><option>已接听</option><option>未接听</option><option>已挂断</option></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>呼叫日期</label>
|
||||
<input class="filter-input" type="date" id="filterFrom" value="2026-09-01" onchange="renderAll()" style="min-width:130px;">
|
||||
<input class="filter-input" type="date" id="filterFrom" value="2026-09-01" onchange="renderAll()" style="width:100px;min-width:100px;">
|
||||
<span style="color:var(--text-placeholder);font-size:var(--font-xs);">至</span>
|
||||
<input class="filter-input" type="date" id="filterTo" value="2026-09-07" onchange="renderAll()" style="min-width:130px;">
|
||||
<input class="filter-input" type="date" id="filterTo" value="2026-09-07" onchange="renderAll()" style="width:100px;min-width:100px;">
|
||||
</div>
|
||||
<button class="btn btn-primary" onclick="renderAll();showToast('查询完成')">
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><circle cx="6" cy="6" r="4.5" stroke="#fff" stroke-width="1.3"/><path d="M9.5 9.5L13 13" stroke="#fff" stroke-width="1.3" stroke-linecap="round"/></svg>查询
|
||||
@@ -200,12 +204,6 @@ tbody tr:hover td:last-child{background:#F8FBFF;}
|
||||
</div>
|
||||
|
||||
|
||||
<!-- [交互] TAB 切换呼入/呼出记录 -->
|
||||
<div class="tab-bar">
|
||||
<div class="tab-item active" id="tabIn" onclick="switchTab('in')">员工呼入</div>
|
||||
<div class="tab-item" id="tabOut" onclick="switchTab('out')">终端呼出</div>
|
||||
</div>
|
||||
|
||||
<div class="table-card">
|
||||
<div class="table-card__head">
|
||||
<!-- [交互] 导出/查看导出任务仅员工呼入 TAB 提供,终端呼出不支持导出 -->
|
||||
@@ -263,35 +261,37 @@ var empProfiles={
|
||||
'CQ022317':{name:'徐立成',sex:'男',age:49,unit:'采油二厂',dept:'桐园作业区',phone:'15089628819',chronic:'慢性支气管炎'},
|
||||
'CQ029905':{name:'呼建国',sex:'男',age:53,unit:'采气一厂',dept:'靖边气田',phone:'18730413345',chronic:'支气管哮喘'}
|
||||
};
|
||||
/* 员工呼入:主呼设备=床头/面板(HC-*),被呼设备=值班室终端(HD-*);赵万福(182/110)与结果异常 YC-20260905-05 同源事件 */
|
||||
/* 员工呼入:主呼设备=床头/面板,被呼设备=值班室终端;赵万福(182/110)与结果异常 YC-20260905-05 同源事件 */
|
||||
var incoming=[
|
||||
{dev:'HC-FX-01',to:'HD-FX-01',time:'2026-09-07 02:14',resp:'2026-09-07 02:15',end:'2026-09-07 02:41',ct:'床位呼叫',no:'CQ021578',cs:'已接通',rs:'处理完成',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101-1',out:'否',reason:'夜间胸闷,请求值班医生到场',info:'值班医生 2 分钟到场,心电监护无异常,处置后回床休息。'},
|
||||
{dev:'HC-FX-04',to:'HD-FX-01',time:'2026-09-06 23:41',resp:'2026-09-06 23:42',end:'2026-09-06 23:58',ct:'宿舍呼叫',no:'CQ032144',cs:'已接通',rs:'处理完成',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101室',out:'否',reason:'同事突发头晕',info:'到 101 室处置,测血压 126/78,判定为体位性低血压,补液后缓解。'},
|
||||
{dev:'HC-TY-02',to:'HD-TY-01',time:'2026-09-05 21:07',resp:'2026-09-05 21:08',end:'2026-09-05 21:52',ct:'宿舍呼叫',no:'CQ033096',cs:'已接通',rs:'处理完成',station:'桐园站点基地',space:'桐园倒班宿舍1号楼 · 201室',out:'是',amb:'桐园医疗点救护车 1 号',drv:'马永林',med:'值班医生白文斌、护士钱晓芸',adate:'2026-09-05',reason:'自测血压 182/110 伴头痛',info:'值班医生到场复测确认,按高血压危象指引处置并通知管理医生,救护车送医疗点降压治疗后平稳,该事件进入结果异常台账(YC-20260905-05)。'},
|
||||
{dev:'HC-JB-01',to:'HD-JB-01',time:'2026-09-05 14:22',resp:'2026-09-05 14:23',end:'2026-09-05 14:50',ct:'床位呼叫',no:'CQ036441',cs:'已接通',rs:'处理完成',station:'靖边气田站点',space:'靖边气田倒班宿舍楼 · 401-1',out:'否',reason:'发热 38.6℃ 需退热处置',info:'靖边医疗点到宿舍处置,物理降温+口服退热,次日随访已退热。'},
|
||||
{dev:'HC-XF-01',to:'HD-XF-01',time:'2026-09-04 07:52',resp:'—',end:'2026-09-04 07:58',ct:'床位呼叫',no:'CQ010564',cs:'未接通',rs:'处理完成',station:'西峰基地',space:'西峰基地综合宿舍楼 · 301-1',out:'否',reason:'晨起手指麻木请求咨询',info:'首呼未接听,5 分钟后值班室回拨接通,指导活动观察,当日无碍。'},
|
||||
{dev:'HC-MZ-01',to:'HD-MZ-01',time:'2026-09-03 19:36',resp:'2026-09-03 19:37',end:'—',ct:'宿舍呼叫',no:'CQ045130',cs:'已接通',rs:'等待处理',station:'麻子山站点',space:'麻子山倒班宿舍楼 · 101室',out:'',reason:'踝扭伤冰敷后疼痛加重',info:'待夜班值班医生到场评估,已电话指导制动抬高。'},
|
||||
{dev:'HC-XF-03',to:'HD-XF-01',time:'2026-09-02 12:03',resp:'2026-09-02 12:04',end:'—',ct:'宿舍呼叫',no:'CQ027710',cs:'已接通',rs:'处理中',station:'西峰基地',space:'西峰基地综合宿舍楼 · 402室',out:'',reason:'外伤换药到期提醒请求处理',info:'值班室已派单,14:00 医疗点护士到宿舍换药。'},
|
||||
{dev:'HC-FX-02',to:'HD-FX-01',time:'2026-09-01 22:48',resp:'2026-09-01 22:49',end:'2026-09-01 23:05',ct:'床位呼叫',no:'CQ032144',cs:'已接通',rs:'处理完成',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101-2',out:'否',reason:'失眠需助眠指导',info:'健康指导并纳入随访关注,无需药物介入。'},
|
||||
{dev:'HC-TY-01',to:'HD-TY-01',time:'2026-09-07 06:02',resp:'—',end:'—',ct:'床位呼叫',no:'CQ022317',cs:'未接通',rs:'等待处理',station:'桐园站点基地',space:'桐园倒班宿舍1号楼 · 301-1',out:'',reason:'晨起呼叫后设备侧无声',info:'终端未接听,值班员正现场核实;超过 10 分钟将联动告警考核。'},
|
||||
{dev:'HC-JB-01',to:'HD-JB-01',time:'2026-09-06 05:36',resp:'2026-09-06 05:37',end:'2026-09-06 06:01',ct:'床位呼叫',no:'CQ029905',cs:'已接通',rs:'处理完成',station:'靖边气田站点',space:'靖边气田倒班宿舍楼 · 401-1',out:'否',reason:'哮喘吸入剂用完需应急配药',info:'值班医生送备用吸入剂并预约复诊。'}
|
||||
{dev:'10001',to:'10013',time:'2026-09-07 02:14',resp:'2026-09-07 02:15',end:'2026-09-07 02:41',ct:'床位呼叫',no:'CQ021578',cs:'已接通',rs:'已完成',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101-1',out:'否',reason:'夜间胸闷,请求值班医生到场',info:'值班医生 2 分钟到场,心电监护无异常,处置后回床休息。'},
|
||||
{dev:'10004',to:'10013',time:'2026-09-06 23:41',resp:'2026-09-06 23:42',end:'2026-09-06 23:58',ct:'宿舍呼叫',no:'CQ032144',cs:'已接通',rs:'已完成',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101室',out:'否',reason:'同事突发头晕',info:'到 101 室处置,测血压 126/78,判定为体位性低血压,补液后缓解。'},
|
||||
{dev:'10007',to:'10015',time:'2026-09-05 21:07',resp:'2026-09-05 21:08',end:'2026-09-05 21:52',ct:'宿舍呼叫',no:'CQ033096',cs:'已接通',rs:'已完成',station:'桐园站点基地',space:'桐园倒班宿舍1号楼 · 201室',out:'是',amb:'桐园医疗点救护车 1 号',drv:'马永林',med:'值班医生白文斌、护士钱晓芸',adate:'2026-09-05',reason:'自测血压 182/110 伴头痛',info:'值班医生到场复测确认,按高血压危象指引处置并通知管理医生,救护车送医疗点降压治疗后平稳,该事件进入结果异常台账(YC-20260905-05)。'},
|
||||
{dev:'10011',to:'10017',time:'2026-09-05 14:22',resp:'2026-09-05 14:23',end:'2026-09-05 14:50',ct:'床位呼叫',no:'CQ036441',cs:'已接通',rs:'已完成',station:'靖边气田站点',space:'靖边气田倒班宿舍楼 · 401-1',out:'否',reason:'发热 38.6℃ 需退热处置',info:'靖边医疗点到宿舍处置,物理降温+口服退热,次日随访已退热。'},
|
||||
{dev:'10008',to:'10016',time:'2026-09-04 07:52',resp:'—',end:'2026-09-04 07:58',ct:'床位呼叫',no:'CQ010564',cs:'未接通',rs:'已完成',station:'西峰基地',space:'西峰基地综合宿舍楼 · 301-1',out:'否',reason:'晨起手指麻木请求咨询',info:'首呼未接听,5 分钟后值班室回拨接通,指导活动观察,当日无碍。'},
|
||||
{dev:'10005',to:'10014',time:'2026-09-03 19:36',resp:'2026-09-03 19:37',end:'—',ct:'宿舍呼叫',no:'CQ045130',cs:'已接通',rs:'待处理',station:'麻子山站点',space:'麻子山倒班宿舍楼 · 101室',out:'',reason:'踝扭伤冰敷后疼痛加重',info:'待夜班值班医生到场评估,已电话指导制动抬高。'},
|
||||
{dev:'10010',to:'10016',time:'2026-09-02 12:03',resp:'2026-09-02 12:04',end:'—',ct:'宿舍呼叫',no:'CQ027710',cs:'已接通',rs:'待处理',station:'西峰基地',space:'西峰基地综合宿舍楼 · 402室',out:'',reason:'外伤换药到期提醒请求处理',info:'值班室已派单,14:00 医疗点护士到宿舍换药。'},
|
||||
{dev:'10002',to:'10013',time:'2026-09-01 22:48',resp:'2026-09-01 22:49',end:'2026-09-01 23:05',ct:'床位呼叫',no:'CQ032144',cs:'已接通',rs:'已完成',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101-2',out:'否',reason:'失眠需助眠指导',info:'健康指导并纳入随访关注,无需药物介入。'},
|
||||
{dev:'10006',to:'10015',time:'2026-09-07 06:02',resp:'—',end:'—',ct:'床位呼叫',no:'CQ022317',cs:'未接通',rs:'待处理',station:'桐园站点基地',space:'桐园倒班宿舍1号楼 · 301-1',out:'',reason:'晨起呼叫后设备侧无声',info:'终端未接听,值班员正现场核实;超过 10 分钟将联动告警考核。'},
|
||||
{dev:'10011',to:'10017',time:'2026-09-06 05:36',resp:'2026-09-06 05:37',end:'2026-09-06 06:01',ct:'床位呼叫',no:'CQ029905',cs:'已接通',rs:'已完成',station:'靖边气田站点',space:'靖边气田倒班宿舍楼 · 401-1',out:'否',reason:'哮喘吸入剂用完需应急配药',info:'值班医生送备用吸入剂并预约复诊。'}
|
||||
];
|
||||
/* 终端呼出:值班室查房呼叫,无救助状态;被呼床位空置时详情不关联员工 */
|
||||
var outgoing=[
|
||||
{from:'HD-FX-01',to:'HC-FX-01',time:'2026-09-07 07:10',resp:'2026-09-07 07:11',end:'2026-09-07 07:13',ct:'语音呼叫',cs:'已接听',no:'CQ021578',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101-1'},
|
||||
{from:'HD-FX-01',to:'HC-FX-04',time:'2026-09-06 21:30',resp:'2026-09-06 21:31',end:'2026-09-06 21:35',ct:'视频呼叫',cs:'已接听',no:'CQ032144',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101室'},
|
||||
{from:'HD-MZ-01',to:'HC-MZ-01',time:'2026-09-06 20:05',resp:'—',end:'—',ct:'语音呼叫',cs:'未接听',no:'CQ045130',station:'麻子山站点',space:'麻子山倒班宿舍楼 · 101室'},
|
||||
{from:'HD-TY-01',to:'HC-TY-01',time:'2026-09-05 19:50',resp:'2026-09-05 19:51',end:'2026-09-05 19:54',ct:'视频呼叫',cs:'已接听',no:'CQ022317',station:'桐园站点基地',space:'桐园倒班宿舍1号楼 · 301-1'},
|
||||
{from:'HD-TY-01',to:'HC-TY-02',time:'2026-09-05 08:20',resp:'—',end:'2026-09-05 08:21',ct:'一键呼叫',cs:'已挂断',no:'CQ033096',station:'桐园站点基地',space:'桐园倒班宿舍1号楼 · 201室'},
|
||||
{from:'HD-XF-01',to:'HC-XF-02',time:'2026-09-04 18:40',resp:'—',end:'—',ct:'语音呼叫',cs:'未接听',no:'',station:'西峰基地',space:'西峰基地综合宿舍楼 · 302-1'},
|
||||
{from:'HD-JB-01',to:'HC-JB-01',time:'2026-09-04 07:15',resp:'2026-09-04 07:16',end:'2026-09-04 07:19',ct:'视频呼叫',cs:'已接听',no:'CQ036441',station:'靖边气田站点',space:'靖边气田倒班宿舍楼 · 401-1'},
|
||||
{from:'HD-JB-01',to:'HC-JB-01',time:'2026-09-01 20:30',resp:'2026-09-01 20:31',end:'2026-09-01 20:36',ct:'语音呼叫',cs:'已接听',no:'CQ029905',station:'靖边气田站点',space:'靖边气田倒班宿舍楼 · 401-1'}
|
||||
{from:'10013',to:'10001',time:'2026-09-07 07:10',resp:'2026-09-07 07:11',end:'2026-09-07 07:13',ct:'语音呼叫',cs:'已接听',no:'CQ021578',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101-1'},
|
||||
{from:'10013',to:'10004',time:'2026-09-06 21:30',resp:'2026-09-06 21:31',end:'2026-09-06 21:35',ct:'视频呼叫',cs:'已接听',no:'CQ032144',station:'樊学站点基地',space:'樊学倒班宿舍1号楼 · 101室'},
|
||||
{from:'10014',to:'10005',time:'2026-09-06 20:05',resp:'—',end:'—',ct:'语音呼叫',cs:'未接听',no:'CQ045130',station:'麻子山站点',space:'麻子山倒班宿舍楼 · 101室'},
|
||||
{from:'10015',to:'10006',time:'2026-09-05 19:50',resp:'2026-09-05 19:51',end:'2026-09-05 19:54',ct:'视频呼叫',cs:'已接听',no:'CQ022317',station:'桐园站点基地',space:'桐园倒班宿舍1号楼 · 301-1'},
|
||||
{from:'10015',to:'10007',time:'2026-09-05 08:20',resp:'—',end:'2026-09-05 08:21',ct:'一键呼叫',cs:'已挂断',no:'CQ033096',station:'桐园站点基地',space:'桐园倒班宿舍1号楼 · 201室'},
|
||||
{from:'10016',to:'10009',time:'2026-09-04 18:40',resp:'—',end:'—',ct:'语音呼叫',cs:'未接听',no:'',station:'西峰基地',space:'西峰基地综合宿舍楼 · 302-1'},
|
||||
{from:'10017',to:'10011',time:'2026-09-04 07:15',resp:'2026-09-04 07:16',end:'2026-09-04 07:19',ct:'视频呼叫',cs:'已接听',no:'CQ036441',station:'靖边气田站点',space:'靖边气田倒班宿舍楼 · 401-1'},
|
||||
{from:'10017',to:'10011',time:'2026-09-01 20:30',resp:'2026-09-01 20:31',end:'2026-09-01 20:36',ct:'语音呼叫',cs:'已接听',no:'CQ029905',station:'靖边气田站点',space:'靖边气田倒班宿舍楼 · 401-1'}
|
||||
];
|
||||
var inBadge={'已接通':'badge--success','未接通':'badge--danger'};
|
||||
var rsBadge={'等待处理':'badge--warning','处理中':'badge--info','处理完成':'badge--success'};
|
||||
var rsBadge={'待处理':'badge--warning','已完成':'badge--success'};
|
||||
var outBadge={'已接听':'badge--success','未接听':'badge--danger','已挂断':'badge--muted'};
|
||||
function headIn(){return '<tr><th style="width:56px;">序号</th><th style="min-width:100px;">主呼设备</th><th style="min-width:140px;">呼叫时间</th><th>呼叫形式</th><th>员工姓名</th><th>员工编号</th><th>呼叫状态</th><th>救助状态</th><th style="min-width:120px;">站点名称</th><th style="min-width:200px;">宿舍/床位信息</th><th style="width:80px;">操作</th></tr>';}
|
||||
function headOut(){return '<tr><th style="width:56px;">序号</th><th style="min-width:100px;">主呼设备</th><th style="min-width:100px;">被呼设备</th><th style="min-width:140px;">呼叫时间</th><th>呼叫形式</th><th>呼叫状态</th><th style="min-width:120px;">站点名称</th><th style="min-width:200px;">宿舍/床位信息</th><th style="width:80px;">操作</th></tr>';}
|
||||
/* 值班室终端名称映射:终端呼叫时主呼设备(呼叫设备编号)对应的终端名称 */
|
||||
var termNames={'10013':'樊学值班室终端','10014':'麻子山值班室终端','10015':'桐园值班室终端','10016':'西峰值班室终端','10017':'靖边值班室终端'};
|
||||
function headIn(){return '<tr><th style="width:56px;">序号</th><th style="min-width:110px;">呼叫设备编号</th><th>员工姓名</th><th>员工编号</th><th style="min-width:140px;">所属单位部门</th><th style="min-width:140px;">呼叫时间</th><th>呼叫状态</th><th style="min-width:110px;">被呼设备编号</th><th>救助状态</th><th style="min-width:120px;">站点名称</th><th style="min-width:140px;">楼栋名称</th><th style="min-width:120px;">宿舍/床位信息</th><th style="width:80px;">操作</th></tr>';}
|
||||
function headOut(){return '<tr><th style="width:56px;">序号</th><th style="min-width:110px;">呼叫设备编号</th><th style="min-width:140px;">终端名称</th><th style="min-width:140px;">呼叫时间</th><th>呼叫状态</th><th style="min-width:110px;">被呼设备编号</th><th style="min-width:120px;">宿舍/床位信息</th><th style="min-width:140px;">楼栋名称</th><th style="min-width:120px;">站点名称</th><th style="width:80px;">操作</th></tr>';}
|
||||
function renderAll(){
|
||||
var f=document.getElementById('filterFrom').value,t=document.getElementById('filterTo').value;
|
||||
if(curTab==='in'){
|
||||
@@ -304,24 +304,24 @@ function renderAll(){
|
||||
});
|
||||
document.getElementById('thead').innerHTML=headIn();
|
||||
document.getElementById('tbody').innerHTML=list.map(function(r){
|
||||
var i=incoming.indexOf(r),p=empProfiles[r.no]||{};
|
||||
return '<tr><td>'+(i+1)+'</td><td style="font-family:monospace;">'+r.dev+'</td><td>'+r.time+'</td><td>'+r.ct+'</td><td>'+(p.name||'—')+'</td><td>'+r.no+'</td>'
|
||||
+'<td><span class="badge '+inBadge[r.cs]+'">'+r.cs+'</span></td><td><span class="badge '+rsBadge[r.rs]+'">'+r.rs+'</span></td>'
|
||||
+'<td>'+r.station+'</td><td>'+r.space+'</td><td><button class="btn btn-link" onclick="openDetailIn('+i+')">详细信息</button></td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="11">没有符合条件的呼叫记录</td></tr>';
|
||||
var i=incoming.indexOf(r),p=empProfiles[r.no]||{},seg=r.space.split(' · ');
|
||||
return '<tr><td>'+(i+1)+'</td><td style="font-family:monospace;">'+r.dev+'</td><td>'+(p.name||'—')+'</td><td>'+r.no+'</td><td>'+(p.unit?p.unit+'/'+p.dept:'—')+'</td><td>'+r.time+'</td>'
|
||||
+'<td><span class="badge '+inBadge[r.cs]+'">'+r.cs+'</span></td><td style="font-family:monospace;">'+(r.cs==='未接通'?'-':r.to)+'</td><td><span class="badge '+rsBadge[r.rs]+'">'+r.rs+'</span></td>'
|
||||
+'<td>'+r.station+'</td><td>'+seg[0]+'</td><td>'+seg[1]+'</td><td><button class="btn btn-link" onclick="openDetailIn('+i+')">详细信息</button></td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="13">没有符合条件的呼叫记录</td></tr>';
|
||||
document.getElementById('totalTip').textContent='共 '+list.length+' 条记录';
|
||||
}else{
|
||||
var kf=document.getElementById('outFrom').value.trim().toUpperCase();
|
||||
var kt=document.getElementById('outTo').value.trim().toUpperCase();
|
||||
var tc2=document.getElementById('outType').value,sc2=document.getElementById('outStatus').value;
|
||||
var list2=outgoing.filter(function(r){return r.from.toUpperCase().indexOf(kf)>=0&&r.to.toUpperCase().indexOf(kt)>=0&&(!tc2||r.ct===tc2)&&(!sc2||r.cs===sc2)&&r.time.slice(0,10)>=f&&r.time.slice(0,10)<=t;});
|
||||
var sc2=document.getElementById('outStatus').value;
|
||||
var list2=outgoing.filter(function(r){return r.from.toUpperCase().indexOf(kf)>=0&&(!sc2||r.cs===sc2)&&r.time.slice(0,10)>=f&&r.time.slice(0,10)<=t;});
|
||||
document.getElementById('thead').innerHTML=headOut();
|
||||
document.getElementById('tbody').innerHTML=list2.map(function(r){
|
||||
var i=outgoing.indexOf(r);
|
||||
return '<tr><td>'+(i+1)+'</td><td style="font-family:monospace;">'+r.from+'</td><td style="font-family:monospace;">'+r.to+'</td><td>'+r.time+'</td><td>'+r.ct+'</td>'
|
||||
+'<td><span class="badge '+outBadge[r.cs]+'">'+r.cs+'</span></td><td>'+r.station+'</td><td>'+r.space+'</td>'
|
||||
var i=outgoing.indexOf(r),seg=r.space.split(' · ');
|
||||
return '<tr><td>'+(i+1)+'</td><td style="font-family:monospace;">'+r.from+'</td><td>'+(termNames[r.from]||'—')+'</td><td>'+r.time+'</td>'
|
||||
+'<td><span class="badge '+outBadge[r.cs]+'">'+r.cs+'</span></td><td style="font-family:monospace;">'+r.to+'</td>'
|
||||
+'<td>'+seg[1]+'</td><td>'+seg[0]+'</td><td>'+r.station+'</td>'
|
||||
+'<td><button class="btn btn-link" onclick="openDetailOut('+i+')">详细信息</button></td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="9">没有符合条件的呼叫记录</td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="10">没有符合条件的呼叫记录</td></tr>';
|
||||
document.getElementById('totalTip').textContent='共 '+list2.length+' 条记录';
|
||||
}
|
||||
}
|
||||
@@ -336,7 +336,7 @@ function switchTab(t){
|
||||
renderAll();
|
||||
}
|
||||
function resetFilter(){
|
||||
['inName','inNo','inDev','inType','inStatus','inRescue','outFrom','outTo','outType','outStatus'].forEach(function(id){document.getElementById(id).value='';});
|
||||
['inName','inNo','inDev','inType','inStatus','inRescue','outFrom','outStatus'].forEach(function(id){document.getElementById(id).value='';});
|
||||
document.getElementById('filterFrom').value='2026-09-01';
|
||||
document.getElementById('filterTo').value='2026-09-07';
|
||||
renderAll();
|
||||
@@ -364,18 +364,19 @@ function dormCard(r){
|
||||
function openDetailIn(i){
|
||||
var r=incoming[i];
|
||||
var stage=r.cs==='已接通'?'<span class="badge badge--success">已接听</span>':'<span class="badge badge--danger">未接听</span>';
|
||||
var emg=r.rs==='处理完成'
|
||||
? '<div class="info-card">'
|
||||
+ik('是否出勤',r.out==='是'?'是':'否')
|
||||
+ik('出勤救护车',r.amb||'—')+ik('出勤司机',r.drv||'—')+ik('随车医护',r.med||'—')+ik('出勤日期',r.adate||'—')
|
||||
+ik('救助信息',r.info,true)+'</div>'
|
||||
var emg=r.rs==='已完成'
|
||||
? (r.out==='是'
|
||||
? '<div class="info-card">'
|
||||
+ik('是否出勤','是')+ik('出勤救护车',r.amb||'—')+ik('出勤司机',r.drv||'—')+ik('随车医护',r.med||'—')+ik('出勤日期',r.adate||'—')
|
||||
+ik('救助信息',r.info,true)+'</div>'
|
||||
: '<div class="info-card">'+ik('是否出勤','否')+ik('救助信息',r.info,true)+'</div>')
|
||||
: '<div class="info-card info-card--grey" style="grid-template-columns:1fr;"><div class="info-empty">暂无急救信息</div></div>';
|
||||
document.getElementById('detailBody').innerHTML=
|
||||
'<div class="ct-head">'+r.ct+' '+stage+'<span class="st">'+r.rs+'</span></div>'
|
||||
'<div class="ct-head"><span class="ct-head__title">'+r.ct+' '+stage+'</span><span class="ct-head__status">救助状态:<span class="badge '+rsBadge[r.rs]+'">'+r.rs+'</span></span></div>'
|
||||
+'<div class="detail-grid">'
|
||||
+dk('呼叫时间',r.time)+dk('响应时间',r.resp)
|
||||
+dk('结束时间',r.end)+dk('呼叫类型',r.ct)
|
||||
+dk('主呼设备',r.dev)+dk('被呼设备',r.to)
|
||||
+dk('呼叫时间',r.time)+dk('接听时间',r.cs==='未接通'?'-':r.resp)
|
||||
+dk('结束时间',r.cs==='未接通'?'-':r.end)+dk('呼叫类型',r.ct)
|
||||
+dk('呼叫设备编号',r.dev)+dk('被呼设备编号',r.cs==='未接通'?'-':r.to)
|
||||
+'</div>'
|
||||
+'<div class="form-section">员工信息</div>'+empCard(r.no)
|
||||
+'<div class="form-section">宿舍信息</div>'+dormCard(r)
|
||||
@@ -385,17 +386,14 @@ function openDetailIn(i){
|
||||
/* 呼出工单详情:无救助处置环节,急救信息固定占位 */
|
||||
function openDetailOut(i){
|
||||
var r=outgoing[i];
|
||||
var stage=r.cs==='已接听'?'<span class="badge badge--success">已接听</span>':'<span class="badge badge--danger">未接听</span>';
|
||||
var seg=r.space.split(' · ');
|
||||
document.getElementById('detailBody').innerHTML=
|
||||
'<div class="ct-head">'+r.ct+' '+stage+'<span class="st">'+r.cs+'</span></div>'
|
||||
+'<div class="detail-grid">'
|
||||
+dk('呼叫时间',r.time)+dk('响应时间',r.resp)
|
||||
+dk('结束时间',r.end)+dk('呼叫类型',r.ct)
|
||||
+dk('主呼设备',r.from)+dk('被呼设备',r.to)
|
||||
+'</div>'
|
||||
+'<div class="form-section">员工信息</div>'+empCard(r.no)
|
||||
+'<div class="form-section">宿舍信息</div>'+dormCard(r)
|
||||
+'<div class="form-section">急救信息</div><div class="info-card info-card--grey" style="grid-template-columns:1fr;"><div class="info-empty">暂无急救信息</div></div>';
|
||||
'<div class="detail-grid">'
|
||||
+dk('呼叫设备编号',r.from)+dk('终端名称',termNames[r.from]||'—')
|
||||
+dk('呼叫时间',r.time)+dk('呼叫状态','<span class="badge '+outBadge[r.cs]+'">'+r.cs+'</span>')
|
||||
+dk('被呼设备编号',r.to)+dk('宿舍/床位信息',seg[1])
|
||||
+dk('站点名称',r.station)+dk('楼栋名称',seg[0])
|
||||
+'</div>';
|
||||
document.getElementById('detailMask').classList.add('open');
|
||||
}
|
||||
function closeDetail(){document.getElementById('detailMask').classList.remove('open');}
|
||||
|
||||
@@ -312,18 +312,18 @@ var dormTree={
|
||||
};
|
||||
/* 与「设备列表」呼叫设备一致;alloc:1宿舍/2床位 */
|
||||
var devices=[
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-01',mac:'00:1A:2B:3C:4D:01',alloc:1,type:2,space:'樊学倒班宿舍1号楼 · 101-1',time:'2026-03-05'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-02',mac:'00:1A:2B:3C:4D:02',alloc:1,type:2,space:'樊学倒班宿舍1号楼 · 101-2',time:'2026-03-05'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-03',mac:'00:1A:2B:3C:4D:03',alloc:1,type:2,space:'樊学倒班宿舍1号楼 · 102-1',time:'2026-03-05'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-04',mac:'00:1A:2B:3C:4D:04',alloc:1,type:1,space:'樊学倒班宿舍1号楼 · 101室',time:'2026-03-05'},
|
||||
{unit:'采油一厂',depart:'麻子山作业区',code:'HC-MZ-01',mac:'00:1A:2B:3C:4D:05',alloc:1,type:1,space:'麻子山倒班宿舍楼 · 101室',time:'2026-03-19'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'HC-TY-01',mac:'00:1A:2B:3C:4D:06',alloc:1,type:2,space:'桐园倒班宿舍1号楼 · 301-1',time:'2026-04-10'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'HC-TY-02',mac:'00:1A:2B:3C:4D:07',alloc:1,type:1,space:'桐园倒班宿舍1号楼 · 201室',time:'2026-04-10'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-01',mac:'00:1A:2B:3C:4D:08',alloc:1,type:2,space:'西峰基地综合宿舍楼 · 301-1',time:'2026-05-12'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-02',mac:'00:1A:2B:3C:4D:09',alloc:1,type:2,space:'西峰基地综合宿舍楼 · 302-1',time:'2026-05-12'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-03',mac:'00:1A:2B:3C:4D:0A',alloc:1,type:1,space:'西峰基地综合宿舍楼 · 402室',time:'2026-05-12'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'HC-JB-01',mac:'00:1A:2B:3C:4D:0B',alloc:1,type:2,space:'靖边气田倒班宿舍楼 · 401-1',time:'2026-06-24'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'HC-JB-02',mac:'00:1A:2B:3C:4D:0C',alloc:0,type:0,space:'',time:''}
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10001',mac:'00:1A:2B:3C:4D:01',alloc:1,type:2,space:'樊学倒班宿舍1号楼 · 101-1',time:'2026-03-05'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10002',mac:'00:1A:2B:3C:4D:02',alloc:1,type:2,space:'樊学倒班宿舍1号楼 · 101-2',time:'2026-03-05'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10003',mac:'00:1A:2B:3C:4D:03',alloc:1,type:2,space:'樊学倒班宿舍1号楼 · 102-1',time:'2026-03-05'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10004',mac:'00:1A:2B:3C:4D:04',alloc:1,type:1,space:'樊学倒班宿舍1号楼 · 101室',time:'2026-03-05'},
|
||||
{unit:'采油一厂',depart:'麻子山作业区',code:'10005',mac:'00:1A:2B:3C:4D:05',alloc:1,type:1,space:'麻子山倒班宿舍楼 · 101室',time:'2026-03-19'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'10006',mac:'00:1A:2B:3C:4D:06',alloc:1,type:2,space:'桐园倒班宿舍1号楼 · 301-1',time:'2026-04-10'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'10007',mac:'00:1A:2B:3C:4D:07',alloc:1,type:1,space:'桐园倒班宿舍1号楼 · 201室',time:'2026-04-10'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10008',mac:'00:1A:2B:3C:4D:08',alloc:1,type:2,space:'西峰基地综合宿舍楼 · 301-1',time:'2026-05-12'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10009',mac:'00:1A:2B:3C:4D:09',alloc:1,type:2,space:'西峰基地综合宿舍楼 · 302-1',time:'2026-05-12'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10010',mac:'00:1A:2B:3C:4D:0A',alloc:1,type:1,space:'西峰基地综合宿舍楼 · 402室',time:'2026-05-12'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'10011',mac:'00:1A:2B:3C:4D:0B',alloc:1,type:2,space:'靖边气田倒班宿舍楼 · 401-1',time:'2026-06-24'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'10012',mac:'00:1A:2B:3C:4D:0C',alloc:0,type:0,space:'',time:''}
|
||||
];
|
||||
var selUnit='',selDept='';
|
||||
function toggleOrg(){
|
||||
|
||||
@@ -358,28 +358,28 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
var unitDeparts={'采油一厂':['樊学作业区','麻子山作业区'],'采油二厂':['桐园作业区','姬圪台作业区'],'第四采油厂':['西峰作业区'],'采气一厂':['靖边气田']};
|
||||
var statusBadge={'0':'badge--success','1':'badge--muted'};
|
||||
var statusText={'0':'在线','1':'离线'};
|
||||
/* 呼叫设备:分配关系与「分配管理」「床位信息」勾稽(HC-FX-03 离线见告警记录演示) */
|
||||
/* 呼叫设备:分配关系与「分配管理」「床位信息」勾稽(10003 离线见告警记录演示) */
|
||||
var callDevices=[
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-01',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:01',store:'2026-03-02',status:'0',manager:'王守正',mphone:'13991203456',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-02',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:02',store:'2026-03-02',status:'0',manager:'王守正',mphone:'13991203456',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-03',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:03',store:'2026-03-02',status:'1',manager:'王守正',mphone:'13991203456',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HC-FX-04',name:'房间一键呼叫面板',model:'KQ-P2',mac:'00:1A:2B:3C:4D:04',store:'2026-03-02',status:'0',manager:'王守正',mphone:'13991203456',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油一厂',depart:'麻子山作业区',code:'HC-MZ-01',name:'房间一键呼叫面板',model:'KQ-P2',mac:'00:1A:2B:3C:4D:05',store:'2026-03-18',status:'0',manager:'安伟',mphone:'13991345012',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'HC-TY-01',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:06',store:'2026-04-09',status:'0',manager:'陈国栋',mphone:'13991567208',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'HC-TY-02',name:'房间一键呼叫面板',model:'KQ-P2',mac:'00:1A:2B:3C:4D:07',store:'2026-04-09',status:'0',manager:'陈国栋',mphone:'13991567208',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-01',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:08',store:'2026-05-11',status:'0',manager:'马文秀',mphone:'13991784320',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-02',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:09',store:'2026-05-11',status:'0',manager:'马文秀',mphone:'13991784320',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HC-XF-03',name:'房间一键呼叫面板',model:'KQ-P2',mac:'00:1A:2B:3C:4D:0A',store:'2026-05-11',status:'0',manager:'马文秀',mphone:'13991784320',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'HC-JB-01',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:0B',store:'2026-06-23',status:'0',manager:'周铁祥',mphone:'13991923745',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'HC-JB-02',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:0C',store:'2026-09-01',status:'0',manager:'周铁祥',mphone:'13991923745',mfr:'CQ中控医疗',mfrTel:'029-86521700'}
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10001',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:01',store:'2026-03-02',status:'0',manager:'王守正',mphone:'13991203456',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10002',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:02',store:'2026-03-02',status:'0',manager:'王守正',mphone:'13991203456',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10003',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:03',store:'2026-03-02',status:'1',manager:'王守正',mphone:'13991203456',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10004',name:'房间一键呼叫面板',model:'KQ-P2',mac:'00:1A:2B:3C:4D:04',store:'2026-03-02',status:'0',manager:'王守正',mphone:'13991203456',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油一厂',depart:'麻子山作业区',code:'10005',name:'房间一键呼叫面板',model:'KQ-P2',mac:'00:1A:2B:3C:4D:05',store:'2026-03-18',status:'0',manager:'安伟',mphone:'13991345012',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'10006',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:06',store:'2026-04-09',status:'0',manager:'陈国栋',mphone:'13991567208',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'10007',name:'房间一键呼叫面板',model:'KQ-P2',mac:'00:1A:2B:3C:4D:07',store:'2026-04-09',status:'0',manager:'陈国栋',mphone:'13991567208',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10008',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:08',store:'2026-05-11',status:'0',manager:'马文秀',mphone:'13991784320',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10009',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:09',store:'2026-05-11',status:'0',manager:'马文秀',mphone:'13991784320',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10010',name:'房间一键呼叫面板',model:'KQ-P2',mac:'00:1A:2B:3C:4D:0A',store:'2026-05-11',status:'0',manager:'马文秀',mphone:'13991784320',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'10011',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:0B',store:'2026-06-23',status:'0',manager:'周铁祥',mphone:'13991923745',mfr:'CQ中控医疗',mfrTel:'029-86521700'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'10012',name:'床头呼叫按钮',model:'KQ-P1',mac:'00:1A:2B:3C:4D:0C',store:'2026-09-01',status:'0',manager:'周铁祥',mphone:'13991923745',mfr:'CQ中控医疗',mfrTel:'029-86521700'}
|
||||
];
|
||||
/* 终端设备:值班室固定部署,不参与宿舍/床位分配 */
|
||||
var termDevices=[
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'HD-FX-01',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:11',store:'2026-03-02',status:'0',manager:'王守正',mphone:'13991203456',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采油一厂',depart:'麻子山作业区',code:'HD-MZ-01',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:12',store:'2026-03-18',status:'0',manager:'安伟',mphone:'13991345012',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'HD-TY-01',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:13',store:'2026-04-09',status:'0',manager:'陈国栋',mphone:'13991567208',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'HD-XF-01',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:14',store:'2026-05-11',status:'1',manager:'马文秀',mphone:'13991784320',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'HD-JB-01',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:15',store:'2026-06-23',status:'0',manager:'周铁祥',mphone:'13991923745',mfr:'华旭智能',mfrTel:'029-87334210'}
|
||||
{unit:'采油一厂',depart:'樊学作业区',code:'10013',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:11',store:'2026-03-02',status:'0',manager:'王守正',mphone:'13991203456',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采油一厂',depart:'麻子山作业区',code:'10014',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:12',store:'2026-03-18',status:'0',manager:'安伟',mphone:'13991345012',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采油二厂',depart:'桐园作业区',code:'10015',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:13',store:'2026-04-09',status:'0',manager:'陈国栋',mphone:'13991567208',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'第四采油厂',depart:'西峰作业区',code:'10016',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:14',store:'2026-05-11',status:'1',manager:'马文秀',mphone:'13991784320',mfr:'华旭智能',mfrTel:'029-87334210'},
|
||||
{unit:'采气一厂',depart:'靖边气田',code:'10017',name:'值班室接收终端',model:'KQ-T10',mac:'00:1A:2B:3C:4D:15',store:'2026-06-23',status:'0',manager:'周铁祥',mphone:'13991923745',mfr:'华旭智能',mfrTel:'029-87334210'}
|
||||
];
|
||||
var curTab='call';
|
||||
function tabName(){return curTab==='call'?'呼叫设备':'终端设备';}
|
||||
|
||||
@@ -102,6 +102,15 @@ tbody tr:hover td:last-child{background:#F8FBFF;}
|
||||
.form-control{height:32px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:0 10px;font-size:var(--font-sm);color:var(--text-primary);outline:none;width:100%;}
|
||||
.form-control:focus{border-color:var(--primary);}
|
||||
select.form-control{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;appearance:none;-webkit-appearance:none;padding-right:28px;cursor:pointer;}
|
||||
/* [交互] 楼栋搜索下拉(新增/编辑宿舍):下拉项显示楼栋名称 + 所属站点 */
|
||||
.building-search{position:relative;}
|
||||
.building-search__panel{display:none;position:absolute;top:34px;left:0;right:0;z-index:320;background:#fff;border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);max-height:240px;overflow-y:auto;}
|
||||
.building-search__panel.open{display:block;}
|
||||
.building-search__item{padding:8px 12px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px;}
|
||||
.building-search__item:hover{background:#F0F8FF;}
|
||||
.building-search__item .ss-name{color:var(--text-primary);font-weight:500;}
|
||||
.building-search__item .ss-org{color:var(--text-placeholder);font-size:var(--font-xs);}
|
||||
.building-search__empty{padding:16px 12px;text-align:center;color:var(--text-placeholder);font-size:var(--font-sm);}
|
||||
.upload-box{border:1px dashed var(--border);border-radius:var(--radius-md);padding:28px 16px;text-align:center;color:var(--text-placeholder);font-size:var(--font-sm);cursor:pointer;transition:all .2s;background:#FAFAFA;}
|
||||
.upload-box:hover{border-color:var(--primary);color:var(--primary);background:#F0F8FF;}
|
||||
.upload-box svg{display:block;margin:0 auto 8px;}
|
||||
@@ -227,7 +236,7 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
<tr>
|
||||
<th style="width:40px;"><input type="checkbox" id="ckAll" onchange="toggleAll(this)"></th>
|
||||
<th style="width:56px;">序号</th><th style="min-width:110px;">宿舍名称</th><th style="min-width:180px;">所属楼栋</th><th style="min-width:120px;">所属站点</th><th style="min-width:160px;">所属单位部门</th>
|
||||
<th>床位数量</th><th>是否分配设备</th><th style="min-width:110px;">设备编号</th><th>负责人</th><th style="min-width:110px;">负责人电话</th><th style="width:110px;">操作</th>
|
||||
<th>床位数量</th><th>是否分配设备</th><th>分配类型</th><th style="min-width:110px;">设备编号</th><th>负责人</th><th style="min-width:110px;">负责人电话</th><th style="width:110px;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody"></tbody>
|
||||
@@ -243,7 +252,10 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
<div class="modal__title" id="editTitle">新增宿舍信息</div>
|
||||
<div class="form-item">
|
||||
<span class="form-label"><span class="req">*</span> 所属楼栋</span>
|
||||
<select class="form-control" id="eBuilding"><option value="">请选择楼栋</option></select>
|
||||
<div class="building-search" id="buildingSearch">
|
||||
<input class="form-control" id="eBuilding" placeholder="请输入楼栋名称搜索" autocomplete="off" oninput="onBuildingInput()" onfocus="onBuildingFocus()">
|
||||
<div class="building-search__panel" id="buildingPanel"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-item">
|
||||
@@ -252,7 +264,7 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<span class="form-label"><span class="req">*</span> 床位数量</span>
|
||||
<input class="form-control" id="eBeds" type="number" min="1" max="8" placeholder="1-8">
|
||||
<input class="form-control" id="eBeds" type="number" min="1" max="8" placeholder="如:4">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
@@ -297,12 +309,12 @@ select.form-control{background:#fff url("data:image/svg+xml,%3Csvg xmlns='http:/
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- [交互] 床位数量下钻:该宿舍的床位清单(列与「床位信息」一致) -->
|
||||
<!-- [交互] 床位数量下钻:该宿舍的床位清单(床位→员工、床位→床头设备绑定) -->
|
||||
<div class="modal-mask" id="bedMask">
|
||||
<div class="modal--list">
|
||||
<div class="modal__title" id="bedTitle">宿舍床位清单</div>
|
||||
<table class="record-table">
|
||||
<thead><tr><th>床位编号</th><th>是否分配员工</th><th>员工姓名</th><th>员工编号</th><th>员工所属单位</th><th>员工所属部门</th><th>员工联系方式</th></tr></thead>
|
||||
<thead><tr><th>床位编号</th><th>是否分配设备</th><th>设备编号</th><th>是否分配员工</th><th>员工姓名</th><th>员工编号</th><th>员工所属单位</th><th>员工所属部门</th><th>员工联系方式</th></tr></thead>
|
||||
<tbody id="bedTbody"></tbody>
|
||||
</table>
|
||||
<div class="modal__footer"><button class="btn btn-default" onclick="closeBed()">关闭</button></div>
|
||||
@@ -346,23 +358,25 @@ var buildingMeta={
|
||||
'西峰基地综合宿舍楼':{station:'西峰基地',unit:'第四采油厂',depart:'西峰作业区'},
|
||||
'靖边气田倒班宿舍楼':{station:'靖边气田站点',unit:'采气一厂',depart:'靖边气田'}
|
||||
};
|
||||
/* 楼栋搜索下拉数据:楼栋名称 + 所属站点 */
|
||||
var buildingList=buildings.map(function(b){var m=buildingMeta[b];return {name:b,station:m.station,unit:m.unit,depart:m.depart};});
|
||||
var selUnit='',selDept='';
|
||||
/* alloc:绑定到宿舍本身的设备(房间级呼叫);床位级绑定见「分配管理」 */
|
||||
/* 分配设备:宿舍型=房间一键呼叫面板(单台);床位型=床头呼叫按钮(可多床多台,编号逗号分隔) */
|
||||
var dorms=[
|
||||
{name:'101室',building:'樊学倒班宿舍1号楼',beds:4,manager:'石维国',mobile:'13991203456',alloc:1,device:'HC-FX-04'},
|
||||
{name:'102室',building:'樊学倒班宿舍1号楼',beds:4,manager:'李桂芳',mobile:'13991207788',alloc:0,device:''},
|
||||
{name:'201室',building:'樊学倒班宿舍1号楼',beds:2,manager:'—',mobile:'—',alloc:0,device:''},
|
||||
{name:'101室',building:'麻子山倒班宿舍楼',beds:4,manager:'杨慧敏',mobile:'13991345012',alloc:1,device:'HC-MZ-01'},
|
||||
{name:'102室',building:'麻子山倒班宿舍楼',beds:2,manager:'—',mobile:'—',alloc:0,device:''},
|
||||
{name:'201室',building:'桐园倒班宿舍1号楼',beds:2,manager:'赵万福',mobile:'13991567208',alloc:1,device:'HC-TY-02'},
|
||||
{name:'301室',building:'桐园倒班宿舍1号楼',beds:4,manager:'—',mobile:'—',alloc:0,device:''},
|
||||
{name:'302室',building:'桐园倒班宿舍1号楼',beds:2,manager:'—',mobile:'—',alloc:0,device:''},
|
||||
{name:'301室',building:'西峰基地综合宿舍楼',beds:4,manager:'高建军',mobile:'13991784320',alloc:0,device:''},
|
||||
{name:'302室',building:'西峰基地综合宿舍楼',beds:4,manager:'闫婷',mobile:'13991784531',alloc:0,device:''},
|
||||
{name:'401室',building:'西峰基地综合宿舍楼',beds:2,manager:'—',mobile:'—',alloc:0,device:''},
|
||||
{name:'402室',building:'西峰基地综合宿舍楼',beds:4,manager:'徐立成',mobile:'13991784906',alloc:1,device:'HC-XF-03'},
|
||||
{name:'401室',building:'靖边气田倒班宿舍楼',beds:4,manager:'刘玉梅',mobile:'13991923745',alloc:0,device:''},
|
||||
{name:'402室',building:'靖边气田倒班宿舍楼',beds:2,manager:'呼建国',mobile:'13991923870',alloc:0,device:''}
|
||||
{name:'101室',building:'樊学倒班宿舍1号楼',beds:4,manager:'石维国',mobile:'13991203456',alloc:1,allocType:'床位',device:'10001,10002'},
|
||||
{name:'102室',building:'樊学倒班宿舍1号楼',beds:4,manager:'李桂芳',mobile:'13991207788',alloc:0,allocType:'',device:''},
|
||||
{name:'201室',building:'樊学倒班宿舍1号楼',beds:2,manager:'—',mobile:'—',alloc:0,allocType:'',device:''},
|
||||
{name:'101室',building:'麻子山倒班宿舍楼',beds:4,manager:'杨慧敏',mobile:'13991345012',alloc:1,allocType:'宿舍',device:'10005'},
|
||||
{name:'102室',building:'麻子山倒班宿舍楼',beds:2,manager:'—',mobile:'—',alloc:0,allocType:'',device:''},
|
||||
{name:'201室',building:'桐园倒班宿舍1号楼',beds:2,manager:'赵万福',mobile:'13991567208',alloc:1,allocType:'宿舍',device:'10007'},
|
||||
{name:'301室',building:'桐园倒班宿舍1号楼',beds:4,manager:'—',mobile:'—',alloc:0,allocType:'',device:''},
|
||||
{name:'302室',building:'桐园倒班宿舍1号楼',beds:2,manager:'—',mobile:'—',alloc:0,allocType:'',device:''},
|
||||
{name:'301室',building:'西峰基地综合宿舍楼',beds:4,manager:'高建军',mobile:'13991784320',alloc:0,allocType:'',device:''},
|
||||
{name:'302室',building:'西峰基地综合宿舍楼',beds:4,manager:'闫婷',mobile:'13991784531',alloc:0,allocType:'',device:''},
|
||||
{name:'401室',building:'西峰基地综合宿舍楼',beds:2,manager:'—',mobile:'—',alloc:0,allocType:'',device:''},
|
||||
{name:'402室',building:'西峰基地综合宿舍楼',beds:4,manager:'徐立成',mobile:'13991784906',alloc:1,allocType:'宿舍',device:'10010'},
|
||||
{name:'401室',building:'靖边气田倒班宿舍楼',beds:4,manager:'刘玉梅',mobile:'13991923745',alloc:0,allocType:'',device:''},
|
||||
{name:'402室',building:'靖边气田倒班宿舍楼',beds:2,manager:'呼建国',mobile:'13991923870',alloc:0,allocType:'',device:''}
|
||||
];
|
||||
/* [交互] 床位下钻演示数据:员工池与「床位信息」页一致(key=楼栋|床位编号) */
|
||||
var empLite={
|
||||
@@ -385,12 +399,17 @@ var bedAssigns={
|
||||
'西峰基地综合宿舍楼|301-1':'CQ010564','西峰基地综合宿舍楼|301-2':'CQ041822','西峰基地综合宿舍楼|302-1':'CQ044871','西峰基地综合宿舍楼|402-1':'CQ027710',
|
||||
'靖边气田倒班宿舍楼|401-1':'CQ036441','靖边气田倒班宿舍楼|401-2':'CQ029905'
|
||||
};
|
||||
/* 床位→床头设备(key=楼栋|床位编号,与「床位信息」页一致) */
|
||||
var bedDevices={
|
||||
'樊学倒班宿舍1号楼|101-1':'10001','樊学倒班宿舍1号楼|101-2':'10002','樊学倒班宿舍1号楼|102-1':'10003',
|
||||
'桐园倒班宿舍1号楼|301-1':'10006','西峰基地综合宿舍楼|301-1':'10008','西峰基地综合宿舍楼|302-1':'10009',
|
||||
'靖边气田倒班宿舍楼|401-1':'10011'
|
||||
};
|
||||
function initFilters(){
|
||||
var unitHtml=Object.keys(unitDeparts).map(function(u){return '<div class="org-item" onclick="selectUnit(this,\''+u+'\')">'+u+'</div>';}).join('');
|
||||
document.getElementById('unitCol').insertAdjacentHTML('beforeend',unitHtml);
|
||||
var opts='<option value="">全部楼栋</option>'+buildings.map(function(b){return '<option>'+b+'</option>';}).join('');
|
||||
document.getElementById('filterBuilding').innerHTML=opts;
|
||||
document.getElementById('eBuilding').innerHTML='<option value="">请选择楼栋</option>'+buildings.map(function(b){return '<option>'+b+'</option>';}).join('');
|
||||
document.getElementById('iBuilding').innerHTML='<option value="">请选择楼栋</option>'+buildings.map(function(b){return '<option>'+b+'</option>';}).join('');
|
||||
var allStations=Object.keys(depStations).reduce(function(a,k){return a.concat(depStations[k]);},[]);
|
||||
document.getElementById('filterStation').innerHTML='<option value="">全部站点</option>'+allStations.map(function(s){return '<option>'+s+'</option>';}).join('');
|
||||
@@ -425,6 +444,10 @@ function resetOrg(){
|
||||
document.querySelectorAll('#unitCol .org-item').forEach(function(i,idx){i.classList.toggle('active',idx===0);});
|
||||
document.getElementById('deptCol').innerHTML='<div class="org-col__title">部门</div><div class="org-item active" onclick="selectDept(this,\'\')">全部部门</div>';
|
||||
}
|
||||
/* 设备编号显示:宿舍级与床位级均直接显示设备值;床位级可能多个,逗号分隔 */
|
||||
function deviceText(r){
|
||||
return r.alloc ? r.device : '-';
|
||||
}
|
||||
function renderTable(){
|
||||
var s=document.getElementById('filterStation').value,b=document.getElementById('filterBuilding').value,n=document.getElementById('filterName').value.trim(),a=document.getElementById('filterAlloc').value;
|
||||
var list=dorms.filter(function(r){
|
||||
@@ -438,10 +461,11 @@ function renderTable(){
|
||||
+'<td>'+(i+1)+'</td><td style="font-weight:500;">'+r.name+'</td><td>'+r.building+'</td><td>'+(meta.station||'')+'</td><td>'+(meta.unit?meta.unit+' / '+meta.depart:'')+'</td>'
|
||||
+'<td><span class="link-num" onclick="openBed('+i+')">'+r.beds+'</span></td>'
|
||||
+'<td>'+(r.alloc?'<span class="badge badge--success">已分配</span>':'<span class="badge badge--muted">未分配</span>')+'</td>'
|
||||
+'<td style="font-family:monospace;">'+(r.device||'-')+'</td><td>'+r.manager+'</td><td>'+r.mobile+'</td>'
|
||||
+'<td>'+(r.alloc?(r.allocType==='床位'?'<span class="badge badge--info">床位</span>':'<span class="badge badge--success">宿舍</span>'):'-')+'</td>'
|
||||
+'<td style="font-family:monospace;">'+deviceText(r)+'</td><td>'+r.manager+'</td><td>'+r.mobile+'</td>'
|
||||
+'<td><button class="btn btn-link" onclick="openEdit('+i+')">编辑</button><button class="btn btn-link--danger" onclick="askDelete('+i+')">删除</button></td></tr>';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="12">没有符合条件的宿舍</td></tr>';
|
||||
document.getElementById('totalTip').textContent='共 '+list.length+' 间 · 房间级设备 '+dorms.filter(function(r){return r.alloc;}).length+' 台';
|
||||
}).join('')||'<tr><td class="td-empty" colspan="13">没有符合条件的宿舍</td></tr>';
|
||||
document.getElementById('totalTip').textContent='共 '+list.length+' 间 · 已分配 '+dorms.filter(function(r){return r.alloc;}).length+' 间';
|
||||
document.getElementById('ckAll').checked=false;
|
||||
}
|
||||
function resetFilter(){resetOrg();['filterStation','filterBuilding','filterAlloc'].forEach(function(id){document.getElementById(id).value='';});document.getElementById('filterName').value='';renderTable();}
|
||||
@@ -458,6 +482,23 @@ function batchDelete(){
|
||||
document.getElementById('confirmText').textContent='确认删除选中的 '+ids.length+' 间宿舍?其下床位将一并失效。';
|
||||
document.getElementById('confirmMask').classList.add('open');
|
||||
}
|
||||
/* [交互] 楼栋搜索下拉(新增/编辑宿舍) */
|
||||
var selBuilding='';
|
||||
function onBuildingInput(){selBuilding='';renderBuildingPanel();}
|
||||
function onBuildingFocus(){renderBuildingPanel();}
|
||||
function renderBuildingPanel(){
|
||||
var q=document.getElementById('eBuilding').value.trim();
|
||||
var list=buildingList.filter(function(b){return !q||b.name.indexOf(q)>=0;});
|
||||
document.getElementById('buildingPanel').innerHTML=list.map(function(b){
|
||||
return '<div class="building-search__item" onclick="pickBuilding(\''+b.name+'\')"><span class="ss-name">'+b.name+'</span><span class="ss-org">'+b.station+'</span></div>';
|
||||
}).join('')||'<div class="building-search__empty">未查询到楼栋</div>';
|
||||
document.getElementById('buildingPanel').classList.add('open');
|
||||
}
|
||||
function pickBuilding(name){
|
||||
selBuilding=name;
|
||||
document.getElementById('eBuilding').value=name;
|
||||
document.getElementById('buildingPanel').classList.remove('open');
|
||||
}
|
||||
/* [交互] 新增/编辑 */
|
||||
var editIdx=-1;
|
||||
function openEdit(i){
|
||||
@@ -465,21 +506,24 @@ function openEdit(i){
|
||||
document.getElementById('editTitle').textContent=i<0?'新增宿舍信息':'编辑宿舍信息';
|
||||
if(i>=0){
|
||||
var r=dorms[i];
|
||||
selBuilding=r.building;
|
||||
document.getElementById('eBuilding').value=r.building;document.getElementById('eName').value=r.name;
|
||||
document.getElementById('eBeds').value=r.beds;document.getElementById('eManager').value=r.manager==='—'?'':r.manager;
|
||||
document.getElementById('eMobile').value=r.mobile==='—'?'':r.mobile;
|
||||
}else{
|
||||
selBuilding='';
|
||||
document.getElementById('eBuilding').value='';['eName','eBeds','eManager','eMobile'].forEach(function(id){document.getElementById(id).value='';});
|
||||
}
|
||||
document.getElementById('buildingPanel').classList.remove('open');
|
||||
document.getElementById('editMask').classList.add('open');
|
||||
}
|
||||
function closeEdit(){document.getElementById('editMask').classList.remove('open');}
|
||||
function saveEdit(){
|
||||
var b=document.getElementById('eBuilding').value,n=document.getElementById('eName').value.trim(),beds=parseInt(document.getElementById('eBeds').value,10);
|
||||
if(!b||!n||!beds||beds<1||beds>8){showToast('请完整填写,床位数量须在 1-8 之间');return;}
|
||||
var b=selBuilding||document.getElementById('eBuilding').value.trim(),n=document.getElementById('eName').value.trim(),beds=parseInt(document.getElementById('eBeds').value,10);
|
||||
if(!b||!buildingMeta[b]||!n||!beds||beds<1||beds>8){showToast('请完整填写,床位数量须在 1-8 之间');return;}
|
||||
var dup=dorms.some(function(r,i){return i!==editIdx&&r.building===b&&r.name===n;});
|
||||
if(dup){showToast('该楼栋下已存在同名宿舍');return;}
|
||||
var obj={name:n,building:b,beds:beds,manager:document.getElementById('eManager').value.trim()||'—',mobile:document.getElementById('eMobile').value.trim()||'—',alloc:editIdx>=0?dorms[editIdx].alloc:0,device:editIdx>=0?dorms[editIdx].device:''};
|
||||
var obj={name:n,building:b,beds:beds,manager:document.getElementById('eManager').value.trim()||'—',mobile:document.getElementById('eMobile').value.trim()||'—',alloc:editIdx>=0?dorms[editIdx].alloc:0,allocType:editIdx>=0?dorms[editIdx].allocType:'',device:editIdx>=0?dorms[editIdx].device:''};
|
||||
if(editIdx<0)dorms.push(obj);else dorms[editIdx]=obj;
|
||||
closeEdit();renderTable();showToast(editIdx<0?'宿舍已新增(将生成 '+beds+' 条床位)':'宿舍已更新');
|
||||
}
|
||||
@@ -513,7 +557,10 @@ function openBed(i){
|
||||
var room=r.name.replace('室',''),rows='';
|
||||
for(var nn=1;nn<=r.beds;nn++){
|
||||
var code=room+'-'+nn,no=bedAssigns[r.building+'|'+code],e=no?empLite[no]:null;
|
||||
var dev=bedDevices[r.building+'|'+code];
|
||||
rows+='<tr><td style="font-family:monospace;">'+code+'</td>'
|
||||
+(dev?'<td><span class="badge badge--success">是</span></td><td style="font-family:monospace;">'+dev+'</td>'
|
||||
:'<td><span class="badge badge--muted">否</span></td><td>—</td>')
|
||||
+(e?'<td><span class="badge badge--success">是</span></td><td>'+e.name+'</td><td>'+no+'</td><td>'+e.unit+'</td><td>'+e.depart+'</td><td>'+e.phone+'</td>'
|
||||
:'<td><span class="badge badge--muted">否</span></td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td>')
|
||||
+'</tr>';
|
||||
@@ -547,6 +594,8 @@ function showToast(msg){
|
||||
document.addEventListener('click',function(e){
|
||||
var ow=document.getElementById('orgWrap');
|
||||
if(ow&&!ow.contains(e.target)){document.getElementById('orgPanel').classList.remove('open');document.getElementById('orgTrigger').classList.remove('open');}
|
||||
var bs=document.getElementById('buildingSearch');
|
||||
if(bs&&!bs.contains(e.target)){document.getElementById('buildingPanel').classList.remove('open');}
|
||||
});
|
||||
initFilters();renderTable();
|
||||
</script>
|
||||
|
||||
@@ -136,7 +136,7 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
<div class="filter-bar">
|
||||
<div class="filter-item">
|
||||
<label>告警设备</label>
|
||||
<input class="filter-input" id="filterDev" placeholder="如:HC-FX-03" oninput="render()">
|
||||
<input class="filter-input" id="filterDev" placeholder="请输入" oninput="render()">
|
||||
</div>
|
||||
<div class="filter-item">
|
||||
<label>宿舍名称</label>
|
||||
@@ -194,14 +194,14 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script>
|
||||
/* 告警数据:与呼叫记录/设备列表跨页勾稽——徐立成未接通升级、杨慧敏超时未派单、HC-FX-03 与 HD-XF-01 离线 */
|
||||
/* 告警数据:与呼叫记录/设备列表跨页勾稽——徐立成未接通升级、杨慧敏超时未派单、10003 与 10016 离线 */
|
||||
var alarms=[
|
||||
{time:'2026-09-07 06:14',type:'呼叫超时未接听',reason:'床位呼叫(HC-TY-01)发起后 10 分钟内值班终端未接听,关联 2026-09-07 06:02 徐立成(CQ022317)呼入',dev:'HC-TY-01',dorm:'桐园倒班宿舍1号楼 · 301室'},
|
||||
{time:'2026-09-06 20:16',type:'呼叫超时未接听',reason:'值班终端(HD-MZ-01)呼出语音呼叫 10 分钟内被呼侧未接听,员工巡检途中未携房卡',dev:'HC-MZ-01',dorm:'麻子山倒班宿舍楼 · 101室'},
|
||||
{time:'2026-09-04 18:51',type:'呼叫超时未接听',reason:'值班终端(HD-XF-01)呼出语音呼叫 10 分钟内被呼侧未接听,被呼员工外出就餐',dev:'HC-XF-02',dorm:'西峰基地综合宿舍楼 · 302室'},
|
||||
{time:'2026-09-04 09:20',type:'设备离线告警',reason:'呼叫设备心跳丢失超过 15 分钟,判定线路老化已派单维修(102-1 曲志明床位)',dev:'HC-FX-03',dorm:'樊学倒班宿舍1号楼 · 102室'},
|
||||
{time:'2026-09-03 20:08',type:'救助处置超时',reason:'呼入已接通但 30 分钟内未派单到场处置,关联 2026-09-03 19:36 杨慧敏(CQ045130)踝扭伤呼入',dev:'HC-MZ-01',dorm:'麻子山倒班宿舍楼 · 101室'},
|
||||
{time:'2026-09-02 23:47',type:'设备离线告警',reason:'值班终端离线超过 15 分钟,疑似电源适配器故障,呼入转接至备用座机',dev:'HD-XF-01',dorm:'西峰基地值班室'}
|
||||
{time:'2026-09-07 06:14',type:'呼叫超时未接听',reason:'床位呼叫(10006)发起后 10 分钟内值班终端未接听,关联 2026-09-07 06:02 徐立成(CQ022317)呼入',dev:'10006',dorm:'桐园倒班宿舍1号楼 · 301室'},
|
||||
{time:'2026-09-06 20:16',type:'呼叫超时未接听',reason:'值班终端(10014)呼出语音呼叫 10 分钟内被呼侧未接听,员工巡检途中未携房卡',dev:'10005',dorm:'麻子山倒班宿舍楼 · 101室'},
|
||||
{time:'2026-09-04 18:51',type:'呼叫超时未接听',reason:'值班终端(10016)呼出语音呼叫 10 分钟内被呼侧未接听,被呼员工外出就餐',dev:'10009',dorm:'西峰基地综合宿舍楼 · 302室'},
|
||||
{time:'2026-09-04 09:20',type:'设备离线告警',reason:'呼叫设备心跳丢失超过 15 分钟,判定线路老化已派单维修(102-1 曲志明床位)',dev:'10003',dorm:'樊学倒班宿舍1号楼 · 102室'},
|
||||
{time:'2026-09-03 20:08',type:'救助处置超时',reason:'呼入已接通但 30 分钟内未派单到场处置,关联 2026-09-03 19:36 杨慧敏(CQ045130)踝扭伤呼入',dev:'10005',dorm:'麻子山倒班宿舍楼 · 101室'},
|
||||
{time:'2026-09-02 23:47',type:'设备离线告警',reason:'值班终端离线超过 15 分钟,疑似电源适配器故障,呼入转接至备用座机',dev:'10016',dorm:'西峰基地值班室'}
|
||||
];
|
||||
var typeBadge={'呼叫超时未接听':'badge--danger','设备离线告警':'badge--warning','救助处置超时':'badge--info'};
|
||||
function day(dt){return dt.slice(0,10);}
|
||||
|
||||
@@ -294,7 +294,7 @@ tbody td:last-child:has(.more-wrap:hover){z-index:30;}
|
||||
<div class="modal--wide">
|
||||
<div class="modal__header"><span id="devFormTitle">新增设备</span><button class="modal__close" onclick="closeDevForm()">×</button></div>
|
||||
<div class="modal__body">
|
||||
<div class="form-row"><div class="form-row__label"><i>*</i>设备编号</div><div class="form-row__control"><input class="form-input" id="dCode" placeholder="如:FX-BP-01"></div></div>
|
||||
<div class="form-row"><div class="form-row__label"><i>*</i>设备编号</div><div class="form-row__control"><input class="form-input" id="dCode" placeholder="请输入"></div></div>
|
||||
<div class="form-row"><div class="form-row__label"><i>*</i>设备名称</div><div class="form-row__control"><input class="form-input" id="dName" placeholder="如:血压检测仪"></div></div>
|
||||
<div class="form-row"><div class="form-row__label"><i>*</i>设备类型</div><div class="form-row__control">
|
||||
<select class="filter-select" id="dCat" style="width:200px;" onchange="onDevCat()">
|
||||
@@ -343,7 +343,7 @@ tbody td:last-child:has(.more-wrap:hover){z-index:30;}
|
||||
<div class="modal">
|
||||
<div class="modal__header"><span id="termFormTitle">新增终端</span><button class="modal__close" onclick="closeTermForm()">×</button></div>
|
||||
<div class="modal__body">
|
||||
<div class="form-row"><div class="form-row__label"><i>*</i>终端编号</div><div class="form-row__control"><input class="form-input" id="tCode" placeholder="如:FX-T01"></div></div>
|
||||
<div class="form-row"><div class="form-row__label"><i>*</i>终端编号</div><div class="form-row__control"><input class="form-input" id="tCode" placeholder="请输入"></div></div>
|
||||
<div class="form-row"><div class="form-row__label"><i>*</i>终端名称</div><div class="form-row__control"><input class="form-input" id="tName" placeholder="如:入口导诊终端"></div></div>
|
||||
<div class="form-row"><div class="form-row__label"><i>*</i>是否有效</div><div class="form-row__control">
|
||||
<div class="radio-group"><label><input type="radio" name="tStatus" value="1" checked>有效</label><label><input type="radio" name="tStatus" value="0">无效</label></div>
|
||||
@@ -476,43 +476,43 @@ var unitDeparts={'采油一厂':['樊学作业区','麻子山作业区'],'采油
|
||||
/* 健康室数据:与站点/作业区勾稽;devices 内类型 1测量/2心理检测/3治疗设备/4监测设备;设备 status 1有效/0禁用 */
|
||||
var rooms=[
|
||||
{name:'樊学站点健康小屋',place:'樊学站点基地综合楼一层',unit:'采油一厂',depar:'樊学作业区',use:['樊学作业区'],status:'是',legal:'是',
|
||||
devices:[{code:'FX-BP-01',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量,支持数据云端回传。',notice:'测量前静坐 5 分钟,保持安静。'},
|
||||
{code:'FX-BG-02',name:'血糖分析仪',cat:1,len:20,num:6,status:1,remark:'指尖采血快速检测血糖。',notice:'空腹或餐后 2 小时测量。'},
|
||||
{code:'FX-PSY-03',name:'心理测评系统',cat:2,len:40,num:2,status:1,remark:'心理健康量表在线测评。',notice:'请独立完成测评。'},
|
||||
{code:'FX-ECG-04',name:'十二导联心电',cat:4,len:0,num:0,status:1,remark:'十二导联心电采集与判读。',notice:'测量前去除金属饰品。'}],
|
||||
terminals:[{code:'FX-T01',name:'入口导诊终端',status:1},{code:'FX-T02',name:'报告打印终端',status:1}],
|
||||
devices:[{code:'20001',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量,支持数据云端回传。',notice:'测量前静坐 5 分钟,保持安静。'},
|
||||
{code:'20002',name:'血糖分析仪',cat:1,len:20,num:6,status:1,remark:'指尖采血快速检测血糖。',notice:'空腹或餐后 2 小时测量。'},
|
||||
{code:'20003',name:'心理测评系统',cat:2,len:40,num:2,status:1,remark:'心理健康量表在线测评。',notice:'请独立完成测评。'},
|
||||
{code:'20004',name:'十二导联心电',cat:4,len:0,num:0,status:1,remark:'十二导联心电采集与判读。',notice:'测量前去除金属饰品。'}],
|
||||
terminals:[{code:'20005',name:'入口导诊终端',status:1},{code:'20006',name:'报告打印终端',status:1}],
|
||||
admins:[{userName:'fxyisheng',realName:'樊学健康师'},{userName:'fxhushi',realName:'樊学护士长'}],
|
||||
selfLayouts:[{date:'2026-09-10',times:[{open:'08:00',close:'12:00'},{open:'14:00',close:'18:00'}],status:'是'},
|
||||
{date:'2026-09-11',times:[{open:'08:00',close:'12:00'}],status:'是'}]},
|
||||
{name:'麻子山站点健康小屋',place:'麻子山站点综合办公楼二层',unit:'采油一厂',depar:'麻子山作业区',use:['麻子山作业区'],status:'是',legal:'是',
|
||||
devices:[{code:'MZ-BP-01',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量。',notice:''},
|
||||
{code:'MZ-BG-02',name:'血糖分析仪',cat:1,len:20,num:6,status:1,remark:'指尖采血快速检测血糖。',notice:''},
|
||||
{code:'MZ-BMI-03',name:'体成分分析仪',cat:1,len:20,num:8,status:1,remark:'体脂率、肌肉量等多指标分析。',notice:'光脚站立测量。'}],
|
||||
terminals:[{code:'MZ-T01',name:'自助签到终端',status:1}],
|
||||
devices:[{code:'20007',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量。',notice:''},
|
||||
{code:'20008',name:'血糖分析仪',cat:1,len:20,num:6,status:1,remark:'指尖采血快速检测血糖。',notice:''},
|
||||
{code:'20009',name:'体成分分析仪',cat:1,len:20,num:8,status:1,remark:'体脂率、肌肉量等多指标分析。',notice:'光脚站立测量。'}],
|
||||
terminals:[{code:'20010',name:'自助签到终端',status:1}],
|
||||
admins:[{userName:'mzjiankangshi',realName:'麻子山健康师'}],
|
||||
selfLayouts:[{date:'2026-09-10',times:[{open:'09:00',close:'17:00'}],status:'是'}]},
|
||||
{name:'桐园站点健康小屋',place:'桐园站点基地服务中心一层',unit:'采油二厂',depar:'桐园作业区',use:['桐园作业区','姬圪台作业区'],status:'是',legal:'是',
|
||||
devices:[{code:'TY-BP-01',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量。',notice:''},
|
||||
{code:'TY-BMI-02',name:'体成分分析仪',cat:1,len:20,num:8,status:0,remark:'体脂率、肌肉量等多指标分析。',notice:'设备检修中,暂不可预约。'},
|
||||
{code:'TY-PSY-03',name:'心理测评系统',cat:2,len:40,num:2,status:1,remark:'心理健康量表在线测评。',notice:''},
|
||||
{code:'TY-DEC-04',name:'音乐放松舱',cat:3,len:60,num:2,status:1,remark:'音乐放松与生物反馈训练。',notice:'请穿宽松衣物。'}],
|
||||
terminals:[{code:'TY-T01',name:'入口导诊终端',status:1},{code:'TY-T02',name:'报告打印终端',status:1}],
|
||||
devices:[{code:'20011',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量。',notice:''},
|
||||
{code:'20012',name:'体成分分析仪',cat:1,len:20,num:8,status:0,remark:'体脂率、肌肉量等多指标分析。',notice:'设备检修中,暂不可预约。'},
|
||||
{code:'20013',name:'心理测评系统',cat:2,len:40,num:2,status:1,remark:'心理健康量表在线测评。',notice:''},
|
||||
{code:'20014',name:'音乐放松舱',cat:3,len:60,num:2,status:1,remark:'音乐放松与生物反馈训练。',notice:'请穿宽松衣物。'}],
|
||||
terminals:[{code:'20015',name:'入口导诊终端',status:1},{code:'20016',name:'报告打印终端',status:1}],
|
||||
admins:[{userName:'tyyisheng',realName:'桐园健康师'},{userName:'tyhushi',realName:'桐园护士长'}],
|
||||
selfLayouts:[{date:'2026-09-10',times:[{open:'08:00',close:'12:00'},{open:'13:30',close:'17:30'}],status:'是'},
|
||||
{date:'2026-09-12',times:[{open:'08:30',close:'11:30'}],status:'否'}]},
|
||||
{name:'西峰基地健康小屋',place:'西峰基地职工服务中心二层',unit:'第四采油厂',depar:'西峰作业区',use:['西峰作业区'],status:'是',legal:'否',
|
||||
devices:[{code:'XF-BP-01',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量。',notice:''},
|
||||
{code:'XF-BG-02',name:'血糖分析仪',cat:1,len:20,num:6,status:1,remark:'指尖采血快速检测血糖。',notice:''},
|
||||
{code:'XF-LAS-03',name:'激光治疗仪',cat:3,len:30,num:3,status:1,remark:'低能量激光理疗。',notice:'遵医嘱使用。'},
|
||||
{code:'XF-ECG-04',name:'十二导联心电',cat:4,len:0,num:0,status:1,remark:'十二导联心电采集。',notice:''},
|
||||
{code:'XF-WCH-05',name:'智能手表充电柜',cat:4,len:0,num:0,status:1,remark:'健康手表集中充电与数据同步。',notice:''}],
|
||||
terminals:[{code:'XF-T01',name:'入口导诊终端',status:1},{code:'XF-T02',name:'报告打印终端',status:1}],
|
||||
devices:[{code:'20017',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量。',notice:''},
|
||||
{code:'20018',name:'血糖分析仪',cat:1,len:20,num:6,status:1,remark:'指尖采血快速检测血糖。',notice:''},
|
||||
{code:'20019',name:'激光治疗仪',cat:3,len:30,num:3,status:1,remark:'低能量激光理疗。',notice:'遵医嘱使用。'},
|
||||
{code:'20020',name:'十二导联心电',cat:4,len:0,num:0,status:1,remark:'十二导联心电采集。',notice:''},
|
||||
{code:'20021',name:'智能手表充电柜',cat:4,len:0,num:0,status:1,remark:'健康手表集中充电与数据同步。',notice:''}],
|
||||
terminals:[{code:'20022',name:'入口导诊终端',status:1},{code:'20023',name:'报告打印终端',status:1}],
|
||||
admins:[{userName:'xfjiankangshi',realName:'西峰健康师'}],
|
||||
selfLayouts:[{date:'2026-09-10',times:[{open:'08:00',close:'18:00'}],status:'是'}]},
|
||||
{name:'靖边气田健康小屋',place:'靖边气田站点营地活动室',unit:'采气一厂',depar:'靖边气田',use:['靖边气田'],status:'否',legal:'是',
|
||||
devices:[{code:'JB-BP-01',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量。',notice:''},
|
||||
{code:'JB-BMI-02',name:'体成分分析仪',cat:1,len:20,num:8,status:1,remark:'体脂率、肌肉量等多指标分析。',notice:''}],
|
||||
terminals:[{code:'JB-T01',name:'入口导诊终端',status:0}],
|
||||
devices:[{code:'20024',name:'血压检测仪',cat:1,len:30,num:4,status:1,remark:'全自动臂式血压测量。',notice:''},
|
||||
{code:'20025',name:'体成分分析仪',cat:1,len:20,num:8,status:1,remark:'体脂率、肌肉量等多指标分析。',notice:''}],
|
||||
terminals:[{code:'20026',name:'入口导诊终端',status:0}],
|
||||
admins:[{userName:'jbjiankangshi',realName:'靖边健康师'}],
|
||||
selfLayouts:[]}
|
||||
];
|
||||
|
||||
@@ -451,6 +451,10 @@ const FOODS = [
|
||||
{type:'编辑',title:'调整净菜类型',time:'2026-03-15 10:42',user:'王秀兰',role:'营养师',dept:'营养管理部',summary:'新增「免淘米」净菜规格,出净率 95%。',changes:[{field:'净菜类型',old:'1 项(普洗组)',new:'2 项(普洗组/免淘米)'}]},
|
||||
{type:'价格调整',title:'更新基础定价',time:'2026-06-05 16:30',user:'张明',role:'采购员',dept:'采购部',summary:'根据 6 月市场行情调整粳米基础定价。',changes:[{field:'基础定价',old:'3.2 元/100g',new:'3.5 元/100g'}]},
|
||||
{type:'编辑',title:'修订色泽描述',time:'2026-07-21 11:05',user:'李建国',role:'营养师',dept:'营养管理部',summary:'色泽描述语义化,补充感官评级。',changes:[{field:'色泽描述',old:'乳白色,半透明',new:'乳白色,半透明,颗粒饱满'},{field:'感官评级',old:'—',new:'优'}]}
|
||||
],
|
||||
priceHistory:[
|
||||
{price:'3.5',time:'2026-06-05 16:30',method:'手工录入',prevPrice:'3.2',operator:'张明'},
|
||||
{price:'3.2',time:'2026-03-20 10:00',method:'食材验收价',prevPrice:'3.0',operator:'王芳'}
|
||||
]},
|
||||
{name:'猪里脊肉',code:'0201001',alias:'里脊',firstClass:'畜禽肉类',secondClass:'猪肉',icon:'🥩',edible:'100',waterRate:'71.4',dataSource:0,basePrice:'18.8',vegTypes:[
|
||||
{groupId:'g1',alias:'里脊肉丝',specAlias:'细丝',yieldRate:'92',edibleRate:'100',cutSpec:{shape:'丝',length:10,width:1,height:1,technique:'平刀'}},
|
||||
@@ -474,6 +478,11 @@ const FOODS = [
|
||||
{type:'编辑',title:'修正嘌呤数据',time:'2026-05-18 13:20',user:'王秀兰',role:'营养师',dept:'营养管理部',summary:'对齐《中国食物成分表》标准,修正嘌呤相关指标。',changes:[{field:'总嘌呤',old:'118.5 mg',new:'132.6 mg'},{field:'次黄嘌呤',old:'42.1 mg',new:'51.2 mg'}]},
|
||||
{type:'价格调整',title:'更新基础定价',time:'2026-07-09 17:00',user:'张明',role:'采购员',dept:'采购部',summary:'夏季猪肉行情稳定,微调定价。',changes:[{field:'基础定价',old:'19.2 元/100g',new:'18.8 元/100g'}]},
|
||||
{type:'编辑',title:'调整慎食人群说明',time:'2026-08-01 10:15',user:'李建国',role:'营养师',dept:'营养管理部',summary:'细化肾病人群慎食提示。',changes:[{field:'人群备注',old:'肾病患者慎食',new:'肾病人群需控制蛋白质摄入'}]}
|
||||
],
|
||||
priceHistory:[
|
||||
{price:'18.8',time:'2026-07-09 17:00',method:'手工录入',prevPrice:'19.2',operator:'张明'},
|
||||
{price:'19.2',time:'2026-05-30 15:20',method:'食材验收价',prevPrice:'18.8',operator:'王芳'},
|
||||
{price:'18.8',time:'2026-04-02 09:10',method:'手工录入',prevPrice:'16.5',operator:'张明'}
|
||||
]},
|
||||
{name:'菠菜',code:'0701001',alias:'菠菜',firstClass:'蔬菜类',secondClass:'叶菜类',icon:'🥬',edible:'89',waterRate:'91.2',dataSource:0,basePrice:'4.2',vegTypes:[],
|
||||
nutri:{calorie:24,protein:2.6,fat:0.3,carbohydrate:3.1,dietary_fiber:1.7,
|
||||
@@ -490,6 +499,10 @@ const FOODS = [
|
||||
{type:'编辑',title:'完善叶酸数据',time:'2026-03-02 14:30',user:'李建国',role:'营养师',dept:'营养管理部',summary:'对齐最新检测数据,叶酸含量上调。',changes:[{field:'叶酸',old:'87 μg',new:'110 μg'}]},
|
||||
{type:'价格调整',title:'更新基础定价',time:'2026-05-20 11:00',user:'张明',role:'采购员',dept:'采购部',summary:'夏季本地菠菜集中上市,定价下调。',changes:[{field:'基础定价',old:'5.5 元/100g',new:'4.2 元/100g'}]},
|
||||
{type:'编辑',title:'调整慎食提示',time:'2026-06-12 09:40',user:'王秀兰',role:'营养师',dept:'营养管理部',summary:'明确草酸含量高的人群风险提示。',changes:[{field:'人群备注',old:'—',new:'肾结石人群慎食,草酸含量高'}]}
|
||||
],
|
||||
priceHistory:[
|
||||
{price:'4.2',time:'2026-05-20 11:00',method:'食材验收价',prevPrice:'5.5',operator:'张明'},
|
||||
{price:'5.5',time:'2026-03-15 09:40',method:'手工录入',prevPrice:'5.0',operator:'王芳'}
|
||||
]},
|
||||
{name:'鸡蛋',code:'0401001',alias:'鸡蛋',firstClass:'蛋类',secondClass:'鸡蛋',icon:'🥚',edible:'88',waterRate:'74.1',dataSource:0,basePrice:'6.5',vegTypes:[],
|
||||
nutri:{calorie:144,protein:13.3,fat:8.8,carbohydrate:2.8,dietary_fiber:0,
|
||||
@@ -506,6 +519,10 @@ const FOODS = [
|
||||
{type:'编辑',title:'完善生物素与胆碱',time:'2026-02-25 16:00',user:'李建国',role:'营养师',dept:'营养管理部',summary:'补充生物素、总胆碱等 4 项指标。',changes:[{field:'生物素',old:'—',new:'20 μg'},{field:'总胆碱',old:'—',new:'294 mg'}]},
|
||||
{type:'价格调整',title:'更新基础定价',time:'2026-04-18 10:20',user:'张明',role:'采购员',dept:'采购部',summary:'蛋价季节性波动,微调。',changes:[{field:'基础定价',old:'7.0 元/100g',new:'6.5 元/100g'}]},
|
||||
{type:'编辑',title:'补充碘含量',time:'2026-07-04 14:50',user:'王秀兰',role:'营养师',dept:'营养管理部',summary:'补充碘元素数据,完善矿物质维度。',changes:[{field:'碘',old:'—',new:'27.2 μg'}]}
|
||||
],
|
||||
priceHistory:[
|
||||
{price:'6.5',time:'2026-04-18 10:20',method:'手工录入',prevPrice:'7.0',operator:'张明'},
|
||||
{price:'7.0',time:'2026-02-20 08:50',method:'食材验收价',prevPrice:'6.8',operator:'王芳'}
|
||||
]},
|
||||
{name:'豆腐(北)',code:'0601001',alias:'北豆腐',firstClass:'豆及豆制品',secondClass:'豆制品',icon:'🧈',edible:'100',waterRate:'82.8',dataSource:1,basePrice:'5.0',vegTypes:[
|
||||
{groupId:'g1',alias:'块类组',specAlias:'大方块',yieldRate:'96',edibleRate:'100',cutSpec:{shape:'块',length:30,width:30,height:20,technique:'直刀'}},
|
||||
@@ -526,6 +543,10 @@ const FOODS = [
|
||||
{type:'价格调整',title:'更新基础定价',time:'2026-05-12 09:30',user:'张明',role:'采购员',dept:'采购部',summary:'豆制品批发价上调。',changes:[{field:'基础定价',old:'4.5 元/100g',new:'5.0 元/100g'}]},
|
||||
{type:'编辑',title:'补充痛风人群提示',time:'2026-06-28 11:45',user:'李建国',role:'营养师',dept:'营养管理部',summary:'新增痛风急性期适量提示。',changes:[{field:'人群备注',old:'—',new:'痛风急性期适量,嘌呤含量偏高'}]},
|
||||
{type:'编辑',title:'修订矿物质数据',time:'2026-08-05 14:00',user:'陈晓燕',role:'营养师',dept:'营养管理部',summary:'对齐《中国食物成分表》修正钙、镁数据。',changes:[{field:'钙',old:'105 mg',new:'138 mg'},{field:'镁',old:'52 mg',new:'63 mg'}]}
|
||||
],
|
||||
priceHistory:[
|
||||
{price:'5.0',time:'2026-05-12 09:30',method:'食材验收价',prevPrice:'4.5',operator:'张明'},
|
||||
{price:'4.5',time:'2026-03-01 14:00',method:'手工录入',prevPrice:'4.2',operator:'王芳'}
|
||||
]}
|
||||
];
|
||||
|
||||
@@ -579,7 +600,8 @@ function renderBasicInfo(f){
|
||||
html += `<div class="profile-field"><div class="profile-field__label">可食部分</div><div class="profile-field__value">${f.edible}%</div></div>`;
|
||||
html += `<div class="profile-field"><div class="profile-field__label">水分</div><div class="profile-field__value">${f.waterRate}%</div></div>`;
|
||||
html += `<div class="profile-field"><div class="profile-field__label">数据来源</div><div class="profile-field__value">${sourceLabel}</div></div>`;
|
||||
const priceHint = f.basePrice ? `<span style="font-size:var(--font-xs);color:var(--text-placeholder);margin-left:8px;font-weight:400;">(2026-06-05 手工录入)</span>` : '';
|
||||
const ph0 = (f.priceHistory && f.priceHistory.length) ? f.priceHistory[0] : null;
|
||||
const priceHint = (f.basePrice && ph0) ? `<span style="font-size:var(--font-xs);color:var(--primary);margin-left:8px;font-weight:400;cursor:pointer;" onclick="openPriceHistoryDialog()">(${ph0.time.slice(0,10)} ${ph0.method})</span>` : '';
|
||||
html += `<div class="profile-field"><div class="profile-field__label">基础定价</div><div class="profile-field__value">${f.basePrice ? f.basePrice + ' 元/100g' : '—'}${priceHint}</div></div>`;
|
||||
let vegTypesValue;
|
||||
if(f.vegTypes && f.vegTypes.length > 0){
|
||||
@@ -1033,6 +1055,34 @@ function confirmDeleteFood(){
|
||||
closeDeleteFoodDialog();
|
||||
alert('已删除该食材');
|
||||
}
|
||||
|
||||
/* ========== 价格变更历史弹窗 ========== */
|
||||
// 打开价格变更历史弹窗,回显当前选中食材的基础定价变更记录
|
||||
function openPriceHistoryDialog(){
|
||||
var f = FOODS[currentFood];
|
||||
var list = f.priceHistory || [];
|
||||
var body = document.getElementById('priceHistoryBody');
|
||||
if(list.length===0){
|
||||
body.innerHTML = '<tr><td colspan="5" style="text-align:center;color:var(--text-placeholder);padding:40px;">暂无价格变更记录</td></tr>';
|
||||
} else {
|
||||
var rows = '';
|
||||
list.forEach(function(h){
|
||||
rows += '<tr>';
|
||||
rows += '<td>' + (h.price ? h.price + ' 元/100g' : '—') + '</td>';
|
||||
rows += '<td>' + (h.time || '—') + '</td>';
|
||||
rows += '<td>' + (h.method || '—') + '</td>';
|
||||
rows += '<td>' + (h.prevPrice ? h.prevPrice + ' 元/100g' : '—') + '</td>';
|
||||
rows += '<td>' + (h.operator || '—') + '</td>';
|
||||
rows += '</tr>';
|
||||
});
|
||||
body.innerHTML = rows;
|
||||
}
|
||||
document.getElementById('priceHistoryDialog').classList.add('open');
|
||||
}
|
||||
// 关闭价格变更历史弹窗
|
||||
function closePriceHistoryDialog(){
|
||||
document.getElementById('priceHistoryDialog').classList.remove('open');
|
||||
}
|
||||
</script>
|
||||
<!-- 食材分类管理弹窗 -->
|
||||
<div class="dialog-mask" id="categoryDialog">
|
||||
@@ -1103,5 +1153,23 @@ function confirmDeleteFood(){
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 价格变更历史弹窗 -->
|
||||
<div class="dialog-mask" id="priceHistoryDialog">
|
||||
<div class="dialog" style="width:640px;">
|
||||
<div class="dialog__header">
|
||||
<div class="dialog__title">价格变更历史</div>
|
||||
<button class="dialog__close" onclick="closePriceHistoryDialog()">✕</button>
|
||||
</div>
|
||||
<div class="dialog__body">
|
||||
<table class="cat-table">
|
||||
<thead><tr><th>价格</th><th>更新时间</th><th>更新方式</th><th>变更前价格</th><th>操作人</th></tr></thead>
|
||||
<tbody id="priceHistoryBody"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="dialog__footer">
|
||||
<button class="btn btn-default" onclick="closePriceHistoryDialog()">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# 营养用餐管理端 CHANGELOG
|
||||
|
||||
## [2026-09-21] feat: 净菜订单生成历史双维度全链路对账 + 食物成分价格变更历史弹窗
|
||||
|
||||
- `prod-clean-order-history.html` 净菜订单生成历史「数据明细」弹窗重构为餐品/食材双维度对账视图:
|
||||
- 新增维度切换 Tab(🍽️ 餐品维度 / 🥬 食材维度),弹窗加宽至 1240px 并支持横向滚动
|
||||
- 餐品维度 12 列双层分组表头:生重环节(推荐生重/下单重量/组配生重)、熟重环节(推荐熟重/烹制熟重)、取餐环节(预测人数/实际人数/取餐重量),三组分色,每个实际值下方带差异率徽标
|
||||
- 食材维度 9 列聚合表:同一食材跨餐品合并一行,采供环节(采购数量/实收数量)、加工环节(出净率显式列/净菜产出量)、组配环节(组配实际用量),毛/净口径经出净率换算桥接
|
||||
- 食材行可展开查看被哪些餐品使用、各餐品用量贡献与占比;餐品行展开子表列名同步更名
|
||||
- 新增 ING_YIELD 出净率表与 COOK_YIELD 熟成率常量,各环节数值由确定性伪随机派生;生成中订单下游环节统一「—」占位
|
||||
- 表头文案不含「AI」字样,统一用「推荐生重/推荐熟重/推荐用量」,一级分组表头不带口径后缀
|
||||
- `din-ingredient.html` 食物成分:
|
||||
- 基础定价旁的定价来源提示改为可点击入口,新增「价格变更历史」弹窗(价格/更新时间/更新方式/变更前价格/操作人)
|
||||
- FOODS 数据模型新增 priceHistory 价格变更记录数组
|
||||
|
||||
## [2026-09-14] feat: 餐品定价规格拆分为餐品规格与餐品净菜包规格
|
||||
|
||||
- `din-dish-add.html` 新增/编辑餐品:
|
||||
|
||||
@@ -76,12 +76,12 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
/* 弹窗 */
|
||||
.modal-mask{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.45);z-index:200;align-items:center;justify-content:center;}
|
||||
.modal-mask.show{display:flex;}
|
||||
.modal{background:#fff;border-radius:var(--radius-lg);width:1100px;max-width:92vw;max-height:88vh;display:flex;flex-direction:column;box-shadow:0 8px 24px rgba(0,0,0,0.15);}
|
||||
.modal{background:#fff;border-radius:var(--radius-lg);width:1240px;max-width:94vw;max-height:88vh;display:flex;flex-direction:column;box-shadow:0 8px 24px rgba(0,0,0,0.15);}
|
||||
.modal__header{display:flex;align-items:center;justify-content:space-between;padding:20px 24px 16px;border-bottom:1px solid var(--border);}
|
||||
.modal__title{font-size:var(--font-lg);font-weight:600;}
|
||||
.modal__close{width:32px;height:32px;border:none;background:none;font-size:18px;cursor:pointer;border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;color:var(--text-secondary);}
|
||||
.modal__close:hover{background:#f5f5f5;color:var(--text-primary);}
|
||||
.modal__body{padding:20px 24px;overflow-y:auto;flex:1;}
|
||||
.modal__body{padding:20px 24px;overflow-y:auto;overflow-x:auto;flex:1;}
|
||||
.modal__footer{display:flex;justify-content:flex-end;gap:8px;padding:16px 24px;border-top:1px solid var(--border);}
|
||||
/* 弹窗概要 */
|
||||
.detail-summary{display:flex;flex-wrap:wrap;gap:20px 40px;padding:14px 16px;background:#F7F9FC;border-radius:var(--radius-sm);margin-bottom:16px;}
|
||||
@@ -110,6 +110,22 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
.ing-type--main{background:var(--primary-light);color:var(--primary);}
|
||||
.ing-type--aux{background:#F6FFED;color:var(--success);}
|
||||
.ing-type--season{background:#FFF7E6;color:var(--warning);}
|
||||
/* 维度切换 Tab */
|
||||
.dim-tabs{display:flex;gap:8px;margin-bottom:14px;}
|
||||
.dim-tab{height:34px;padding:0 22px;border-radius:6px;border:1px solid var(--border);background:#fff;font-size:var(--font-sm);color:var(--text-secondary);cursor:pointer;transition:all .2s;display:inline-flex;align-items:center;gap:6px;}
|
||||
.dim-tab:hover{color:var(--primary);border-color:var(--primary);}
|
||||
.dim-tab.active{background:var(--primary);border-color:var(--primary);color:#fff;font-weight:500;}
|
||||
/* 环节分组表头(生重/熟重/取餐、采供/加工/组配 分色) */
|
||||
.dish-table thead th.th-group{font-weight:600;border-bottom:none;}
|
||||
.dish-table thead th.th-group--raw,.dish-table thead th.th-group--ing-purchase{background:#F0F7FF;color:#1D6FE8;text-align:center;}
|
||||
.dish-table thead th.th-group--cook,.dish-table thead th.th-group--ing-process{background:#FFF7E6;color:#D48806;text-align:center;}
|
||||
.dish-table thead th.th-group--pickup,.dish-table thead th.th-group--ing-combo{background:#F6FFED;color:#389E0D;text-align:center;}
|
||||
/* 预测值/实际值单元格 */
|
||||
.val{font-weight:600;}
|
||||
.val--base{color:var(--primary);}
|
||||
.val-empty{color:var(--text-placeholder);font-weight:400;}
|
||||
.val-diff{margin-top:3px;line-height:1;}
|
||||
.tag--mini{font-size:10px;padding:1px 6px;border-radius:8px;}
|
||||
/* 空态 */
|
||||
.empty-state{text-align:center;color:var(--text-placeholder);padding:60px 0;font-size:var(--font-sm);}
|
||||
.empty-state .icon{font-size:40px;display:block;margin-bottom:12px;}
|
||||
@@ -140,7 +156,7 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
<div class="page-header">
|
||||
<div class="page-header__left">
|
||||
<span class="page-header__title">净菜订单生成历史</span>
|
||||
<span class="page-header__desc">自动生成的净菜订单记录,点击「数据明细」查看餐品与食材用量对比</span>
|
||||
<span class="page-header__desc">自动生成的净菜订单记录,点击「数据明细」按餐品/食材双维度追溯下单、组配、烹制、取餐各环节准确性</span>
|
||||
</div>
|
||||
<div class="page-header__right">
|
||||
<a class="btn btn-default" href="prod-clean-order.html">← 返回净菜订单</a>
|
||||
@@ -196,10 +212,52 @@ tbody tr:hover{background:#F8FBFF;}
|
||||
</div>
|
||||
<div class="modal__body">
|
||||
<div class="detail-summary" id="detailSummary"></div>
|
||||
<table class="dish-table">
|
||||
<thead><tr><th style="width:28px;"></th><th>餐次</th><th>餐品名称</th><th>规格</th><th>就餐人数</th><th>打包份数</th><th>内配料</th><th>AI 推荐生重(kg)</th><th>AI 推荐熟重(kg)</th><th>实际制作量(kg)</th><th>差异率</th></tr></thead>
|
||||
<tbody id="detailDishBody"></tbody>
|
||||
</table>
|
||||
<div class="dim-tabs">
|
||||
<button class="dim-tab active" id="tabDish" onclick="switchDim('dish')">🍽️ 餐品维度</button>
|
||||
<button class="dim-tab" id="tabIng" onclick="switchDim('ing')">🥬 食材维度</button>
|
||||
</div>
|
||||
<div id="dimDishWrap">
|
||||
<table class="dish-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:28px;" rowspan="2"></th>
|
||||
<th rowspan="2">餐次</th>
|
||||
<th rowspan="2">餐品名称</th>
|
||||
<th rowspan="2">规格</th>
|
||||
<th colspan="3" class="th-group th-group--raw">生重环节</th>
|
||||
<th colspan="2" class="th-group th-group--cook">熟重环节</th>
|
||||
<th colspan="3" class="th-group th-group--pickup">取餐环节</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>推荐生重(kg)</th><th>下单重量(kg)</th><th>组配生重(kg)</th>
|
||||
<th>推荐熟重(kg)</th><th>烹制熟重(kg)</th>
|
||||
<th>预测人数</th><th>实际人数</th><th>取餐重量(kg)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="detailDishBody"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="dimIngWrap" style="display:none;">
|
||||
<table class="dish-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:28px;" rowspan="2"></th>
|
||||
<th rowspan="2">食材名称</th>
|
||||
<th rowspan="2">类别</th>
|
||||
<th rowspan="2">推荐用量(kg·净)</th>
|
||||
<th colspan="2" class="th-group th-group--ing-purchase">采供环节</th>
|
||||
<th colspan="2" class="th-group th-group--ing-process">加工环节</th>
|
||||
<th class="th-group th-group--ing-combo">组配环节</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>采购数量(kg·毛)</th><th>实收数量(kg·毛)</th>
|
||||
<th>出净率</th><th>净菜产出量(kg·净)</th>
|
||||
<th>组配实际用量(kg·净)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="detailIngBody"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal__footer">
|
||||
<button class="btn btn-default" onclick="closeDetail()">关闭</button>
|
||||
@@ -240,6 +298,11 @@ var recipeBom={
|
||||
'酸奶':[{name:'酸奶',type:'主材',perServing:200}]
|
||||
};
|
||||
var ING_TYPE_CLS={'主材':'ing-type--main','辅材':'ing-type--aux','调料':'ing-type--season'};
|
||||
/* 食材出净率(毛菜→净菜换算桥梁,食材维度显式露出) */
|
||||
var ING_YIELD={'鸡胸肉':0.88,'花生米':0.98,'黄瓜':0.85,'干辣椒':1,'葱姜蒜':0.9,'鲈鱼':0.82,'姜片':0.9,'葱丝':0.9,'五花肉':0.88,'酱油':1,'冰糖':1,'八角':1,'嫩豆腐':0.95,'肉末':0.9,'豆瓣酱':1,'花椒':1,'番茄':0.92,'鸡蛋':0.98,'葱花':0.9,'西兰花':0.82,'胡萝卜':0.88,'大蒜':0.88,'小米':1,'清水':1,'大米':1,'黄豆':1,'面粉':1,'酵母':1,'猪里脊':0.9,'木耳':1,'青椒':0.88,'猪排骨':0.85,'白糖':1,'香醋':1,'紫菜':1,'冬瓜':0.85,'酸奶':1,'茶叶':1};
|
||||
/* AI 预测熟成率(生重→熟重) */
|
||||
var COOK_YIELD=0.85;
|
||||
function round2(n){return parseFloat(n.toFixed(2));}
|
||||
|
||||
/* ========== 净菜订单生成历史数据(订单维度,一个订单可含多个餐次) ========== */
|
||||
var genOrders=[
|
||||
@@ -341,14 +404,26 @@ function nameHash(s){
|
||||
for(var i=0;i<s.length;i++){h=(h*31+s.charCodeAt(i))%1000;}
|
||||
return h;
|
||||
}
|
||||
/* ========== 派生:为订单每个餐品补齐食材明细与推荐/实际数值 ========== */
|
||||
/* ========== 派生:为订单每个餐品补齐双维度全链路数据 ========== */
|
||||
/* 餐品维度:AI 预测双值(生重/熟重)+ 下单/组配/烹制/取餐各环节实际值 */
|
||||
function deriveDetail(order){
|
||||
var generating=order.genStatus==='generating';
|
||||
return order.details.map(function(d){
|
||||
var bom=recipeBom[d.foodName]||[];
|
||||
var baseRatio=d.actualRatio!=null?d.actualRatio:(order.actualRatio||1);
|
||||
var perDishGram=bom.reduce(function(s,i){return s+i.perServing;},0);
|
||||
var recRaw=parseFloat((perDishGram*d.servings/1000).toFixed(2));
|
||||
var recCooked=parseFloat((recRaw*0.85).toFixed(2));
|
||||
var recCooked=parseFloat((recRaw*COOK_YIELD).toFixed(2));
|
||||
/* 下游环节实际值:生成中订单环节未发生,置 null 由展示层占位 */
|
||||
var orderWeight=null,comboRaw=null,cookCooked=null,actualDiner=null,pickupWeight=null;
|
||||
if(!generating){
|
||||
var seed=nameHash(d.foodName+d.meal);
|
||||
orderWeight=round2(recRaw*(1+(seed%9-4)/100));
|
||||
comboRaw=round2(orderWeight*(1+((seed>>2)%9-4)/100));
|
||||
cookCooked=round2(comboRaw*(COOK_YIELD+((seed>>3)%7-3)/100));
|
||||
actualDiner=Math.round(d.dinerCount*(1+((seed>>4)%11-5)/100));
|
||||
pickupWeight=round2(cookCooked*(0.88+(seed>>5)%7/100));
|
||||
}
|
||||
var ingredients=bom.map(function(ing){
|
||||
var ingRec=parseFloat((ing.perServing*d.servings/1000).toFixed(3));
|
||||
var offset=(nameHash(ing.name)%13-6)/100;
|
||||
@@ -356,14 +431,44 @@ function deriveDetail(order){
|
||||
var ingAct=parseFloat((ingRec*ingRatio).toFixed(3));
|
||||
return {name:ing.name,type:ing.type,perServing:ing.perServing,rec:ingRec,act:ingAct};
|
||||
});
|
||||
var actRaw=parseFloat(ingredients.reduce(function(s,i){return s+i.act;},0).toFixed(2));
|
||||
return {
|
||||
meal:d.meal,foodName:d.foodName,spec:d.spec,dinerCount:d.dinerCount,servings:d.servings,needSeasoning:d.needSeasoning,
|
||||
recRaw:recRaw,recCooked:recCooked,actRaw:actRaw,ingredients:ingredients
|
||||
recRaw:recRaw,recCooked:recCooked,
|
||||
orderWeight:orderWeight,comboRaw:comboRaw,cookCooked:cookCooked,actualDiner:actualDiner,pickupWeight:pickupWeight,
|
||||
ingredients:ingredients
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/* 食材维度:同一食材跨餐品合并一行,链路覆盖 AI 用量→采购/实收(毛)→净菜产出(净)→组配实际(净) */
|
||||
function deriveIngredients(order){
|
||||
var generating=order.genStatus==='generating';
|
||||
var map={};
|
||||
deriveDetail(order).forEach(function(d){
|
||||
d.ingredients.forEach(function(ing){
|
||||
if(!map[ing.name]){
|
||||
map[ing.name]={name:ing.name,type:ing.type,aiUsed:0,seed:nameHash(ing.name),
|
||||
yieldRate:ING_YIELD[ing.name]!=null?ING_YIELD[ing.name]:0.9,usedBy:[]};
|
||||
}
|
||||
map[ing.name].aiUsed=parseFloat((map[ing.name].aiUsed+ing.rec).toFixed(3));
|
||||
map[ing.name].usedBy.push({meal:d.meal,foodName:d.foodName,qty:ing.rec});
|
||||
});
|
||||
});
|
||||
return Object.keys(map).map(function(k){
|
||||
var m=map[k],ai=m.aiUsed;
|
||||
if(!generating){
|
||||
var safety=1+(m.seed%7)/100; /* 采购安全余量 0~6% */
|
||||
m.purchase=parseFloat((ai/m.yieldRate*safety).toFixed(3)); /* 采购(毛)=净用量按出净率反推 */
|
||||
m.received=parseFloat((m.purchase*(1-(m.seed%4)/100)).toFixed(3)); /* 实收(毛)含收货损耗 0~3% */
|
||||
m.netOut=parseFloat((m.received*m.yieldRate).toFixed(3)); /* 净菜产出(净)=实收×出净率 */
|
||||
m.comboUsed=parseFloat((ai*(1+(m.seed%13-6)/100)).toFixed(3)); /* 组配实际(净)±6% */
|
||||
}else{
|
||||
m.purchase=m.received=m.netOut=m.comboUsed=null;
|
||||
}
|
||||
return m;
|
||||
});
|
||||
}
|
||||
|
||||
/* ========== 差异率 ========== */
|
||||
function diffInfo(act,rec){
|
||||
if(!rec)return {cls:'flat',text:'— 持平'};
|
||||
@@ -503,37 +608,100 @@ function openDetail(orderNo){
|
||||
summary+='<div class="detail-summary__item"><span class="detail-summary__label">创建人</span><span class="detail-summary__value">'+o.creator+'</span></div>';
|
||||
summary+='<div class="detail-summary__item"><span class="detail-summary__label">菜品种类</span><span class="detail-summary__value">'+distinctDishCount(o)+'</span></div>';
|
||||
document.getElementById('detailSummary').innerHTML=summary;
|
||||
/* 餐品列表 */
|
||||
var details=deriveDetail(o);
|
||||
/* 双维度渲染并重置回餐品维度 Tab */
|
||||
renderDishRows(deriveDetail(o));
|
||||
renderIngRows(deriveIngredients(o));
|
||||
switchDim('dish');
|
||||
document.getElementById('modal-detail').classList.add('show');
|
||||
}
|
||||
function closeDetail(){document.getElementById('modal-detail').classList.remove('show');}
|
||||
|
||||
/* ========== 维度切换 ========== */
|
||||
function switchDim(dim){
|
||||
document.getElementById('tabDish').classList.toggle('active',dim==='dish');
|
||||
document.getElementById('tabIng').classList.toggle('active',dim==='ing');
|
||||
document.getElementById('dimDishWrap').style.display=dim==='dish'?'':'none';
|
||||
document.getElementById('dimIngWrap').style.display=dim==='ing'?'':'none';
|
||||
}
|
||||
|
||||
/* ========== 数值 + 差异徽标单元格(生成中环节未发生时占位 —) ========== */
|
||||
function stageCell(val,rec){
|
||||
if(val==null)return '<td><span class="val-empty">—</span></td>';
|
||||
var diff=diffInfo(val,rec);
|
||||
return '<td><div class="val">'+val.toFixed(2)+'</div><div class="val-diff"><span class="tag tag--mini '+diff.cls+'">'+diff.text+'</span></div></td>';
|
||||
}
|
||||
function dinerCell(actual,plan){
|
||||
if(actual==null)return '<td><span class="val-empty">—</span></td>';
|
||||
var diff=diffInfo(actual,plan);
|
||||
return '<td><div class="val">'+actual+'</div><div class="val-diff"><span class="tag tag--mini '+diff.cls+'">'+diff.text+'</span></div></td>';
|
||||
}
|
||||
function ingStageCell(val,rec){
|
||||
if(val==null||rec==null)return '<td><span class="val-empty">—</span></td>';
|
||||
var diff=diffInfo(val,rec);
|
||||
return '<td><div class="val">'+val.toFixed(3)+'</div><div class="val-diff"><span class="tag tag--mini '+diff.cls+'">'+diff.text+'</span></div></td>';
|
||||
}
|
||||
function plainCell(val){
|
||||
if(val==null)return '<td><span class="val-empty">—</span></td>';
|
||||
return '<td><div class="val">'+val.toFixed(3)+'</div></td>';
|
||||
}
|
||||
|
||||
/* ========== 餐品维度表:生重生、熟重熟分开对账 ========== */
|
||||
function renderDishRows(details){
|
||||
var html='';
|
||||
details.forEach(function(d){
|
||||
var seasonTag=d.needSeasoning?'<span class="tag tag-blue">✓ 是</span>':'<span class="tag tag-gray">✗ 否</span>';
|
||||
var diff=diffInfo(d.actRaw,d.recRaw);
|
||||
html+='<tr class="dish-row" onclick="toggleIng(this)">';
|
||||
html+='<td><span class="expand-arrow">▶</span></td>';
|
||||
html+='<td><span class="tag tag-blue">'+d.meal+'</span></td>';
|
||||
html+='<td style="font-weight:600;">'+d.foodName+'</td>';
|
||||
html+='<td>'+d.spec+'</td>';
|
||||
html+='<td>'+d.dinerCount+'</td>';
|
||||
html+='<td>'+d.servings+'</td>';
|
||||
html+='<td>'+seasonTag+'</td>';
|
||||
html+='<td><b>'+d.recRaw.toFixed(2)+'</b></td>';
|
||||
html+='<td>'+d.recCooked.toFixed(2)+'</td>';
|
||||
html+='<td><b>'+d.actRaw.toFixed(2)+'</b></td>';
|
||||
html+='<td><span class="tag '+diff.cls+'">'+diff.text+'</span></td>';
|
||||
/* 生重环节 */
|
||||
html+='<td><span class="val val--base">'+d.recRaw.toFixed(2)+'</span></td>';
|
||||
html+=stageCell(d.orderWeight,d.recRaw);
|
||||
html+=stageCell(d.comboRaw,d.recRaw);
|
||||
/* 熟重环节 */
|
||||
html+='<td><span class="val val--base">'+d.recCooked.toFixed(2)+'</span></td>';
|
||||
html+=stageCell(d.cookCooked,d.recCooked);
|
||||
/* 取餐环节 */
|
||||
html+='<td><span class="val">'+d.dinerCount+'</span></td>';
|
||||
html+=dinerCell(d.actualDiner,d.dinerCount);
|
||||
html+=stageCell(d.pickupWeight,d.recCooked);
|
||||
html+='</tr>';
|
||||
html+='<tr class="ingredient-row" style="display:none;">';
|
||||
html+='<td colspan="11">'+buildIngredientsDetail(d)+'</td>';
|
||||
html+='<td colspan="12">'+buildIngredientsDetail(d)+'</td>';
|
||||
html+='</tr>';
|
||||
});
|
||||
document.getElementById('detailDishBody').innerHTML=html;
|
||||
document.getElementById('modal-detail').classList.add('show');
|
||||
}
|
||||
function closeDetail(){document.getElementById('modal-detail').classList.remove('show');}
|
||||
|
||||
/* ========== 食材维度表:跨餐品合并一行,毛/净口径沿链路对账 ========== */
|
||||
function renderIngRows(ings){
|
||||
var html='';
|
||||
ings.forEach(function(m){
|
||||
html+='<tr class="dish-row" onclick="toggleIng(this)">';
|
||||
html+='<td><span class="expand-arrow">▶</span></td>';
|
||||
html+='<td style="font-weight:600;">'+m.name+'</td>';
|
||||
var cls=ING_TYPE_CLS[m.type]||'';
|
||||
html+='<td><span class="ing-type '+cls+'">'+m.type+'</span></td>';
|
||||
html+='<td><span class="val val--base">'+m.aiUsed.toFixed(3)+'</span></td>';
|
||||
/* 采供环节:采购(链路起点)+ 实收 vs 采购(收货损耗) */
|
||||
html+=plainCell(m.purchase);
|
||||
html+=ingStageCell(m.received,m.purchase);
|
||||
/* 加工环节:出净率 + 净菜产出 */
|
||||
html+='<td><span class="val">'+(m.received!=null?(m.yieldRate*100).toFixed(0)+'%':'—')+'</span></td>';
|
||||
html+=plainCell(m.netOut);
|
||||
/* 组配环节:实际用量 vs AI 生成用量(核心对账) */
|
||||
html+=ingStageCell(m.comboUsed,m.aiUsed);
|
||||
html+='</tr>';
|
||||
html+='<tr class="ingredient-row" style="display:none;">';
|
||||
html+='<td colspan="9">'+buildUsedByDetail(m)+'</td>';
|
||||
html+='</tr>';
|
||||
});
|
||||
document.getElementById('detailIngBody').innerHTML=html;
|
||||
}
|
||||
document.querySelector('.modal-mask').addEventListener('click',function(e){if(e.target===this)closeDetail();});
|
||||
|
||||
function buildIngredientsDetail(d){
|
||||
var html='<table class="ing-table"><thead><tr><th>食材名称</th><th>类别</th><th>每份用量(g)</th><th>AI 推荐总量(kg)</th><th>实际用量(kg)</th><th>差异率</th></tr></thead><tbody>';
|
||||
var html='<table class="ing-table"><thead><tr><th>食材名称</th><th>类别</th><th>每份用量(g)</th><th>推荐总量(kg)</th><th>组配实际用量(kg)</th><th>差异率</th></tr></thead><tbody>';
|
||||
d.ingredients.forEach(function(ing){
|
||||
var cls=ING_TYPE_CLS[ing.type]||'';
|
||||
var diff=diffInfo(ing.act,ing.rec);
|
||||
@@ -549,6 +717,20 @@ function buildIngredientsDetail(d){
|
||||
html+='</tbody></table>';
|
||||
return html;
|
||||
}
|
||||
/* 食材维度展开:该食材被哪些餐品使用(AI 用量贡献与占比) */
|
||||
function buildUsedByDetail(m){
|
||||
var html='<table class="ing-table"><thead><tr><th>餐次</th><th>使用餐品</th><th>用量贡献(kg)</th><th>占比</th></tr></thead><tbody>';
|
||||
m.usedBy.forEach(function(u){
|
||||
html+='<tr>';
|
||||
html+='<td>'+u.meal+'</td>';
|
||||
html+='<td>'+u.foodName+'</td>';
|
||||
html+='<td>'+u.qty.toFixed(3)+'</td>';
|
||||
html+='<td>'+(u.qty/m.aiUsed*100).toFixed(1)+'%</td>';
|
||||
html+='</tr>';
|
||||
});
|
||||
html+='</tbody></table>';
|
||||
return html;
|
||||
}
|
||||
function toggleIng(tr){
|
||||
var next=tr.nextElementSibling;
|
||||
var arrow=tr.querySelector('.expand-arrow');
|
||||
|
||||
Reference in New Issue
Block a user