terminado a falta de pruebas

This commit is contained in:
2025-04-26 10:50:59 +02:00
parent ef173ab0fc
commit b5b86b4164
6 changed files with 159 additions and 69 deletions

View File

@ -32,6 +32,8 @@ class EnvioEdit {
if (!$("#empresaMensajeriaInput").length) {
this.proveedor = new ClassSelect($("#empresaMensajeria"), '/compras/proveedores/getProveedores', "", true, { 'tipo_id': 2 });
}
this.impresoraEtiquetas = $("#impresoraEtiquetas");
}
init() {
@ -492,7 +494,9 @@ class EnvioEdit {
envio_id: envio_id,
envio_lineas: ids,
cajas: num_cajas
cajas: num_cajas,
printer_id: this.impresoraEtiquetas.val(),
}, function (response) {
if (response.status) {
Swal.fire({
@ -506,7 +510,18 @@ class EnvioEdit {
},
buttonsStyling: false
}).then(() => {
if(response.data){
// show xml in a new tab
const blob = new Blob([response.data], { type: 'application/xml' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'etiquetas.xml';
a.click();
URL.revokeObjectURL(url);
a.remove();
}
});
}
else {