This commit is contained in:
naielv
2025-08-27 15:47:54 +02:00
parent e9342b6fec
commit b64a9bc78b
3 changed files with 37 additions and 3 deletions

View File

@@ -10,6 +10,15 @@ PAGES.index = {
`;
},
edit: function(mid) {
switch (mid) {
case 'qr':
PAGES.index.__scan()
break;
case "labels":
PAGES.index.__labels()
}
},
__scan: function(mid) {
var qrscan = safeuuid()
container.innerHTML = `
<h1>Escanear Codigo Aztec/QR</h1>
@@ -29,5 +38,29 @@ PAGES.index = {
}
html5QrcodeScanner.render(onScanSuccess);
},
__labels: function(mid) {
var div_materiales = safeuuid()
container.innerHTML = `
<h1>Imprimir Etiquetas AztecQR</h1>
<button onclick="print()">Imprimir</button>
<h2>Materiales</h2>
<div id="${div_co}"></div>
<br><br>`;
div_materiales = document.getElementById(div_materiales)
gun.get(TABLE).get("materiales").once().map().once((data, mid) => {
function add_row(data, key) {
if (data != null) {
div_materiales.innerHTML += BuildQR("materiales," + mid, data["Nombre"] || mid)
}
}
if (typeof data == "string") {
SEA.decrypt(data, SECRET, (data) => {
add_row(data, key);
});
} else {
add_row(data, key);
}
})
}
}

View File

@@ -18,7 +18,7 @@ PAGES.materiales = {
var btn_borrar = safeuuid();
container.innerHTML = `
<h1>Material <code id="${nameh1}"></code></h1>
${BuildQR("materiales," + mid)}
${BuildQR("materiales," + mid, "Este Material")}
<fieldset>
<label>
Referencia<br>