corregidos varios fallos en el importador. Añadidos avisos de error y success al importar

This commit is contained in:
2025-03-19 20:55:08 +01:00
parent 756578a251
commit f6c2e608cf
5 changed files with 110 additions and 51 deletions

View File

@ -251,7 +251,23 @@ $("#fecha_entrega_externo").flatpickr({
<?php if ($pedidoEntity->estado !== 'finalizado' && $pedidoEntity->estado !== 'cancelado'): ?>
$('.buton-estado').on('click', function() {
var id = <?=$pedidoEntity->id ?>;
Swal.fire({
title: '¿Estás seguro?',
text: "Esta acción no se puede deshacer",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Sí',
cancelButtonText: 'Cancelar',
customClass: {
confirmButton: 'btn btn-primary me-1',
cancelButton: 'btn btn-label-secondary'
},
buttonsStyling: false
}).then((result) => {
if (result.isConfirmed) {
var id = <?=$pedidoEntity->id ?>;
var estado = $(this).attr('id').split('_')[1];
var url = '<?= route_to('cambiarEstadoPedido') ?>';
var data = {
@ -273,6 +289,10 @@ $('.buton-estado').on('click', function() {
}
}
});
}
}).catch((err) => {
console.log(err);
});
});
<?php endif; ?>