rotativa planning

This commit is contained in:
amazuecos
2025-03-26 21:01:31 +01:00
parent ff73caec21
commit 81573eede4
11 changed files with 101 additions and 18 deletions

View File

@ -3,5 +3,4 @@ import PlanningRotativa from "./planning_rotativa.js";
$(function(){
const planningRotativa = new PlanningRotativa($("#planning-rotativa-page"));
planningRotativa.init();
console.log("PL")
})

View File

@ -25,15 +25,26 @@ class PlanningRotativa {
{ data: 'tareasCount', searchable: true, sortable: true },
{ data: 'totalTirada', searchable: false, sortable: false },
{ data: 'tiempoReal', searchable: false, sortable: false },
{
data: 'action', searchable: false, sortable: false, render: (d) => {
return `<button type="button" class="btn btn-primary btn-sm w-100 papel-gramaje-btn" data-id="${d.data.papelImpresionId}" data-name="${d.data.papelImpresionNombre}" data-bs-toggle="button">${d.title}</button>`
}
},
]
this.maquinaSelectFilter = new ClassSelect($("#maquina-select-filter"), `/maquinas/select`, "Seleccione una maquina", true);
this.papelImpresionFilter = new ClassSelect($("#papel-impresion-select-filter"), `/papelesimpresion/select`, "Seleccione un papel", true);
this.maquinaSelectFilter.config.dropdownParent = this.item
}
init() {
this.maquinaSelectFilter.init()
this.papelImpresionFilter.init()
this.papelGramajeTablePlanning.on('click','.papel-gramaje-btn',this.filterPapelGramaje.bind(this))
this.datatablePlanningRot = this.tablePlanningRot.DataTable({
processing: true,
orderCellsTop : true,
layout: {
topStart: 'pageLength',
topEnd: 'search',
@ -52,6 +63,7 @@ class PlanningRotativa {
});
this.papelGramajeDatatable = this.papelGramajeTablePlanning.DataTable({
processing: true,
orderCellsTop : true,
layout: {
topStart: 'pageLength',
topEnd: 'search',
@ -77,14 +89,27 @@ class PlanningRotativa {
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
this.datatablePlanningRot.column(columnIndex).search(this.maquinaSelectFilter.getText()).draw()
})
this.item.on("change", "#papel-impresion-select-filter", (event) => {
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
this.datatablePlanningRot.column(columnIndex).search(this.papelImpresionFilter.getText()).draw()
})
}
_renderBtnAction(d) {
return `<a type="button" href="/produccion/ordentrabajo/edit/${d.otId}" class="btn btn-md btn-primary ot-tarea-comment" data-id="${d.otId}"><i class="ti ti-building-factory-2 ti-sm mx-2"></i> Ver orden</a>`
return `<a href="/produccion/ordentrabajo/edit/${d.otId}" class="ot-tarea-comment" data-id="${d.otId}"><i class="ti ti-eye"></i></a>`
}
_columnFiltering() {
this.api().columns()
console.log(this.api().columns())
}
filterPapelGramaje(event)
{
const papelImpresionId = $(event.currentTarget).data('id')
const papelImpresionName = $(event.currentTarget).data('name')
this.papelImpresionFilter.setOption(papelImpresionId,papelImpresionName)
}
}
export default PlanningRotativa;