mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/planning-plana' into 'main'
Fix/planning plana See merge request jjimenez/safekat!829
This commit is contained in:
@ -822,6 +822,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->get('rotativa', 'Ordentrabajo::index_planning_rotativa');
|
||||
$routes->get('papel/datatable', 'Ordentrabajo::papel_gramaje_datatable');
|
||||
$routes->get('papel/plana/datatable', 'Ordentrabajo::papel_pliego_datatable');
|
||||
$routes->get('maquina/plana/datatable', 'Ordentrabajo::maquina_plana_datatable');
|
||||
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
|
||||
$routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable');
|
||||
$routes->post('tarea/toggle/corte/(:num)', 'Ordentrabajo::tarea_toggle_corte/$1');
|
||||
|
||||
@ -372,6 +372,15 @@ class Ordentrabajo extends BaseController
|
||||
->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_paper'), 'data' => $q])
|
||||
->toJson(true);
|
||||
}
|
||||
public function maquina_plana_datatable()
|
||||
{
|
||||
// return $this->response->setStatusCode(400);
|
||||
$q = $this->produccionService->maquinaPlanaDatatableQuery();
|
||||
return DataTable::of($q)
|
||||
->edit("tiempoReal", fn($q) => $q->tiempoReal)
|
||||
->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_machine'), 'data' => $q])
|
||||
->toJson(true);
|
||||
}
|
||||
public function reset_tareas(int $orden_trabajo_id)
|
||||
{
|
||||
$r = $this->produccionService->init($orden_trabajo_id)->resetAllTareas();
|
||||
|
||||
@ -13,6 +13,7 @@ return [
|
||||
'prod' => 'Producción'
|
||||
],
|
||||
"datatable" => [
|
||||
"nombre" => "Nombre",
|
||||
"ot_id" => "OT ID",
|
||||
"barcode" => "Código",
|
||||
"pedido_id" => "Pedido ID",
|
||||
@ -38,6 +39,7 @@ return [
|
||||
"progreso" => "Progreso",
|
||||
"logo" => "Logo impresion",
|
||||
"filter_by_task" => "Filtrar por tarea",
|
||||
"filter_by_machine" => "Filtrar por máquina",
|
||||
"filter_by_paper" => "Filtrar por papel",
|
||||
"metros" => "Metros",
|
||||
"corte" => "Corte",
|
||||
@ -141,7 +143,7 @@ return [
|
||||
"attr_not_exist" => "El atributo {0,string} no pertenece al modelo Pedido"
|
||||
|
||||
],
|
||||
|
||||
"maquinas_planas" => "Máquinas planas",
|
||||
"progress_ferro" => "Ferro",
|
||||
"progress_preimpresion" => "Preimpresión",
|
||||
"progress_logistica" => "Logística",
|
||||
|
||||
@ -913,6 +913,29 @@ class ProductionService extends BaseService
|
||||
|
||||
|
||||
|
||||
return $q;
|
||||
}
|
||||
public function maquinaPlanaDatatableQuery()
|
||||
{
|
||||
$q = $this->otModel->builder()->select([
|
||||
"lg_maquinas.nombre as maquinaNombre",
|
||||
"lg_maquinas.id as maquinaId",
|
||||
"COUNT(orden_trabajo_tareas.id) as tareasCount",
|
||||
"presupuesto_linea.pliegos_pedido as pliegosPedido",
|
||||
"SUM(ordenes_trabajo.total_tirada) as totalTirada",
|
||||
"SUM(orden_trabajo_tareas.tiempo_real) as tiempoReal"
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||
->join('lg_maquinas',"lg_maquinas.id = orden_trabajo_tareas.maquina_id","left")
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL, FALSE)
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||
->groupBy('lg_maquinas.id');
|
||||
|
||||
|
||||
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
@ -1323,7 +1346,8 @@ class ProductionService extends BaseService
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
||||
->where('lg_maquinas.is_rotativa', true)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC")
|
||||
->groupBy('lg_maquinas.id');
|
||||
if ($q) {
|
||||
$query->like('lg_maquinas.nombre', $q);
|
||||
}
|
||||
@ -1341,7 +1365,8 @@ class ProductionService extends BaseService
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||
->where('lg_maquinas.is_rotativa', false)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC")
|
||||
->groupBy('lg_maquinas.id');
|
||||
if ($q) {
|
||||
$query->like('lg_maquinas.nombre', $q);
|
||||
}
|
||||
|
||||
28
ci4/app/Views/themes/vuexy/components/tables/planning_maquina_table.php
Executable file
28
ci4/app/Views/themes/vuexy/components/tables/planning_maquina_table.php
Executable file
@ -0,0 +1,28 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.datatable.nombre') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tareas') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tirada') ?></th>
|
||||
<th><?= lang('Produccion.datatable.pliegos_libro') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tiempo') ?>(HH:MM)</th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="3" style="text-align:right">Total:</th>
|
||||
<th><span id="total-pliegos-maquina"></span></th>
|
||||
<th id="total-tiempo-pliego-maquina"></th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
@ -76,14 +76,17 @@
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionPapelPliegoContainer" aria-expanded="false"
|
||||
aria-controls="accordionPapelPliegoContainer">
|
||||
<h4><?= lang("Produccion.papel_gramajes") ?></h4>
|
||||
<h4><?= lang("Produccion.maquinas_planas") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionPapelPliegoContainer" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionPapelPliego">
|
||||
<div class="accordion-body">
|
||||
<?= view("themes/vuexy/components/tables/planning_papel_pliego_table.php", ["id" => "planning-pliego-datatable"]) ?>
|
||||
<div class="d-none">
|
||||
<?= view("themes/vuexy/components/tables/planning_papel_pliego_table.php", ["id" => "planning-pliego-datatable"]) ?>
|
||||
</div>
|
||||
<?= view("themes/vuexy/components/tables/planning_maquina_table.php", ["id" => "planning-maquina-datatable"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -10,6 +10,7 @@ class PlanningRotativa {
|
||||
this.tablePlanningPlana = this.item.find("#planning-plana-datatable")
|
||||
this.papelGramajeTablePlanning = this.item.find("#planning-papel-datatable")
|
||||
this.papelPliegoTablePlanning = this.item.find("#planning-pliego-datatable")
|
||||
this.maquinaTablePlanning = this.item.find("#planning-maquina-datatable")
|
||||
this.papelImpresionHeader = this.item.find('#papel-impresion-name-header')
|
||||
this.papelImpresionPlanaHeader = this.item.find('#papel-impresion-name-plana-header')
|
||||
|
||||
@ -27,7 +28,7 @@ class PlanningRotativa {
|
||||
{ data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_impresion', searchable: false, sortable: false },
|
||||
{ data: 'papel_gramaje',name:"presupuesto_linea.gramaje", searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_gramaje', name: "presupuesto_linea.gramaje", searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'corte', searchable: false, sortable: false, render: this.renderCorteImage.bind(this), width: "10rem" },
|
||||
{ data: 'metros_check', searchable: false, sortable: false, render: d => `<input class="form-check-input metros-check" data-id="${d}" type="checkbox" value="" />` },
|
||||
{ data: 'metros', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
@ -44,10 +45,10 @@ class PlanningRotativa {
|
||||
{ data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_impresion', searchable: false, sortable: false },
|
||||
{ data: 'papel_gramaje', name:"presupuesto_linea.gramaje", searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_gramaje', name: "presupuesto_linea.gramaje", searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'pliegos_check', searchable: false, sortable: false, render: d => `<input class="form-check-input pliegos-check" data-id="${d}" type="checkbox" value="" />` },
|
||||
{ data: 'pliegosPedido', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'tiempo_real_sum', searchable: false, sortable: false,render: d => this.formatSeconds(parseFloat(d))},
|
||||
{ data: 'tiempo_real_sum', searchable: false, sortable: false, render: d => this.formatSeconds(parseFloat(d)) },
|
||||
{ data: 'action', searchable: false, sortable: false, render: this._renderBtnAction },
|
||||
|
||||
]
|
||||
@ -65,6 +66,20 @@ class PlanningRotativa {
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
this.maquinaPlanaDatatableColumns = [
|
||||
{ data: 'maquinaNombre', searchable: true, sortable: true },
|
||||
{ data: 'tareasCount', searchable: true, sortable: true },
|
||||
{ data: 'totalTirada', searchable: false, sortable: false },
|
||||
{ data: 'pliegosPedido', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'tiempoReal', searchable: false, sortable: false, render: d => this.formatSeconds(d) },
|
||||
{
|
||||
data: 'action', searchable: false, sortable: false, render: (d) => {
|
||||
return `<button type="button" class="btn btn-primary btn-sm w-100 maquina-planning-btn" data-id="${d.data.maquinaId}" data-bs-toggle="button">${d.title}</button>`
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
this.papelPliegoDatatableColumns = [
|
||||
{ data: 'papelImpresionNombre', searchable: true, sortable: true },
|
||||
@ -86,8 +101,8 @@ class PlanningRotativa {
|
||||
`/produccion/ordentrabajo/planning/select/maquina/rotativa`,
|
||||
"Seleccione una maquina",
|
||||
true, {
|
||||
dropdownCssClass: "h-2"
|
||||
}, $('body'));
|
||||
dropdownCssClass: "h-2"
|
||||
}, $('body'));
|
||||
this.papelImpresionFilter = new ClassSelect(this.tablePlanningRot.find(".planning-papel-select"), `/produccion/ordentrabajo/planning/select/papel/rotativa`, "Seleccione un papel", true, {}, $('body'));
|
||||
this.maquinaSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-select"), `/produccion/ordentrabajo/planning/select/maquina/plana`, "Seleccione una maquina", true, {}, $('body'));
|
||||
this.maquinaPadreSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-padre-select"), `/produccion/ordentrabajo/planning/select/maquina/padre/plana`, "Máquina padre", true, {}, $('body'));
|
||||
@ -116,6 +131,7 @@ class PlanningRotativa {
|
||||
this.totalMetros = new AutoNumeric(this.item.find('#total-metros')[0], autoNumericOptions);
|
||||
this.totalMetrosSel = new AutoNumeric(this.item.find('#metros-sel-total')[0], autoNumericOptions);
|
||||
this.totalPliegos = new AutoNumeric(this.item.find('#total-pliegos')[0], autoNumericPliegosOptions);
|
||||
this.totalMaquinaPliegos = new AutoNumeric(this.item.find('#total-pliegos-maquina')[0], autoNumericPliegosOptions);
|
||||
this.totalPliegosSel = new AutoNumeric(this.item.find('#pliegos-sel-total')[0], autoNumericPliegosOptions);
|
||||
|
||||
this.maquinaSelectFilter.init()
|
||||
@ -133,7 +149,8 @@ class PlanningRotativa {
|
||||
})
|
||||
this.papelGramajeTablePlanning.on('click', '.papel-gramaje-btn', this.filterPapelGramaje.bind(this))
|
||||
this.papelPliegoTablePlanning.on('click', '.papel-pliego-btn', this.filterPapelGramajePlana.bind(this))
|
||||
|
||||
this.maquinaTablePlanning.on('click', '.maquina-planning-btn', this.filterMaquinaPlana.bind(this))
|
||||
//!AÑADIR MAQUINA
|
||||
this.papelImpresionFilter.onChange(() => {
|
||||
this.papelImpresionHeader.text(this.papelImpresionFilter.getText())
|
||||
})
|
||||
@ -151,8 +168,8 @@ class PlanningRotativa {
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
this.getColorOtStatus(row,data)
|
||||
createdRow: (row, data, dataIndex) => {
|
||||
this.getColorOtStatus(row, data)
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/rotativa/datatable'
|
||||
@ -168,13 +185,13 @@ class PlanningRotativa {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatablePlanaColumns,
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
this.getColorOtStatus(row,data)
|
||||
createdRow: (row, data, dataIndex) => {
|
||||
this.getColorOtStatus(row, data)
|
||||
},
|
||||
ajax: {
|
||||
url : '/produccion/ordentrabajo/planning/plana/datatable',
|
||||
data : d => {
|
||||
if(this.maquinaPadreSelectFilterPlana.getVal()){
|
||||
url: '/produccion/ordentrabajo/planning/plana/datatable',
|
||||
data: d => {
|
||||
if (this.maquinaPadreSelectFilterPlana.getVal()) {
|
||||
d.padre_id = this.maquinaPadreSelectFilterPlana.getVal()
|
||||
}
|
||||
}
|
||||
@ -206,11 +223,23 @@ class PlanningRotativa {
|
||||
columns: this.papelPliegoDatatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/papel/plana/datatable'
|
||||
});
|
||||
this.maquinaPlanaDatatable = this.maquinaTablePlanning.DataTable({
|
||||
processing: true,
|
||||
orderCellsTop: true,
|
||||
dom: 'lrtip',
|
||||
serverSide: true,
|
||||
responsive: true,
|
||||
pageLength: 10,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.maquinaPlanaDatatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/maquina/plana/datatable'
|
||||
});
|
||||
/**
|
||||
* PLANNING ROTATIVA
|
||||
*/
|
||||
this.tablePlanningRot.on("keyup", ".planning-filter", (event) => {
|
||||
console.log(this.datatablePlanningRot.column($(event.currentTarget).attr("name")))
|
||||
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||
this.datatablePlanningRot.column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||
})
|
||||
@ -225,12 +254,11 @@ class PlanningRotativa {
|
||||
this.papelGramajeDatatable.on('draw', this.addTotalFooter.bind(this))
|
||||
|
||||
this.tablePlanningRot.on('change', ".metros-check", this.calcMetrosCheck.bind(this))
|
||||
this.tablePlanningRot.on("click",'.change-corte',this.toggleCorte.bind(this))
|
||||
this.tablePlanningRot.on("click", '.change-corte', this.toggleCorte.bind(this))
|
||||
/**
|
||||
* PLANNING PLANA
|
||||
*/
|
||||
this.tablePlanningPlana.on("keyup", ".planning-filter", (event) => {
|
||||
console.log(this.datatablePlanningRot.column($(event.currentTarget).attr("name")))
|
||||
let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||
this.datatablePlanningPlana.column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||
})
|
||||
@ -246,7 +274,7 @@ class PlanningRotativa {
|
||||
this.datatablePlanningPlana.ajax.reload();
|
||||
})
|
||||
this.papelPliegoDatatable.on('draw', this.addTotalFooterPliego.bind(this))
|
||||
|
||||
this.maquinaPlanaDatatable.on('draw', this.addTotalFooterMaquinaPlana.bind(this))
|
||||
this.tablePlanningPlana.on('change', ".pliegos-check", this.calcPliegosCheck.bind(this))
|
||||
}
|
||||
_renderBtnAction(d) {
|
||||
@ -254,7 +282,6 @@ class PlanningRotativa {
|
||||
}
|
||||
_columnFiltering() {
|
||||
this.api().columns()
|
||||
console.log(this.api().columns())
|
||||
}
|
||||
filterPapelGramaje(event) {
|
||||
const papelImpresionId = $(event.currentTarget).data('id')
|
||||
@ -264,6 +291,10 @@ class PlanningRotativa {
|
||||
const papelImpresionId = $(event.currentTarget).data('id')
|
||||
this.getPapelImpresionPlana(papelImpresionId)
|
||||
}
|
||||
filterMaquinaPlana(event) {
|
||||
const maquinaId = $(event.currentTarget).data('id')
|
||||
this.getMaquinaPlana(maquinaId)
|
||||
}
|
||||
getPapelImpresion(papelImpresionId) {
|
||||
let ajax = new Ajax('/configuracion/papelesimpresion/show/' + papelImpresionId,
|
||||
null,
|
||||
@ -282,6 +313,15 @@ class PlanningRotativa {
|
||||
)
|
||||
ajax.get()
|
||||
}
|
||||
getMaquinaPlana(maquinaId) {
|
||||
let ajax = new Ajax('/configuracion/maquinas/' + maquinaId,
|
||||
null,
|
||||
null,
|
||||
this.getMaquinaPlanaSuccess.bind(this),
|
||||
this.getMaquinaPlanaError.bind(this)
|
||||
)
|
||||
ajax.get()
|
||||
}
|
||||
getPapelImpresionSuccess(response) {
|
||||
this.papelImpresionFilter.setOption(response.id, response.nombre)
|
||||
this.tablePlanningRot.find('input[name=papel_gramaje]').val(response.gramaje).trigger("change")
|
||||
@ -293,7 +333,18 @@ class PlanningRotativa {
|
||||
this.tablePlanningPlana.find('input[name=papel_gramaje]').val(response.gramaje).trigger("change")
|
||||
this.papelImpresionPlanaHeader.text(response.nombre)
|
||||
}
|
||||
getMaquinaPlanaSuccess(response) {
|
||||
if (response.is_padre != 0) {
|
||||
this.maquinaSelectFilterPlana.setOption(response.id, response.nombre)
|
||||
this.tablePlanningPlana.find('input[name=maquina_planning_nombre]').val(response.nombre).trigger("change")
|
||||
} else {
|
||||
this.maquinaPadreSelectFilterPlana.setOption(response.id, response.nombre)
|
||||
this.tablePlanningPlana.find('input[name=lg_maquinas.padre_id]').val(response.nombre).trigger("change")
|
||||
}
|
||||
this.papelImpresionPlanaHeader.text(response.nombre)
|
||||
}
|
||||
getPapelImpresionPlanaError(response) { }
|
||||
getMaquinaPlanaError(response) { }
|
||||
formatSeconds(s) {
|
||||
const hours = Math.floor(s / 60 / 60)
|
||||
const minutes = Math.floor(s / 60 % 60)
|
||||
@ -316,8 +367,14 @@ class PlanningRotativa {
|
||||
const pliegos = this.papelPliegoDatatable.column(4).data().map((e) => parseFloat(e))
|
||||
$('#total-tiempo-pliego').text(this.formatSeconds(seconds))
|
||||
this.totalPliegos.set(pliegos.reduce((a, b) => a + b, 0))
|
||||
|
||||
|
||||
}
|
||||
addTotalFooterMaquinaPlana() {
|
||||
const seconds = this.maquinaPlanaDatatable.column(4).data().reduce((a, b) => {
|
||||
return parseFloat(a) + parseFloat(b)
|
||||
}, 0)
|
||||
const pliegos = this.maquinaPlanaDatatable.column(3).data().map((e) => parseFloat(e))
|
||||
$('#total-tiempo-pliego-maquina').text(this.formatSeconds(seconds))
|
||||
this.totalMaquinaPliegos.set(pliegos.reduce((a, b) => a + b, 0))
|
||||
}
|
||||
calcMetrosCheck() {
|
||||
const metros_sel = this.datatablePlanningRot.rows((idx, data, node) => {
|
||||
@ -334,15 +391,13 @@ class PlanningRotativa {
|
||||
return $(node).find('input[type="checkbox"]').prop('checked');
|
||||
}).data().toArray().map((e) => parseFloat(e.tiempo_real_sum))
|
||||
this.totalPliegosSel.set(metros_sel.reduce((a, b) => a + b, 0))
|
||||
const totalSeconds = tiempo_total_sel.reduce((a,b) => a+b,0)
|
||||
console.log("Total seconds",totalSeconds);
|
||||
const totalSeconds = tiempo_total_sel.reduce((a, b) => a + b, 0)
|
||||
this.tiempoPlanaTotal.text(this.formatSeconds(totalSeconds))
|
||||
|
||||
|
||||
}
|
||||
renderCorteImage(data) {
|
||||
const tipo_corte = data.tipo_corte == "bobina" ? "cortadora_bobinas" : "guillotina";
|
||||
console.log(data.tipo_corte)
|
||||
return `
|
||||
<a type="button" class="btn btn-outline-secondary bg-white btn-xs change-corte" data-id=${data.otId}>
|
||||
<div class="avatar avatar-size-xs">
|
||||
@ -351,7 +406,7 @@ class PlanningRotativa {
|
||||
</a>
|
||||
`
|
||||
}
|
||||
toggleCorte(event){
|
||||
toggleCorte(event) {
|
||||
let otId = $(event.currentTarget).data('id')
|
||||
let ajax = new Ajax("/produccion/ordentrabajo/planning/tarea/toggle/corte/" + otId,
|
||||
null,
|
||||
@ -361,18 +416,18 @@ class PlanningRotativa {
|
||||
)
|
||||
ajax.post()
|
||||
}
|
||||
toggleCorteSuccess(response){
|
||||
toggleCorteSuccess(response) {
|
||||
this.datatablePlanningRot.ajax.reload()
|
||||
alertSuccess(response.message).fire()
|
||||
}
|
||||
toggleCorteError(){
|
||||
toggleCorteError() {
|
||||
}
|
||||
getColorOtStatus(row,data){
|
||||
let ajax = new Ajax("/produccion/ordentrabajo/color/"+data.otId,null,null,
|
||||
getColorOtStatus(row, data) {
|
||||
let ajax = new Ajax("/produccion/ordentrabajo/color/" + data.otId, null, null,
|
||||
(response) => {
|
||||
$(row).css("border-left",`10px solid ${response.color}`)
|
||||
$(row).css("border-right",`10px solid ${response.color}`)
|
||||
},null
|
||||
$(row).css("border-left", `10px solid ${response.color}`)
|
||||
$(row).css("border-right", `10px solid ${response.color}`)
|
||||
}, null
|
||||
)
|
||||
ajax.get()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user