diff --git a/ci4/app/Config/RBAC/permissionMatrix.php b/ci4/app/Config/RBAC/permissionMatrix.php index e0b0fec1..c60bd757 100644 --- a/ci4/app/Config/RBAC/permissionMatrix.php +++ b/ci4/app/Config/RBAC/permissionMatrix.php @@ -194,6 +194,8 @@ const SK_PERMISSION_MATRIX = [ "pedidos-cancelados.menu", "pedidos-todos.view", "pedidos-todos.menu", + "pedidos-gestion.toprod", + "pedidos-gestion.menu", "tarifa-preimpresion.create", "tarifa-preimpresion.edit", "tarifa-preimpresion.menu", diff --git a/ci4/app/Config/Routes.php b/ci4/app/Config/Routes.php index a894926d..f0336fbe 100644 --- a/ci4/app/Config/Routes.php +++ b/ci4/app/Config/Routes.php @@ -1001,7 +1001,10 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func $routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) { $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('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable'); + $routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable'); + }); }); }); diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php index 6834ecf0..cfb354c7 100755 --- a/ci4/app/Controllers/Produccion/Ordentrabajo.php +++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php @@ -193,8 +193,16 @@ class Ordentrabajo extends BaseController $q = $this->produccionService->papelGramajeDatatableQuery(); return DataTable::of($q) - ->edit("tiempoReal", fn($q) => float_seconds_to_hhmm_string($q->tiempoReal * 3600)) - ->add("metros", fn($q) => $q->papel_ancho*$q->totalTirada/1000) + ->edit("tiempoReal", fn($q) => $q->tiempoReal * 3600) + ->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_task'), 'data' => $q]) + ->toJson(true); + } + public function papel_pliego_datatable() + { + + $q = $this->produccionService->papelPliegoDatatableQuery(); + return DataTable::of($q) + ->edit("tiempoReal", fn($q) => $q->tiempoReal * 3600) ->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_task'), 'data' => $q]) ->toJson(true); } @@ -266,9 +274,17 @@ class Ordentrabajo extends BaseController ->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") : "") ->add("metros_check", fn($q) => $q->otId) ->add("corte", fn($q) => $q->otId) - ->add("metros", fn($q) => $q->papel_ancho*$q->ot_tirada/1000) ->add("action", fn($q) => $q) ->toJson(true); } + public function planning_plana_datatable() + { + $q = $this->produccionService->planningPlanaQueryDatatable(); + return DataTable::of($q) + ->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") : "") + ->add("pliegos_check", fn($q) => $q->otId) + ->add("action", fn($q) => $q) + ->toJson(true); + } } diff --git a/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php b/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php index f0705d98..247a12ec 100755 --- a/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php +++ b/ci4/app/Entities/Presupuestos/PresupuestoLineaEntity.php @@ -221,4 +221,8 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity return $nombre; } + public function isRotativa() : bool + { + return in_array($this->attributes['tipo'],['lp_rot_color','lp_rot_bn']); + } } diff --git a/ci4/app/Language/es/App.php b/ci4/app/Language/es/App.php index db627a10..d1875d70 100755 --- a/ci4/app/Language/es/App.php +++ b/ci4/app/Language/es/App.php @@ -791,6 +791,8 @@ return [ "menu_orden_trabajo_finalizados" => "OTs finalizados", "menu_orden_trabajo_pendientes" => "OTs pendientes", "menu_planning_rotativa" => "Planning rotativa", + "menu_planning" => "Plannings", + "menu_ordentrabajomaquetacion" => "Orden de trabajo maquetación", "menu_ordenmaquina" => "Orden máquina", diff --git a/ci4/app/Language/es/Produccion.php b/ci4/app/Language/es/Produccion.php index fdceace1..da69474a 100644 --- a/ci4/app/Language/es/Produccion.php +++ b/ci4/app/Language/es/Produccion.php @@ -25,7 +25,9 @@ return [ "logo" => "Logo impresion", "filter_by_task" => "Filtrar por tarea", "metros" => "Metros", - "corte" => "Corte" + "corte" => "Corte", + "pliegos" => "Pliegos", + "pliegos_libro" => "Pliegos" ], @@ -71,7 +73,8 @@ return [ "preview_pdf" => "Previsualizar PDF", "imprimir_codigo_safekat" => "Imprimir código SAFEKAT", "imprimir_ferro" => "Imprimir ferro", - "planning_rotativa" => "Tareas rotativa", + "planning_rotativa" => "Planificación rotativa", + "planning_plana" => "Planificación plana", "solapa" => "Solapa", "papel_gramajes" => "Papel y gramajes" diff --git a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php index bd7ff3a0..d6a7d7c1 100644 --- a/ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php +++ b/ci4/app/Models/OrdenTrabajo/OrdenTrabajoDate.php @@ -61,9 +61,9 @@ class OrdenTrabajoDate extends Model // Callbacks protected $allowCallbacks = true; protected $beforeInsert = []; - protected $afterInsert = ["updateOrdenTrabajoUser"]; + protected $afterInsert = []; protected $beforeUpdate = []; - protected $afterUpdate = ["updateOrdenTrabajoUser"]; + protected $afterUpdate = []; protected $beforeFind = []; protected $afterFind = []; protected $beforeDelete = []; @@ -102,7 +102,7 @@ class OrdenTrabajoDate extends Model } return $data; } - protected function updateUserDateMap($data,$values){ + public function updateUserDateMap($orden_trabajo_id,$data){ $mapping = [ "fecha_encuadernado_at" => "encuadernacion_user_id", // "fecha_externo_at" => "null", @@ -121,10 +121,10 @@ class OrdenTrabajoDate extends Model ]; $otUser = model(OrdenTrabajoUser::class); $auth_user_id = auth()->user()->id; - foreach ($values as $key => $value) { + foreach ($data as $key => $value) { if(isset($mapping[$key])){ if($value){ - $otUser->where('orden_trabajo_id',$data['orden_trabajo_id']) + $otUser->where('orden_trabajo_id',$orden_trabajo_id) ->set([$mapping[$key] => $auth_user_id]) ->update(); } diff --git a/ci4/app/Models/Tarifas/Maquinas/TarifaExtraMaquinaModel.php b/ci4/app/Models/Tarifas/Maquinas/TarifaExtraMaquinaModel.php index 1ee4be1e..8cb8d36d 100644 --- a/ci4/app/Models/Tarifas/Maquinas/TarifaExtraMaquinaModel.php +++ b/ci4/app/Models/Tarifas/Maquinas/TarifaExtraMaquinaModel.php @@ -9,7 +9,7 @@ use CodeIgniter\Model; class TarifaExtraMaquinaModel extends Model { - protected $table = 'tarifa_acabado_maquinas'; + protected $table = 'tarifa_extra_maquinas'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = TarifaExtraMaquinaEntity::class; diff --git a/ci4/app/Services/ChatService.php b/ci4/app/Services/ChatService.php index 97d88a65..4a91bf92 100644 --- a/ci4/app/Services/ChatService.php +++ b/ci4/app/Services/ChatService.php @@ -22,7 +22,7 @@ use CodeIgniter\Email\Email; class ChatService extends BaseService { protected ?ChatEntity $chatEntity; - protected Email $emailService; + protected EmailService $emailService; protected UserModel $userModel; protected ChatModel $chatModel; protected ChatMessageModel $chatMessageModel; diff --git a/ci4/app/Services/ProductionService.php b/ci4/app/Services/ProductionService.php index 70b5b11f..6f9ea0c6 100644 --- a/ci4/app/Services/ProductionService.php +++ b/ci4/app/Services/ProductionService.php @@ -13,10 +13,14 @@ use App\Models\OrdenTrabajo\OrdenTrabajoTarea; use App\Models\OrdenTrabajo\OrdenTrabajoUser; use App\Models\Usuarios\UserModel; use CodeIgniter\Config\BaseService; +use App\Entities\Configuracion\Maquina as MaquinaEntity; +use App\Entities\Produccion\OrdenTrabajoTareaEntity; +use App\Models\Configuracion\MaquinaModel; use CodeIgniter\Database\BaseBuilder; use CodeIgniter\Database\BaseResult; use CodeIgniter\Database\Exceptions\DatabaseException; use CodeIgniter\I18n\Time; +use CodeIgniter\Model; use Dompdf\Dompdf; /** @@ -24,12 +28,19 @@ use Dompdf\Dompdf; */ class ProductionService extends BaseService { + public array $TIPOS_PLANA = ['lp_bn','lp_color','lp_colorhq']; + public array $TIPOS_ROTATIVA = ['lp_rot_bn','lp_rot_color']; + protected OrdenTrabajoModel $otModel; + protected OrdenTrabajoTarea $otTarea; protected OrdenTrabajoDate $otDate; protected OrdenTrabajoUser $otUser; protected OrdenTrabajoEntity $ot; protected UserModel $userModel; + protected string $defaultMaquinaCorteName = 'HT-1000'; + protected MaquinaEntity $defaultMaquinaCorte; + protected MaquinaModel $maquinaModel; protected array $MAPPING_DATE_USER = [ "fecha_encuadernado_at" => "encuadernacion_user_id", // "fecha_externo_at" => "null", @@ -70,10 +81,12 @@ class ProductionService extends BaseService } public function init(int $orden_trabajo_id): self { + $this->maquinaModel = model(MaquinaModel::class); $this->otModel = model(OrdenTrabajoModel::class); $this->ot = $this->otModel->find($orden_trabajo_id); $pedido = $this->ot->pedido(); $this->setPedido($pedido); + $this->defaultMaquinaCorte = $this->maquinaModel->where('nombre',$this->defaultMaquinaCorteName)->first(); return $this; } /** @@ -140,14 +153,17 @@ class ProductionService extends BaseService $fecha_encuadernado = Time::now()->addDays(2)->format("Y-m-d"); $fecha_entrega_real = Time::now()->addDays(5)->format("Y-m-d"); $fecha_embalaje_at = Time::now()->addDays(4)->format("Y-m-d"); - return $this->otDate->insert([ + $data = [ "orden_trabajo_id" => $this->ot->id, "fecha_encuadernado_at" => $fecha_encuadernado, "fecha_entrega_real_at" => $fecha_entrega_real, "fecha_impresion_at" => Time::now()->format("Y-m-d"), "embalaje_at" => $fecha_embalaje_at, "fecha_entrega_externo" => $this->pedido->fecha_entrega_externo, - ]); + ]; + $otDateId = $this->otDate->insert($data); + $this->otDate->updateUserDateMap($this->ot->id,$data); + return $otDateId; } protected function storeOrdenTrabajoUsers(): int|bool|string { @@ -171,7 +187,7 @@ class ProductionService extends BaseService return $r; } /** - * Inserta las tareas de la orden de trabajo. + * Inserta las tareas de la orden de trabajo.p * Acepta como argumento una entidad de la orden de trabajo OrdenTrabajoEntity * * @@ -196,9 +212,28 @@ class ProductionService extends BaseService $ot_tareas["tiempo_real"] = $p_linea->horas_maquina; //? Tiempo real se inserta manual? $insert_query_result = $this->otTarea->insert($ot_tareas); $ot_tareas = []; + $this->storeTareaCorte($p_linea); } return $insert_query_result; } + protected function storeTareaCorte(PresupuestoLineaEntity $pLinea): ?OrdenTrabajoTareaEntity + { + $otCorte = null; + if($pLinea->isRotativa()){ + $tareaId = $this->otTarea->insert([ + 'orden_trabajo_id' => $this->ot->id, + 'presupuesto_linea_id' => $pLinea->id, + 'nombre' => 'Corte', + 'maquina_id' => $this->defaultMaquinaCorte->id, + 'orden' => $this->defaultMaquinaCorte->orden_planning, + 'tiempo_estimado' => $pLinea->rotativa_tiempo_corte, + 'tiempo_real' => $pLinea->rotativa_tiempo_corte + ]); + $otCorte = $this->otTarea->find($tareaId); + } + return $otCorte; + } + protected function storeOrdenTrabajoAcabadoTareas(): bool { $p_lineas = $this->presupuesto_lineas_acabado(); @@ -404,6 +439,7 @@ class ProductionService extends BaseService "ordenes_trabajo.total_tirada as ot_tirada", "lg_papel_formato.ancho as papel_ancho", "lg_papel_formato.alto as papel_alto", + "presupuesto_linea.rotativa_metros_total as metros", // "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') as maquina_ancho", // "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') as maquina_alto", "lg_papel_impresion.nombre as papel_impresion", @@ -422,7 +458,49 @@ class ProductionService extends BaseService ->join("lg_maquinas as lgmp", "lgmp.id = presupuesto_linea.maquina_id", "left") ->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left") // ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id) - ->whereIn("presupuesto_linea.tipo", ["lp_rot_bn", "lp_rot_color"]) + ->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"); + return $q; + } + /** + * Query para mostrar en datatable + * + * @return BaseBuilder + */ + public function planningPlanaQueryDatatable(): BaseBuilder + { + $q = $this->otModel->builder()->select([ + "ordenes_trabajo.id as otId", + "orden_trabajo_dates.fecha_entrega_real_at", + "presupuestos.titulo as presupuesto_titulo", + "orden_trabajo_tareas.maquina_id", + "lg_maquinas.nombre as maquina_planning_nombre", + "ordenes_trabajo.total_tirada as ot_tirada", + "lg_papel_formato.ancho as papel_ancho", + "lg_papel_formato.alto as papel_alto", + "presupuesto_linea.pliegos_pedido as pliegosPedido", + // "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') as maquina_ancho", + // "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') as maquina_alto", + "lg_papel_impresion.nombre as papel_impresion", + "presupuesto_linea.gramaje as papel_gramaje", + + + + ]) + ->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left") + ->join("orden_trabajo_dates", "orden_trabajo_dates.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_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left") + ->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left") + ->join("lg_papel_impresion", "lg_papel_impresion.id = presupuesto_linea.papel_impresion_id", "left") + ->join("lg_maquinas as lgmp", "lgmp.id = presupuesto_linea.maquina_id", "left") + ->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left") + // ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id) + ->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"); return $q; @@ -472,6 +550,7 @@ class ProductionService extends BaseService "lg_papel_formato.alto as papel_alto", // "CAST(JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') AS DOUBLE) as maquina_ancho", // "CAST(JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') AS DOUBLE) as maquina_alto", + "presupuesto_linea.rotativa_metros_total as metros", "SUM(ordenes_trabajo.total_tirada) as totalTirada", "SUM(orden_trabajo_tareas.tiempo_real) as tiempoReal" ]) @@ -482,6 +561,34 @@ class ProductionService extends BaseService ->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_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_ROTATIVA) + ->groupBy('lg_papel_impresion.id'); + + + + return $q; + } + public function papelPliegoDatatableQuery(): BaseBuilder + { + $q = $this->otModel->builder()->select([ + "lg_papel_impresion.id as papelImpresionId", + "lg_papel_impresion.nombre as papelImpresionNombre", + "lg_papel_impresion.gramaje as papelImpresionGramaje", + "COUNT(orden_trabajo_tareas.id) as tareasCount", + "lg_papel_formato.ancho as papel_ancho", + "lg_papel_formato.alto as papel_alto", + "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_papel_impresion", "presupuesto_linea.papel_impresion_id = lg_papel_impresion.id", "left") + ->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_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_papel_impresion.id'); @@ -614,18 +721,23 @@ class ProductionService extends BaseService public function updateOrdenTrabajoDate($data) { - // // return $this->otDate->find($this->ot->id); + $result = []; $otDate = $this->otDate->where('orden_trabajo_id', $this->ot->id) ->set([$data['name'] => $data[$data['name']]]) ->update($data); + $this->otDate->updateUserDateMap($this->ot->id,$data); $ot_users = $this->ot->users(); - if($this->MAPPING_DATE_USER[$data["name"]]){ + if(isset($this->MAPPING_DATE_USER[$data["name"]])){ $user_id = $ot_users->{$this->MAPPING_DATE_USER[$data["name"]]}; $user = $this->userModel->find($user_id); - return ["user" => $user, "status" => $otDate]; + if($user_id){ + $result = ["user" => null, "status" => false]; + } + $result = ["user" => $user, "status" => $otDate]; }else{ - return ["user" => null, "status" => false]; + $result = ["user" => null, "status" => false]; } + return $result; } public function updateOrdenTrabajo($data): bool diff --git a/ci4/app/Views/themes/vuexy/components/tables/planning_papel_gramaje_table.php b/ci4/app/Views/themes/vuexy/components/tables/planning_papel_gramaje_table.php index cc71352d..e8427765 100644 --- a/ci4/app/Views/themes/vuexy/components/tables/planning_papel_gramaje_table.php +++ b/ci4/app/Views/themes/vuexy/components/tables/planning_papel_gramaje_table.php @@ -19,7 +19,7 @@ Total: - (m) + diff --git a/ci4/app/Views/themes/vuexy/components/tables/planning_papel_pliego_table.php b/ci4/app/Views/themes/vuexy/components/tables/planning_papel_pliego_table.php new file mode 100644 index 00000000..51a75dca --- /dev/null +++ b/ci4/app/Views/themes/vuexy/components/tables/planning_papel_pliego_table.php @@ -0,0 +1,29 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
(gr)(HH:MM)
Total:
+
\ No newline at end of file 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 new file mode 100644 index 00000000..e0e9aac3 --- /dev/null +++ b/ci4/app/Views/themes/vuexy/components/tables/planning_plana_table.php @@ -0,0 +1,43 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/components/tables/planning_rot_table.php b/ci4/app/Views/themes/vuexy/components/tables/planning_rot_table.php index 7cb8e213..f12d2c00 100644 --- a/ci4/app/Views/themes/vuexy/components/tables/planning_rot_table.php +++ b/ci4/app/Views/themes/vuexy/components/tables/planning_rot_table.php @@ -19,16 +19,16 @@ - - - - - - + + + + + + - @@ -39,7 +39,7 @@ - + diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otCosts.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otCosts.php index c6d7826b..874d4a23 100644 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otCosts.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otCosts.php @@ -3,7 +3,10 @@

diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php index 26d44620..59aeb8cf 100644 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otDates.php @@ -3,7 +3,10 @@

diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otDetails.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otDetails.php index 3c2279e5..e8c94487 100644 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otDetails.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otDetails.php @@ -3,37 +3,79 @@

-
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - +
+
+
+
+
+
+
+ +
+
+
papel_formato()->ancho?>xpapel_formato()->alto?>
+ +
+
+
+
+
+
+ +
+
+
merma?>
+ +
+
+
+
+
+
+ +
+
+
solapas?>
+ + +
+
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+
merma?>
+ + +
+
+
+
+
diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php new file mode 100644 index 00000000..08c29f9a --- /dev/null +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php @@ -0,0 +1,45 @@ +
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+

[id ?>]titulo ?>

+

nombre ?>

+

OT : id ?>

+
+
+

progreso ?> %

+ Progreso +
+
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otPortada.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otPortada.php index 508202ff..8e13bdc7 100644 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otPortada.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otPortada.php @@ -2,8 +2,10 @@

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 1cbcb577..3abb1ac0 100644 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otProgress.php @@ -3,7 +3,10 @@

diff --git a/ci4/app/Views/themes/vuexy/form/produccion/ot/otTask.php b/ci4/app/Views/themes/vuexy/form/produccion/ot/otTask.php index 113178d8..40eb9437 100644 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/otTask.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/otTask.php @@ -3,7 +3,10 @@

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 48b56fb7..2c84a148 100644 --- a/ci4/app/Views/themes/vuexy/form/produccion/ot/viewPlanningRotativa.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/ot/viewPlanningRotativa.php @@ -12,11 +12,24 @@
-
- -
endSection() ?> section('css') ?> diff --git a/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoEdit.php b/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoEdit.php index 59191045..5340bde6 100644 --- a/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoEdit.php +++ b/ci4/app/Views/themes/vuexy/form/produccion/viewOrdenTrabajoEdit.php @@ -5,79 +5,8 @@ extend('themes/vuexy/main/defaultlayout') ?> section('content'); ?>
-
-
-
-
-
-
-
-
-
+ - -
-
- - -
- -
diff --git a/ci4/app/Views/themes/vuexy/main/menus/produccion_menu.php b/ci4/app/Views/themes/vuexy/main/menus/produccion_menu.php index b59fd6ac..399ff4a3 100644 --- a/ci4/app/Views/themes/vuexy/main/menus/produccion_menu.php +++ b/ci4/app/Views/themes/vuexy/main/menus/produccion_menu.php @@ -33,7 +33,7 @@ if (auth()->user()->inGroup('beta')) { --> diff --git a/httpdocs/assets/img/cortadora_bobinas.png b/httpdocs/assets/img/cortadora_bobinas.png new file mode 100644 index 00000000..e802a0f3 Binary files /dev/null and b/httpdocs/assets/img/cortadora_bobinas.png differ diff --git a/httpdocs/assets/img/guillotina.png b/httpdocs/assets/img/guillotina.png new file mode 100644 index 00000000..3e6343ae Binary files /dev/null and b/httpdocs/assets/img/guillotina.png differ diff --git a/httpdocs/assets/js/safekat/pages/produccion/ot.js b/httpdocs/assets/js/safekat/pages/produccion/ot.js index 616b8a4e..23a52461 100644 --- a/httpdocs/assets/js/safekat/pages/produccion/ot.js +++ b/httpdocs/assets/js/safekat/pages/produccion/ot.js @@ -1,7 +1,7 @@ import Ajax from "../../components/ajax.js" import ClassSelect from "../../components/select2.js"; import DatePicker from "../../components/datepicker.js"; -import { alertConfirmationDelete } from "../../components/alerts/sweetAlert.js"; +import { alertConfirmationDelete, alertSuccess } from "../../components/alerts/sweetAlert.js"; import Modal from "../../components/modal.js" class OrdenTrabajo { @@ -100,7 +100,7 @@ class OrdenTrabajo { this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this)) this.otForm.on("click", ".ot-tarea-comment", this.handleNoteTarea.bind(this)) $("#btn-update-tarea-comment").on("click", this.handleTareaNoteSubmit.bind(this)) - this.otForm.on("keyup","#ot-comment",this.handleOtComment.bind(this)) + this.otForm.on("change", "#ot-comment", this.handleOtComment.bind(this)) this._handleGetData() this.handleGetPortada() @@ -116,7 +116,7 @@ class OrdenTrabajo { bottomEnd: 'paging' }, serverSide: true, - responsive : true, + responsive: true, createdRow: this.filterCreatedRow.bind(this), pageLength: 10, language: { @@ -231,10 +231,10 @@ class OrdenTrabajo { } fillOtDetails() { const progreso = this.summaryData.ot.progreso - this.otForm.find("#ot-progress-bar").attr('aria-valuenow',progreso).text(progreso + "%").css("width",progreso + "%") - this.otForm.find("#ot-paginas").val(this.summaryData.presupuesto.paginas) - this.otForm.find("#ot-tirada").val(this.summaryData.presupuesto.tirada) - this.otForm.find("#ot-merma").val(this.summaryData.presupuesto.merma) + this.otForm.find("#ot-progress-bar").attr('aria-valuenow', progreso).text(progreso + "%").css("width", progreso + "%") + this.otForm.find("#ot-paginas").text(this.summaryData.presupuesto.paginas) + this.otForm.find("#ot-tirada").text(this.summaryData.presupuesto.tirada) + this.otForm.find("#ot-merma").text(this.summaryData.presupuesto.merma) } fillOtDates() { this.fechaImpresion.setDate(this.summaryData.dates.fecha_impresion_at) @@ -275,7 +275,7 @@ class OrdenTrabajo { handleTareaNoteSubmit(event) { const data = {} data["comment"] = $("#comment-tarea").val() - data["orden_trabajo_tarea_id"] = $("#comment-tarea").data("id") + data["orden_trabajo_tarea_id"] = this.tareaIdComment const ajax = new Ajax( "/produccion/ordentrabajo/update/tarea", data, @@ -291,17 +291,19 @@ class OrdenTrabajo { this._handleGetData(); } handleTareaChangeError(error) { } - handleOtComment(event){ + handleOtComment(event) { console.log($(event.currentTarget).val()) const ajax = new Ajax( "/produccion/ordentrabajo/update", { - "orden_trabajo_id" : this.modelId, - "name" : $(event.currentTarget).attr("name"), - "comentarios" : $(event.currentTarget).val() + "orden_trabajo_id": this.modelId, + "name": $(event.currentTarget).attr("name"), + "comentarios": $(event.currentTarget).val() }, null, - null, + (response) => { + alertSuccess(response.message).fire() + }, null ) ajax.post(); @@ -326,7 +328,11 @@ class OrdenTrabajo { } handleDateChangeSuccess(formItem, response) { formItem.addClass("is-valid") - formItem.parent().append(`
${[response.user.first_name, response.user.last_name].join(" ")}
`) + alertSuccess(response.message).fire() + if (response.user) { + formItem.parent().find(".form-text").remove() + formItem.parent().append(`
${[response.user.first_name, response.user.last_name].join(" ")}
`) + } } handleDateChangeError(errors) { } handlePreimpresionReviewChange(event) { @@ -455,10 +461,10 @@ class OrdenTrabajo { } handleDeleteTareaError() { } handleNoteTarea(event) { - let tarea_id = $(event.currentTarget).data("id"); - const tarea = this.summaryData.tasks.find(task => task.id == tarea_id) + this.tareaIdComment = $(event.currentTarget).data("id"); + const tarea = this.summaryData.tasks.find(task => task.id == this.tareaIdComment) if (tarea) { - $("#comment-tarea").attr("data-id", tarea_id) + $("#comment-tarea").attr("data-id", this.tareaIdComment) $("#comment-type").text(tarea.nombre ?? "") $("#comment-tarea").val(tarea.comment) this.tareaCommentModal.toggle() 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 8b3225fc..e590a591 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 @@ -6,24 +6,45 @@ class PlanningRotativa { constructor(domItem) { this.item = domItem this.tablePlanningRot = this.item.find("#planning-rotativa-datatable") + 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.papelImpresionHeader = this.item.find('#papel-impresion-name-header') + this.papelImpresionPlanaHeader = this.item.find('#papel-impresion-name-plana-header') + this.checkAllMetros = this.item.find("#metros-check-all") + this.checkAllPliegos = this.item.find("#pliegos-check-all") + this.datatableColumns = [ - { data: 'otId', searchable: false, sortable: false }, - { data: 'fecha_entrega_real_at', searchable: true, sortable: false }, - { data: 'presupuesto_titulo', searchable: true, sortable: false }, - { data: 'maquina_planning_nombre', searchable: true, sortable: false }, - { data: 'ot_tirada', searchable: false, sortable: false, }, - { data: 'papel_ancho', searchable: false, sortable: false, render: d => `${d}` }, - { data: 'papel_alto', searchable: false, sortable: false, render: d => `${d}` }, + { data: 'otId', searchable: false, sortable: false, width: "3rem" }, + { data: 'fecha_entrega_real_at', searchable: true, sortable: false, width: "15rem" }, + { data: 'presupuesto_titulo', searchable: true, sortable: false, width: "20rem" }, + { data: 'maquina_planning_nombre', searchable: true, sortable: false, width: "10rem" }, + { data: 'ot_tirada', searchable: false, sortable: false, width: "5rem" }, + { data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `${d}` }, + { data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `${d}` }, { data: 'papel_impresion', searchable: false, sortable: false }, - { data: 'papel_gramaje', searchable: false, sortable: false, render: d => `${d}` }, - { data: 'corte', searchable: false, sortable: false, render: d => d }, + { data: 'papel_gramaje', searchable: false, sortable: false, width: "5rem", render: d => `${d}` }, + { data: 'corte', searchable: false, sortable: false, render: this.renderCorteImage.bind(this), width: "10rem" }, { data: 'metros_check', searchable: false, sortable: false, render: d => `` }, { data: 'metros', searchable: false, sortable: false, render: d => `${d}` }, { data: 'action', searchable: false, sortable: false, render: this._renderBtnAction }, + ] + this.datatablePlanaColumns = [ + { data: 'otId', searchable: false, sortable: false, width: "3rem" }, + { data: 'fecha_entrega_real_at', searchable: true, sortable: false, width: "15rem" }, + { data: 'presupuesto_titulo', searchable: true, sortable: false, width: "20rem" }, + { data: 'maquina_planning_nombre', searchable: true, sortable: false, width: "10rem" }, + { data: 'ot_tirada', searchable: false, sortable: false, width: "5rem" }, + { data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `${d}` }, + { data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `${d}` }, + { data: 'papel_impresion', searchable: false, sortable: false }, + { data: 'papel_gramaje', searchable: false, sortable: false, width: "5rem", render: d => `${d}` }, + { data: 'pliegos_check', searchable: false, sortable: false, render: d => `` }, + { data: 'pliegosPedido', searchable: false, sortable: false, render: d => `${d}` }, + { data: 'action', searchable: false, sortable: false, render: this._renderBtnAction }, + ] this.papelGramajeDatatableColumns = [ { data: 'papelImpresionNombre', searchable: true, sortable: true }, @@ -31,7 +52,7 @@ class PlanningRotativa { { data: 'tareasCount', searchable: true, sortable: true }, { data: 'totalTirada', searchable: false, sortable: false }, { data: 'metros', searchable: false, sortable: false, render: d => `${d}` }, - { data: 'tiempoReal', searchable: false, sortable: false }, + { data: 'tiempoReal', searchable: false, sortable: false, render: d => this.formatSeconds(d) }, { data: 'action', searchable: false, sortable: false, render: (d) => { return `` @@ -40,32 +61,82 @@ class PlanningRotativa { ] - this.maquinaSelectFilter = new ClassSelect($("#maquina-select-filter"), `/maquinas/select`, "Seleccione una maquina", true, {}, $('body')); - this.papelImpresionFilter = new ClassSelect($("#papel-impresion-select-filter"), `/papelesimpresion/select`, "Seleccione un papel", true, {}, $('body')); + this.papelPliegoDatatableColumns = [ + { data: 'papelImpresionNombre', searchable: true, sortable: true }, + { data: 'papelImpresionGramaje', searchable: true, sortable: true }, + { data: 'tareasCount', searchable: true, sortable: true }, + { data: 'totalTirada', searchable: false, sortable: false }, + { data: 'pliegosPedido', searchable: false, sortable: false, render: d => `${d}` }, + { data: 'tiempoReal', searchable: false, sortable: false, render: d => this.formatSeconds(d) }, + { + data: 'action', searchable: false, sortable: false, render: (d) => { + return `` + } + }, + + + ] + this.maquinaSelectFilter = new ClassSelect( + this.tablePlanningRot.find(".planning-maquina-select"), + `/maquinas/select`, + "Seleccione una maquina", + true, { + dropdownCssClass: "h-2" + }, $('body')); + this.papelImpresionFilter = new ClassSelect(this.tablePlanningRot.find(".planning-papel-select"), `/papelesimpresion/select`, "Seleccione un papel", true, {}, $('body')); + this.maquinaSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-select"), `/maquinas/select`, "Seleccione una maquina", true, {}, $('body')); + this.papelImpresionFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-papel-select"), `/papelesimpresion/select`, "Seleccione un papel", true, {}, $('body')); this.maquinaSelectFilter.config.dropdownParent = this.item } init() { + const autoNumericOptions = { + digitGroupSeparator: ".", + decimalCharacter: ",", + allowDecimalPadding: 'floats', + currencySymbol: '(m)', + currencySymbolPlacement: 's', + decimalPlaces: 2, + unformatOnSubmit: true, + + } + const autoNumericPliegosOptions = { + digitGroupSeparator: ".", + decimalCharacter: ",", + allowDecimalPadding: 'floats', + decimalPlaces: 0, + unformatOnSubmit: true, + + } + 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.totalPliegosSel = new AutoNumeric(this.item.find('#pliegos-sel-total')[0], autoNumericPliegosOptions); this.maquinaSelectFilter.init() this.papelImpresionFilter.init() + this.maquinaSelectFilterPlana.init() + this.papelImpresionFilterPlana.init() this.checkAllMetros.on('change', () => { let isChecked = this.checkAllMetros.prop('checked') this.item.find(".metros-check").prop('checked', isChecked).trigger("change") }) + this.checkAllPliegos.on('change', () => { + let isChecked = this.checkAllPliegos.prop('checked') + this.item.find(".pliegos-check").prop('checked', isChecked).trigger("change") + }) this.papelGramajeTablePlanning.on('click', '.papel-gramaje-btn', this.filterPapelGramaje.bind(this)) + this.papelPliegoTablePlanning.on('click', '.papel-pliego-btn', this.filterPapelGramajePlana.bind(this)) + this.papelImpresionFilter.onChange(() => { this.papelImpresionHeader.text(this.papelImpresionFilter.getText()) }) + this.papelImpresionFilterPlana.onChange(() => { + this.papelImpresionPlanaHeader.text(this.papelImpresionFilter.getText()) + }) this.datatablePlanningRot = this.tablePlanningRot.DataTable({ processing: true, orderCellsTop: true, - layout: { - topStart: 'info', - topEnd: null, - bottomStart: 'pageLength', - bottomEnd: 'paging' - }, - + dom: 'lrtip', serverSide: true, responsive: true, pageLength: 10, @@ -75,17 +146,23 @@ class PlanningRotativa { columns: this.datatableColumns, ajax: '/produccion/ordentrabajo/planning/rotativa/datatable' }); + this.datatablePlanningPlana = this.tablePlanningPlana.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.datatablePlanaColumns, + ajax: '/produccion/ordentrabajo/planning/plana/datatable' + }); this.papelGramajeDatatable = this.papelGramajeTablePlanning.DataTable({ processing: true, orderCellsTop: true, - - layout: { - topStart: 'info', - topEnd: null, - bottomStart: 'pageLength', - bottomEnd: 'paging' - }, - + dom: 'lrtip', serverSide: true, responsive: true, pageLength: 10, @@ -95,22 +172,58 @@ class PlanningRotativa { columns: this.papelGramajeDatatableColumns, ajax: '/produccion/ordentrabajo/planning/papel/datatable' }); - this.item.on("keyup", ".planning-filter", (event) => { + this.papelPliegoDatatable = this.papelPliegoTablePlanning.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.papelPliegoDatatableColumns, + ajax: '/produccion/ordentrabajo/planning/papel/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() }) - this.item.on("change", "#maquina-select-filter", (event) => { + this.tablePlanningRot.on("change", ".planning-maquina-select", (event) => { 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) => { + this.tablePlanningRot.on("change", ".planning-papel-select", (event) => { let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name")) this.datatablePlanningRot.column(columnIndex).search(this.papelImpresionFilter.getText()).draw() }) this.papelGramajeDatatable.on('draw', this.addTotalFooter.bind(this)) + this.tablePlanningRot.on('change', ".metros-check", this.calcMetrosCheck.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() + }) + this.tablePlanningPlana.on("change", ".planning-maquina-select", (event) => { + let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name")) + this.datatablePlanningPlana.column(columnIndex).search(this.maquinaSelectFilterPlana.getText()).draw() + }) + this.tablePlanningPlana.on("change", ".planning-papel-select", (event) => { + let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name")) + this.datatablePlanningPlana.column(columnIndex).search(this.papelImpresionFilterPlana.getText()).draw() + }) + this.papelPliegoDatatable.on('draw', this.addTotalFooterPliego.bind(this)) + + this.tablePlanningPlana.on('change', ".pliegos-check", this.calcPliegosCheck.bind(this)) } _renderBtnAction(d) { return `` @@ -123,6 +236,10 @@ class PlanningRotativa { const papelImpresionId = $(event.currentTarget).data('id') this.getPapelImpresion(papelImpresionId) } + filterPapelGramajePlana(event) { + const papelImpresionId = $(event.currentTarget).data('id') + this.getPapelImpresionPlana(papelImpresionId) + } getPapelImpresion(papelImpresionId) { let ajax = new Ajax('/papelesimpresion/show/' + papelImpresionId, null, @@ -132,43 +249,74 @@ class PlanningRotativa { ) ajax.get() } + getPapelImpresionPlana(papelImpresionId) { + let ajax = new Ajax('/papelesimpresion/show/' + papelImpresionId, + null, + null, + this.getPapelImpresionPlanaSuccess.bind(this), + this.getPapelImpresionPlanaError.bind(this) + ) + ajax.get() + } getPapelImpresionSuccess(response) { this.papelImpresionFilter.setOption(response.id, response.nombre) + this.tablePlanningRot.find('input[name=gramaje]').val(response.gramaje).trigger("change") this.papelImpresionHeader.text(response.nombre) } getPapelImpresionError(response) { } + getPapelImpresionPlanaSuccess(response) { + this.papelImpresionFilterPlana.setOption(response.id, response.nombre) + this.tablePlanningPlana.find('input[name=gramaje]').val(response.gramaje).trigger("change") + this.papelImpresionPlanaHeader.text(response.nombre) + } + getPapelImpresionPlanaError(response) { } formatSeconds(s) { return [parseInt(s / 60 / 60), parseInt(s / 60 % 60)].join(':').replace(/\b(\d)\b/g, '0$1'); } addTotalFooter() { - const data = this.papelGramajeDatatable.column(5).data().reduce((a, b) => { - let sa = a.split(":") - let ha = parseInt(sa[0]) * 3600 - let ma = parseInt(sa[1]) * 60 - let sb = b.split(":") - let hb = parseInt(sb[0]) * 3600 - let mb = parseInt(sb[1]) * 60 - return hb + mb + ha + ma - }) - const metros = this.papelGramajeDatatable.column(4).data().reduce((a, b) => { + const seconds = this.papelGramajeDatatable.column(5).data().reduce((a, b) => { + return parseFloat(a) + parseFloat(b) + }, 0) + const metros = this.papelGramajeDatatable.column(4).data().map((e) => parseFloat(e)) + $('#total-tiempo-papel').text(this.formatSeconds(seconds)) + this.totalMetros.set(metros.reduce((a, b) => a + b, 0)) + + + } + addTotalFooterPliego() { + const seconds = this.papelPliegoDatatable.column(5).data().reduce((a, b) => { + return parseFloat(a) + parseFloat(b) + }, 0) + 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)) - return a + b - }) - $('#total-tiempo-papel').text(this.formatSeconds(data)) - $('#total-metros').text(metros) } calcMetrosCheck() { const metros_sel = this.datatablePlanningRot.rows((idx, data, node) => { return $(node).find('input[type="checkbox"]').prop('checked'); - }).data().toArray().reduce((a, b) => { - a = a?.metros ?? 0 - b = b?.metros ?? 0 - return a + b - }, null) - this.item.find('#metros-sel-total').text(metros_sel) + }).data().toArray().map((e) => parseFloat(e.metros)) + this.totalMetrosSel.set(metros_sel.reduce((a, b) => a + b, 0)) } + calcPliegosCheck() { + const metros_sel = this.datatablePlanningPlana.rows((idx, data, node) => { + return $(node).find('input[type="checkbox"]').prop('checked'); + }).data().toArray().map((e) => parseInt(e.pliegosPedido)) + this.totalPliegosSel.set(metros_sel.reduce((a, b) => a + b, 0)) + + } + renderCorteImage() { + return ` + +
+ Guillotina +
+
+ ` + } + }