437 lines
18 KiB
Plaintext
437 lines
18 KiB
Plaintext
extends layout
|
|
|
|
block content
|
|
.mainContainer
|
|
link(rel='stylesheet' href='/bower_components/bootstrap/dist/css/bootstrap.min.css')
|
|
|
|
link(rel='stylesheet' href='/bower_components/bootstrap-select/dist/css/bootstrap-select.css')
|
|
link(rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css')
|
|
link(rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.14.2/sweetalert2.css" integrity="sha512-TG239kA30BXeGpy+HpJei+qfJcKo8V9HKpe8UWuVdpk49NGUe86EDhmdXkCxMqD5gSlkLLi6YQ9SbNp+yRa9xQ==" crossorigin="anonymous" referrerpolicy="no-referrer")
|
|
include Modals/modal_jkv_kabel
|
|
.panel.panel-primary
|
|
.panel-heading
|
|
h4 Berendezés: #{article.title}
|
|
h4#articleId(style='display:none') #{article._id}
|
|
h4#articleSn(style='display:none') #{article.deviceNumber}
|
|
.panel-body
|
|
#form-group
|
|
div.row
|
|
div.col-md-6
|
|
h4(style="font-weight: bold") Munka szám: #{article.workNumber}
|
|
h4(style="font-weight: bold") Gyártási szám: #{article.deviceNumber}
|
|
h4(style="font-weight: bold") Berendezés jele: #{article.workSign}
|
|
div.col-md-6
|
|
p(style="text-align:right;") Létrehozó: #{author}
|
|
p(style="text-align:right;") Létrehozva: #{article.deviceDate}
|
|
p(style="text-align:right;") Megnevezés: #{article.title}
|
|
div.row
|
|
hr
|
|
div.col-md-6
|
|
p Megjegyzés: #{article.body}
|
|
|
|
|
|
//input.btn.btn-primary(type='Submit',value='Törlés')
|
|
.panel-footer
|
|
.btn-toolbar(role='toolbar')
|
|
if (rot || user.canAdd.files)
|
|
.btn-group(role='group')
|
|
a.btn.btn-success(href='/articles/edit/'+article._id+'/'+workId)
|
|
i.fa.fa-edit.fa-lg.fa-fw
|
|
| Szerkesztés
|
|
.btn-group(role='group')
|
|
a.btn.btn-danger.delete-article(href='#', data-id=article._id, data-wid=work)
|
|
i.fa.fa-trash.fa-lg.fa-fw
|
|
| Törlés
|
|
.btn-group(role='group')
|
|
if (workId==='0')
|
|
a.btn.btn-success(href='/devices/')
|
|
i.fa.fa-home.fa-lg.fa-fw
|
|
| Vissza
|
|
else
|
|
a.btn.btn-success(href='/work/'+workId)
|
|
i.fa.fa-home.fa-lg.fa-fw
|
|
| Vissza
|
|
.btn-group(role='group')
|
|
a.btn.btn-primary(href='/components/list/'+article._id+"/"+workId+"/0") Komponensek
|
|
|
|
|
span.badge #{article.componentsArray.length}
|
|
.btn-group(role='group')
|
|
form(method='POST', action='/articles/gyartmanykisero/'+article.id+"/"+workId)
|
|
.input-group(style='width:400px')
|
|
input.form-control(type='text',name='separationText',placeholder='Szeparáció',style='background-color:#B9EFB9;')
|
|
span.input-group-btn
|
|
button.btn.btn-primary(type='submit')
|
|
span.glyphicon.glyphicon-print(aria-hidden='true')
|
|
| Gyártmánykísérő lap
|
|
|
|
.panel.panel-primary
|
|
.panel-heading
|
|
h4 Hozzáadott jegyzőkönyvek
|
|
.panel-body
|
|
.row
|
|
container
|
|
.table-responsive
|
|
table#certsTable.table.table-striped.table-hover
|
|
thead
|
|
tr
|
|
th #
|
|
th Kábelszám
|
|
th Megnevezés
|
|
th Típus
|
|
th Létrehozva
|
|
th Készítő
|
|
th Művelet
|
|
tbody
|
|
//-each cert, i in certs
|
|
tr
|
|
td #{i+1}
|
|
td
|
|
if (user.canAdd.files || user.canModify.files)
|
|
if (cert.certType==='KIF')
|
|
a(href="/certificates_kif/kifcert/"+cert._id)= cert.jkvTitle
|
|
if (cert.certType==='KOFTR')
|
|
a(href="/certificates_tr/kofcert/"+cert._id)= cert.jkvTitle
|
|
if (cert.certType==='KOFMC')
|
|
a(href="/certificates_mc/kofcert/"+cert._id)= cert.jkvTitle
|
|
else
|
|
if (cert.certType==='KIF')
|
|
label #{cert.jkvTitle}
|
|
if (cert.certType==='KOFTR')
|
|
label #{cert.jkvTitle}
|
|
if (cert.certType==='KOFMC')
|
|
label #{cert.jkvTitle}
|
|
td #{cert.certType}
|
|
td #{cert.bornDate}
|
|
td #{cert.author}
|
|
.panel-footer
|
|
.btn-toolbar(role='toolbar')
|
|
.btn-group(role='group')
|
|
a.btn.btn-primary(href='/certificates_kif/kifcertnew/'+article._id) Új KIF jegyzőkönyv
|
|
.btn-group(role='group')
|
|
a.btn.btn-primary(href='/certificates_tr/kofcertnew/'+article._id) Új TR jegyzőkönyv
|
|
.btn-group(role='group')
|
|
a.btn.btn-primary(href='/certificates_mc/kofcertnew/'+article._id) Új Mérőcella jkv
|
|
.btn-group(role='group')
|
|
button.btn.btn-primary(data-toggle='modal', data-wn=article.workNumber,data-aid=article._id,data-sn=article.deviceNumber,data-title=article.title, data-target='#jkvkabelModal',data-headertitle='Kábel szigetelés vizsgálat',style='width:40px;',type='button')
|
|
i.fa.fa-cogs
|
|
.panel.panel-primary
|
|
.panel-heading
|
|
h4 Hozzáadott dokumentumok
|
|
.panel-body
|
|
.row
|
|
main.col-sm-9.ml-sm-auto.col-md-10.pt-3(role='main')
|
|
h2 Hozzáadott dokumentumok
|
|
.table-responsive
|
|
table.table.table-hover.table-striped(style='background-color:#FFFFE0;')
|
|
thead
|
|
tr
|
|
th #
|
|
th Megnevezés
|
|
th Típus
|
|
if (user.canDelete.files)
|
|
th Törlés
|
|
tbody
|
|
if (docObjs)
|
|
each doc, i in docObjs
|
|
tr
|
|
td #{i+1}
|
|
td
|
|
if (user.canDownload)
|
|
a(href='/articles/view/'+article.filePath+'/'+doc.filen) #{doc.filen}
|
|
else
|
|
p #{doc.filen}
|
|
td
|
|
img(src=doc.ico, width='32px', height='32px', alt='description here')
|
|
if (user.canDelete.files)
|
|
td
|
|
a.btn.btn-danger.delete-articleFile(href='#',data-path=doc.filen,data-id=article._id, data-wid=workId)
|
|
.glyphicon.glyphicon-trash
|
|
.panel-footer
|
|
if (user.canAdd.files)
|
|
|
|
form(id='upForm',enctype='multipart/form-data', action='/articles/upload/'+article._id+'/'+workId, method='post', aid=article._id,wid=workId)
|
|
div.row
|
|
div.col-md-5
|
|
label.btn.btn-primary.btn-block.btn-outlined(for='imageUpload') Fájlok kiválasztása
|
|
input#imageUpload(type='file',multiple='', style='display: none', name='photo')
|
|
input.form-control#dpath(name='dataPath',type='hidden', readonly=true, value=article.filePath)
|
|
div.col-md-1
|
|
button.btn.btn-primary.upload-btn(type='submit',value='Fájlok feltöltése')
|
|
.glyphicon.glyphicon-cloud-upload
|
|
br
|
|
.progress
|
|
.progress-bar(role='progressbar', style='width: 0%;', aria-valuenow='0', aria-valuemin='0', aria-valuemax='100', )
|
|
|
|
//label(id='perc') Percent Complete:
|
|
|
|
|
|
br
|
|
|
|
br
|
|
.container-fluid
|
|
.panel.panel-primary
|
|
.panel-heading
|
|
h4 Gyártmány fotók
|
|
.panel-body
|
|
|
|
style.
|
|
div.gallery {
|
|
background: #0275d8aa;
|
|
border-radius: 5px;
|
|
border: 1px solid #ccc;
|
|
width: 270px;
|
|
height: 270px;
|
|
}
|
|
div.gallery:hover {
|
|
border: 1px solid #777;
|
|
}
|
|
div.gallery .glr {
|
|
display: block;
|
|
margin-top: 10px;
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
width: 253px;
|
|
height: 190px;
|
|
}
|
|
div.desc {
|
|
padding: 5px;
|
|
text-align: center;
|
|
}
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
.responsive {
|
|
padding: 6px 6px;
|
|
float: left;
|
|
width: 24.99999%;
|
|
}
|
|
@media only screen and (max-width: 700px){
|
|
.responsive {
|
|
width: 49.99999%;
|
|
margin: 6px 0;
|
|
}
|
|
}
|
|
@media only screen and (max-width: 500px){
|
|
.responsive {
|
|
width: 100%;
|
|
}
|
|
}
|
|
.clearfix:after {
|
|
content: "";
|
|
display: table;
|
|
clear: both;
|
|
}
|
|
.glr:focus {
|
|
/*image.width=150;*/
|
|
}
|
|
.glr:hover {
|
|
box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5);
|
|
transform: scale(2);
|
|
|
|
height: auto;
|
|
}
|
|
.glr {
|
|
transition: transform .25s ease;
|
|
}
|
|
each file in fileObjs
|
|
if(file.extension === '.jpg')
|
|
.responsive
|
|
.gallery
|
|
a(target='_blank', href='/articles/view/'+article.filePath+'/'+file.filen)
|
|
img.glr(src=file.ico, width='280px', height='300px')
|
|
.desc
|
|
if (user.canDelete.files)
|
|
a.btn.btn-danger.delete-articleFile(href='#',data-path=file.filen,data-id=article._id, data-wid=workId)
|
|
.glyphicon.glyphicon-trash
|
|
//a.btn.btn-danger.btn-xs.delete-file(href='#',file-name=file.filen,file-path=+article.filePath+'/'+file.filen,id='delete') Törlés
|
|
.glyphicon.glyphicon-trash
|
|
.clearfix
|
|
div(style='padding:6px;')
|
|
br
|
|
script(src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js')
|
|
//-script(src='/bower_components/bootstrap-table/dist/bootstrap-table.min.js')
|
|
-//script(src='/bower_components/jquery/dist/jquery.js')
|
|
-//script(src='https://code.jquery.com/jquery-1.10.2.js')
|
|
script(src='/js/upload.js')
|
|
script(src='/js/main.js')
|
|
script(src='/js/removeFile.js')
|
|
script(src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.14.2/sweetalert2.min.js" integrity="sha512-nD7/PXl2UD6bAYMJVKTLhr7qwnWVvoyqk8/WMzedDKMiQbaNXT3EUPzLYbLUHCLWqAZoXO37aVCtCKmAxZfqGw==" crossorigin="anonymous" referrerpolicy="no-referrer")
|
|
script.
|
|
// Jegyzőkönyvek listázása
|
|
var createTable=function (data,articleId)
|
|
{
|
|
$('#certsTable > tbody').empty();
|
|
if (data)
|
|
{ const articleSn=$('#articleSn').text();
|
|
$.each(data,function(i,el){
|
|
var url2="https://google.com"
|
|
var newRow=$('<tr id='+el._id+'>'+
|
|
'<td style="text-align:left">'+(i+1)+'</td>'+
|
|
'<td style="text-align:left">'+el.gyariszam+'</td>'+
|
|
'<td style="text-align:left">'+el.jkvTitle+'</td>'+
|
|
'<td style="text-align:left"> Kábel'+'</td>'+
|
|
'<td style="text-align:left">'+moment(el.bornDate).format("YYYY.MM.DD")+'</td>'+
|
|
'<td style="text-align:left">'+el.user.name+'</td>'+
|
|
'<td>'+'<div class="btn-group" role="group" aria-label="Basic example">'+
|
|
//-data-toggle='modal',data-wn=article.workNumber,data-id=article._id,data-sn=article.deviceNumber,data-title=article.title, data-target='#jkvkabelModal',data-headertitle='Kábel szigetelés vizsgálat',
|
|
'<button type="button" class="btn btn-warning" data-id="'+el._id+'" data-headertitle="Kábel szigetelés vizsgálat módosítás" data-sn="'+articleSn+'" data-feszultseg="'+el.feszultseg+'" data-title="'+el.jkvTitle+'" data-megrendelo="'+el.megrendelo+'" data-tipus="'+el.tipus+'" data-keresztmetszet="'+el.keresztmetszet+'" data-hossz="'+el.hossz+'" data-nyomvonal="'+el.nyomvonal+'" data-aid="'+articleId+'" data-toggle=modal data-target=#jkvkabelModal style="width:40px;"><i class="fa fa-edit"></i></button>'+
|
|
'<button id="ajaxPrint" type="button" class="btn btn-success" data-id="'+el._id+'", style="width:40px;"><i class="fa fa-print"></i></button>'+
|
|
'<button id="ajaxDelete" type="button" class="btn btn-danger" data-title="'+el.jkvTitle+'" data-id="'+el._id+'", style="width:40px;"><i class="fa fa-trash"></i></button>'+
|
|
|
|
'</div></td>'+
|
|
'</tr>');
|
|
$('#certsTable > tbody:last-child').append (newRow);
|
|
|
|
})
|
|
|
|
}
|
|
}
|
|
//Jegyzőkönyv nyomtatás
|
|
$(document).on("click","#ajaxPrint",async function(e)
|
|
{
|
|
var id = $(this).data('id');
|
|
var title = $(this).data('title');
|
|
|
|
const result= await Swal.fire(
|
|
{
|
|
title: "Biztosan törli a jegyzőkönyvet? ",
|
|
text: title+" véglegesen törlésre kerül!",
|
|
icon: "question",
|
|
showDenyButton: true,
|
|
confirmButtonText: 'Igen',
|
|
denyButtonText: 'Nem',
|
|
customClass: {
|
|
actions: 'my-actions',
|
|
confirmButton: 'order-2',
|
|
denyButton: 'order-3',
|
|
},
|
|
}
|
|
);
|
|
if (result.isConfirmed)
|
|
{
|
|
console.log("Generating: "+id)
|
|
location.href="/articles/generatecert/"+id
|
|
/* const response = await fetch("/articles/generatecert/"+id,
|
|
{
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
method: "POST"
|
|
|
|
});
|
|
const data = await response.json();
|
|
if (!response.ok)
|
|
{
|
|
Swal.fire('Error', '', 'error')
|
|
}
|
|
if (data.response="OK")
|
|
{
|
|
Swal.fire({
|
|
position: "top-end",
|
|
icon: "success",
|
|
title: data.message,
|
|
showConfirmButton: false,
|
|
timer: 1500,
|
|
backdrop: false
|
|
});
|
|
} else
|
|
{
|
|
Swal.fire({
|
|
position: "top-end",
|
|
icon: "error",
|
|
title: data.message,
|
|
showConfirmButton: false,
|
|
timer: 1500,
|
|
backdrop: false
|
|
});
|
|
} */
|
|
//refreshCerts(id)
|
|
|
|
}
|
|
});
|
|
//Jegyzőkönyv törlése
|
|
$(document).on("click","#ajaxDelete",async function(e)
|
|
{
|
|
var id = $(this).data('id');
|
|
var title = $(this).data('title');
|
|
console.log("DataId: "+id+"\nHolidayId: "+title);
|
|
const result= await Swal.fire(
|
|
{
|
|
title: "Biztosan törli a jegyzőkönyvet? ",
|
|
text: title+" véglegesen törlésre kerül!",
|
|
icon: "question",
|
|
showDenyButton: true,
|
|
confirmButtonText: 'Igen',
|
|
denyButtonText: 'Nem',
|
|
customClass: {
|
|
actions: 'my-actions',
|
|
confirmButton: 'order-2',
|
|
denyButton: 'order-3',
|
|
},
|
|
}
|
|
);
|
|
if (result.isConfirmed)
|
|
{
|
|
console.log("Deleting: "+id)
|
|
const response = await fetch("/articles/deletekabelcerts/"+id,
|
|
{
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
method: "DELETE"
|
|
|
|
});
|
|
const data = await response.json();
|
|
if (!response.ok)
|
|
{
|
|
Swal.fire('Error', '', 'error')
|
|
}
|
|
if (data.response="OK")
|
|
{
|
|
Swal.fire({
|
|
position: "top-end",
|
|
icon: "success",
|
|
title: data.message,
|
|
showConfirmButton: false,
|
|
timer: 1500,
|
|
backdrop: false
|
|
});
|
|
} else
|
|
{
|
|
Swal.fire({
|
|
position: "top-end",
|
|
icon: "error",
|
|
title: data.message,
|
|
showConfirmButton: false,
|
|
timer: 1500,
|
|
backdrop: false
|
|
});
|
|
}
|
|
refreshCerts(id)
|
|
|
|
}
|
|
});
|
|
const refreshCerts=function(id)
|
|
{
|
|
$.get('/articles/getkabelcerts/'+id,function(data)
|
|
{
|
|
createTable(data,id);
|
|
const tableRows = document.querySelectorAll(".table-clickable tbody tr");
|
|
|
|
for (const tableRow of tableRows) {
|
|
tableRow.addEventListener("click", function () {
|
|
window.open(this.dataset.href, "_blank");
|
|
});
|
|
}
|
|
})
|
|
}
|
|
$(document).ready(function () {
|
|
const id=$('#articleId').text();
|
|
refreshCerts(id)
|
|
|
|
|
|
})
|
|
|
|
|
|
|