terminado consultas de pedidos a safekat

This commit is contained in:
2025-12-28 12:01:40 +01:00
parent 61be8d6d3b
commit 5b5ce7ccd7
4 changed files with 60 additions and 8368 deletions

File diff suppressed because one or more lines are too long

View File

@ -386,8 +386,6 @@ public class PedidosController {
Boolean result = pedidoService.aceptarFerro(id, locale); Boolean result = pedidoService.aceptarFerro(id, locale);
if (result) { if (result) {
entity.setEstado(PedidoLinea.Estado.haciendo_ferro);
repoPedidoLinea.save(entity);
String successMsg = messageSource.getMessage("pedido.success.estado-actualizado", null, locale); String successMsg = messageSource.getMessage("pedido.success.estado-actualizado", null, locale);
return Map.of( return Map.of(
"success", true, "success", true,

View File

@ -42,7 +42,7 @@ $(() => {
if (estadoSpan.length) { if (estadoSpan.length) {
estadoSpan.text(response.state); estadoSpan.text(response.state);
} }
if(response.stateKey === 'terminado' || response.stateKey === 'cancelado') { if (response.stateKey === 'terminado' || response.stateKey === 'cancelado') {
$(`.update-estado-button[data-linea-id='${lineaId}']`) $(`.update-estado-button[data-linea-id='${lineaId}']`)
.closest('.update-estado-button') .closest('.update-estado-button')
.addClass('d-none'); .addClass('d-none');
@ -57,7 +57,12 @@ $(() => {
cancelButton: 'btn btn-light' cancelButton: 'btn btn-light'
}, },
showConfirmButton: false showConfirmButton: false
}).then((result) => {
if (result.dismiss === Swal.DismissReason.timer) {
location.reload();
}
}); });
;
} }
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {

View File

@ -2,21 +2,21 @@ $(() => {
if ($(".btn-download-ferro").length) { if ($(".btn-download-ferro").length) {
$(document).on('click', '.btn-download-ferro', function () { $(document).on('click', '.btn-download-ferro', function () {
const lineaId = $(this).data('linea-id'); const lineaId = $(this).data('linea-id');
window.open(`/pedidos/linea/${lineaId}/download-ferro`, '_blank'); window.open(`/pedidos/linea/${lineaId}/download-ferro`, '_blank');
}); });
} }
if ($(".btn-download-cub").length) { if ($(".btn-download-cub").length) {
$(document).on('click', '.btn-download-cub', function () { $(document).on('click', '.btn-download-cub', function () {
const lineaId = $(this).data('linea-id'); const lineaId = $(this).data('linea-id');
window.open(`/pedidos/linea/${lineaId}/download-cub`, '_blank'); window.open(`/pedidos/linea/${lineaId}/download-cub`, '_blank');
}); });
} }
if ($(".btn-download-tapa").length) { if ($(".btn-download-tapa").length) {
$(document).on('click', '.btn-download-tapa', function () { $(document).on('click', '.btn-download-tapa', function () {
const lineaId = $(this).data('linea-id'); const lineaId = $(this).data('linea-id');
window.open(`/pedidos/linea/${lineaId}/download-tapa`, '_blank'); window.open(`/pedidos/linea/${lineaId}/download-tapa`, '_blank');
}); });
} }
@ -24,7 +24,7 @@ $(() => {
if ($(".btn-aceptar-ferro").length) { if ($(".btn-aceptar-ferro").length) {
$(document).on('click', '.btn-aceptar-ferro', function () { $(document).on('click', '.btn-aceptar-ferro', function () {
const lineaId = $(this).data('linea-id'); const lineaId = $(this).data('linea-id');
$.ajax({ $.ajax({
url: `/pedidos/linea/${lineaId}/aceptar-ferro`, url: `/pedidos/linea/${lineaId}/aceptar-ferro`,
type: 'POST', type: 'POST',
@ -60,7 +60,12 @@ $(() => {
cancelButton: 'btn btn-light' cancelButton: 'btn btn-light'
}, },
showConfirmButton: false showConfirmButton: false
}).then((result) => {
if (result.dismiss === Swal.DismissReason.timer) {
location.reload();
}
}); });
;
} }
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {