From 3db124ea247c3149b3c789c8233d852a52f23852 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Fri, 30 May 2025 07:31:18 +0200 Subject: [PATCH 1/3] add maquinas default corte --- .../Seeds/DefaultConfigVariablesSeeder.php | 29 ++++++++++++++++--- ci4/app/Services/ProductionService.php | 25 +++++++++++----- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/ci4/app/Database/Seeds/DefaultConfigVariablesSeeder.php b/ci4/app/Database/Seeds/DefaultConfigVariablesSeeder.php index 64336be4..a0ee4e15 100755 --- a/ci4/app/Database/Seeds/DefaultConfigVariablesSeeder.php +++ b/ci4/app/Database/Seeds/DefaultConfigVariablesSeeder.php @@ -27,16 +27,37 @@ class DefaultConfigVariablesSeeder extends Seeder "name" => "maquina_guillotina_id_default", "value" => 20, "description" => "ID de máquina que se asigna a tareas de corte tras impresión" - ] + ], + [ + "name" => "maquina_guillotina_prep_id_default", + "value" => 31, + "description" => "ID de máquina que se asigna a tareas de corte tras impresión" + ], + [ + "name" => "maquina_tecnau_id", + "value" => 54, + "description" => "ID de máquina que se asigna a tareas de corte TECNAU" + ], + [ + "name" => "maquina_hunkeler_id", + "value" => 151, + "description" => "ID de máquina que se asigna a tareas de corte HUNKELER" + ], + [ + "name" => "maquina_trimming_id", + "value" => 149, + "description" => "ID de máquina que se asigna a tareas de corte HUNKELER" + ], + ]; public function run() { - + $variableModel = model(ConfigVariableModel::class); foreach ($this->data as $row) { - if($variableModel->where("name",$row["name"])->first() == null){ + if ($variableModel->where("name", $row["name"])->first() == null) { $variableModel->insert($row); } } } -} \ No newline at end of file +} diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index 18e769df..02f3cddf 100755 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -85,6 +85,11 @@ class ProductionService extends BaseService */ public string $statusColor; public int $guillotinaMaquinaId; + public int $hunkelerMaquinaId; + public int $tecnauMaquinaId; + public int $trimmingMaquinaId; + public int $guillotinaPreparacionInteriorMaquinaId; + /** * Valor límite del POD * @@ -214,6 +219,11 @@ class ProductionService extends BaseService $this->configVariableModel = model(ConfigVariableModel::class); $this->podValue = $this->configVariableModel->getVariable('POD')->value; $this->guillotinaMaquinaId = $this->configVariableModel->getVariable('maquina_guillotina_id_default')->value; + $this->hunkelerMaquinaId = $this->configVariableModel->getVariable('maquina_hunkeler_id')->value; + $this->tecnauMaquinaId = $this->configVariableModel->getVariable('maquina_tecnau_id')->value; + $this->trimmingMaquinaId = $this->configVariableModel->getVariable('maquina_trimming_id')->value; + $this->guillotinaPreparacionInteriorMaquinaId = $this->configVariableModel->getVariable('maquina_guillotina_prep_id_default')->value; + $this->OT_TAREA_STATUS_TITLE = [ "P" => lang('Produccion.tarea_estados.P'), "F" => lang('Produccion.tarea_estados.F'), @@ -424,14 +434,14 @@ class ProductionService extends BaseService */ protected function storeTareaCorteFinal(): ?OrdenTrabajoTareaEntity { - + $maquina_id = $this->presupuesto->solapas == 1 ? $this->trimmingMaquinaId : $this->defaultMaquinaCorte->id; $presupuestoLineaImpresion = $this->presupuesto->presupuestoLineaImpresion(); $data = [ 'orden_trabajo_id' => $this->ot->id, 'presupuesto_linea_id' => $presupuestoLineaImpresion->id, 'nombre' => lang('Produccion.end_cut'), - 'maquina_id' => $this->defaultMaquinaCorte->id, - 'orden' => $this->defaultMaquinaCorte->orden_planning, + 'maquina_id' => $maquina_id, + 'orden' => $this->maquinaModel->find($maquina_id)->orden_planning, 'tiempo_estimado' => 0, 'tiempo_real' => 0, 'is_corte' => true, @@ -457,8 +467,8 @@ class ProductionService extends BaseService 'orden_trabajo_id' => $this->ot->id, 'presupuesto_linea_id' => $pLinea->id, 'nombre' => 'Corte', - 'maquina_id' => $this->guillotinaMaquinaId, - 'orden' => $pLinea->maquina()->orden_planning + 1, + 'maquina_id' => $this->guillotinaPreparacionInteriorMaquinaId, + 'orden' => $this->maquinaModel->find($this->guillotinaPreparacionInteriorMaquinaId)->orden_planning, 'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60, 'tiempo_real' => 0, 'is_corte' => true, @@ -493,13 +503,14 @@ class ProductionService extends BaseService { $otCorte = null; $name = $this->cosido() ? lang('Produccion.hunkeler') : lang('Produccion.tecnau'); + $maquina_id = $this->cosido() ? $this->hunkelerMaquinaId : $this->tecnauMaquinaId; if ($pLinea->isRotativa()) { $tareaId = $this->otTarea->insert([ 'orden_trabajo_id' => $this->ot->id, 'presupuesto_linea_id' => $pLinea->id, 'nombre' => $name, - 'maquina_id' => $this->defaultMaquinaCorte->id, - 'orden' => $pLinea->maquina()->orden_planning + 1, + 'maquina_id' => $maquina_id, + 'orden' => $this->maquinaModel->find($maquina_id)->orden_planning, 'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60, 'tiempo_real' => 0, 'is_corte' => true, From 23a577b55e67ce16040e4b5a1b06438ac577700e Mon Sep 17 00:00:00 2001 From: amazuecos Date: Sat, 31 May 2025 07:58:43 +0200 Subject: [PATCH 2/3] tareas corte y tiempo procesamiento --- ci4/app/Language/es/Produccion.php | 1 + ci4/app/Services/ProductionService.php | 78 +++++++++++++++++-- .../vuexy/form/produccion/ot/otProgress.php | 19 ++++- .../assets/js/safekat/pages/produccion/ot.js | 5 +- 4 files changed, 92 insertions(+), 11 deletions(-) diff --git a/ci4/app/Language/es/Produccion.php b/ci4/app/Language/es/Produccion.php index 9552d726..cb059577 100755 --- a/ci4/app/Language/es/Produccion.php +++ b/ci4/app/Language/es/Produccion.php @@ -76,6 +76,7 @@ return [ "formato" => "Formato", "paginas" => "Páginas", "guillotina" => "Guillotina/Corte", + "prep_interior_guillotina" => "Prep. interior guillotina", "tirada" => "Tirada", "merma" => "Merma", "pendiente_ferro" => "Pendiente ferro", diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index dced1317..c4699178 100755 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -188,6 +188,14 @@ class ProductionService extends BaseService * @var boolean */ public bool $isCorte = false; //* CHECK DONE + + /** + * Indica si hay una tarea de preparacion interior de guillotina ya se cubierta o interior + * Se usa para mostrar la fecha correspondiente en la vista + * + * @var boolean + */ + public bool $isPrepInteriorGuillotina = false; //* CHECK DONE /** * Pedido Entity * @@ -436,13 +444,14 @@ class ProductionService extends BaseService { $maquina_id = $this->presupuesto->solapas == 1 ? $this->trimmingMaquinaId : $this->defaultMaquinaCorte->id; $presupuestoLineaImpresion = $this->presupuesto->presupuestoLineaImpresion(); + $maquinaCorteEntity = $this->maquinaModel->find($maquina_id); $data = [ 'orden_trabajo_id' => $this->ot->id, 'presupuesto_linea_id' => $presupuestoLineaImpresion->id, 'nombre' => lang('Produccion.end_cut'), 'maquina_id' => $maquina_id, - 'orden' => $this->maquinaModel->find($maquina_id)->orden_planning, - 'tiempo_estimado' => 0, + 'orden' => $maquinaCorteEntity->orden_planning, + 'tiempo_estimado' => $this->tiempoCorteFinalEstimado($maquinaCorteEntity), 'tiempo_real' => 0, 'is_corte' => true, 'tipo_corte' => "bobina", @@ -463,6 +472,7 @@ class ProductionService extends BaseService $otCorte = null; $presupuestoTipo = $this->presupuesto->tipo_presupuesto()->codigo; $isRusticaFresado = str_contains($presupuestoTipo, "Fresado"); + $maquinaCorteEntity = $this->maquinaModel->find($this->guillotinaPreparacionInteriorMaquinaId); $data = [ 'orden_trabajo_id' => $this->ot->id, 'presupuesto_linea_id' => $pLinea->id, @@ -476,10 +486,14 @@ class ProductionService extends BaseService ]; if ($pLinea->isCubierta()) { $data['nombre'] = lang('Produccion.cover_cut'); + $data['tiempo_estimado'] = $this->tiempoCortePrepInterior($maquinaCorteEntity); $tareaId = $this->otTarea->insert($data); $otCorte = $this->otTarea->find($tareaId); } if ($pLinea->isImpresionInteriorPlana() || $pLinea->isRotativa()) { + if ($pLinea->isImpresionInteriorPlana()) { + $data['tiempo_estimado'] = $this->tiempoCortePrepInterior($maquinaCorteEntity); + } $data['nombre'] = lang('Produccion.interior_cut'); //* Si es rustica fresado y rotativa no se añade preparación de interior en guillotina if (!$isRusticaFresado && !$pLinea->isRotativa()) { @@ -939,7 +953,7 @@ class ProductionService extends BaseService ->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") + ->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) @@ -1364,7 +1378,7 @@ class ProductionService extends BaseService } return $query->get()->getResultArray(); } - public function querySelectMaquinaPlanningPlana($q,?string $padreId) + public function querySelectMaquinaPlanningPlana($q, ?string $padreId) { $query = $this->otModel->builder()->select([ "orden_trabajo_tareas.maquina_id as id", @@ -1381,8 +1395,8 @@ class ProductionService extends BaseService if ($q) { $query->like('lg_maquinas.nombre', $q); } - if($padreId){ - $query->where('lg_maquinas.padre_id',$padreId); + if ($padreId) { + $query->where('lg_maquinas.padre_id', $padreId); } return $query->get()->getResultArray(); } @@ -1889,6 +1903,7 @@ class ProductionService extends BaseService "isColor" => $this->isColor, "isBN" => $this->isBN, "isCorte" => $this->corte(), + "isPrepInteriorGuillotina" => $this->hasPrepInteriorGuillotina(), "isGrapado" => $this->isGrapado, "isCosido" => $this->cosido(), ]; @@ -2054,6 +2069,17 @@ class ProductionService extends BaseService } return $this->isCorte; } + public function hasPrepInteriorGuillotina(): bool + { + $ot_tareas = $this->ot->tareas(); + foreach ($ot_tareas as $key => $tarea) { + if ($tarea->is_corte && $tarea->tipo_corte = "prep") { + $this->isPrepInteriorGuillotina = true; + break; + } + } + return $this->isPrepInteriorGuillotina; + } public function getFileBarCode() { return $this->ot->getBarCodeFile(); @@ -2359,6 +2385,12 @@ class ProductionService extends BaseService if ($tarea->isEncuadernado()) { $dateName = "encuadernacion_at"; } + if ($tarea->is_corte) { + $dateName = "corte_at"; + } + if ($tarea->is_corte && $tarea->tipo_corte == "prep") { + $dateName = "preparacion_interiores_at"; + } return $dateName; } public function getTitleTareaEstado($tarea_id): array @@ -2380,4 +2412,38 @@ class ProductionService extends BaseService "userName" => $userName ?? "", ]; } + /** + * Devuelve en segundos el tiempo que tarda una máquina de corte en realizar el corte de la tirada completa + * + * $t = tirada[libros] / velocidad_maquina[libros/minutos]$ + * + * @param MaquinaEntity $maquina + * @return float $seconds + */ + public function tiempoCorteFinalEstimado(MaquinaEntity $maquina): float + { + $seconds = 0; + if ($this->presupuesto->tirada > 0) { + $minutos = $this->presupuesto->tirada / $maquina->velocidad; + $seconds = $minutos * 60; + } + return $seconds; + } + /** + * Devuelve en segundos el tiempo que tarda una máquina de corte en realizar + * + * $t = tirada[libros] / velocidad_maquina[libros/minutos]$ + * + * @param MaquinaEntity $maquina + * @return float $seconds + */ + public function tiempoCortePrepInterior(MaquinaEntity $maquina) + { + $seconds = 0; + if ($this->presupuesto->tirada > 0) { + $minutos = $this->presupuesto->tirada / $maquina->velocidad; + $seconds = $minutos * 60; + } + return $seconds; + } } diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php index e9457217..12e4646a 100755 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php @@ -280,15 +280,16 @@
" ?>
-
"> - +
"> +
- > + >
-
" ?>
+
" ?>
+
"> @@ -309,6 +310,16 @@
" ?>
+ +
"> + +
+ > + +
+
" ?>
+ +
diff --git a/httpdocs/assets/js/safekat/pages/produccion/ot.js b/httpdocs/assets/js/safekat/pages/produccion/ot.js index 34f05244..ef2a16e9 100644 --- a/httpdocs/assets/js/safekat/pages/produccion/ot.js +++ b/httpdocs/assets/js/safekat/pages/produccion/ot.js @@ -119,6 +119,8 @@ class OrdenTrabajo { this.entradaManipulado = new DatePicker(this.otForm.find("#ot-manipulado"), option) this.prepGuillotina = new DatePicker(this.otForm.find("#ot-prep-guillotina"), option) + this.prepInteriorGuillotina = new DatePicker(this.otForm.find("#ot-prep-interior-guillotina"), option) + this.prepCosido = new DatePicker(this.otForm.find("#ot-prep-cosido"), option) @@ -527,7 +529,8 @@ class OrdenTrabajo { this.encuadernacion.setDate(this.summaryData.dates.encuadernacion_at) this.prepGuillotina.setDate(this.summaryData.dates.corte_at) - + this.prepInteriorGuillotina.setDate(this.summaryData.dates.preparacion_interiores_at) + this.entradaManipulado.setDate(this.summaryData.dates.entrada_manipulado_at) // this.prepCosido.setDate(this.summaryData.dates.cosido_at) From 67c4b4bc9360ac247b33af22de41018a54ca7174 Mon Sep 17 00:00:00 2001 From: amazuecos Date: Sat, 31 May 2025 08:35:01 +0200 Subject: [PATCH 3/3] add filter padre - hija - papel --- .../Controllers/Produccion/Ordentrabajo.php | 14 ++++---- ci4/app/Language/es/Produccion.php | 1 + ci4/app/Services/ProductionService.php | 24 ++++++++------ .../tables/planning_plana_table.php | 1 - .../produccion/ot/viewPlanningRotativa.php | 10 ++++-- .../planning_rotativa/planning_rotativa.js | 33 +++++++++++-------- 6 files changed, 51 insertions(+), 32 deletions(-) diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php index 2d3baeca..0784d246 100755 --- a/ci4/app/Controllers/Produccion/Ordentrabajo.php +++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php @@ -375,7 +375,11 @@ class Ordentrabajo extends BaseController public function maquina_plana_datatable() { // return $this->response->setStatusCode(400); + $padreId = $this->request->getGet('padre_id'); $q = $this->produccionService->maquinaPlanaDatatableQuery(); + if ($padreId) { + $q->where('lg_maquinas.padre_id', $padreId); + } return DataTable::of($q) ->edit("tiempoReal", fn($q) => $q->tiempoReal) ->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_machine'), 'data' => $q]) @@ -496,10 +500,7 @@ class Ordentrabajo extends BaseController public function planning_plana_datatable() { $query = $this->produccionService->planningPlanaQueryDatatable(); - $padreId = $this->request->getGet('padre_id'); - if ($padreId) { - $query->where('lg_maquinas.padre_id', $padreId); - } + return DataTable::of($query) ->edit("tiempo_real_sum", fn($q) => $q->tiempo_real_sum) ->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "") @@ -523,7 +524,7 @@ class Ordentrabajo extends BaseController { $q = $this->request->getGet('q'); $padreId = $this->request->getGet('padre_id'); - $result = $this->produccionService->querySelectMaquinaPlanningPlana($q,$padreId); + $result = $this->produccionService->querySelectMaquinaPlanningPlana($q, $padreId); return $this->response->setJSON($result); } public function select_maquina_padre_planning_plana() @@ -535,7 +536,8 @@ class Ordentrabajo extends BaseController public function select_papel_planning_plana() { $q = $this->request->getGet('q'); - $result = $this->produccionService->querySelectPapelPlanningPlana($q); + $maquinaId = $this->request->getGet('maquina_id'); + $result = $this->produccionService->querySelectPapelPlanningPlana($q,$maquinaId); return $this->response->setJSON($result); } public function tarea_toggle_corte($orden_trabajo_id) diff --git a/ci4/app/Language/es/Produccion.php b/ci4/app/Language/es/Produccion.php index 9552d726..6e999e6b 100755 --- a/ci4/app/Language/es/Produccion.php +++ b/ci4/app/Language/es/Produccion.php @@ -144,6 +144,7 @@ return [ ], "maquinas_planas" => "Máquinas planas", + "select_maquina_padre" => "Seleccione una máquina", "progress_ferro" => "Ferro", "progress_preimpresion" => "Preimpresión", "progress_logistica" => "Logística", diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index 8332b322..e53a8fd6 100755 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -199,6 +199,7 @@ class ProductionService extends BaseService public function __construct() { $this->otModel = model(OrdenTrabajoModel::class); + $this->maquinaModel = model(MaquinaModel::class); $this->otDate = model(OrdenTrabajoDate::class); $this->otTarea = model(OrdenTrabajoTarea::class); $this->otUser = model(OrdenTrabajoUser::class); @@ -227,8 +228,6 @@ class ProductionService extends BaseService public function init(int $orden_trabajo_id): self { try { - $this->maquinaModel = model(MaquinaModel::class); - $this->otModel = model(OrdenTrabajoModel::class); $ot = $this->otModel->find($orden_trabajo_id); if ($ot == null) { throw new Exception(lang('Produccion.errors.ot_not_found', ['ot_id' => $orden_trabajo_id])); @@ -777,6 +776,7 @@ class ProductionService extends BaseService ->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left") ->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA) ->where('lg_maquinas.is_rotativa', true) + ->where('lg_maquinas.tipo', 'impresion') ->where("orden_trabajo_tareas.deleted_at", null) ->orderBy("orden_trabajo_tareas.orden", "ASC") ->groupBy('ordenes_trabajo.id'); @@ -819,6 +819,7 @@ class ProductionService extends BaseService // ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id) ->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA) ->where('lg_maquinas.is_rotativa', false) + ->where('lg_maquinas.tipo', 'impresion') ->where("orden_trabajo_tareas.deleted_at", null) ->orderBy("orden_trabajo_tareas.orden", "ASC") ->groupBy('ordenes_trabajo.id'); @@ -928,10 +929,12 @@ class ProductionService extends BaseService ->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") + ->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) + ->where('lg_maquinas.tipo', 'impresion') + // ->where('lg_maquinas.padre_id', 0) ->groupBy('lg_maquinas.id'); @@ -1353,7 +1356,7 @@ class ProductionService extends BaseService } return $query->get()->getResultArray(); } - public function querySelectMaquinaPlanningPlana($q,?string $padreId) + public function querySelectMaquinaPlanningPlana($q, ?string $padreId) { $query = $this->otModel->builder()->select([ "orden_trabajo_tareas.maquina_id as id", @@ -1370,8 +1373,8 @@ class ProductionService extends BaseService if ($q) { $query->like('lg_maquinas.nombre', $q); } - if($padreId){ - $query->where('lg_maquinas.padre_id',$padreId); + if ($padreId) { + $query->where('lg_maquinas.padre_id', $padreId); } return $query->get()->getResultArray(); } @@ -1385,10 +1388,8 @@ class ProductionService extends BaseService ->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left") ->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left") ->join("lg_maquinas mp", "mp.id = lg_maquinas.padre_id", "left") - ->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA) ->where('lg_maquinas.is_rotativa', false) - ->where('mp.is_padre', 0) - ->where("orden_trabajo_tareas.deleted_at", null) + ->where('lg_maquinas.is_padre !=', 0) ->groupBy("mp.id"); if ($q) { $query->like('lg_maquinas.nombre', $q); @@ -1415,7 +1416,7 @@ class ProductionService extends BaseService } return $query->get()->getResultArray(); } - public function querySelectPapelPlanningPlana($q) + public function querySelectPapelPlanningPlana($q, ?string $maquinaId) { $query = $this->otModel->builder()->select([ "lg_papel_impresion.id", @@ -1433,6 +1434,9 @@ class ProductionService extends BaseService if ($q) { $query->like('lg_papel_impresion.nombre', $q); } + if ($maquinaId) { + $query->where('orden_trabajo_tareas.maquina_id', $maquinaId); + } return $query->get()->getResultArray(); } public function tareaUpdateMaquinaCorte($orden_trabajo_id): bool diff --git a/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php b/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php index ab28244c..454cb84c 100755 --- a/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php +++ b/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php @@ -24,7 +24,6 @@
-
diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/viewPlanningRotativa.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/viewPlanningRotativa.php index 29d216ab..ca342d84 100755 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/viewPlanningRotativa.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/viewPlanningRotativa.php @@ -29,7 +29,7 @@
-
+

@@ -86,7 +86,13 @@
"planning-pliego-datatable"]) ?>
- "planning-maquina-datatable"]) ?> +
+
+ + +
+ "planning-maquina-datatable"]) ?> +

