Поле для ссылок на документы и прикрепления файлов
This commit is contained in:
parent
a127271971
commit
8de0864b6b
10
app.html
10
app.html
@ -87,7 +87,7 @@ body{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,s
|
||||
<div class="fg" style="margin-top:14px"><label>Отметка БиОТ ДПБ</label><div class="ot"><div class="tb sel" id="os" onclick="setO('safe')">✅ ВСЕ БЕЗОПАСНО</div><div class="tb dng" id="od" onclick="setO('danger')">☐ ЕСТЬ ОПАСНО</div></div></div></div>
|
||||
<div id="cats"></div>
|
||||
<div class="vb"><h3>📄 Несоответствия и меры</h3><div class="vg hr" style="display:grid"><span>№</span><span>Несоответствие</span><span>Исполнитель</span><span>Вид</span><span>Меры</span><span>Ответственный</span><span>Дата</span><span>Завершение</span><span></span></div><div id="vr"></div><button class="btn bo bs" onclick="addVio()" style="margin-top:8px">+ Добавить</button></div>
|
||||
<div class="vb"><h3>💬 Итог диалога</h3><p style="font-size:12px;color:var(--g5);margin-bottom:14px">Результаты беседы</p><div class="cl2 c1"><div class="ci"><input type="checkbox" id="d0"><div><label for="d0">Работник привёл примеры безопасных действий</label></div></div><div class="ci"><input type="checkbox" id="d1"><div><label for="d1">Были обсуждены риски / проблемы</label></div></div><div class="ci"><input type="checkbox" id="d2"><div><label for="d2">Определены корректирующие меры</label></div></div><div class="ci"><input type="checkbox" id="d3"><div><label for="d3">Предложения работника зафиксированы</label></div></div><div class="ci"><input type="checkbox" id="d4"><div><label for="d4">Другое</label><input class="oi" id="do" placeholder="Укажите..."></div></div></div><div style="margin-top:14px;padding:12px;background:var(--g1);border-radius:var(--r);font-size:12px;color:var(--g5)">📎 Фото и документы — приложите к бумажному бланку.</div></div>
|
||||
<div class="vb"><h3>💬 Итог диалога</h3><p style="font-size:12px;color:var(--g5);margin-bottom:14px">Результаты беседы</p><div class="cl2 c1"><div class="ci"><input type="checkbox" id="d0"><div><label for="d0">Работник привёл примеры безопасных действий</label></div></div><div class="ci"><input type="checkbox" id="d1"><div><label for="d1">Были обсуждены риски / проблемы</label></div></div><div class="ci"><input type="checkbox" id="d2"><div><label for="d2">Определены корректирующие меры</label></div></div><div class="ci"><input type="checkbox" id="d3"><div><label for="d3">Предложения работника зафиксированы</label></div></div><div class="ci"><input type="checkbox" id="d4"><div><label for="d4">Другое</label><input class="oi" id="do" placeholder="Укажите..."></div></div></div><div class="vb"><h3>📎 Фото и документы</h3><div class="fg"><label>Ссылки на документы (Google Drive, SharePoint и др.)</label><textarea id="pdoc" placeholder="Вставьте ссылки на фото, сканы документов, протоколы..."></textarea></div><div class="fg"><label>Прикрепить файлы с компьютера</label><input type="file" id="pfiles" multiple accept="image/*,.pdf,.doc,.docx" onchange="showFileNames()" style="padding:8px"><div id="fileNames" style="font-size:12px;color:var(--g5);margin-top:6px"></div></div></div>
|
||||
<div class="fa2"><button class="btn bp" onclick="submitAudit()">💾 Сохранить</button><button class="btn bo" onclick="resetF()">🗑️ Очистить</button></div>
|
||||
<div class="fs" id="fs"><div style="font-size:28px;margin-bottom:6px">✅</div><div style="font-size:18px;font-weight:800;margin-bottom:8px">Аудит успешно отправлен!</div><div id="sd" style="font-size:14px;color:var(--ink);margin-bottom:14px"></div><div style="display:flex;gap:10px;flex-wrap:wrap;justify-content:center"><button class="btn bo bs" onclick="printConfirm()">🖨️ Распечатать</button></div></div>
|
||||
</div>
|
||||
@ -132,6 +132,8 @@ var vioHTML="";for(var i=0;i<vrc;i++)vioHTML+=mkV(i+1);document.getElementById("
|
||||
document.getElementById("vr").onclick=function(e){if(e.target.classList.contains("rvb")){var n=parseInt(e.target.getAttribute("data-row"));removeVR(n)}};
|
||||
document.getElementById("d4").onchange=function(){var o=document.getElementById("do");o.style.display=this.checked?"block":"none";o.classList.toggle("vs",this.checked)};
|
||||
|
||||
function showFileNames(){var f=document.getElementById("pfiles");var d=document.getElementById("fileNames");if(!f||!d)return;var names=[];for(var i=0;i<f.files.length;i++)names.push(f.files[i].name);d.textContent=names.length>0?"📄 "+names.join(", "):""}
|
||||
|
||||
function setO(t){var os=document.getElementById("os"),od=document.getElementById("od");if(!os||!od)return;if(t==="safe"){os.style.background="#EDF7F0";os.style.borderColor="#2D6A4F";os.style.color="#2D6A4F";os.textContent="✅ ВСЕ БЕЗОПАСНО";od.style.background="#fff";od.style.borderColor="#E2E6EB";od.style.color="#5B6573";od.textContent="☐ ЕСТЬ ОПАСНО"}else{os.style.background="#fff";os.style.borderColor="#E2E6EB";os.style.color="#5B6573";os.textContent="☐ ВСЕ БЕЗОПАСНО";od.style.background="#FFEBED";od.style.borderColor="#E63946";od.style.color="#E63946";od.textContent="⚠️ ЕСТЬ ОПАСНО"}}
|
||||
function toggleAllSafe(id){var cb=document.getElementById("ascb-"+id),tog=document.getElementById("as-"+id);if(!cb||!tog)return;var is=!cb.checked;cb.checked=is;if(is){tog.classList.add("ac2");var cat=CATS.find(function(c){return c.id===id});if(cat)cat.items.forEach(function(_,i){var e=document.getElementById("cb-"+id+"-"+i);if(e){e.checked=false;e.parentElement.classList.remove("ck")}var o=document.getElementById("other-"+id);if(o){o.style.display="none";o.classList.remove("vs")}})}else{tog.classList.remove("ac2")}updateCatTotal(id)}
|
||||
function onCheckItem(id,idx){var cb=document.getElementById("cb-"+id+"-"+idx);if(!cb)return;if(cb.checked){cb.parentElement.classList.add("ck");document.getElementById("ascb-"+id).checked=false;document.getElementById("as-"+id).classList.remove("ac2")}else{cb.parentElement.classList.remove("ck")}var cat=CATS.find(function(c){return c.id===id});if(cat&&cat.items[idx]==="Другое"){var o=document.getElementById("other-"+id);if(o){if(cb.checked){o.style.display="block";o.classList.add("vs")}else{o.style.display="none";o.classList.remove("vs")}}}updateCatTotal(id)}
|
||||
@ -143,8 +145,8 @@ function getVR(){var rs=[];document.querySelectorAll("#vr .vg").forEach(function
|
||||
function getDL(){var r=[];["Работник привёл примеры безопасных действий","Были обсуждены риски / проблемы","Определены корректирующие меры","Предложения работника зафиксированы","Другое"].forEach(function(l,i){var cb=document.getElementById("d"+i);if(cb&&cb.checked)r.push({item:l,other:l==="Другое"?document.getElementById("do").value.trim()||"":null})});return r}
|
||||
function setDL(items){for(var i=0;i<5;i++){var cb=document.getElementById("d"+i);if(cb)cb.checked=false}var o=document.getElementById("do");if(o){o.value="";o.style.display="none";o.classList.remove("vs")}items.forEach(function(di){var idx=["Работник привёл примеры безопасных действий","Были обсуждены риски / проблемы","Определены корректирующие меры","Предложения работника зафиксированы","Другое"].indexOf(di.item);if(idx>=0){var cb=document.getElementById("d"+idx);if(cb){cb.checked=true;if(di.item==="Другое"&&di.other){var oo=document.getElementById("do");oo.value=di.other;oo.style.display="block";oo.classList.add("vs")}}}})}
|
||||
|
||||
function submitAudit(){if(editId&&!isA()){alert("Только администратор");return}var loc=document.getElementById("pl").value.trim();if(!loc){alert("Укажите место");return}var cats={},tv=0;CATS.forEach(function(cat){var ch=[];cat.items.forEach(function(item,i){var cb=document.getElementById("cb-"+cat.id+"-"+i);if(cb&&cb.checked){var ov=item==="Другое"?(document.getElementById("other-"+cat.id).value.trim()||""):null;ch.push({item:item,other:ov})}});cats[cat.id]={items:ch,allSafe:ch.length===0};tv+=ch.length});var e={id:editId||Date.now(),number:document.getElementById("pn").value.trim(),date:document.getElementById("pd").value,timeStart:document.getElementById("ps").value,timeEnd:document.getElementById("pe").value,location:loc,region:document.getElementById("pr").value,workType:document.getElementById("pw").value.trim(),workerCount:parseInt(document.getElementById("pc").value)||1,observer:document.getElementById("po").value.trim()||U.name,observerRole:document.getElementById("por").value.trim(),supervisor:document.getElementById("psv").value.trim(),supervisorRole:document.getElementById("psr").value.trim(),email:document.getElementById("pem").value.trim()||U.email||"",overallSafe:document.getElementById("os").classList.contains("sel"),categories:cats,totalViolations:tv,violations:getVR(),dialogue:getDL(),createdBy:U.login,createdAt:new Date().toISOString()};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;resetF();document.getElementById("sd").innerHTML="<b>Бланк №"+(e.number||"—")+"</b> | "+e.date+" | <b>"+(e.overallSafe?"БЕЗОПАСНО":"НАРУШЕНИЙ: "+e.totalViolations)+"</b>";document.getElementById("fs").style.display="block";setTimeout(function(){document.getElementById("fs").style.display="none"},30000);if(!isA())checkSA()}
|
||||
function resetF(){document.getElementById("pn").value="";document.getElementById("pd").value=new Date().toISOString().split("T")[0];document.getElementById("ps").value="";document.getElementById("pe").value="";document.getElementById("pl").value="";document.getElementById("pr").value=U.region||"";document.getElementById("pw").value="";document.getElementById("pc").value="1";document.getElementById("po").value=U.name;document.getElementById("por").value="";document.getElementById("psv").value="";document.getElementById("psr").value="";document.getElementById("pem").value=U.email||"";setO("safe");editId=null;CATS.forEach(function(cat){document.getElementById("ascb-"+cat.id).checked=true;document.getElementById("as-"+cat.id).classList.add("ac2");cat.items.forEach(function(_,i){var cb=document.getElementById("cb-"+cat.id+"-"+i);if(cb){cb.checked=false;cb.parentElement.classList.remove("ck")}var o=document.getElementById("other-"+cat.id);if(o){o.value="";o.style.display="none";o.classList.remove("vs")}});updateCatTotal(cat.id)});document.getElementById("vr").innerHTML="";vrc=6;for(var i=0;i<vrc;i++)document.getElementById("vr").innerHTML+=mkV(i+1);setDL([]);return true}
|
||||
function submitAudit(){if(editId&&!isA()){alert("Только администратор");return}var loc=document.getElementById("pl").value.trim();if(!loc){alert("Укажите место");return}var cats={},tv=0;CATS.forEach(function(cat){var ch=[];cat.items.forEach(function(item,i){var cb=document.getElementById("cb-"+cat.id+"-"+i);if(cb&&cb.checked){var ov=item==="Другое"?(document.getElementById("other-"+cat.id).value.trim()||""):null;ch.push({item:item,other:ov})}});cats[cat.id]={items:ch,allSafe:ch.length===0};tv+=ch.length});var e={id:editId||Date.now(),number:document.getElementById("pn").value.trim(),date:document.getElementById("pd").value,timeStart:document.getElementById("ps").value,timeEnd:document.getElementById("pe").value,location:loc,region:document.getElementById("pr").value,workType:document.getElementById("pw").value.trim(),workerCount:parseInt(document.getElementById("pc").value)||1,observer:document.getElementById("po").value.trim()||U.name,observerRole:document.getElementById("por").value.trim(),supervisor:document.getElementById("psv").value.trim(),supervisorRole:document.getElementById("psr").value.trim(),email:document.getElementById("pem").value.trim()||U.email||"",overallSafe:document.getElementById("os").classList.contains("sel"),categories:cats,totalViolations:tv,violations:getVR(),dialogue:getDL(),docs:document.getElementById("pdoc").value.trim(),createdBy:U.login,createdAt:new Date().toISOString()};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;resetF();document.getElementById("sd").innerHTML="<b>Бланк №"+(e.number||"—")+"</b> | "+e.date+" | <b>"+(e.overallSafe?"БЕЗОПАСНО":"НАРУШЕНИЙ: "+e.totalViolations)+"</b>";document.getElementById("fs").style.display="block";setTimeout(function(){document.getElementById("fs").style.display="none"},30000);if(!isA())checkSA()}
|
||||
function resetF(){document.getElementById("pn").value="";document.getElementById("pd").value=new Date().toISOString().split("T")[0];document.getElementById("ps").value="";document.getElementById("pe").value="";document.getElementById("pl").value="";document.getElementById("pr").value=U.region||"";document.getElementById("pw").value="";document.getElementById("pc").value="1";document.getElementById("po").value=U.name;document.getElementById("por").value="";document.getElementById("psv").value="";document.getElementById("psr").value="";document.getElementById("pem").value=U.email||"";document.getElementById("pdoc").value="";document.getElementById("pfiles").value="";document.getElementById("fileNames").textContent="";setO("safe");editId=null;CATS.forEach(function(cat){document.getElementById("ascb-"+cat.id).checked=true;document.getElementById("as-"+cat.id).classList.add("ac2");cat.items.forEach(function(_,i){var cb=document.getElementById("cb-"+cat.id+"-"+i);if(cb){cb.checked=false;cb.parentElement.classList.remove("ck")}var o=document.getElementById("other-"+cat.id);if(o){o.value="";o.style.display="none";o.classList.remove("vs")}});updateCatTotal(cat.id)});document.getElementById("vr").innerHTML="";vrc=6;for(var i=0;i<vrc;i++)document.getElementById("vr").innerHTML+=mkV(i+1);setDL([]);return true}
|
||||
function sendEmailConfirm(){if(!lastSubmitted)return;var e=lastSubmitted,to=e.email||U.email||"";if(!to||to.indexOf("@")<0){alert("Нет email");return}location.href="mailto:"+encodeURIComponent(to)+"?subject="+encodeURIComponent("ПАБ №"+(e.number||"—"))+"&body="+encodeURIComponent("Подтверждение ПАБ\nБланк: "+(e.number||"—")+"\nДата: "+e.date+"\nМесто: "+e.location+"\nСтатус: "+(e.overallSafe?"БЕЗОПАСНО":"НАРУШЕНИЙ: "+e.totalViolations))}
|
||||
function printConfirm(){if(!lastSubmitted)return;var e=lastSubmitted;var w=window.open("","_blank","width=700,height=800");w.document.write("<!DOCTYPE html><html><head><meta charset=\"utf-8\"><title>ПАБ</title><style>body{font:14px/1.5 Arial;max-width:700px;margin:40px auto}@media print{button{display:none}}</style></head><body><button onclick=\"window.print()\">🖨️ Печать</button><h1>БЛАНК ПАБ №"+(e.number||"—")+" от "+e.date+"</h1><p>Место: "+e.location+" | Наблюдатель: "+e.observer+" | Статус: "+(e.overallSafe?"БЕЗОПАСНО":"НАРУШЕНИЙ: "+e.totalViolations)+"</p></body></html>");w.document.close()}
|
||||
|
||||
@ -158,7 +160,7 @@ function rVL(){var c=document.getElementById("vlc");if(!c)return;var audits=getA
|
||||
|
||||
function rHT(){var audits=getA();var fs=document.getElementById("hfs"),fd=document.getElementById("hfd"),fl=document.getElementById("hfl");if(fs&&fs.value==="safe")audits=audits.filter(function(a){return a.overallSafe});if(fs&&fs.value==="danger")audits=audits.filter(function(a){return !a.overallSafe});if(fd&&fd.value)audits=audits.filter(function(a){return a.date===fd.value});if(fl&&fl.value)audits=audits.filter(function(a){var v=fl.value.toLowerCase();return a.location.toLowerCase().indexOf(v)>=0});var tb=document.getElementById("hbd");if(!tb)return;tb.innerHTML=audits.length===0?"<tr><td colspan=\"8\" style=\"text-align:center;padding:30px;color:var(--g5)\">Нет записей</td></tr>":audits.map(function(a){var ab=isA()?"<a class=\"vl\" onclick=\"editA("+a.id+")\">✏️</a> <button class=\"btn bd bs\" onclick=\"delA("+a.id+")\">🗑️</button>":"<span style=\"color:var(--g5);font-size:11px\">чтение</span>";return"<tr><td>"+(a.number||"—")+"</td><td>"+a.date+"</td><td>"+(a.timeStart||"—")+" — "+(a.timeEnd||"—")+"</td><td>"+a.location+"</td><td>"+a.observer+"</td><td><span class=\"badge "+(a.overallSafe?"badge-s":"badge-d")+"\">"+(a.overallSafe?"Безопасно":"Нарушения")+"</span></td><td>"+(a.totalViolations||0)+"</td><td>"+ab+"</td></tr>"}).join("")}
|
||||
function exportCSV(){var audits=getA();if(audits.length===0){alert("Нет данных");return}var all=allU();var h="Бланк №;Дата;Время;Место;Наблюдатель;Должность;Филиал;Регион;Область;Город;Статус;Нарушений";var rows=audits.map(function(a){var u=all[a.createdBy]||{};return(a.number||"")+";"+a.date+";"+(a.timeStart||"")+"-"+(a.timeEnd||"")+";\""+a.location+"\";\""+a.observer+"\";\""+(a.observerRole||"")+"\";\""+(u.branch||"")+"\";\""+(u.region||"")+"\";\""+(u.oblast||"")+"\";\""+(u.city||"")+"\";"+(a.overallSafe?"Безопасно":"Нарушения")+";"+(a.totalViolations||0)});var csv="\uFEFF"+h+"\n"+rows.join("\n");var blob=new Blob([csv],{type:"text/csv"});var url=URL.createObjectURL(blob);var dl=document.createElement("a");dl.href=url;dl.download="pab.csv";dl.click();URL.revokeObjectURL(url)}
|
||||
function editA(id){if(!isA()){alert("Только администратор");return}var a=getA().find(function(x){return x.id===id});if(!a)return;editId=id;swP("NA");setTimeout(function(){document.getElementById("pn").value=a.number||"";document.getElementById("pd").value=a.date||"";document.getElementById("ps").value=a.timeStart||"";document.getElementById("pe").value=a.timeEnd||"";document.getElementById("pl").value=a.location||"";document.getElementById("pr").value=a.region||"";document.getElementById("pw").value=a.workType||"";document.getElementById("pc").value=a.workerCount||1;document.getElementById("po").value=a.observer||"";document.getElementById("por").value=a.observerRole||"";document.getElementById("psv").value=a.supervisor||"";document.getElementById("psr").value=a.supervisorRole||"";document.getElementById("pem").value=a.email||"";setO(a.overallSafe?"safe":"danger");CATS.forEach(function(cat){var cd=a.categories&&a.categories[cat.id];var it=cd?cd.items:[];it.forEach(function(i){var idx=cat.items.indexOf(i.item);if(idx>=0){var cb=document.getElementById("cb-"+cat.id+"-"+idx);if(cb){cb.checked=true;cb.parentElement.classList.add("ck")}if(i.other){var o=document.getElementById("other-"+cat.id);if(o){o.value=i.other;o.style.display="block";o.classList.add("vs")}}}});document.getElementById("ascb-"+cat.id).checked=it.length===0;document.getElementById("as-"+cat.id).classList.toggle("ac2",it.length===0);updateCatTotal(cat.id)});document.getElementById("vr").innerHTML="";if(a.violations&&a.violations.length>0){vrc=a.violations.length;document.getElementById("vr").innerHTML=a.violations.map(function(v,i){return mkV(i+1,v)}).join("")}else{vrc=1;document.getElementById("vr").innerHTML=mkV(1)}setDL(a.dialogue||[])},200)}
|
||||
function editA(id){if(!isA()){alert("Только администратор");return}var a=getA().find(function(x){return x.id===id});if(!a)return;editId=id;swP("NA");setTimeout(function(){document.getElementById("pn").value=a.number||"";document.getElementById("pd").value=a.date||"";document.getElementById("ps").value=a.timeStart||"";document.getElementById("pe").value=a.timeEnd||"";document.getElementById("pl").value=a.location||"";document.getElementById("pr").value=a.region||"";document.getElementById("pw").value=a.workType||"";document.getElementById("pc").value=a.workerCount||1;document.getElementById("po").value=a.observer||"";document.getElementById("por").value=a.observerRole||"";document.getElementById("psv").value=a.supervisor||"";document.getElementById("psr").value=a.supervisorRole||"";document.getElementById("pem").value=a.email||"";document.getElementById("pdoc").value=a.docs||"";setO(a.overallSafe?"safe":"danger");CATS.forEach(function(cat){var cd=a.categories&&a.categories[cat.id];var it=cd?cd.items:[];it.forEach(function(i){var idx=cat.items.indexOf(i.item);if(idx>=0){var cb=document.getElementById("cb-"+cat.id+"-"+idx);if(cb){cb.checked=true;cb.parentElement.classList.add("ck")}if(i.other){var o=document.getElementById("other-"+cat.id);if(o){o.value=i.other;o.style.display="block";o.classList.add("vs")}}}});document.getElementById("ascb-"+cat.id).checked=it.length===0;document.getElementById("as-"+cat.id).classList.toggle("ac2",it.length===0);updateCatTotal(cat.id)});document.getElementById("vr").innerHTML="";if(a.violations&&a.violations.length>0){vrc=a.violations.length;document.getElementById("vr").innerHTML=a.violations.map(function(v,i){return mkV(i+1,v)}).join("")}else{vrc=1;document.getElementById("vr").innerHTML=mkV(1)}setDL(a.dialogue||[])},200)}
|
||||
function delA(id){if(!isA()){alert("Только администратор");return}if(!confirm("Удалить?"))return;saveA(getA().filter(function(a){return a.id!==id}));rHT()}
|
||||
function downloadFullCSV(){var audits=getA();if(audits.length===0){alert("Нет данных");return}var all=allU();var h="Бланк №;Дата;Время;Место;Тип;Наблюдатель;Должность;Руководитель;Филиал;Подразделение;Регион;Область;Город;Статус;Нарушений";var rows=audits.map(function(a){var u=all[a.createdBy]||{};return(a.number||"")+";"+a.date+";"+(a.timeStart||"")+"-"+(a.timeEnd||"")+";\""+a.location+"\";\""+(a.workType||"")+"\";\""+a.observer+"\";\""+(a.observerRole||"")+"\";\""+(a.supervisor||"")+"\";\""+(u.branch||"")+"\";\""+(u.dept||"")+"\";\""+(u.region||"")+"\";\""+(u.oblast||"")+"\";\""+(u.city||"")+"\";"+(a.overallSafe?"Безопасно":"Нарушения")+";"+(a.totalViolations||0)});var csv="\uFEFF"+h+"\n"+rows.join("\n");var blob=new Blob([csv],{type:"text/csv"});var url=URL.createObjectURL(blob);var dl=document.createElement("a");dl.href=url;dl.download="pab-full.csv";dl.click();URL.revokeObjectURL(url)}
|
||||
function downloadWorkerReport(){var audits=getA();var all=allU();var ul=[];for(var k in all)if(k!=="admin")ul.push({login:k,name:all[k].name,role:all[k].role,branch:all[k].branch||"",dept:all[k].dept||"",region:all[k].region||"",oblast:all[k].oblast||"",city:all[k].city||"",email:all[k].email||""});if(ul.length===0){alert("Нет работников");return}var h="Логин;ФИО;Должность;Филиал;Подразделение;Регион;Область;Город;Email;График;Период;Выполнено;Нужно;Статус";var rows=ul.map(function(u){var q=getUserQuota(u);if(!q.p)return u.login+";\""+u.name+"\";\""+u.role+"\";\""+u.branch+"\";\""+u.dept+"\";\""+u.region+"\";\""+u.oblast+"\";\""+u.city+"\";\""+u.email+"\";Без графика;;;0;—";var p=gp(q.p);var done=audits.filter(function(a){return a.createdBy===u.login&&new Date(a.date)>=p.s}).length;var st=done>=q.c?"Выполнен":"Отстаёт ("+(q.c-done)+")";return u.login+";\""+u.name+"\";\""+u.role+"\";\""+u.branch+"\";\""+u.dept+"\";\""+u.region+"\";\""+u.oblast+"\";\""+u.city+"\";\""+u.email+"\";\""+q.l+"\";\""+p.l+"\";"+done+";"+q.c+";\""+st+"\""});var csv="\uFEFF"+h+"\n"+rows.join("\n");var blob=new Blob([csv],{type:"text/csv"});var url=URL.createObjectURL(blob);var dl=document.createElement("a");dl.href=url;dl.download="pab-workers.csv";dl.click();URL.revokeObjectURL(url)}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user