diff --git a/index.html b/index.html
index 07f36ce..1e420fd 100644
--- a/index.html
+++ b/index.html
@@ -238,6 +238,7 @@ body{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,s
Новый аудит
Мой график
Дашборд
+ Нарушения
История
@@ -324,6 +325,10 @@ body{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,s
+ |
+
+
+
@@ -332,6 +337,10 @@ body{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,s
+ с
+
+ по
+
@@ -356,6 +365,28 @@ body{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,s
+
+
+
+
+
+
+
+
+
+
+ | № | Несоответствие | Аудит (дата) | Исполнитель | Вид | Меры | Ответственный | Срок | Завершение | Статус |
+
+
+
+
✅Несоответствий не найдено
+
+
@@ -701,6 +732,7 @@ function switchPanel(name,el){
if(name==='dashboard')renderDashboard();
if(name==='history')renderHistory();
if(name==='mySchedule')renderMySchedule();
+ if(name==='violations')renderViolations();
}
// ========== DASHBOARD ==========
@@ -742,6 +774,12 @@ function renderDashboard(){
return true;
});
+ // Date range filter
+ const df=document.getElementById('dfDateFrom')?.value;
+ const dt=document.getElementById('dfDateTo')?.value;
+ if(df)audits=audits.filter(a=>a.date>=df);
+ if(dt)audits=audits.filter(a=>a.date<=dt);
+
const total=audits.length;
const allSafe=audits.filter(a=>a.overallSafe).length;
const withDanger=audits.filter(a=>!a.overallSafe).length;
@@ -857,7 +895,8 @@ function exportCSV(){
// ========== ADMIN DOWNLOADS ==========
function downloadFullCSV(){
- const audits=getAudits();if(audits.length===0){alert('Нет данных');return}
+ const {audits,all}=getDashboardFilters();
+ if(audits.length===0){alert('Нет данных');return}
const all=getAllUsers();
const header='Бланк №;Дата;Время;Место;Тип работы;Наблюдатель;Должность;Руководитель;Филиал;Подразделение;Регион;Область;Город;Статус;Нарушений;Категории с нарушениями';
const rows=audits.map(a=>{
@@ -869,7 +908,8 @@ function downloadFullCSV(){
}
function downloadWorkerReport(){
- const all=getAllUsers();const audits=getAudits();const userList=Object.entries(all).filter(([l])=>l!=='admin');
+ const {audits}=getDashboardFilters();
+ const all=getAllUsers();const userList=Object.entries(all).filter(([l])=>l!=='admin');
if(userList.length===0){alert('Нет зарегистрированных работников');return}
const header='Логин;ФИО;Должность;Филиал;Подразделение;Регион;Область;Город;Email;График;Период;Выполнено;Нужно;Статус';
const rows=userList.map(([login,u])=>{
@@ -883,7 +923,8 @@ function downloadWorkerReport(){
}
function downloadSummaryHTML(){
- const audits=getAudits();const all=getAllUsers();const userList=Object.entries(all).filter(([l])=>l!=='admin');
+ const {audits}=getDashboardFilters();
+ const all=getAllUsers();const userList=Object.entries(all).filter(([l])=>l!=='admin');
const total=audits.length;const allSafe=audits.filter(a=>a.overallSafe).length;
const withDanger=audits.filter(a=>!a.overallSafe).length;const totalVio=audits.reduce((s,a)=>s+(a.totalViolations||0),0);
@@ -944,6 +985,112 @@ tr:hover td{background:#F2F4F7}