mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
feat/ot-datatable-news
This commit is contained in:
@ -12,14 +12,14 @@ class OrdenTrabajo extends BaseConfig
|
||||
"interior_bn_at" => "interior_bn_user_id",
|
||||
"interior_color_at" => "interior_color_user_id",
|
||||
"cubierta_at" => "cubierta_user_id",
|
||||
"sobrecubierta_at" => "sobrecubierta_user_id", //TODO
|
||||
"guarda_at" => "guarda_user_id", //TODO
|
||||
"sobrecubierta_at" => "sobrecubierta_user_id",
|
||||
"guarda_at" => "guarda_user_id",
|
||||
//ACABADO
|
||||
"plastificado_at" => "plastificado_user_id",
|
||||
"plakene_at" => "plakene_user_id", //TODO
|
||||
"plakene_at" => "plakene_user_id",
|
||||
"retractilado_at" => "retractilado_user_id",
|
||||
"estampado_at" => "estampado_user_id", //TODO
|
||||
"uvi_at" => "uvi_user_id", //TODO
|
||||
"estampado_at" => "estampado_user_id",
|
||||
"uvi_at" => "uvi_user_id",
|
||||
"encuadernacion_at" => "encuadernacion_user_id",
|
||||
"corte_at" => "corte_user_id",
|
||||
"preparacion_interiores_at" => "preparacion_interior_user_id",
|
||||
@ -121,7 +121,14 @@ class OrdenTrabajo extends BaseConfig
|
||||
"default" => ["bg" => "white", "color" => "black"],
|
||||
];
|
||||
|
||||
|
||||
public array $OT_TAREA_STATUS_COLOR = [
|
||||
"P" => '#FFD63A',
|
||||
"F" => '#67AE6E',
|
||||
"S" => '#EB5B00',
|
||||
"I" => '#3A59D1',
|
||||
"E" => '#FF0B55',
|
||||
"D" => '#FFA725',
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@ -751,6 +751,10 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->get('datatable_pendientes', 'Ordentrabajo::datatable_pendientes');
|
||||
$routes->get('datatable_ferro_pendiente', 'Ordentrabajo::datatable_ferro_pendiente');
|
||||
$routes->get('datatable_ferro_ok', 'Ordentrabajo::datatable_ferro_ok');
|
||||
$routes->get('datatable_news', 'Ordentrabajo::datatable_news');
|
||||
$routes->get('datatable_prod', 'Ordentrabajo::datatable_prod');
|
||||
$routes->get('datatable_waiting', 'Ordentrabajo::datatable_waiting');
|
||||
$routes->get('datatable_revision_com', 'Ordentrabajo::datatable_revision_com');
|
||||
$routes->get('tareas/datatable/(:num)', 'Ordentrabajo::tareas_datatable/$1', ['as' => 'datatableTareasOrdenTrabajo']);
|
||||
$routes->get("tarea/progress/(:num)", "Ordentrabajo::get_orden_trabajo_progress_date/$1");
|
||||
$routes->get('tarea/(:num)', 'Ordentrabajo::find_tarea/$1');
|
||||
|
||||
@ -283,6 +283,62 @@ class Ordentrabajo extends BaseController
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_news()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery();
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_prod()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro',1)->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_waiting()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('ordenes_trabajo.is_pedido_espera',1);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function datatable_revision_com()
|
||||
{
|
||||
$logo = config(LogoImpresion::class);
|
||||
|
||||
$q = $this->otModel->getDatatableQuery()->where('presupuestos.ferro',1)->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
return DataTable::of($q)
|
||||
->add("logo", fn($q) => ["logo" => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)), "imposicion" => $q->imposicion_name, "color" => $this->produccionService->init($q->id)->getOtColorStatus()])
|
||||
->edit(
|
||||
"fecha_encuadernado_at",
|
||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||
)
|
||||
->add("action", fn($q) => $q->id)
|
||||
->toJson(true);
|
||||
}
|
||||
public function papel_gramaje_datatable()
|
||||
{
|
||||
|
||||
@ -585,8 +641,15 @@ class Ordentrabajo extends BaseController
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_tarea_progress_date");
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $this->validation->getValidated(),"errors" => $this->validation->getErrors()]);
|
||||
if ($validated) {
|
||||
$r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($this->validation->getValidated());
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $bodyData]);
|
||||
$validatedData = $this->validation->getValidated();
|
||||
$r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($validatedData);
|
||||
$otTareaEntity = $this->otTarea->find($validatedData['ot_tarea_id']);
|
||||
$data = [
|
||||
"tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_trabajado()),
|
||||
"tarea" => $otTareaEntity,
|
||||
"estado" => $validatedData['estado'],
|
||||
];
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "data" => $data]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
|
||||
@ -178,6 +178,12 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
return $m->where('ot_tarea_id', $this->attributes["id"])->findAll() ?? [];
|
||||
}
|
||||
public function lastState() : ?OrdenTrabajoTareaProgressDateEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
$progressDates = $m->where('ot_tarea_id', $this->attributes["id"])->orderBy('action_at', 'DESC')->first();
|
||||
return $progressDates;
|
||||
}
|
||||
public function tiempo_trabajado()
|
||||
{
|
||||
$dates = $this->progress_dates();
|
||||
|
||||
@ -24,11 +24,11 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
||||
"deleted_at" => null,
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
'plastificado' => false,
|
||||
'plakene' => false,
|
||||
'rectractilado' => false,
|
||||
'estampado' => false,
|
||||
'uvi' => false,
|
||||
'plastificado' => null,
|
||||
'plakene' => null,
|
||||
'rectractilado' => null,
|
||||
'estampado' => null,
|
||||
'uvi' => null,
|
||||
'plastificado_tipo' => null,
|
||||
'plakene_tipo' => null,
|
||||
'rectractilado_tipo' => null,
|
||||
|
||||
@ -1,15 +1,25 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
"navs" => [
|
||||
'finalizadas' => 'Finalizadas',
|
||||
'pendientes' => 'Pendientes',
|
||||
'pendientes_ferro' => 'Ferro pendiente',
|
||||
'ferro_ok' => 'Ferro/Prototipo OK',
|
||||
'news' => 'Nuevas',
|
||||
'waiting' => 'En espera',
|
||||
'revision_com' => 'Revisión comercial',
|
||||
'prod' => 'Producción'
|
||||
],
|
||||
"datatable" => [
|
||||
"pedido_id"=> "Pedido ID",
|
||||
"fecha_encuadernacion"=> "Fecha encuadernación",
|
||||
"fecha_impresion"=> "Fecha impresión",
|
||||
"cliente"=> "Cliente",
|
||||
"titulo"=> "Título",
|
||||
"ubicacion"=> "Ubicación",
|
||||
"tirada"=> "Tirada",
|
||||
"impresion"=> "Impresión",
|
||||
"pedido_id" => "Pedido ID",
|
||||
"fecha_encuadernacion" => "Fecha encuadernación",
|
||||
"fecha_impresion" => "Fecha impresión",
|
||||
"cliente" => "Cliente",
|
||||
"titulo" => "Título",
|
||||
"ubicacion" => "Ubicación",
|
||||
"tirada" => "Tirada",
|
||||
"impresion" => "Impresión",
|
||||
"fecha_entrega_at" => "Fecha entrega prevista",
|
||||
"maquina" => "Máquina",
|
||||
"ancho" => "Ancho",
|
||||
@ -31,8 +41,6 @@ return [
|
||||
"pliegos" => "Pliegos",
|
||||
"pliegos_libro" => "Pliegos",
|
||||
"fecha" => "fecha"
|
||||
|
||||
|
||||
],
|
||||
"task" => [
|
||||
"order" => "Orden",
|
||||
@ -116,7 +124,7 @@ return [
|
||||
"pre_solapa" => "Revisión solapa",
|
||||
"pre_codbarras" => "Revisión código barras",
|
||||
"pre_imposicion" => "Revisión imposición",
|
||||
|
||||
|
||||
"iniciada" => "Iniciada",
|
||||
"finalizada" => "Finalizada",
|
||||
"error" => "Error",
|
||||
@ -128,7 +136,7 @@ return [
|
||||
"attr_not_exist" => "El atributo {0,string} no pertenece al modelo Pedido"
|
||||
|
||||
],
|
||||
|
||||
|
||||
"progress_ferro" => "Ferro",
|
||||
"progress_preimpresion" => "Preimpresión",
|
||||
"progress_logistica" => "Logística",
|
||||
@ -139,6 +147,7 @@ return [
|
||||
"maquinas" => "Máquinas",
|
||||
"tareas_hoy" => "Tareas para HOY",
|
||||
"tareas_all" => "Todas",
|
||||
"tareas_delay" => "Aplazadas",
|
||||
"play_tarea" => "Continuar",
|
||||
"play_pause" => "Pausar",
|
||||
"play_stop" => "Aplazar",
|
||||
@ -146,6 +155,14 @@ return [
|
||||
"cancel" => "Cancelar",
|
||||
|
||||
],
|
||||
'tarea_estados' => [
|
||||
'P' => 'Pendiente',
|
||||
'I' => 'Iniciada',
|
||||
'F' => 'Finalizada',
|
||||
'S' => 'Pausada',
|
||||
'D' => 'Aplazada',
|
||||
'E' => 'Error'
|
||||
],
|
||||
'duplicate_estado_tarea_progress' => "Último estado de la tarea repetido",
|
||||
'task_already_finished' => "La tarea se ha marcado como finalizada.",
|
||||
'print_label' => "Imprimir etiqueta",
|
||||
@ -158,4 +175,4 @@ return [
|
||||
"comentariosEncuadernacion" => "Comentarios encuadernación",
|
||||
"comentariosLogistica" => "Comentarios logística",
|
||||
"info_solapa_guillotina" => "Datos solapa y preparación guillotina",
|
||||
];
|
||||
];
|
||||
|
||||
@ -110,6 +110,12 @@ class ProductionService extends BaseService
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isPlastificado = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene retractilado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
* @var boolean
|
||||
*/
|
||||
public bool $isRetractilado = false; //* CHECK DONE
|
||||
/**
|
||||
* Indica si la orden de trabajo contiene gofrado
|
||||
* Se usa para mostrar la fecha correspondiente en la vista
|
||||
@ -273,6 +279,10 @@ class ProductionService extends BaseService
|
||||
$this->storeOrdenTrabajoUsers();
|
||||
$this->storeOrdenTrabajoDates();
|
||||
$this->storeAllTareas();
|
||||
try {
|
||||
$this->updatePodDates();
|
||||
} catch (\Throwable $th) {
|
||||
}
|
||||
$this->updatePedidoEspera();
|
||||
return $this->ot;
|
||||
}
|
||||
@ -844,6 +854,7 @@ class ProductionService extends BaseService
|
||||
"tareas_preimpresion" => $this->tareas_preimpresion(),
|
||||
"tareas_impresion" => $this->tareas_impresion(),
|
||||
"tiempo_procesamiento" => $this->getTiempoProcesamientoHHMM(),
|
||||
"tiempo_total" => $this->getTiempoTotalTareas(),
|
||||
"statusColor" => $this->getOtColorStatus(),
|
||||
"tareaCosido" => $this->getTareaCosido(),
|
||||
];
|
||||
@ -989,8 +1000,8 @@ class ProductionService extends BaseService
|
||||
throw new Exception(lang('Produccion.task_already_finished'));
|
||||
}
|
||||
}
|
||||
if(isset($data['estado'])){
|
||||
if($data['estado'] == 'F'){
|
||||
if (isset($data['estado'])) {
|
||||
if ($data['estado'] == 'F') {
|
||||
$tareaEntity = $this->otTarea->find($data['ot_tarea_id']);
|
||||
$this->init($tareaEntity->orden_trabajo_id);
|
||||
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
|
||||
@ -1015,11 +1026,11 @@ class ProductionService extends BaseService
|
||||
$data["action_at"] = Time::now()->format('Y-m-d H:i:s');
|
||||
$data["action_user_id"] = auth()->user()->id;
|
||||
$status = $this->otTareaProgressDate->where('ot_tarea_id', $orden_trabajo_tarea_id)->delete();
|
||||
if($status){
|
||||
$tareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
|
||||
$this->init($tareaEntity->orden_trabajo_id);
|
||||
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
|
||||
$this->emptyOrdenTrabajoDate($this->ot->id,$dateName);
|
||||
if ($status) {
|
||||
$tareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
|
||||
$this->init($tareaEntity->orden_trabajo_id);
|
||||
$dateName = $this->getOrdenTrabajoTareaDate($tareaEntity);
|
||||
$this->emptyOrdenTrabajoDate($this->ot->id, $dateName);
|
||||
}
|
||||
if ($status) {
|
||||
$response = $this->storeOrdenTrabajoTareaProgressDate($data);
|
||||
@ -1409,14 +1420,33 @@ class ProductionService extends BaseService
|
||||
}
|
||||
public function getTiempoTareasImpresionHHMM(): string
|
||||
{
|
||||
$tareas_impresion = $this->ot->tareas_impresion();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas_impresion as $key => $tarea) {
|
||||
if ($tarea->is_corte == false) {
|
||||
$tiempo_seconds += $tarea->tiempo_estimado;
|
||||
try {
|
||||
$tareas_impresion = $this->ot->tareas_impresion();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas_impresion as $key => $tarea) {
|
||||
if ($tarea->is_corte == false) {
|
||||
$tiempo_seconds += $tarea->tiempo_estimado;
|
||||
}
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
} catch (\Throwable $th) {
|
||||
return '00:00';
|
||||
}
|
||||
}
|
||||
public function getTiempoTotalTareas(): string
|
||||
{
|
||||
try {
|
||||
$tareas = $this->ot->tareas();
|
||||
$tiempo_seconds = 0;
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
if ($tarea->tiempo_real) {
|
||||
$tiempo_seconds += $tarea->tiempo_real;
|
||||
}
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
} catch (\Throwable $th) {
|
||||
return '00:00';
|
||||
}
|
||||
return float_seconds_to_hhmm_string($tiempo_seconds);
|
||||
}
|
||||
public function getUVI(): ?TarifaAcabadoEntity
|
||||
{
|
||||
@ -1735,13 +1765,13 @@ class ProductionService extends BaseService
|
||||
$acabados = $this->presupuesto->acabados();
|
||||
foreach ($acabados as $key => $acabado) {
|
||||
$tarifa_acabado = $acabado->tarifa();
|
||||
if ($tarifa_acabado->retractilado) {
|
||||
if ($tarifa_acabado->rectractilado) {
|
||||
$flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->isPlakene = $flag;
|
||||
return $this->isPlakene;
|
||||
$this->isRetractilado = $flag;
|
||||
return $this->isRetractilado;
|
||||
}
|
||||
public function plakene_tipo(): ?string
|
||||
{
|
||||
@ -1891,7 +1921,7 @@ class ProductionService extends BaseService
|
||||
)
|
||||
->join("pedidos", "pedidos.id = ordenes_trabajo.pedido_id", "right")
|
||||
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->where('orden_trabajo_tareas.maquina_id', $maquina_id)
|
||||
->where('orden_trabajo_tareas.maquina_id', $maquina_id)
|
||||
// ->where('pedidos.fecha_impresion IS NOT NULL', null, false)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("tarea_progress.estado", 'P')
|
||||
|
||||
@ -18,6 +18,8 @@ use CodeIgniter\I18n\Time;
|
||||
<div class="d-flex flex-row justify-content-center align-items-stretch gap-2 h-100">
|
||||
<button type="button" id="btn-tareas-hoy" class="btn btn-primary h-100 active w-50" aria-pressed="true"><?= lang('Produccion.maquinista.tareas_hoy') ?></button>
|
||||
<button type="button" id="btn-all-tareas" class="btn btn-primary h-100 w-50"><?= lang('Produccion.maquinista.tareas_all') ?></button>
|
||||
<button type="button" id="btn-delay-tasks" class="btn btn-warning h-100 w-50"><?= lang('Produccion.maquinista.tareas_delay') ?></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-xs-12 justify-content-end d-flex">
|
||||
|
||||
@ -268,7 +268,7 @@
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_encuadernado()) > 0 ? "" : "d-none" ?>">
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= count($ot->tareas_manipulado()) > 0 ? "" : "d-none" ?>">
|
||||
<label for="ot-manipulado" class="form-label"><?= @lang("Produccion.manipulado") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="entrada_manipulado_at" id="ot-manipulado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
@ -320,10 +320,12 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<p><?= @lang("Produccion.tiempo_estimado") ?> : <?= $tiempo_estimado ?> (HH:MM)</p>
|
||||
<span><?= @lang("Produccion.tiempo_estimado") ?>(HH:MM)</span>
|
||||
<span class="tiempo-estimado"> <?= $tiempo_estimado ?></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p><?= @lang("Produccion.tiempo_consumido") ?> :</p>
|
||||
<span><?= @lang("Produccion.tiempo_consumido") ?>(HH:MM)</span>
|
||||
<span id="tiempo-total"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
@ -11,17 +11,30 @@
|
||||
<div class="nav-tabs-shadow nav-align-top">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-news-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-news"><?= lang("Produccion.navs.news") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" id="navs-top-align-pendientes-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-pendientes"><?= lang("Produccion.pendientes") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-waiting-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-waiting"><?= lang("Produccion.navs.waiting") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ferro-pendiente-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-pendiente"><?= lang("Produccion.pendiente_ferro") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ferro-ok-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-ok"><?= lang("Produccion.ferro_ok") ?></button>
|
||||
</li>
|
||||
|
||||
<li class="nav-item d-none">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-revision-com-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-revision-com"><?= lang("Produccion.navs.revision_com") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-prod-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-prod"><?= lang("Produccion.navs.prod") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="ots-datatables-container">
|
||||
<div class="tab-pane fade show" id="navs-top-align-finalizados">
|
||||
@ -36,6 +49,19 @@
|
||||
<div class="tab-pane fade show" id="navs-top-align-ferro-ok">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-ferro-ok"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-news">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-news"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-waiting">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-waiting"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-revision-com">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-revision-com"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-top-align-prod">
|
||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-prod"]) ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
|
||||
@ -6,6 +6,12 @@ class OrdenTrabajoDatatable {
|
||||
this.datatablePendientesItem = this.item.find("#ot-datatable-pendientes")
|
||||
this.datatableFerroPendienteItem = this.item.find("#ot-datatable-ferro-pendiente")
|
||||
this.datatableFerroOkItem = this.item.find("#ot-datatable-ferro-ok")
|
||||
this.datatableNews = this.item.find("#ot-datatable-news")
|
||||
this.datatableProd = this.item.find("#ot-datatable-prod")
|
||||
this.datatableWaiting = this.item.find("#ot-datatable-waiting")
|
||||
this.datatableRevisionComerical = this.item.find("#ot-datatable-revision-com")
|
||||
|
||||
|
||||
|
||||
|
||||
this.datatableColumns = [
|
||||
@ -37,15 +43,15 @@ class OrdenTrabajoDatatable {
|
||||
render: (d, t) => {
|
||||
return `<div class="btn-group btn-group-sm">
|
||||
<a type="button" href="/produccion/ordentrabajo/edit/${d}" class=" btn btn-outline ot-edit"><i class="ti ti-eye ti-sm mx-2"></i></a>
|
||||
<a type="button" target="_blank" href="/produccion/ordentrabajo/pdf/${d}" class="btn btn-outline ot-pdf"><i class="ti ti-download ti-sm mx-2"></i></a>
|
||||
|
||||
</div>`
|
||||
}
|
||||
// <a type="button" target="_blank" href="/produccion/ordentrabajo/pdf/${d}" class="btn btn-outline ot-pdf"><i class="ti ti-download ti-sm mx-2"></i></a>
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
init() {
|
||||
this.datatable = this.datatableItem.DataTable({
|
||||
this.datatableItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
@ -71,7 +77,7 @@ class OrdenTrabajoDatatable {
|
||||
});
|
||||
}
|
||||
initPendientes() {
|
||||
this.datatable = this.datatablePendientesItem.DataTable({
|
||||
this.datatablePendientesItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
@ -98,7 +104,7 @@ class OrdenTrabajoDatatable {
|
||||
});
|
||||
}
|
||||
initFerroPendiente() {
|
||||
this.datatable = this.datatableFerroPendienteItem.DataTable({
|
||||
this.datatableFerroPendienteItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
@ -124,7 +130,7 @@ class OrdenTrabajoDatatable {
|
||||
});
|
||||
}
|
||||
initFerroOk() {
|
||||
this.datatable = this.datatableFerroOkItem.DataTable({
|
||||
this.datatableFerroOkItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
@ -149,6 +155,110 @@ class OrdenTrabajoDatatable {
|
||||
}
|
||||
});
|
||||
}
|
||||
initNews() {
|
||||
this.datatableNews.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_news',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initWaiting() {
|
||||
this.datatableWaiting.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_waiting',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initProd() {
|
||||
this.datatableProd.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_prod',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
initRevisionComercial() {
|
||||
this.datatableRevisionComerical.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
columnDefs: [
|
||||
{ className: 'dt-center', targets: '_all' },
|
||||
|
||||
],
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/datatable_revision_com',
|
||||
createdRow: (row,data,dataIndex) => {
|
||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -53,6 +53,8 @@ class MaquinistaTareaView {
|
||||
}
|
||||
disableButtons() {
|
||||
this.actionButtons.attr('disabled', 'disabled')
|
||||
this.btnDelay.attr('disabled','disabled')
|
||||
this.btnDeleteProgress.attr('disabled','disabled')
|
||||
}
|
||||
enableButtons() {
|
||||
this.actionButtons.removeAttr('disabled')
|
||||
@ -126,9 +128,7 @@ class MaquinistaTareaView {
|
||||
console.log("Last status :", lastStatus)
|
||||
this.showBasedOnStatus(lastStatus)
|
||||
}
|
||||
if (response.tiempo_trabajado) {
|
||||
this.item.find('#tiempo-real-info').html(response.tiempo_trabajado)
|
||||
}
|
||||
this.item.find('#tiempo-real-info').html(response.tiempo_trabajado ?? "00:00")
|
||||
this.actionLoader(false)
|
||||
|
||||
}
|
||||
@ -146,15 +146,25 @@ class MaquinistaTareaView {
|
||||
this.handleUpdateTareaProgressError.bind(this),
|
||||
)
|
||||
if (this.tareaId) {
|
||||
ajax.post();
|
||||
if(status == "F"){
|
||||
alertConfirmAction('La tarea se marcará como finalizada')
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
ajax.post();
|
||||
}
|
||||
})
|
||||
}else{
|
||||
ajax.post();
|
||||
}
|
||||
}
|
||||
}
|
||||
handleUpdateTareaProgressSuccess(response) {
|
||||
if (response.data) {
|
||||
if (response.data.estado == 'D') {
|
||||
if (response.data.tarea) {
|
||||
if (response.data.tarea.estado == 'D') {
|
||||
window.location.href = '/produccion/ordentrabajo/maquinista/maquinas/view'
|
||||
}
|
||||
this.showBasedOnStatus(response.data.status)
|
||||
this.item.find('#tiempo-real-info').html(response.data.tiempo_trabajado ?? "00:00")
|
||||
this.showBasedOnStatus(response.data.estado)
|
||||
alertSuccess(response.message, null, { position: 'top' }).fire()
|
||||
}
|
||||
this.actionLoader(false)
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
import OrdenTrabajoDatatable from '../../components/datatables/otDatatable.js'
|
||||
|
||||
$(function() {
|
||||
$(function () {
|
||||
const otDatatable = new OrdenTrabajoDatatable($("#ots-datatables-container"))
|
||||
otDatatable.init()
|
||||
otDatatable.initPendientes()
|
||||
otDatatable.initFerroPendiente()
|
||||
otDatatable.initFerroOk()
|
||||
otDatatable.initNews()
|
||||
otDatatable.initProd()
|
||||
otDatatable.initWaiting()
|
||||
// otDatatable.initRevisionComercial()
|
||||
})
|
||||
@ -21,7 +21,8 @@ class OrdenTrabajo {
|
||||
this.btnErasePedidoDate = this.item.find('.btn-erase-pedido-date');
|
||||
|
||||
this.isOtFinalizada = false;
|
||||
|
||||
this.tiempoTotal = this.item.find('#tiempo-total')
|
||||
this.tiempoEstimado = this.item.find('#tiempo-estimado')
|
||||
this.btnResetTareas = this.item.find("#btn-reset-tareas")
|
||||
this.pedidoEnEsperaCheck = this.item.find("#ot-pedido-espera");
|
||||
this.pedidoEnEsperaBy = this.item.find("#pedido_espera_by");
|
||||
@ -278,7 +279,6 @@ class OrdenTrabajo {
|
||||
createSelectMaquinaTarea() {
|
||||
try {
|
||||
$('.select-proveedor-tarea-datatable').each((index, element) => {
|
||||
console.log(element)
|
||||
this.createSelectProveedor($(element))
|
||||
})
|
||||
this.summaryData.tasks.forEach(async (element) => {
|
||||
@ -472,6 +472,8 @@ 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.tiempoEstimado.html(this.summaryData.tiempo_procesamiento)
|
||||
this.tiempoTotal.html(this.summaryData.tiempo_total)
|
||||
}
|
||||
fillOtDates() {
|
||||
this.fechaImpresion.setDate(this.summaryData.pedido.fecha_impresion)
|
||||
@ -861,7 +863,6 @@ class OrdenTrabajo {
|
||||
alertConfirmationDelete()
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
console.log(name)
|
||||
ajax.post()
|
||||
}
|
||||
})
|
||||
@ -892,7 +893,6 @@ class OrdenTrabajo {
|
||||
alertConfirmationDelete()
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
console.log(name)
|
||||
ajax.post()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user