generando el grupo de envios

This commit is contained in:
2025-04-14 22:00:52 +02:00
parent c157b1215c
commit 16dc39ee15
7 changed files with 149 additions and 25 deletions

View File

@ -0,0 +1,41 @@
import Ajax from '../../components/ajax.js';
$(()=>{
$('#buscadorPedidos').on('keydown', function(e) {
if (e.key === 'Enter' || e.keyCode === 13) {
e.preventDefault(); // Evita el submit si está dentro de un form
let search = $(this).val().trim();
new Ajax(
'/logistica/buscar/'+search,
{},
{},
function(response) {
if(response.data.createAlbaran){
Swal.fire({
title: 'Atención!',
text: 'El pedido no contenía ningún albarán. Se han añadido automáticamente.',
icon: 'warning',
showCancelButton: false,
confirmButtonColor: '#3085d6',
confirmButtonText: 'Ok',
customClass: {
confirmButton: 'btn btn-primary me-1',
},
buttonsStyling: false
}).then(() => {
//window.open(`${urlObj.origin}` + '/presupuestoadmin/edit/' + response.id);
});
}
},
function(xhr, status, error) {
popErrorAlert(error.responseJSON.message);
}
).get();
}
});
});