Iniciada implementacion de recuperacion de historicos erp antiguo

This commit is contained in:
Ignacio Martinez Navajas
2025-06-03 11:24:44 +02:00
parent 2c711c526b
commit 84693d5c6c
6 changed files with 208 additions and 25 deletions

View File

@ -295,6 +295,7 @@ class Catalogo {
this.selectGramajeSobrecubiertaPod.init();
this.acabadosSobrecubierta.init();
this.initPedidosTable();
// Al cargar la página
this.toggleSobrecubiertaFields();
@ -327,6 +328,62 @@ class Catalogo {
});
}
initPedidosTable() {
const lastColPedidos = $('#tablaPedidosAntiguos').find("tr:first th").length - 1;
const catalogoId = $('#catalogo_id').val(); // Asegúrate que este valor exista
const tablaPedidosAntiguos = $('#tablaPedidosAntiguos').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
orderCellsTop: true,
responsive: true,
scrollX: true,
lengthMenu: [5, 10, 25, 50, 75, 100],
pageLength: 10,
lengthChange: true,
dom: 'lfBrtip',
buttons: [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
order: [[1, 'desc']],
language: {
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
},
ajax: {
url: '/catalogo/libros/pedidosAntiguos',
method: 'GET',
data: {
catalogo_id: catalogoId
}
},
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColPedidos]
}
],
columns: [
{ data: 'id' },
{ data: 'created_at' },
{ data: 'titulo' },
{ data: 'paginas' },
{ data: 'tirada' },
{ data: 'total' },
{ data: 'estado' },
{ data: 'actionBtns' }
]
});
}
actualizarDesdeColor() {
const total = parseInt(this.total.val(), 10) || 0;
const color = parseInt(this.color.val(), 10) || 0;