diff --git a/httpdocs/assets/js/safekat/pages/produccion/planning_rotativa/planning_rotativa.js b/httpdocs/assets/js/safekat/pages/produccion/planning_rotativa/planning_rotativa.js index ddec1f65..82b40061 100644 --- a/httpdocs/assets/js/safekat/pages/produccion/planning_rotativa/planning_rotativa.js +++ b/httpdocs/assets/js/safekat/pages/produccion/planning_rotativa/planning_rotativa.js @@ -104,7 +104,7 @@ class PlanningRotativa { 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.maquinaPadreSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-padre-select"), `/produccion/ordentrabajo/planning/select/maquina/padre/plana`, "Máquina padre", true, {}, $('body')); + this.maquinaPadreSelectFilterPlana = new ClassSelect(this.item.find(".planning-maquina-padre-select"), `/produccion/ordentrabajo/planning/select/maquina/padre/plana`, "Máquina padre", true, {}, $('body')); this.maquinaSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-select"), `/produccion/ordentrabajo/planning/select/maquina/plana`, "Seleccione una maquina", true, { }, $('body')); this.papelImpresionFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-papel-select"), `/produccion/ordentrabajo/planning/select/papel/plana`, "Seleccione un papel", true, {}, $('body')); @@ -141,8 +141,12 @@ class PlanningRotativa { this.papelImpresionFilterPlana.init() this.maquinaPadreSelectFilterPlana.init(); this.maquinaPadreSelectFilterPlana.onChange(() => { - const params = {padre_id : this.maquinaPadreSelectFilterPlana.getVal()} - this.maquinaSelectFilterPlana.params = {...params} + const params = { padre_id: this.maquinaPadreSelectFilterPlana.getVal() } + this.maquinaSelectFilterPlana.params = { ...params } + }) + this.maquinaSelectFilterPlana.onChange(() => { + const params = { maquina_id: this.maquinaSelectFilterPlana.getVal() } + this.papelImpresionFilterPlana.params = { ...params } }) this.checkAllMetros.on('change', () => { let isChecked = this.checkAllMetros.prop('checked') @@ -155,7 +159,6 @@ 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()) }) @@ -195,11 +198,7 @@ class PlanningRotativa { }, ajax: { url: '/produccion/ordentrabajo/planning/plana/datatable', - data: d => { - if (this.maquinaPadreSelectFilterPlana.getVal()) { - d.padre_id = this.maquinaPadreSelectFilterPlana.getVal() - } - } + } }); this.papelGramajeDatatable = this.papelGramajeTablePlanning.DataTable({ @@ -231,7 +230,7 @@ class PlanningRotativa { this.maquinaPlanaDatatable = this.maquinaTablePlanning.DataTable({ processing: true, orderCellsTop: true, - dom: 'lrtip', + dom: 'rtip', serverSide: true, responsive: true, pageLength: 10, @@ -239,7 +238,15 @@ class PlanningRotativa { url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json" }, columns: this.maquinaPlanaDatatableColumns, - ajax: '/produccion/ordentrabajo/planning/maquina/plana/datatable' + ajax: { + url: '/produccion/ordentrabajo/planning/maquina/plana/datatable', + data: d => { + if (this.maquinaPadreSelectFilterPlana.getVal()) { + d.padre_id = this.maquinaPadreSelectFilterPlana.getVal() + } + } + + } }); /** * PLANNING ROTATIVA @@ -275,8 +282,8 @@ class PlanningRotativa { let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name")) this.datatablePlanningPlana.column(columnIndex).search(this.papelImpresionFilterPlana.getText()).draw() }) - this.tablePlanningPlana.on("change", ".planning-maquina-padre-select", (event) => { - this.datatablePlanningPlana.ajax.reload(); + this.item.on("change", ".planning-maquina-padre-select", (event) => { + this.maquinaPlanaDatatable.ajax.reload(); }) this.papelPliegoDatatable.on('draw', this.addTotalFooterPliego.bind(this)) this.maquinaPlanaDatatable.on('draw', this.addTotalFooterMaquinaPlana.bind(this))