update
This commit is contained in:
@@ -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);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user