mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
maquinista view-basic
This commit is contained in:
@ -116,6 +116,8 @@ class OrdenTrabajo extends BaseConfig
|
||||
"default" => ["bg" => "white", "color" => "black"],
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@ -743,6 +743,8 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->get('datatable_ferro_pendiente', 'Ordentrabajo::datatable_ferro_pendiente');
|
||||
$routes->get('datatable_ferro_ok', 'Ordentrabajo::datatable_ferro_ok');
|
||||
$routes->get('tareas/datatable/(:num)', 'Ordentrabajo::tareas_datatable/$1', ['as' => 'datatableTareasOrdenTrabajo']);
|
||||
$routes->get("tarea/progress/(:num)","Ordentrabajo::get_orden_trabajo_progress_date/$1");
|
||||
|
||||
/**======================
|
||||
* UPDATES
|
||||
*========================**/
|
||||
@ -755,6 +757,8 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->post("upload/portada", 'Ordentrabajo::upload_orden_trabajo_portada');
|
||||
$routes->delete("portada/(:num)", 'Ordentrabajo::delete_orden_trabajo_portada/$1');
|
||||
$routes->get("color/(:num)", 'Ordentrabajo::get_orden_trabajo_color_status/$1');
|
||||
$routes->post("update/tarea/progress","Ordentrabajo::store_orden_trabajo_progress_date");
|
||||
$routes->delete("tarea/progress/(:num)","Ordentrabajo::delete_orden_trabajo_progress_date/$1");
|
||||
|
||||
/**======================
|
||||
* FILES
|
||||
@ -784,9 +788,9 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->group('maquinista', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->get('maquinas/view', 'Ordentrabajo::maquinista_maquinas_view', ['as' => 'viewProduccionMaquinistaMaquinas']);
|
||||
$routes->get('maquinas/view/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_list/$1', ['as' => 'viewProduccionMaquinaTareasList']);
|
||||
$routes->get('maquinas/tareas/datatable/(:alpha)/(:num)', 'Ordentrabajo::maquinista_maquina_tareas_datatable/$1/$2', ['as' => 'viewMaquinistaMaquinaTareaDatatable']);
|
||||
|
||||
$routes->get('maquinas/view/tarea/(:num)', 'Ordentrabajo::maquinista_maquina_tarea_view/$1', ['as' => 'viewProduccionMaquinistaTareaView']);
|
||||
|
||||
|
||||
$routes->get('colas/view', 'Ordentrabajo::maquinista_colas_view', ['as' => 'viewProduccionMaquinistaColas']);
|
||||
});
|
||||
});
|
||||
|
||||
@ -155,6 +155,17 @@ class Validation extends BaseConfig
|
||||
],
|
||||
|
||||
];
|
||||
public array $orden_trabajo_tarea_progress_date = [
|
||||
|
||||
"ot_tarea_id" => [
|
||||
"rules" => "required|integer",
|
||||
"label" => "tarea"
|
||||
],
|
||||
"estado" => [
|
||||
"rules" => "required|in_list[P,I,S,D,F,E]",
|
||||
"label" => "estado"
|
||||
]
|
||||
];
|
||||
public array $orden_trabajo = [
|
||||
"orden_trabajo_id" => [
|
||||
"rules" => "required|integer",
|
||||
|
||||
@ -173,7 +173,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ordenes_trabajo.estado", "F");
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
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()])
|
||||
->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") : ""
|
||||
@ -188,7 +188,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->whereIn("ordenes_trabajo.estado", ["I", "PM"]);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
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()])
|
||||
->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") : ""
|
||||
@ -203,7 +203,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at", null);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
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()])
|
||||
->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") : ""
|
||||
@ -218,7 +218,7 @@ class Ordentrabajo extends BaseController
|
||||
$q = $this->otModel->getDatatableQuery()->where("ferro_ok_at is NOT NULL", NULL, FALSE);
|
||||
// return $this->response->setJSON($q->get()->getResultArray());
|
||||
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()])
|
||||
->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") : ""
|
||||
@ -357,7 +357,7 @@ class Ordentrabajo extends BaseController
|
||||
->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") : "")
|
||||
->add("pliegos_check", fn($q) => $q->otId)
|
||||
->add("action", fn($q) => ["data" => $q ])
|
||||
->add("action", fn($q) => ["data" => $q])
|
||||
->toJson(true);
|
||||
}
|
||||
public function select_maquina_planning_rot()
|
||||
@ -460,7 +460,7 @@ class Ordentrabajo extends BaseController
|
||||
{
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Produccion.maquinista.maquinas"), 'route' =>route_to("viewProduccionMaquinistaMaquinas"), 'active' => true],
|
||||
['title' => lang("Produccion.maquinista.maquinas"), 'route' => route_to("viewProduccionMaquinistaMaquinas"), 'active' => true],
|
||||
];
|
||||
$data = [
|
||||
"impresion" => $this->maquinaModel->queryViewMaquinistaMaquinas('impresion')->get()->getResultArray(),
|
||||
@ -469,28 +469,78 @@ class Ordentrabajo extends BaseController
|
||||
];
|
||||
$this->viewData["maquinas"] = $data;
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaMaquinaList', $this->viewData);
|
||||
|
||||
}
|
||||
public function maquinista_maquina_tareas_list(int $maquina_id)
|
||||
{
|
||||
$maquina = $this->maquinaModel->find($maquina_id);
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Produccion.maquinista.maquinas"), 'route' =>route_to("viewProduccionMaquinistaMaquinas"), 'active' => false],
|
||||
['title' => $maquina->nombre, 'route' =>route_to("viewProduccionMaquinistaMaquina",$maquina_id), 'active' => true],
|
||||
['title' => lang("Produccion.maquinista.maquinas"), 'route' => route_to("viewProduccionMaquinistaMaquinas"), 'active' => false],
|
||||
['title' => $maquina->nombre, 'route' => route_to("viewProduccionMaquinistaMaquina", $maquina_id), 'active' => true],
|
||||
];
|
||||
$this->viewData["maquinaEntity"] = $maquina;
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaMaquinaTareas', $this->viewData);
|
||||
|
||||
}
|
||||
public function maquinista_maquina_tarea_view(int $orden_trabajo_tarea_id)
|
||||
{
|
||||
$otTareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
|
||||
$this->viewData['ot_tarea'] = $otTareaEntity;
|
||||
$this->viewData['ot'] = $otTareaEntity->orden_trabajo();
|
||||
$this->viewData['presupuesto'] = $this->viewData['ot']->presupuesto();
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Produccion.maquinista.maquinas"), 'route' => route_to("viewProduccionMaquinistaMaquinas"), 'active' => false],
|
||||
['title' => $otTareaEntity->maquina_actual()->nombre, 'route' => route_to("viewProduccionMaquinaTareasList", $otTareaEntity?->maquina_actual()?->id), 'active' => true],
|
||||
['title' => $otTareaEntity->nombre, 'route' => route_to("viewProduccionMaquinistaTareaView", $otTareaEntity->id), 'active' => true]
|
||||
|
||||
];
|
||||
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaMaquinaTarea', $this->viewData);
|
||||
|
||||
}
|
||||
public function maquinista_colas_view(){
|
||||
public function maquinista_colas_view()
|
||||
{
|
||||
return view(static::$viewPath . '/maquinista/viewMaquinistaPlanningList', $this->viewData);
|
||||
|
||||
}
|
||||
public function maquinista_maquina_tareas_datatable(string $content , int $maquina_id)
|
||||
{
|
||||
$pm = $this->produccionService->getMaquinaImpresionTareasList($maquina_id);
|
||||
if($content == 'today'){
|
||||
$pm->like('pedidos.fecha_impresion', Time::now()->format('Y-m-d'));
|
||||
}
|
||||
return DataTable::of($pm)
|
||||
->edit('fecha_impresion', fn($q) => $q->fecha_impresion ? Time::createFromFormat('Y-m-d H:i:s', $q->fecha_impresion)->format('d/m/Y') : '')
|
||||
->add('action', fn($q) => $this->produccionService->buttonActionDatatableTareaList($q->ot_tarea_id))
|
||||
->toJson(true);
|
||||
}
|
||||
|
||||
|
||||
public function store_orden_trabajo_progress_date()
|
||||
{
|
||||
try {
|
||||
$bodyData = $this->request->getPost();
|
||||
$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]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
return $this->response->setJSON(["status" => false, "error" => $th->getMessage()])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
public function delete_orden_trabajo_progress_date(int $orden_trabajo_tarea_id)
|
||||
{
|
||||
|
||||
$status = $this->produccionService->deleteOrdenTrabajoTareaProgressDates($orden_trabajo_tarea_id);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status]);
|
||||
}
|
||||
public function get_orden_trabajo_progress_date(int $orden_trabajo_tarea_id)
|
||||
{
|
||||
$otTareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
|
||||
$data = [
|
||||
"tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_trabajado()),
|
||||
"progress_dates" => $otTareaEntity->progress_dates(),
|
||||
];
|
||||
return $this->response->setJSON($data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
|
||||
class AddMaquinistaFieldsOrdenTrabajoTareas extends Migration
|
||||
{
|
||||
|
||||
protected array $COLUMNS = [
|
||||
"estado" => [
|
||||
"type" => "ENUM",
|
||||
"constraint" => ["P","I","D","F","E"],
|
||||
"default" => "P",
|
||||
"comment" => "(P)ENDING,(I)NIT,(D)ELAY,(F)INISHED,(E)RROR"
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn("orden_trabajo_tareas", $this->COLUMNS);
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn("orden_trabajo_tareas",array_keys($this->COLUMNS));
|
||||
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,10 @@
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
class AddTableOrdenTrabajoTareaProgressDates extends Migration
|
||||
{
|
||||
@ -13,36 +16,67 @@ class AddTableOrdenTrabajoTareaProgressDates extends Migration
|
||||
"unsigned" => true,
|
||||
"auto_increment" => true,
|
||||
],
|
||||
"init_at" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => "INT",
|
||||
"comment" => "Timestamp task init"
|
||||
],
|
||||
"end_at" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => "INT",
|
||||
"comment" => "Timestamp task finish"
|
||||
],
|
||||
"init_user_id" => [
|
||||
"ot_tarea_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 11
|
||||
],
|
||||
"end_user_id" => [
|
||||
"action_at" => [
|
||||
"type" => "DATETIME",
|
||||
"comment" => "Datetime task init"
|
||||
],
|
||||
"action_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"constraint" => 11
|
||||
"constraint" => 11,
|
||||
"null" => true,
|
||||
],
|
||||
"estado" => [
|
||||
"type" => "ENUM",
|
||||
"constraint" => ["P", "I", "S", "D", "F", "E"],
|
||||
"default" => "P",
|
||||
"comment" => "(P)ENDING,(I)NIT,(S)TOPPED,(D)ELAY,(F)INISHED,(E)RROR"
|
||||
]
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField($this->COLUMNS);
|
||||
$currenttime = new RawSql('CURRENT_TIMESTAMP');
|
||||
$this->forge->addField([
|
||||
'created_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'default' => $currenttime,
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'TIMESTAMP',
|
||||
'null' => true,
|
||||
|
||||
],
|
||||
]);
|
||||
$this->forge->addPrimaryKey('id');
|
||||
$this->forge->addForeignKey('ot_tarea_id', 'orden_trabajo_tareas', 'id');
|
||||
$this->forge->createTable("orden_trabajo_tarea_progress_dates");
|
||||
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
$tareas = $m->findAll();
|
||||
try {
|
||||
foreach ($tareas as $key => $tarea) {
|
||||
$this->db->table('orden_trabajo_tarea_progress_dates')->insert([
|
||||
"ot_tarea_id" => $tarea->id,
|
||||
"action_at" => $tarea->created_at->format('Y-m-d H:i:s'),
|
||||
"action_user_id" => $tarea?->orden_trabajo()?->user_created_id ?? null,
|
||||
]);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
echo $th->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn("orden_trabajo_tareas",array_keys($this->COLUMNS));
|
||||
|
||||
$this->forge->dropTable("orden_trabajo_tarea_progress_dates");
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\Database\RawSql;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
class AddClickColumnOrdenTrabajoTarea extends Migration
|
||||
{
|
||||
|
||||
protected array $COLUMNS = [
|
||||
"click_init" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
"comment" => "Click iniciales de una tarea de impresion"
|
||||
],
|
||||
"click_end" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"default" => 0,
|
||||
"comment" => "Click finales de una tarea de impresion"
|
||||
],
|
||||
];
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addColumn('orden_trabajo_tareas', $this->COLUMNS);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropColumn('orden_trabajo_tareas', array_keys($this->COLUMNS));
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Entities\Pedidos\PedidoEntity;
|
||||
use App\Entities\Presupuestos\PresupuestoEntity;
|
||||
use App\Entities\Usuarios\UserEntity;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoDate;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoFileModel;
|
||||
@ -78,6 +79,15 @@ class OrdenTrabajoEntity extends Entity
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->where("orden_trabajo_id", $this->attributes["id"])->where("presupuesto_linea_id IS NOT NULL", NULL, FALSE)->findAll() ?? [];
|
||||
}
|
||||
/**
|
||||
* Devuelve el presupuesto de la orden de trabajo
|
||||
*
|
||||
* @return PresupuestoEntity
|
||||
*/
|
||||
public function presupuesto(): ?PresupuestoEntity
|
||||
{
|
||||
return $this->pedido()->presupuesto();
|
||||
}
|
||||
/**
|
||||
* Devuelve el pedido de la orden de trabajo
|
||||
|
||||
@ -10,10 +10,12 @@ use App\Entities\Presupuestos\PresupuestoManipuladosEntity;
|
||||
use App\Models\Configuracion\ImposicionModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate;
|
||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||
use App\Models\Presupuestos\PresupuestoLineaModel;
|
||||
use App\Models\Presupuestos\PresupuestoManipuladosModel;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
class OrdenTrabajoTareaEntity extends Entity
|
||||
{
|
||||
@ -30,6 +32,8 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
"is_corte" => null,
|
||||
"tipo_corte" => null,
|
||||
"comment" => null,
|
||||
"click_init" => null,
|
||||
"click_end" => null,
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||
@ -45,7 +49,9 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
"tiempo_real" => "?float",
|
||||
"is_corte" => "boolean",
|
||||
"tipo_corte" => "string",
|
||||
"comment" => "?string"
|
||||
"comment" => "?string",
|
||||
"click_init" => "integer",
|
||||
"click_end" => "integer",
|
||||
];
|
||||
|
||||
/**
|
||||
@ -53,7 +59,7 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return OrdenTrabajoEntity
|
||||
*/
|
||||
public function orden_trabajo() : OrdenTrabajoEntity
|
||||
public function orden_trabajo(): OrdenTrabajoEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoModel::class);
|
||||
return $m->find($this->attributes["orden_trabajo_id"]);
|
||||
@ -63,7 +69,7 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function withOrdenTrabajo() : self
|
||||
public function withOrdenTrabajo(): self
|
||||
{
|
||||
$this->attributes["orden_trabajo"] = $this->orden_trabajo();
|
||||
return $this;
|
||||
@ -73,7 +79,7 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return Maquina
|
||||
*/
|
||||
public function maquina_actual() : Maquina
|
||||
public function maquina_actual(): Maquina
|
||||
{
|
||||
$m = model(MaquinaModel::class);
|
||||
return $m->find($this->attributes["maquina_id"]);
|
||||
@ -83,7 +89,7 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return PresupuestoLineaEntity
|
||||
*/
|
||||
public function presupuesto_linea() : PresupuestoLineaEntity
|
||||
public function presupuesto_linea(): PresupuestoLineaEntity
|
||||
{
|
||||
$m = model(PresupuestoLineaModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
@ -93,7 +99,7 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return Maquina
|
||||
*/
|
||||
public function maquina_presupuesto_linea() : Maquina
|
||||
public function maquina_presupuesto_linea(): Maquina
|
||||
{
|
||||
return $this->presupuesto_linea()->maquina();
|
||||
}
|
||||
@ -102,19 +108,49 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return PresupuestoAcabadosEntity
|
||||
*/
|
||||
public function presupuesto_acabado() : PresupuestoAcabadosEntity
|
||||
public function presupuesto_acabado(): PresupuestoAcabadosEntity
|
||||
{
|
||||
$m = model(PresupuestoAcabadosModel::class);
|
||||
return $m->find($this->attributes["presupuesto_linea_id"]);
|
||||
}
|
||||
public function imposicion() : ?Imposicion
|
||||
public function imposicion(): ?Imposicion
|
||||
{
|
||||
$m = model(ImposicionModel::class);
|
||||
$imposicion = null;
|
||||
if($this->attributes["imposicion_id"]){
|
||||
if ($this->attributes["imposicion_id"]) {
|
||||
$imposicion = $m->find($this->attributes["imposicion_id"]);
|
||||
}
|
||||
return $imposicion;
|
||||
}
|
||||
public function progress_dates(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoTareaProgressDate::class);
|
||||
return $m->where('ot_tarea_id', $this->attributes["id"])->findAll() ?? [];
|
||||
}
|
||||
public function tiempo_trabajado()
|
||||
{
|
||||
$dates = $this->progress_dates();
|
||||
$intervals = [];
|
||||
$init = [];
|
||||
$end = [];
|
||||
foreach ($dates as $key => $date) {
|
||||
if ($date->estado == "I") {
|
||||
if ($date->action_at) {
|
||||
$init = Time::createFromFormat('Y-m-d H:i:s', $date->action_at);
|
||||
}
|
||||
}
|
||||
if ($date->estado == "S" || $date->estado == "F") {
|
||||
if ($date->action_at) {
|
||||
$end = Time::createFromFormat('Y-m-d H:i:s', $date->action_at);
|
||||
$intervals[] = $init->difference($end)->getSeconds();
|
||||
}
|
||||
}
|
||||
}
|
||||
return array_sum($intervals);
|
||||
}
|
||||
public function getClickTarea(): int
|
||||
{
|
||||
return $this->attributes['click_end'] - $this->attributes['click_init'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
31
ci4/app/Entities/Produccion/OrdenTrabajoTareaProgressDateEntity.php
Executable file
31
ci4/app/Entities/Produccion/OrdenTrabajoTareaProgressDateEntity.php
Executable file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entities\Produccion;
|
||||
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
class OrdenTrabajoTareaProgressDateEntity extends Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"ot_tarea_id" => null,
|
||||
"action_at" => null,
|
||||
"action_user_id" => null,
|
||||
"estado" => null
|
||||
];
|
||||
protected $datamap = [];
|
||||
protected $dates = ['created_at', 'updated_at', 'deleted_at','action_at'];
|
||||
protected $casts = [ ];
|
||||
|
||||
/**
|
||||
* Orden de trabajo de la tarea
|
||||
*
|
||||
* @return OrdenTrabajoEntity
|
||||
*/
|
||||
public function orden_trabajo_tarea() : OrdenTrabajoTareaEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
return $m->find($this->attributes["ot_tarea_id"]);
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,6 +4,7 @@ return [
|
||||
"datatable" => [
|
||||
"pedido_id"=> "Pedido ID",
|
||||
"fecha_encuadernacion"=> "Fecha encuadernación",
|
||||
"fecha_impresion"=> "Fecha impresión",
|
||||
"cliente"=> "Cliente",
|
||||
"titulo"=> "Título",
|
||||
"ubicacion"=> "Ubicación",
|
||||
@ -36,6 +37,7 @@ return [
|
||||
"task" => [
|
||||
"order" => "Orden",
|
||||
"task" => "Tarea",
|
||||
"estado" => "Estado",
|
||||
"note" => "Nota",
|
||||
"maquina_presupuesto" => "Máquina presupuesto",
|
||||
"maquina_actual" => "Máquina actual",
|
||||
@ -127,6 +129,19 @@ return [
|
||||
"maquinista" => [
|
||||
"maquinas" => "Máquinas",
|
||||
"tareas_hoy" => "Tareas para HOY",
|
||||
]
|
||||
"tareas_all" => "Todas",
|
||||
"play_tarea" => "Continuar",
|
||||
"play_pause" => "Pausar",
|
||||
"play_stop" => "Aplazar",
|
||||
"play_end" => "Finalizar",
|
||||
"cancel" => "Cancelar",
|
||||
|
||||
],
|
||||
'duplicate_estado_tarea_progress' => "Último estado de la tarea repetido",
|
||||
'task_already_finished' => "La tarea se ha marcado como finalizada.",
|
||||
'print_label' => "Imprimir etiqueta",
|
||||
'click_init' => "Clicks al inicio",
|
||||
'click_end' => "Clicks al final",
|
||||
|
||||
|
||||
];
|
||||
@ -404,12 +404,29 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
->select([
|
||||
'lg_maquinas.id as maquinaId',
|
||||
'lg_maquinas.nombre',
|
||||
'COUNT(orden_trabajo_tareas.id) as countTareas'
|
||||
'COUNT(tarea_progress.ot_tarea_id) as countTareas'
|
||||
])
|
||||
->join('orden_trabajo_tareas','orden_trabajo_tareas.maquina_id = lg_maquinas.id','left')
|
||||
->join('orden_trabajo_tareas', 'orden_trabajo_tareas.maquina_id = lg_maquinas.id', 'left')
|
||||
->join(
|
||||
"(SELECT ot_tarea_id, estado,deleted_at
|
||||
FROM orden_trabajo_tarea_progress_dates
|
||||
WHERE (ot_tarea_id, created_at) IN (
|
||||
SELECT ot_tarea_id, MAX(created_at)
|
||||
FROM orden_trabajo_tarea_progress_dates
|
||||
WHERE estado = 'P'
|
||||
GROUP BY ot_tarea_id
|
||||
)
|
||||
) as tarea_progress",
|
||||
'tarea_progress.ot_tarea_id = orden_trabajo_tareas.id',
|
||||
'left'
|
||||
)
|
||||
->join('ordenes_trabajo', 'ordenes_trabajo.id = orden_trabajo_tareas.orden_trabajo_id', 'left')
|
||||
->join('pedidos', 'pedidos.id = ordenes_trabajo.pedido_id', 'left')
|
||||
->where('lg_maquinas.tipo', $maquina_tipo)
|
||||
->where('lg_maquinas.deleted_at',null)
|
||||
->groupBy('lg_maquinas.id');
|
||||
->where('lg_maquinas.deleted_at', null)
|
||||
->where('tarea_progress.deleted_at', null)
|
||||
->groupBy('lg_maquinas.id')
|
||||
->orderBy('countTareas','DESC');
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
@ -103,8 +103,5 @@ class OrdenTrabajoModel extends Model
|
||||
return $q;
|
||||
}
|
||||
|
||||
public function updateMaquinas(OrdenTrabajoEntity $ot)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,9 @@ class OrdenTrabajoTarea extends Model
|
||||
"tiempo_real",
|
||||
"is_corte",
|
||||
"tipo_corte",
|
||||
"comment"
|
||||
"comment",
|
||||
"click_init",
|
||||
"click_end"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\OrdenTrabajo;
|
||||
|
||||
use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
||||
use CodeIgniter\Database\MySQLi\Builder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class OrdenTrabajoTareaProgressDate extends Model
|
||||
{
|
||||
protected $table = 'orden_trabajo_tarea_progress_dates';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = OrdenTrabajoTareaEntity::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"ot_tarea_id",
|
||||
"action_at",
|
||||
"action_user_id",
|
||||
"estado"
|
||||
];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = true;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
protected $cleanValidationRules = true;
|
||||
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = ['updateTiempoReal'];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
|
||||
protected function updateTiempoReal(array $data)
|
||||
{
|
||||
if (!isset($data['data']['estado']) && !isset($data['data']['ot_tarea_id']) ) {
|
||||
return $data;
|
||||
}
|
||||
$m = model(OrdenTrabajoTarea::class);
|
||||
$ot_tarea = $m->find($data['data']['ot_tarea_id']);
|
||||
if($ot_tarea){
|
||||
$tiempo_real = $ot_tarea->tiempo_trabajado();
|
||||
$m->update($data['data']['ot_tarea_id'],['tiempo_real' => $tiempo_real]);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
@ -20,6 +20,7 @@ use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||
use App\Models\Configuracion\ConfigVariableModel;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoFileModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTareaProgressDate;
|
||||
use App\Models\Pedidos\PedidoModel;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
@ -55,6 +56,7 @@ class ProductionService extends BaseService
|
||||
protected OrdenTrabajoUser $otUser;
|
||||
protected OrdenTrabajoEntity $ot;
|
||||
protected OrdenTrabajoFileModel $otFileModel;
|
||||
protected OrdenTrabajoTareaProgressDate $otTareaProgressDate;
|
||||
protected PedidoModel $pedidoModel;
|
||||
protected UserModel $userModel;
|
||||
protected ConfigVariableModel $configVariableModel;
|
||||
@ -172,6 +174,7 @@ class ProductionService extends BaseService
|
||||
$this->userModel = model(UserModel::class);
|
||||
$this->otFileModel = model(OrdenTrabajoFileModel::class);
|
||||
$this->pedidoModel = model(PedidoModel::class);
|
||||
$this->otTareaProgressDate = model(OrdenTrabajoTareaProgressDate::class);
|
||||
$this->ordenTrabajoConfig = config('OrdenTrabajo');
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
$this->configVariableModel = model(ConfigVariableModel::class);
|
||||
@ -926,7 +929,38 @@ class ProductionService extends BaseService
|
||||
}
|
||||
return $this->otTarea->update($tarea_id, $data);
|
||||
}
|
||||
|
||||
public function storeOrdenTrabajoTareaProgressDate($data): bool
|
||||
{
|
||||
$data["action_at"] = Time::now()->format('Y-m-d H:i:s');
|
||||
$data["action_user_id"] = auth()->user()->id;
|
||||
$lastDate = $this->otTareaProgressDate->where('ot_tarea_id', $data['ot_tarea_id'])->orderBy('action_at', 'DESC')->first();
|
||||
if ($lastDate) {
|
||||
if ($lastDate->estado == $data['estado']) {
|
||||
throw new Exception(lang('Produccion.duplicate_estado_tarea_progress'));
|
||||
}
|
||||
if ($lastDate->estado == 'F') {
|
||||
throw new Exception(lang('Produccion.task_already_finished'));
|
||||
}
|
||||
}
|
||||
return $this->otTareaProgressDate->insert($data);
|
||||
}
|
||||
public function getTareaLastState($tarea_id)
|
||||
{
|
||||
$lastDate = $this->otTareaProgressDate->where('ot_tarea_id', $tarea_id)->orderBy('action_at', 'DESC')->first();
|
||||
return $lastDate->estado;
|
||||
}
|
||||
public function deleteOrdenTrabajoTareaProgressDates($orden_trabajo_tarea_id): bool
|
||||
{
|
||||
$response = false;
|
||||
$data = ['ot_tarea_id' => $orden_trabajo_tarea_id, 'estado' => 'P'];
|
||||
$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) {
|
||||
$response = $this->storeOrdenTrabajoTareaProgressDate($data);
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
public function updateOrdenTrabajoDate($data)
|
||||
{
|
||||
$result = [];
|
||||
@ -1620,4 +1654,56 @@ class ProductionService extends BaseService
|
||||
{
|
||||
return $this->ot->getBarCodeFile();
|
||||
}
|
||||
|
||||
public function getMaquinaImpresionTareasList(int $maquina_id)
|
||||
{
|
||||
|
||||
$q = $this->otModel->builder()->select([
|
||||
"ordenes_trabajo.id as otId",
|
||||
"orden_trabajo_tareas.id as ot_tarea_id",
|
||||
"pedidos.fecha_impresion",
|
||||
"orden_trabajo_tareas.nombre as tareaName",
|
||||
"presupuestos.titulo as presupuesto_titulo",
|
||||
"orden_trabajo_tareas.maquina_id",
|
||||
"lg_papel_impresion.nombre as papel_impresion",
|
||||
"presupuesto_linea.gramaje as papel_gramaje",
|
||||
"tarea_progress.estado as tareaEstado"
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
// Obtener el ultimo estado de la tarea
|
||||
->join(
|
||||
'(SELECT ot_tarea_id, estado
|
||||
FROM orden_trabajo_tarea_progress_dates
|
||||
WHERE (ot_tarea_id, created_at) IN (
|
||||
SELECT ot_tarea_id, MAX(created_at)
|
||||
FROM orden_trabajo_tarea_progress_dates
|
||||
GROUP BY ot_tarea_id
|
||||
)
|
||||
) as tarea_progress',
|
||||
'tarea_progress.ot_tarea_id = orden_trabajo_tareas.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("pedidos", "pedidos.id = ordenes_trabajo.pedido_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")
|
||||
->groupStart()
|
||||
->orWhere('orden_trabajo_tareas.maquina_id', $maquina_id)
|
||||
->orWhere('presupuesto_linea.maquina_id', $maquina_id)
|
||||
->groupEnd()
|
||||
->where('pedidos.fecha_impresion IS NOT NULL', null, false)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("tarea_progress.estado", 'P')
|
||||
->orderBy("pedidos.fecha_impresion", "ASC")
|
||||
->groupBy('orden_trabajo_tareas.nombre');
|
||||
|
||||
return $q;
|
||||
}
|
||||
public function buttonActionDatatableTareaList($id)
|
||||
{
|
||||
$url = route_to("viewProduccionMaquinistaTareaView", $id);
|
||||
return "<a type='button' href='$url' class='maquina-btn btn btn-primary btn-md'><span class='ti ti-arrow-big-right'></span></a>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,21 +6,38 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body row">
|
||||
<div class="col-6">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="mt-lg-4 mt-lg-2 mb-lg-4 mb-2 pt-1 w-100">
|
||||
<p class="mb-0">OT ID</p>
|
||||
<h1 class="mb-0"><?= $ot->id ?></h1>
|
||||
<h4 class="mb-0"><?= $ot->id ?></h4>
|
||||
</div>
|
||||
<div class="mt-lg-4 mt-lg-2 mb-lg-4 mb-2 pt-1 w-100">
|
||||
<p class="mb-0">Clicks presupuesto</p>
|
||||
<h4 class="mb-0"><?= $presupuesto->presupuestoLineaImpresion()->rotativa_clicks_total ?></h4>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="mt-lg-4 mt-lg-2 mb-lg-4 mb-2 pt-1 w-100">
|
||||
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||
<div class="mt-lg-4 mt-lg-2 mb-lg-4 mb-2 pt-1 w-100 h-80 justify-content-start d-flex flex-column">
|
||||
<div>
|
||||
<img class="img-fluid w-100" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row d-flex justify-content-between align-items-center">
|
||||
<div class="col-md-6 mb-2">
|
||||
<p class="mb-0">Tarea</p>
|
||||
<h4 class="mb-0"><?= $ot_tarea->nombre ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="d-flex flex-row justify-content-end align-item-center gap-2">
|
||||
<button type="button" id="ot-messages-show" class="maquina-btn btn btn-primary w-100"><span class="ti ti-message ti-lg"></span></button>
|
||||
<a href="<?=route_to("viewOrdenTrabajoEdit",$ot->id)?>" type="button" class="maquina-btn btn btn-primary w-100"><span class="ti ti-eye ti-lg"></span></a>
|
||||
<!-- <button type="button" id="ot-messages-show" class="maquina-btn btn btn-primary w-100"><span class="ti ti-message ti-lg"></span></button> -->
|
||||
<a href="<?= route_to("viewOrdenTrabajoEdit", $ot->id) ?>" type="button" class="maquina-btn btn btn-primary w-100 d-flex justify-content-center gap-2"><span class="ti ti-eye ti-lg"></span><?= lang('Produccion.ot') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,18 +1,56 @@
|
||||
<div class="card h-100">
|
||||
<div class="card-body row">
|
||||
<div class="card-body">
|
||||
<div class="row h-100">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="col-6">
|
||||
<div class="mt-lg-4 mt-lg-2 mb-lg-4 mb-2 pt-1 w-100">
|
||||
<div class="d-flex flex-column justify-content-evenly gap-2 h-100">
|
||||
|
||||
<div class="row mb-2">
|
||||
|
||||
<div class="col-md-6 mb-2">
|
||||
<p class="mb-0">Tirada</p>
|
||||
<h1 class="mb-0" id="tirada-info"></h1>
|
||||
<h4 class="mb-0" id="tirada-info"><?= $ot->total_tirada ?></h4>
|
||||
</div>
|
||||
<div class="col-md-6 mb-2">
|
||||
<p class="mb-0">Clicks</p>
|
||||
<h4 class="mb-0" id="clicks-info"><?= $ot_tarea->click_tarea ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="d-flex flex-column justify-content-center align-item-center gap-2">
|
||||
<button type="button" id="btn-start-tarea" class="maquina-btn btn btn-success w-100"><span class="ti ti-player-play ti-lg"></span></button>
|
||||
<button type="button" id="btn-stop-tarea" class="maquina-btn btn btn-danger w-100"><span class="ti ti-player-stop ti-lg"></span></button>
|
||||
<button type="button" id="btn-pause-tarea" class="maquina-btn btn btn-warning w-100"><span class="ti ti-player-pause ti-lg"></span></button>
|
||||
<button type="button" id="btn-finish-tarea" class="maquina-btn btn btn-primary w-100"><span class="ti ti-player-eject ti-lg"></span></button>
|
||||
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-6">
|
||||
<p class="mb-0">Tiempo estimado</p>
|
||||
<h4 class="mb-0" id="tiempo-estimado-info"><?= float_seconds_to_hhmm_string($ot_tarea->tiempo_estimado) ?></h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p class="mb-0">Tiempo real</p>
|
||||
<h4 class="mb-0" id="tiempo-real-info"></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group form-group-lg">
|
||||
<label for="input-click-init" class="form-label"><?= lang('Produccion.click_init') ?></label>
|
||||
<input class="form-control input-lg ot-tarea-click" data-id="<?= $ot_tarea->id ?>" min="0" name="click_init" id="input-click-init" placeholder="<?= lang('Produccion.click_init') ?>" value="<?= $ot_tarea->click_init ?>">
|
||||
</div>
|
||||
<div class="col-md-12 form-group form-group-lg">
|
||||
<label for="input-click-init" class="form-label input-lg"><?= lang('Produccion.click_end') ?></label>
|
||||
<input class="form-control ot-tarea-click" data-id="<?= $ot_tarea->id ?>" min="0" name="click_end" id="input-click-end" placeholder="<?= lang('Produccion.click_end') ?>" value="<?= $ot_tarea->click_end ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-6 h-100">
|
||||
<div class="d-flex flex-column justify-content-evenly gap-2 h-100">
|
||||
<button type="button" data-estado="I" id="btn-start-tarea" class="maquina-btn btn btn-success w-100 d-flex justify-content-evenly action-btn"><span class="ti ti-player-play ti-lg"></span><?= lang('Produccion.maquinista.play_tarea') ?></button>
|
||||
<button type="button" data-estado="S" id="btn-pause-tarea" class="maquina-btn btn btn-info w-100 d-flex justify-content-evenly d-none action-btn"><span class="ti ti-player-pause ti-lg"></span><?= lang('Produccion.maquinista.play_pause') ?></button>
|
||||
<button type="button" data-estado="D" id="btn-stop-tarea" class="maquina-btn btn btn-warning w-100 d-flex justify-content-evenly"><span class="ti ti-player-stop ti-lg"></span><?= lang('Produccion.maquinista.play_stop') ?></button>
|
||||
<button type="button" data-estado="F" id="btn-finish-tarea" class="maquina-btn btn btn-primary w-100 d-flex justify-content-evenly action-btn d-none"><span class="ti ti-player-eject ti-lg"></span><?= lang('Produccion.maquinista.play_end') ?></button>
|
||||
<button type="button" id="btn-delete-tarea" class="maquina-btn btn btn-danger w-100 d-flex justify-content-evenly"><span class="ti ti-square-x ti-lg"></span><?= lang('Produccion.maquinista.cancel') ?></button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -1,13 +1,15 @@
|
||||
<div class="table-responsive">
|
||||
<div class="table-maquinista">
|
||||
|
||||
<table id="maquinista-tarea-table" class="table table-hover text-dark" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ID') ?></th>
|
||||
<th><?= lang('Produccion.task.task') ?></th>
|
||||
<th><?= lang('Produccion.task.estado') ?></th>
|
||||
<th><?= lang('Produccion.datatable.titulo') ?></th>
|
||||
<th><?= lang('Produccion.datatable.papel') ?></th>
|
||||
<th><?= lang('Produccion.datatable.gramaje') ?></th>
|
||||
<th><?= lang('Produccion.datatable.fecha') ?></th>
|
||||
<th><?= lang('Produccion.datatable.fecha_impresion') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -15,4 +17,5 @@
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@ -83,7 +83,6 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/index.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||
|
||||
@ -5,31 +5,80 @@
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row">
|
||||
<div class="row" id="viewMaquinistaMaquinaTarea" data-id="<?= $ot_tarea->id ?>">
|
||||
<div class="nav-align-top">
|
||||
<ul class="nav nav-pills mb-4 nav-fill" role="tablist">
|
||||
<li class="nav-item mb-1 mb-sm-0">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link active"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#navs-tarea"
|
||||
aria-controls="navs-tarea"
|
||||
aria-selected="true">
|
||||
<span class="d-none d-sm-inline-flex align-items-center">
|
||||
Tarea
|
||||
</span>
|
||||
<i class="icon-base ti tabler-home icon-sm d-sm-none"></i>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item mb-1 mb-sm-0">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#navs-chat"
|
||||
aria-controls="navs-chat"
|
||||
aria-selected="false">
|
||||
<span class="d-none d-sm-inline-flex align-items-center">Mensajería</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="navs-tarea">
|
||||
<div class="container-fluid h-100">
|
||||
<div class="row mb-2 h-100 d-flex flex-wrap">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12 d-flex justify-content-end mb-2">
|
||||
<button class="btn-primary btn d-flex justify-content-evenly gap-2"><span class="ti ti-barcode ti-lg"></span><?= lang('Produccion.print_label') ?></button>
|
||||
</div>
|
||||
<div class="col-md-6 tarea-card-info-block">
|
||||
<?= view("/themes/vuexy/components/cards/tarea_card.php") ?>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-6 tarea-card-action-block">
|
||||
<?= view("/themes/vuexy/components/cards/tarea_card_actions.php") ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade show" id="navs-chat">
|
||||
<div class="col-md-12 section-block">
|
||||
<?= view("themes/vuexy/components/chat_internal_orden_trabajo", data: ["modelId" => $ot->id, "type" => "orden_trabajo"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/maquinista.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/notiflix/notiflix.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/index.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/notiflix/notiflix.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||
<script type="module" src="<?= site_url("/assets/js/safekat/pages/configuracion/maquinista/viewTareaView.js") ?>"></script>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -5,16 +5,24 @@
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row">
|
||||
<?php
|
||||
|
||||
use CodeIgniter\I18n\Time;
|
||||
?>
|
||||
<div class="row" id="viewMaquinistaMaquinaTareas" data-id="<?= $maquinaEntity->id ?>">
|
||||
<div class="col-md-12">
|
||||
<div class="card vh-100">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row mb-2">
|
||||
<div class="d-flex flex-row justify-content-between align-content-center">
|
||||
<button type="button" class="btn btn-primary"><?= lang('Produccion.maquinista.tareas_hoy') ?></button>
|
||||
<div class="d-flex flex-row justify-content-end align-content-center gap-2">
|
||||
<button type="button" class="btn btn-primary"><?= lang('Produccion.maquinista.maquinas') ?></button>
|
||||
<div class="d-flex flex-row justify-content-between align-items-center">
|
||||
<div class="d-flex flex-row justify-content-start align-items-center gap-2">
|
||||
<button type="button" id="btn-tareas-hoy" class="btn btn-primary h-100 active" aria-pressed="true"><?= lang('Produccion.maquinista.tareas_hoy') ?></button>
|
||||
<button type="button" id="btn-all-tareas" class="btn btn-primary h-100"><?= lang('Produccion.maquinista.tareas_all') ?></button>
|
||||
</div>
|
||||
<span class="display-6" id="today-date"><?= Time::now()->format('d/m/Y') ?></span>
|
||||
<!-- <div class="d-flex flex-row justify-content-end align-content-center gap-2">
|
||||
<button type="button" class="btn btn-primary"><?= lang('Produccion.maquinista.maquinas') ?></button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<?= view("/themes/vuexy/components/tables/maquinista_tarea_table.php") ?>
|
||||
@ -31,7 +39,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/index.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/notiflix/notiflix.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||
|
||||
@ -7,13 +7,13 @@ if (auth()->user()->inGroup('maquina')) {
|
||||
?>
|
||||
<!-- Catalogue -->
|
||||
<li class="menu-item">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle beta">
|
||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||
<i class="menu-icon tf-icons ti ti-printer"></i>
|
||||
<div><?= lang("App.menu_maquinista") ?></div>
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("viewProduccionMaquinistaMaquinas") ?>" class="menu-link beta">
|
||||
<a href="<?= route_to("viewProduccionMaquinistaMaquinas") ?>" class="menu-link">
|
||||
<div><?= lang("App.menu_maquinista_maquinas") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@ -1,4 +1,92 @@
|
||||
|
||||
class MaquinistaTareaList{}
|
||||
class MaquinistaTareaList {
|
||||
constructor(domItem) {
|
||||
this.item = domItem
|
||||
this.maquinaId = this.item.data("id")
|
||||
this.datatableItem = $("#maquinista-tarea-table")
|
||||
this.btnTareasHoy = $("#btn-tareas-hoy")
|
||||
this.todayDate = $('#today-date')
|
||||
this.btnAllTareas = $("#btn-all-tareas")
|
||||
this.datatableColumns = [
|
||||
{ data: 'otId', searchable: false, sortable: false },
|
||||
{ data: 'tareaName', searchable: false, sortable: false },
|
||||
{ data: 'tareaEstado', searchable: false, sortable: false,render : this.renderStado.bind(this)},
|
||||
{ data: 'presupuesto_titulo', searchable: false, sortable: false },
|
||||
{ data: 'papel_impresion', searchable: false, sortable: false },
|
||||
{ data: 'papel_gramaje', searchable: false, sortable: false },
|
||||
{ data: 'fecha_impresion', searchable: false, sortable: false },
|
||||
{ data: 'action', searchable: false, sortable: false, width: "20rem" },
|
||||
]
|
||||
this.urlAll = '/produccion/ordentrabajo/maquinista/maquinas/tareas/datatable/all/' + this.maquinaId
|
||||
this.urlToday = '/produccion/ordentrabajo/maquinista/maquinas/tareas/datatable/today/' + this.maquinaId
|
||||
this.initTable()
|
||||
this.estadoClass = {
|
||||
I : 'primary',
|
||||
P : 'warning',
|
||||
S : 'warning',
|
||||
D : 'danger',
|
||||
F : 'success'
|
||||
}
|
||||
this.estadoNames = {
|
||||
I : 'Iniciada',
|
||||
P : 'Pendiente',
|
||||
S : 'Pausada',
|
||||
D : 'Aplazada',
|
||||
F : 'Finalizada'
|
||||
}
|
||||
|
||||
}
|
||||
init(){
|
||||
this.btnTareasHoy.on('click',this.loadToday.bind(this))
|
||||
this.btnAllTareas.on('click',this.loadAll.bind(this))
|
||||
}
|
||||
initTable() {
|
||||
|
||||
this.datatable = this.datatableItem.DataTable({
|
||||
processing: true,
|
||||
layout: {
|
||||
topStart: 'pageLength',
|
||||
topEnd: 'search',
|
||||
bottomStart: 'info',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
pageLength: 25,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatableColumns,
|
||||
ajax: this.urlToday
|
||||
});
|
||||
}
|
||||
loadToday() {
|
||||
this.btnTareasHoy.removeClass('active')
|
||||
this.btnTareasHoy.removeAttr('aria-pressed')
|
||||
this.btnAllTareas.removeClass('active')
|
||||
this.btnAllTareas.removeAttr('aria-pressed')
|
||||
this.todayDate.removeClass('d-none')
|
||||
this.btnTareasHoy.addClass('active')
|
||||
this.btnTareasHoy.attr('aria-pressed',true)
|
||||
this.datatable.ajax.url(this.urlToday)
|
||||
this.datatable.ajax.reload()
|
||||
|
||||
|
||||
}
|
||||
loadAll(){
|
||||
this.btnTareasHoy.removeClass('active')
|
||||
this.btnTareasHoy.removeAttr('aria-pressed')
|
||||
this.todayDate.addClass('d-none')
|
||||
this.btnAllTareas.addClass('active')
|
||||
this.btnAllTareas.attr('aria-pressed',true)
|
||||
this.datatable.ajax.url(this.urlAll)
|
||||
this.datatable.ajax.reload()
|
||||
|
||||
}
|
||||
renderStado(d){
|
||||
|
||||
return `<span class="badge text-bg-${this.estadoClass[d]}">${this.estadoNames[d]}</span>`
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default MaquinistaTareaList;
|
||||
@ -1,4 +1,201 @@
|
||||
|
||||
class MaquinistaTareaView{}
|
||||
import Ajax from '../../../components/ajax.js'
|
||||
import { alertConfirmAction } from '../../../components/alerts/sweetAlert.js'
|
||||
class MaquinistaTareaView {
|
||||
constructor(domItem) {
|
||||
this.item = domItem
|
||||
this.tareaId = this.item.data("id");
|
||||
this.btnPlay = this.item.find("#btn-start-tarea")
|
||||
this.btnPause = this.item.find("#btn-pause-tarea")
|
||||
this.btnDelay = this.item.find("#btn-stop-tarea")
|
||||
this.btnFinish = this.item.find("#btn-finish-tarea")
|
||||
this.btnDeleteProgress = this.item.find("#btn-delete-tarea")
|
||||
this.actionButtons = this.item.find('.action-btn')
|
||||
this.tareaCardClass = '.tarea-card-action-block'
|
||||
this.inputClick = $('.ot-tarea-click')
|
||||
}
|
||||
init() {
|
||||
this.actionButtons.on('click', this.eventActionButton.bind(this))
|
||||
this.btnDelay.on('click', this.delayEventActionButton.bind(this))
|
||||
this.btnDeleteProgress.on('click', this.handleDeleteTareaProgress.bind(this))
|
||||
this.handleGetTareaProgress();
|
||||
this.inputClick.on('input', this.handleUpdateClickInput.bind(this))
|
||||
}
|
||||
|
||||
eventActionButton(event) {
|
||||
let statusClick = $(event.currentTarget).data('estado');
|
||||
this.showBasedOnStatus(statusClick);
|
||||
console.info(`Estado ${statusClick}`)
|
||||
this.handleUpdateTareaProgress(statusClick)
|
||||
this.handleGetTareaProgress()
|
||||
}
|
||||
delayEventActionButton(event) {
|
||||
let statusClick = $(event.currentTarget).data('estado');
|
||||
this.delayTarea()
|
||||
}
|
||||
actionLoader(status = true) {
|
||||
if (status) {
|
||||
Notiflix.Block.circle(this.tareaCardClass);
|
||||
} else {
|
||||
Notiflix.Block.remove(this.tareaCardClass);
|
||||
}
|
||||
}
|
||||
showPlay() {
|
||||
this.btnPause.addClass('d-none')
|
||||
this.btnPlay.removeClass('d-none')
|
||||
this.btnFinish.removeClass('d-none')
|
||||
|
||||
}
|
||||
showPause() {
|
||||
this.btnPlay.addClass('d-none')
|
||||
this.btnFinish.addClass('d-none')
|
||||
this.btnPause.removeClass('d-none')
|
||||
|
||||
}
|
||||
disableButtons() {
|
||||
this.actionButtons.attr('disabled', 'disabled')
|
||||
}
|
||||
enableButtons() {
|
||||
this.actionButtons.removeAttr('disabled')
|
||||
}
|
||||
handleUpdateClickInput(event) {
|
||||
let tareaId = $(event.currentTarget).data('id');
|
||||
let name = $(event.currentTarget).attr('name')
|
||||
let value = $(event.currentTarget).val()
|
||||
let formData = {
|
||||
orden_trabajo_tarea_id: tareaId
|
||||
}
|
||||
|
||||
formData[name] = value;
|
||||
let ajax = new Ajax('/produccion/ordentrabajo/update/tarea',
|
||||
formData,
|
||||
null,
|
||||
this.handleUpdateClickInputSucess.bind(this),
|
||||
this.handleGetTareaProgressError.bind(this)
|
||||
)
|
||||
if (value) {
|
||||
ajax.post()
|
||||
}
|
||||
|
||||
}
|
||||
handleUpdateClickInputSucess(response) {
|
||||
popSuccessAlert(response.message)
|
||||
}
|
||||
handleUpdateClickInputError(error) {
|
||||
popErrorAlert(error)
|
||||
}
|
||||
handleDeleteTareaProgress() {
|
||||
let ajax = new Ajax('/produccion/ordentrabajo/tarea/progress/' + this.tareaId,
|
||||
null,
|
||||
null,
|
||||
this.handleDeleteTareaProgressSuccess.bind(this),
|
||||
this.handleDeleteTareaProgressError.bind(this)
|
||||
)
|
||||
alertConfirmAction('Se borrará todo el progreso y se reiniciará el progreso')
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
this.actionLoader(true)
|
||||
ajax.delete()
|
||||
}
|
||||
})
|
||||
}
|
||||
handleDeleteTareaProgressSuccess() {
|
||||
window.location.reload()
|
||||
}
|
||||
handleDeleteTareaProgressError(error) {
|
||||
popErrorAlert(error)
|
||||
}
|
||||
|
||||
handleGetTareaProgress() {
|
||||
this.actionLoader()
|
||||
let ajax = new Ajax(`/produccion/ordentrabajo/tarea/progress/${this.tareaId}`, null, null,
|
||||
this.handleGetTareaProgressSuccess.bind(this),
|
||||
this.handleGetTareaProgressError.bind(this),
|
||||
|
||||
)
|
||||
if (this.tareaId) {
|
||||
ajax.get();
|
||||
}
|
||||
}
|
||||
handleGetTareaProgressSuccess(response) {
|
||||
if (response.progress_dates) {
|
||||
let lastStatus = response.progress_dates.findLast(e => e.estado != null).estado
|
||||
this.showBasedOnStatus(lastStatus)
|
||||
}
|
||||
if (response.tiempo_trabajado) {
|
||||
this.item.find('#tiempo-real-info').html(response.tiempo_trabajado)
|
||||
}
|
||||
this.actionLoader(false)
|
||||
|
||||
}
|
||||
handleGetTareaProgressError(error) {
|
||||
this.actionLoader(false)
|
||||
}
|
||||
handleUpdateTareaProgress(status) {
|
||||
this.actionLoader(true)
|
||||
let ajax = new Ajax(`/produccion/ordentrabajo/update/tarea/progress`,
|
||||
{
|
||||
'ot_tarea_id': this.tareaId,
|
||||
'estado': status
|
||||
}, null,
|
||||
this.handleUpdateTareaProgressSuccess.bind(this),
|
||||
this.handleUpdateTareaProgressError.bind(this),
|
||||
)
|
||||
if (this.tareaId) {
|
||||
ajax.post();
|
||||
}
|
||||
}
|
||||
handleUpdateTareaProgressSuccess(response) {
|
||||
if (response.data) {
|
||||
if (response.data.estado == 'D') {
|
||||
window.location.href = '/produccion/ordentrabajo/maquinista/maquinas/view'
|
||||
}
|
||||
this.showBasedOnStatus(response.data.status)
|
||||
}
|
||||
this.actionLoader(false)
|
||||
}
|
||||
handleUpdateTareaProgressError(error) {
|
||||
popErrorAlert(error.error)
|
||||
this.actionLoader(false)
|
||||
}
|
||||
|
||||
showBasedOnStatus(status) {
|
||||
if (['P', 'S'].includes(status)) {
|
||||
this.enableButtons()
|
||||
this.showPlay()
|
||||
}
|
||||
if (['F', 'E'].includes(status)) {
|
||||
this.disableButtons()
|
||||
this.showPlay()
|
||||
}
|
||||
if (status == 'I') {
|
||||
this.enableButtons()
|
||||
this.showPause()
|
||||
}
|
||||
if (status == 'D') {
|
||||
window.href
|
||||
}
|
||||
}
|
||||
eventUnloadWindow(event) {
|
||||
// return confirm('¿Estás seguro de abandonar la página? La tarea se marcará como pausada')
|
||||
alertConfirmAction('La tarea se marcará como pausada')
|
||||
.then(result => {
|
||||
|
||||
if (result.isConfirmed) {
|
||||
return ""
|
||||
}
|
||||
})
|
||||
}
|
||||
delayTarea() {
|
||||
alertConfirmAction('La tarea se marcará como aplazada y podrás continuar después')
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
this.handleUpdateTareaProgress('D')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default MaquinistaTareaView;
|
||||
@ -1,5 +1,7 @@
|
||||
import maquinistaTareaList from "./maquinistaTareaList.js";
|
||||
import MaquinistaTareaList from "./maquinistaTareaList.js";
|
||||
|
||||
$(() => {
|
||||
console.info("MAQUINISTA TAREA LIST")
|
||||
let maquinistaTareaList = new MaquinistaTareaList($("#viewMaquinistaMaquinaTareas"))
|
||||
maquinistaTareaList.init();
|
||||
})
|
||||
@ -2,4 +2,6 @@ import MaquinistaTareaView from "./maquinistaTareaView.js";
|
||||
|
||||
$(() => {
|
||||
console.info("MAQUINISTA TAREA VIEW")
|
||||
let mtv = new MaquinistaTareaView($("#viewMaquinistaMaquinaTarea"))
|
||||
mtv.init();
|
||||
})
|
||||
@ -1,4 +1,9 @@
|
||||
.maquina-btn
|
||||
{
|
||||
height : 5rem;
|
||||
width : 100%;
|
||||
font-size : 20px;
|
||||
}
|
||||
.table-maquinista td{
|
||||
height : 10rem;
|
||||
}
|
||||
Reference in New Issue
Block a user