mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
generando el grupo de envios
This commit is contained in:
41
httpdocs/assets/js/safekat/pages/logistica/envio.js
Normal file
41
httpdocs/assets/js/safekat/pages/logistica/envio.js
Normal 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();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user