diff --git a/app.html b/app.html index d7ed1f6..3705014 100644 --- a/app.html +++ b/app.html @@ -149,7 +149,11 @@ function rDB(){ },300); } -function rVL(){var c=document.getElementById("vlc");if(!c)return;var a=getA(),td=new Date().toISOString().split("T")[0],av=[];a.forEach(function(x){if(!x.violations)return;x.violations.forEach(function(v){var dd=v.date||"",dn=v.done&&v.done.trim();var st="pending";if(dn)st="done";else if(dd&&dd
"+av.length+"
Всего
"+av.filter(function(v){return v.st==="done"}).length+"
Устранено
"+av.filter(function(v){return v.st==="overdue"}).length+"
Просрочено
"+av.filter(function(v){return v.st==="pending"}).length+"
В работе
"+(av.length>0?""+av.map(function(v,i){var sc=v.st==="done"?"bs":v.st==="overdue"?"bd2":"bw";var sl=v.st==="done"?"Устранено":v.st==="overdue"?"Просрочено":"В работе";return""}).join("")+"
НесоответствиеАудитИсполнительМерыСрокСтатус
"+(i+1)+""+v.nc+""+v.ad+""+v.ex+""+(v.ms||"—")+""+(v.dt||"—")+""+sl+"
":"

Несоответствий не найдено

")} +function rVL(){var c=document.getElementById("vlc");if(!c)return;var a=getA(),td=new Date().toISOString().split("T")[0],av=[]; + a.forEach(function(x){ + if(x.violations&&x.violations.length>0){x.violations.forEach(function(v){var dd=v.date||"",dn=v.done&&v.done.trim();var st="pending";if(dn)st="done";else if(dd&&dd0&&x.categories){Object.values(x.categories).forEach(function(cat){if(cat.items)cat.items.forEach(function(it){av.push({nc:it.item+" ("+x.location+")",ex:x.observer,ms:"",rs:"",dt:"",dn:"",st:"info",ad:x.date,an:x.number||"—"})})})} + });c.innerHTML="
"+av.length+"
Всего
"+av.filter(function(v){return v.st==="done"}).length+"
Устранено
"+av.filter(function(v){return v.st==="overdue"}).length+"
Просрочено
"+av.filter(function(v){return v.st==="pending"}).length+"
В работе
"+(av.length>0?""+av.map(function(v,i){var sc=v.st==="done"?"bs":v.st==="overdue"?"bd2":"bw";var sl=v.st==="done"?"Устранено":v.st==="overdue"?"Просрочено":"В работе";return""}).join("")+"
НесоответствиеАудитИсполнительМерыСрокСтатус
"+(i+1)+""+v.nc+""+v.ad+""+v.ex+""+(v.ms||"—")+""+(v.dt||"—")+""+sl+"
":"

Несоответствий не найдено

")} function rHS(){var a=getA(),tb=document.getElementById("hbd");if(!tb)return;tb.innerHTML=a.length===0?"Нет записей":a.map(function(x){var ab=isA()?"✏️ ":"чтение";return""+(x.number||"—")+""+x.date+""+x.location+""+x.observer+""+(x.overallSafe?"Безопасно":"Нарушения")+""+(x.totalViolations||0)+""+ab+""}).join("")} @@ -162,6 +166,7 @@ function submitAudit(){ var audits=getA();if(editId){audits=audits.map(function(a){return a.id===editId?e:a});editId=null}else{audits.unshift(e)}saveA(audits);lastSubmitted=e; document.getElementById("sd").innerHTML="Бланк №"+(e.number||"—")+" | "+e.date+" | "+(e.overallSafe?"БЕЗОПАСНО":"НАРУШЕНИЙ: "+e.totalViolations);document.getElementById("fs").style.display="block";setTimeout(function(){document.getElementById("fs").style.display="none"},20000); resetF(); + rVL(); } function resetF(){