mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'feat/view-maquinista' into 'main'
Feat/view maquinista See merge request jjimenez/safekat!737
This commit is contained in:
@ -116,6 +116,8 @@ class OrdenTrabajo extends BaseConfig
|
||||
"default" => ["bg" => "white", "color" => "black"],
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
@ -744,18 +744,24 @@ $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
|
||||
*========================**/
|
||||
$routes->post("update/tarea", 'Ordentrabajo::update_orden_trabajo_tarea');
|
||||
$routes->post("update/date", 'Ordentrabajo::update_orden_trabajo_date');
|
||||
$routes->post("reset/date", 'Ordentrabajo::reset_orden_trabajo_date');
|
||||
$routes->post("update/pedido/date", 'Ordentrabajo::update_orden_trabajo_pedido_date');
|
||||
$routes->post("reset/pedido/date", 'Ordentrabajo::reset_orden_trabajo_pedido_date');
|
||||
$routes->post("update/pedido", 'Ordentrabajo::update_orden_trabajo_pedido');
|
||||
$routes->post("update/user", 'Ordentrabajo::update_orden_trabajo_user');
|
||||
$routes->post("update", 'Ordentrabajo::update_orden_trabajo');
|
||||
$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,6 +790,10 @@ $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",
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Controllers\Produccion;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoUser;
|
||||
@ -27,6 +28,7 @@ class Ordentrabajo extends BaseController
|
||||
protected OrdenTrabajoModel $otModel;
|
||||
protected OrdenTrabajoUser $otUserModel;
|
||||
protected OrdenTrabajoTarea $otTarea;
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected UserModel $userModel;
|
||||
protected Validation $validation;
|
||||
protected static $viewPath = 'themes/vuexy/form/produccion/';
|
||||
@ -42,6 +44,7 @@ class Ordentrabajo extends BaseController
|
||||
$this->userModel = model(UserModel::class);
|
||||
$this->produccionService = new ProductionService();
|
||||
$this->otTarea = model(OrdenTrabajoTarea::class);
|
||||
$this->maquinaModel = model(MaquinaModel::class);
|
||||
$this->validation = service("validation");
|
||||
helper("time");
|
||||
parent::initController($request, $response, $logger);
|
||||
@ -118,6 +121,19 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function reset_orden_trabajo_date()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
// return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "data" => $bodyData]);
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_date");
|
||||
if ($validated) {
|
||||
$validatedData = $bodyData;
|
||||
$r = $this->produccionService->emptyOrdenTrabajoDate($validatedData['orden_trabajo_id'],$validatedData['name']);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "user" => auth()->user(), "data" => $bodyData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_orden_trabajo_pedido_date()
|
||||
{
|
||||
try {
|
||||
@ -128,6 +144,18 @@ class Ordentrabajo extends BaseController
|
||||
return $this->response->setJSON(["errors" => $th->getMessage(), "status" => false])->setStatusCode(500);
|
||||
}
|
||||
}
|
||||
public function reset_orden_trabajo_pedido_date()
|
||||
{
|
||||
$bodyData = $this->request->getPost();
|
||||
$validated = $this->validation->run($bodyData, "orden_trabajo_date");
|
||||
if ($validated) {
|
||||
$validatedData = $bodyData;
|
||||
$r = $this->produccionService->init($bodyData['orden_trabajo_id'])->emptyOrdenTrabajoPedidoDate($validatedData['name']);
|
||||
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $r, "user" => auth()->user(), "data" => $bodyData]);
|
||||
} else {
|
||||
return $this->response->setJSON(["errors" => $this->validation->getErrors()])->setStatusCode(400);
|
||||
}
|
||||
}
|
||||
public function update_orden_trabajo_pedido()
|
||||
{
|
||||
try {
|
||||
@ -170,7 +198,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") : ""
|
||||
@ -185,7 +213,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") : ""
|
||||
@ -200,7 +228,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") : ""
|
||||
@ -215,7 +243,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") : ""
|
||||
@ -354,7 +382,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()
|
||||
@ -448,11 +476,96 @@ class Ordentrabajo extends BaseController
|
||||
helper('file');
|
||||
$barcode = $this->produccionService->init($orden_trabajo_id)->getFileBarCode();
|
||||
return $this->response
|
||||
->setHeader('Content-Type', 'image/png')
|
||||
->setHeader('Content-Disposition', "attachment; filename=CodigoBarrasOT_{$orden_trabajo_id}.png")
|
||||
->setBody($barcode);
|
||||
->setHeader('Content-Type', 'image/png')
|
||||
->setHeader('Content-Disposition', "attachment; filename=CodigoBarrasOT_{$orden_trabajo_id}.png")
|
||||
->setBody($barcode);
|
||||
}
|
||||
public function maquinista_maquinas_view(){}
|
||||
public function maquinista_colas_view(){}
|
||||
|
||||
public function maquinista_maquinas_view()
|
||||
{
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("Produccion.maquinista.maquinas"), 'route' => route_to("viewProduccionMaquinistaMaquinas"), 'active' => true],
|
||||
];
|
||||
$data = [
|
||||
"impresion" => $this->maquinaModel->queryViewMaquinistaMaquinas('impresion')->get()->getResultArray(),
|
||||
"manipulado" => $this->maquinaModel->queryViewMaquinistaMaquinas('manipulado')->get()->getResultArray(),
|
||||
"acabado" => $this->maquinaModel->queryViewMaquinistaMaquinas('acabado')->get()->getResultArray(),
|
||||
];
|
||||
$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],
|
||||
];
|
||||
$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()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
protected array $COLUMNS = [
|
||||
"id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"auto_increment" => true,
|
||||
],
|
||||
"ot_tarea_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
],
|
||||
"action_at" => [
|
||||
"type" => "DATETIME",
|
||||
"comment" => "Datetime task init"
|
||||
],
|
||||
"action_user_id" => [
|
||||
"type" => "INT",
|
||||
"unsigned" => true,
|
||||
"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->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,28 +99,58 @@ class OrdenTrabajoTareaEntity extends Entity
|
||||
*
|
||||
* @return Maquina
|
||||
*/
|
||||
public function maquina_presupuesto_linea() : Maquina
|
||||
public function maquina_presupuesto_linea(): Maquina
|
||||
{
|
||||
return $this->presupuesto_linea()->maquina();
|
||||
}
|
||||
/**
|
||||
/**
|
||||
* Devuelve el presupuesto acabado origen de esta tarea
|
||||
*
|
||||
* @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",
|
||||
@ -28,13 +29,15 @@ return [
|
||||
"metros" => "Metros",
|
||||
"corte" => "Corte",
|
||||
"pliegos" => "Pliegos",
|
||||
"pliegos_libro" => "Pliegos"
|
||||
"pliegos_libro" => "Pliegos",
|
||||
"fecha" => "fecha"
|
||||
|
||||
|
||||
],
|
||||
"task" => [
|
||||
"order" => "Orden",
|
||||
"task" => "Tarea",
|
||||
"estado" => "Estado",
|
||||
"note" => "Nota",
|
||||
"maquina_presupuesto" => "Máquina presupuesto",
|
||||
"maquina_actual" => "Máquina actual",
|
||||
@ -121,8 +124,24 @@ return [
|
||||
"progress_preimpresion" => "Preimpresión",
|
||||
"progress_logistica" => "Ferro/Logística",
|
||||
"progress_impresion" => "Impresión",
|
||||
"progress_manipulado" => "Manipulado/Acabado"
|
||||
"progress_manipulado" => "Manipulado/Acabado",
|
||||
|
||||
"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",
|
||||
|
||||
|
||||
];
|
||||
@ -20,7 +20,8 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
3 => "t1.ancho_impresion",
|
||||
4 => "t1.alto_impresion",
|
||||
5 => "t1.min",
|
||||
6 => "t1.max", ];
|
||||
6 => "t1.max",
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
@ -249,7 +250,7 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getIdMaquinasForPapelImpresion($papel_impresion_id, $rotativa , $inkjet)
|
||||
public function getIdMaquinasForPapelImpresion($papel_impresion_id, $rotativa, $inkjet)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
@ -262,7 +263,8 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public function getVelocidad($maquina_id){
|
||||
public function getVelocidad($maquina_id)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
@ -272,9 +274,9 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
|
||||
$resultObject = $builder->get()->getResultObject();
|
||||
|
||||
if(count($resultObject)>0)
|
||||
if (count($resultObject) > 0)
|
||||
return $resultObject[0]->velocidad;
|
||||
else{
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -318,7 +320,7 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
}
|
||||
}
|
||||
|
||||
public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $uso_tarifa , $tirada, $papel_impresion_id = -1)
|
||||
public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $uso_tarifa, $tirada, $papel_impresion_id = -1)
|
||||
{
|
||||
/*
|
||||
1.-> tarifa_Tipo impresion
|
||||
@ -338,10 +340,10 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
t1.forzar_num_formas_horizontales_cubierta AS forzar_num_formas_horizontales_cubierta,
|
||||
t1.forzar_num_formas_verticales_cubierta AS forzar_num_formas_verticales_cubierta"
|
||||
)
|
||||
->join("lg_maquinas_tarifas_impresion t2", "t1.id = t2.maquina_id", "left")
|
||||
->join("lg_maquinas_tarifas_impresion t2", "t1.id = t2.maquina_id", "left")
|
||||
->join("lg_maquina_papel_impresion t3", "t1.id = t3.maquina_id", "left")
|
||||
|
||||
|
||||
|
||||
|
||||
->where("t1.is_deleted", 0)
|
||||
->where("t1.tipo", "impresion")
|
||||
->where("t1.is_rotativa", $is_rotativa)
|
||||
@ -351,28 +353,28 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
->where("t1.min <=", $tirada)
|
||||
->where("t1.max >=", $tirada);
|
||||
|
||||
if(is_array($tarifa_tipo)){
|
||||
foreach($tarifa_tipo as $tarifa){
|
||||
$builder->where("EXISTS (SELECT * FROM lg_maquinas_tarifas_impresion t2 WHERE t1.id=t2.maquina_id AND t2.tipo='{$tarifa}' AND t2.uso='{$uso_tarifa}' AND t2.is_deleted=0)");
|
||||
}
|
||||
}
|
||||
else{
|
||||
$builder->where("t2.tipo", $tarifa_tipo);
|
||||
$builder->where("t2.uso", $uso_tarifa);
|
||||
if (is_array($tarifa_tipo)) {
|
||||
foreach ($tarifa_tipo as $tarifa) {
|
||||
$builder->where("EXISTS (SELECT * FROM lg_maquinas_tarifas_impresion t2 WHERE t1.id=t2.maquina_id AND t2.tipo='{$tarifa}' AND t2.uso='{$uso_tarifa}' AND t2.is_deleted=0)");
|
||||
}
|
||||
} else {
|
||||
$builder->where("t2.tipo", $tarifa_tipo);
|
||||
$builder->where("t2.uso", $uso_tarifa);
|
||||
}
|
||||
|
||||
return $builder;
|
||||
|
||||
}
|
||||
|
||||
public function getNombre($id){
|
||||
public function getNombre($id)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.nombre AS text");
|
||||
|
||||
"t1.nombre AS text"
|
||||
);
|
||||
|
||||
$builder->where("t1.id", $id);
|
||||
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
@ -383,16 +385,49 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
* @param string|null $type Tipo de maquina impresion,manipulado,acabado
|
||||
* @return array
|
||||
*/
|
||||
public function getSelectQuery(?string $q = null, ?string $type = null) : array
|
||||
public function getSelectQuery(?string $q = null, ?string $type = null): array
|
||||
{
|
||||
$query = $this->builder()->select(["id","nombre","tipo as description"])
|
||||
->where("deleted_at",null);
|
||||
if($q){
|
||||
$query->like("nombre",$q);
|
||||
$query = $this->builder()->select(["id", "nombre", "tipo as description"])
|
||||
->where("deleted_at", null);
|
||||
if ($q) {
|
||||
$query->like("nombre", $q);
|
||||
}
|
||||
if($type){
|
||||
$query->where("tipo",$type);
|
||||
if ($type) {
|
||||
$query->where("tipo", $type);
|
||||
}
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
|
||||
public function queryViewMaquinistaMaquinas($maquina_tipo = "impresion")
|
||||
{
|
||||
$query = $this->builder()
|
||||
->select([
|
||||
'lg_maquinas.id as maquinaId',
|
||||
'lg_maquinas.nombre',
|
||||
'COUNT(tarea_progress.ot_tarea_id) as countTareas'
|
||||
])
|
||||
->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)
|
||||
->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 = [];
|
||||
@ -948,6 +982,18 @@ class ProductionService extends BaseService
|
||||
$this->updateProgress();
|
||||
return $result;
|
||||
}
|
||||
public function emptyOrdenTrabajoDate(int $orden_trabajo_id, string $dateName)
|
||||
{
|
||||
$status = $this->otDate->where('orden_trabajo_id', $orden_trabajo_id)
|
||||
->set($dateName, null)
|
||||
->update();
|
||||
if (isset($this->ordenTrabajoConfig->DATE_USER_MAPPING[$dateName])) {
|
||||
$this->otUser->where('orden_trabajo_id', $orden_trabajo_id)
|
||||
->set($this->ordenTrabajoConfig->DATE_USER_MAPPING[$dateName], auth()->user()->id)
|
||||
->update();
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function updateOrdenTrabajoPedidoDate($data): array
|
||||
{
|
||||
$status = false;
|
||||
@ -970,6 +1016,25 @@ class ProductionService extends BaseService
|
||||
"status" => $status
|
||||
];
|
||||
}
|
||||
public function emptyOrdenTrabajoPedidoDate(string $dateName)
|
||||
{
|
||||
$status = false;
|
||||
$user = auth()->user();
|
||||
$row = [];
|
||||
$pedidoDatesUser = $this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO;
|
||||
if (isset($pedidoDatesUser[$dateName])) {
|
||||
$attrUserPedido = $pedidoDatesUser[$dateName];
|
||||
$row[$attrUserPedido] = $user->id;
|
||||
$row[$dateName] = null;
|
||||
$status = $this->pedidoModel->update($this->pedido->id, $row);
|
||||
$this->updateProgress();
|
||||
} else {
|
||||
throw new Exception(lang('Produccion.errors.attr_not_exist', [$dateName]));
|
||||
}
|
||||
|
||||
|
||||
return $status;
|
||||
}
|
||||
public function updateOrdenTrabajo($data): bool
|
||||
{
|
||||
if (isset($data["is_pedido_espera"])) {
|
||||
@ -1620,4 +1685,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>";
|
||||
}
|
||||
}
|
||||
|
||||
44
ci4/app/Views/themes/vuexy/components/cards/tarea_card.php
Normal file
44
ci4/app/Views/themes/vuexy/components/cards/tarea_card.php
Normal file
@ -0,0 +1,44 @@
|
||||
<div class="card h-100">
|
||||
<div class="card-header pb-0 d-flex justify-content-between">
|
||||
<div class="card-title mb-0">
|
||||
<small class="text-muted">Titulo</small>
|
||||
<h5 class="mb-0"><?= $presupuesto->titulo ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body row">
|
||||
<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>
|
||||
<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 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 d-flex justify-content-center gap-2"><span class="ti ti-eye ti-lg"></span><?= lang('Produccion.ot') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,55 @@
|
||||
<div class="card h-100">
|
||||
<div class="card-body">
|
||||
<div class="row h-100">
|
||||
<div class="col-6">
|
||||
<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>
|
||||
<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="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>
|
||||
21
ci4/app/Views/themes/vuexy/components/tables/maquinista_tarea_table.php
Executable file
21
ci4/app/Views/themes/vuexy/components/tables/maquinista_tarea_table.php
Executable file
@ -0,0 +1,21 @@
|
||||
<div class="table-maquinista table-responsive">
|
||||
|
||||
<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_impresion') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@ -0,0 +1,89 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="row text-center">
|
||||
<h4>Seleccione una máquina</h4>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row text-start">
|
||||
<h4>Máquinas impresión</h4>
|
||||
</div>
|
||||
<div class="row" id="maquinas-impresion">
|
||||
<?php foreach ($maquinas["impresion"] as $key => $maquina): ?>
|
||||
<div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-primary w-100">
|
||||
<span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
<span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
|
||||
<? endif; ?>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row text-start">
|
||||
<h4>Máquinas acabado</h4>
|
||||
</div>
|
||||
<div class="row" id="maquinas-acabado">
|
||||
<?php foreach ($maquinas["acabado"] as $key => $maquina): ?>
|
||||
<div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-primary w-100">
|
||||
<span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
<span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
|
||||
<? endif; ?>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row text-start">
|
||||
<h4>Máquinas manipulado</h4>
|
||||
</div>
|
||||
<div class="row" id="maquinas-manipulado">
|
||||
<?php foreach ($maquinas["manipulado"] as $key => $maquina): ?>
|
||||
<div class="col-md-4 col-sm-2 col-lg-3 col-xs-12 mb-2 h-100 p-2">
|
||||
<a href="<?= route_to("viewProduccionMaquinaTareasList", $maquina["maquinaId"]) ?>" type="button" class="maquina-btn btn btn-outline-primary w-100">
|
||||
<span class="d-sm-inline-flex justify-content-between align-items-center gap-2">
|
||||
<?= $maquina["nombre"] ?>
|
||||
<?php if ($maquina["countTareas"] > 0): ?>
|
||||
<span class="badge rounded-pill badge-center h-px-20 w-px-20 bg-secondary ms-1_5"><?= $maquina["countTareas"] ?></span>
|
||||
<? endif; ?>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<? endforeach; ?>
|
||||
</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') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<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>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,85 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<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">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="row mb-2 h-100 d-flex flex-wrap">
|
||||
<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 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 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() ?>
|
||||
@ -0,0 +1,49 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<?php
|
||||
|
||||
use CodeIgniter\I18n\Time;
|
||||
?>
|
||||
<div class="row" id="viewMaquinistaMaquinaTareas" data-id="<?= $maquinaEntity->id ?>">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row mb-2 align-items-center">
|
||||
<div class="col-md-6 col-xs-12 justify-content-start ">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-xs-12 justify-content-end d-flex">
|
||||
<span class="display-6" id="today-date"><?= Time::now()->format('d/m/Y') ?></span>
|
||||
</div>
|
||||
<!-- <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>
|
||||
<?= view("/themes/vuexy/components/tables/maquinista_tarea_table.php") ?>
|
||||
</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') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalExternalJs") ?>
|
||||
<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 type="module" src="<?= site_url("/assets/js/safekat/pages/configuracion/maquinista/viewTareaList.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,27 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row">
|
||||
|
||||
</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/ot.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/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>
|
||||
<?= $this->endSection() ?>
|
||||
@ -16,13 +16,19 @@
|
||||
<!-- Date 1-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-tiempo-procesamiento" class="form-label"><?= @lang("Produccion.tiempo_procesamiento") ?> (HH:MM)</label>
|
||||
<input type="text" class="form-control" name="tiempo_procesamiento" placeholder="HH:MM" id="ot-tiempo-procesamiento" data-input disabled>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="tiempo_procesamiento" placeholder="HH:MM" id="ot-tiempo-procesamiento" data-input disabled>
|
||||
<button class="btn btn-outline-warning btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Date 2-->
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_impresion") ?></label>
|
||||
<input type="text" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_impresion" id="ot-fecha-impresion" data-input <?= $is_finalizada ? "disabled": "" ?> >
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_impresion" id="ot-fecha-impresion" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-warning btn-erase-pedido-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_impresion"] ?></div>
|
||||
|
||||
|
||||
@ -31,7 +37,10 @@
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_encuadernado") ?></label>
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_encuadernado" id="ot-fecha-encuadernado" data-input <?= $is_finalizada ? "disabled": "" ?> />
|
||||
<div class="input-group">
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_encuadernado" id="ot-fecha-encuadernado" data-input <?= $is_finalizada ? "disabled" : "" ?> />
|
||||
<button class="btn btn-outline-warning btn-erase-pedido-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_encuadernado"] ?></div>
|
||||
|
||||
</div>
|
||||
@ -39,7 +48,10 @@
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_externo") ?></label>
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_entrega_externo" id="ot-fecha-entrega-externo" data-input <?= $is_finalizada ? "disabled": "" ?> />
|
||||
<div class="input-group">
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_entrega_externo" id="ot-fecha-entrega-externo" data-input <?= $is_finalizada ? "disabled" : "" ?> />
|
||||
<button class="btn btn-outline-warning btn-erase-pedido-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_entrega_externo"] ?></div>
|
||||
|
||||
</div>
|
||||
@ -49,13 +61,17 @@
|
||||
<div>
|
||||
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_real") ?></label>
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_entrega_real" id="ot-fecha-entrega-real" data-input <?= $is_finalizada ? "disabled": "" ?> />
|
||||
|
||||
<div class="input-group">
|
||||
<input type="date" class="form-control ot-pedido" placeholder="DD/MM/YYYY" name="fecha_entrega_real" id="ot-fecha-entrega-real" data-input <?= $is_finalizada ? "disabled" : "" ?> />
|
||||
<button class="btn btn-outline-warning btn-erase-pedido-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $pedido_user_dates["fecha_entrega_real"] ?></div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
|
||||
<label class="switch switch-danger switch-lg mt-1">
|
||||
<input type="checkbox" class="switch-input ot-pedido-check" name="inaplazable" data-input <?= $is_finalizada ? "disabled": "" ?>/>
|
||||
<input type="checkbox" class="switch-input ot-pedido-check" name="inaplazable" data-input <?= $is_finalizada ? "disabled" : "" ?> />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-alert-triangle"></i>
|
||||
@ -68,7 +84,7 @@
|
||||
</label>
|
||||
<div class="form-text"><?= $pedido_user_dates["inaplazable"] ?></div>
|
||||
<label class="switch switch-lg mt-1">
|
||||
<input type="checkbox" class="switch-input ot-preview" name="fecha_entrega_warning_revised" data-input <?= $is_finalizada ? "disabled": "" ?>/>
|
||||
<input type="checkbox" class="switch-input ot-preview" name="fecha_entrega_warning_revised" data-input <?= $is_finalizada ? "disabled" : "" ?> />
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on">
|
||||
<i class="ti ti-check"></i>
|
||||
@ -87,7 +103,10 @@
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("Produccion.fecha_entrega_estimada") ?></label>
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_estimada_at" id="ot-fecha-entrega-estimada" data-input disabled />
|
||||
<div class="input-group">
|
||||
<input type="date" class="form-control ot-date" placeholder="DD/MM/YYYY" name="fecha_entrega_estimada_at" id="ot-fecha-entrega-estimada" data-input disabled />
|
||||
<button class="btn btn-outline-warning btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -25,33 +25,45 @@
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?=lang("Produccion.progress_impresion")?></h4>
|
||||
</div>
|
||||
<h4><?= lang("Produccion.progress_impresion") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isBN"] ? "" : "d-none" ?>">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_bn") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_bn_at" id="ot-impresion-bn" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_bn_at" id="ot-impresion-bn" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["interior_bn_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isColor"] ? "" : "d-none" ?>"">
|
||||
<label for="ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_color") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_color_at" id="ot-impresion-color" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<label for=" ot-impresion-color" class="form-label"><?= @lang("Produccion.impresion_color") ?></label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="interior_color_at" id="ot-impresion-color" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["interior_color_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCubierta"] ? "" : "d-none" ?>">
|
||||
<label for="ot-portada" class="form-label"><?= @lang("Produccion.cubierta") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-portada" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="form-text"><?= $user_dates["cubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>"?></div>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cubierta_at" id="ot-portada" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["cubierta_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isPlastificado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-plastificado-mate" class="form-label"><?= @lang("Produccion.plastificado_mate") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado-mate" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="plastificado_at" id="ot-plastificado-mate" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["plastificado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
@ -59,63 +71,90 @@
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?=lang("Produccion.progress_manipulado")?></h4>
|
||||
</div>
|
||||
<h4><?= lang("Produccion.progress_manipulado") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->cosido ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-cosido" class="form-label"><?= @lang("Produccion.cosido") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cosido_at" id="ot-prep-cosido" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="cosido_at" id="ot-prep-cosido" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["cosido_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isGrapado"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-grapado" class="form-label"><?= @lang("Produccion.grapado") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="grapado_at" id="ot-prep-grapado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="grapado_at" id="ot-prep-grapado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["grapado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->solapas ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-solapa" class="form-label"><?= @lang("Produccion.solapa") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="solapa_at" id="ot-prep-solapa" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="solapa_at" id="ot-prep-solapa" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["solapa_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-retractilado" class="form-label"><?= @lang("Produccion.retractilado") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-prep-retractilado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado_at" id="ot-prep-retractilado" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["retractilado_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->retractilado5 ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-retractilado5" class="form-label"><?= @lang("Produccion.retractilado5") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado5_at" id="ot-prep-retractilado5" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="retractilado5_at" id="ot-prep-retractilado5" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["retractilado5_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->prototipo ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-prototipo" class="form-label"><?= @lang("Produccion.prototipo") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="prototipo_at" id="ot-prep-prototipo" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="prototipo_at" id="ot-prep-prototipo" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["prototipo_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->marcapaginas ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-marcapaginas" class="form-label"><?= @lang("Produccion.marcapaginas") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="marcapaginas_at" id="ot-prep-marcapaginas" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="marcapaginas_at" id="ot-prep-marcapaginas" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["marcapaginas_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isCorte"] ? "" : "d-none" ?>">
|
||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("Produccion.guillotina") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="corte_at" id="ot-prep-guillotina" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["corte_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $flags["isEspiral"] ? "" : "d-none" ?>">
|
||||
<label for="ot-espiral" class="form-label"><?= @lang("Produccion.espiral") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="espiral_at" id="ot-espiral" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="espiral_at" id="ot-espiral" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"> <?= $user_dates["espiral_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
@ -123,38 +162,53 @@
|
||||
<div class="col-md-3">
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?=lang("Produccion.progress_logistica")?></h4>
|
||||
</div>
|
||||
<h4><?= lang("Produccion.progress_logistica") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-pendiente-ferro" class="form-label"><?= @lang("Produccion.pendiente_ferro") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="pendiente_ferro_at" placeholder="DD/MM/YYYY" id="ot-pendiente-ferro" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="pendiente_ferro_at" placeholder="DD/MM/YYYY" id="ot-pendiente-ferro" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["pendiente_ferro_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-ferro-cliente" class="form-label"><?= @lang("Produccion.ferro_cliente") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_en_cliente_at" placeholder="DD/MM/YYYY" id="ot-ferro-cliente" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="ferro_en_cliente_at" placeholder="DD/MM/YYYY" id="ot-ferro-cliente" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["ferro_en_cliente_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $presupuesto->ferro ? "" : "d-none" ?>">
|
||||
<label for="ot-ferro-ok" class="form-label"><?= @lang("Produccion.ferro_ok") ?></label>
|
||||
<input type="text" class="form-control ot-date" name="ferro_ok_at" placeholder="DD/MM/YYYY" id="ot-ferro-ok" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" name="ferro_ok_at" placeholder="DD/MM/YYYY" id="ot-ferro-ok" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["ferro_ok_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-embalaje" class="form-label"><?= @lang("Produccion.embalaje") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="embalaje_at" id="ot-embalaje" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="embalaje_at" id="ot-embalaje" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["embalaje_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Progress -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<label for="ot-envio" class="form-label"><?= @lang("Produccion.envio") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="envio_at" id="ot-envio" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="envio_at" id="ot-envio" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["envio_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
@ -163,39 +217,54 @@
|
||||
<div class="col-md-3">
|
||||
<!-- PREIMPRESION -->
|
||||
<!-- Preformato -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?=lang("Produccion.progress_preimpresion")?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100">
|
||||
<h4><?= lang("Produccion.progress_preimpresion") ?></h4>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->revisar_formato ? "" : "d-none" ?>">
|
||||
<label for="ot-preformato-btn" class="form-label"><?= @lang("Produccion.pre_formato") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_formato_at" id="ot-preformato-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_formato_at" id="ot-preformato-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["pre_formato_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
</div>
|
||||
<!-- Prelomo -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->revisar_lomo ? "" : "d-none" ?>">
|
||||
<label for="ot-prelomo-btn" class="form-label"><?= @lang("Produccion.pre_lomo") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_lomo_at" id="ot-prelomo-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_lomo_at" id="ot-prelomo-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["pre_lomo_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Presolapa -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->revisar_solapa ? "" : "d-none" ?>">
|
||||
<label for="ot-presolapa-btn" class="form-label"><?= @lang("Produccion.pre_solapa") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_solapa_at" id="ot-presolapa-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_solapa_at" id="ot-presolapa-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["pre_solapa_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Precodbarras -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->revisar_codigo_barras ? "" : "d-none" ?>">
|
||||
<label for="ot-precodbarras-btn" class="form-label"><?= @lang("Produccion.pre_codbarras") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_codbarras_at" id="ot-precodbarras-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_codbarras_at" id="ot-precodbarras-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["pre_codbarras_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
<!-- Preimposicion -->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2 w-100 <?= $ot->realizar_imposicion ? "" : "d-none" ?>">
|
||||
<label for="ot-preimposicion-btn" class="form-label"><?= @lang("Produccion.pre_imposicion") ?></label>
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_imposicion_at" id="ot-preimposicion-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control ot-date" placeholder="DD/MM/YYYY" name="pre_imposicion_at" id="ot-preimposicion-date" data-input <?= $is_finalizada ? "disabled" : "" ?>>
|
||||
<button class="btn btn-outline-danger btn-erase-date" type="button"><i class="ti-eraser ti"></i></button>
|
||||
</div>
|
||||
<div class="form-text"><?= $user_dates["pre_imposicion_at"] ?? "<span class='ti-sm ti ti-alert-triangle me-1'></span>" ?></div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -4,12 +4,6 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row">
|
||||
|
||||
@ -7,23 +7,23 @@ 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="<?= site_url("viewProduccionMaquinistaMaquinas") ?>" class="menu-link beta">
|
||||
<a href="<?= route_to("viewProduccionMaquinistaMaquinas") ?>" class="menu-link">
|
||||
<div><?= lang("App.menu_maquinista_maquinas") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("viewProduccionMaquinistaColas") ?>" class="menu-link beta">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/planning/rotativa") ?>" class="menu-link">
|
||||
<div><?= lang("App.menu_maquinista_colas") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("viewProduccionMaquinistaMantenimiento") ?>" class="menu-link beta">
|
||||
<a href="<?= route_to("viewProduccionMaquinistaMantenimiento") ?>" class="menu-link beta">
|
||||
<div><?= lang("App.menu_maquinista_mantenimiento") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
|
||||
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;
|
||||
@ -0,0 +1,201 @@
|
||||
|
||||
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)
|
||||
}
|
||||
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
|
||||
console.log("Last status :", lastStatus)
|
||||
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;
|
||||
@ -0,0 +1,7 @@
|
||||
import MaquinistaTareaList from "./maquinistaTareaList.js";
|
||||
|
||||
$(() => {
|
||||
console.info("MAQUINISTA TAREA LIST")
|
||||
let maquinistaTareaList = new MaquinistaTareaList($("#viewMaquinistaMaquinaTareas"))
|
||||
maquinistaTareaList.init();
|
||||
})
|
||||
@ -0,0 +1,7 @@
|
||||
import MaquinistaTareaView from "./maquinistaTareaView.js";
|
||||
|
||||
$(() => {
|
||||
console.info("MAQUINISTA TAREA VIEW")
|
||||
let mtv = new MaquinistaTareaView($("#viewMaquinistaMaquinaTarea"))
|
||||
mtv.init();
|
||||
})
|
||||
@ -1,7 +1,7 @@
|
||||
import Ajax from "../../components/ajax.js"
|
||||
import ClassSelect from "../../components/select2.js";
|
||||
import DatePicker from "../../components/datepicker.js";
|
||||
import { alertConfirmAction, alertConfirmationDelete, alertSuccess } from "../../components/alerts/sweetAlert.js";
|
||||
import { alertConfirmAction, alertConfirmationDelete, alertError, alertSuccess } from "../../components/alerts/sweetAlert.js";
|
||||
import Modal from "../../components/modal.js"
|
||||
import FileUploadDropzone from '../../components/forms/fileUploadDropzone.js';
|
||||
class OrdenTrabajo {
|
||||
@ -17,6 +17,9 @@ class OrdenTrabajo {
|
||||
this.alertOrdenTrabajo = this.item.find("#alert-orden-trabajo");
|
||||
this.btnFinalizarPedido = this.item.find("#btn-finalizar-orden-pedido")
|
||||
this.btnReactivarOt = this.item.find("#btn-reactivar-orden-pedido")
|
||||
this.btnEraseDate = this.item.find('.btn-erase-date');
|
||||
this.btnErasePedidoDate = this.item.find('.btn-erase-pedido-date');
|
||||
|
||||
this.isOtFinalizada = false;
|
||||
|
||||
this.btnResetTareas = this.item.find("#btn-reset-tareas")
|
||||
@ -61,7 +64,7 @@ class OrdenTrabajo {
|
||||
altInput: true,
|
||||
altFormat: "d/m/Y",
|
||||
dateFormat: "Y-m-d",
|
||||
allowInput: true,
|
||||
allowInput: false,
|
||||
}
|
||||
this.tiempoProcesamiento = this.otForm.find("#ot-tiempo-procesamiento")
|
||||
this.fechaImpresion = new DatePicker(this.otForm.find("#ot-fecha-impresion"), option)
|
||||
@ -144,7 +147,8 @@ class OrdenTrabajo {
|
||||
this.otForm.on("click", "#btn-delete-portada", this.handleDeletePortada.bind(this))
|
||||
this.btnFinalizarPedido.on("click", this.handleFinalizarPedido.bind(this))
|
||||
this.btnReactivarOt.on("click", this.handleReactivarPedido.bind(this))
|
||||
|
||||
this.btnEraseDate.on('click', this.handleEraseDate.bind(this))
|
||||
this.btnErasePedidoDate.on('click', this.handleErasePedidoDate.bind(this))
|
||||
this.tareasTableItem.on("click", ".ot-tarea-btn-delete", this.handleTareaDeleteConfirmation.bind(this))
|
||||
this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this))
|
||||
this.otForm.on("click", ".ot-tarea-comment", this.handleNoteTarea.bind(this))
|
||||
@ -496,7 +500,8 @@ class OrdenTrabajo {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
const data = {}
|
||||
const element = $(event.currentTarget);
|
||||
data[key] = $(event.currentTarget).val()
|
||||
const value = $(event.currentTarget).val()
|
||||
data[key] = value
|
||||
data["orden_trabajo_id"] = this.modelId
|
||||
data["name"] = key;
|
||||
const ajax = new Ajax(
|
||||
@ -506,7 +511,12 @@ class OrdenTrabajo {
|
||||
this.handleDateChangeSuccess.bind(this, element),
|
||||
this.handleDateChangeError.bind(this)
|
||||
)
|
||||
ajax.post();
|
||||
if (value) {
|
||||
|
||||
ajax.post();
|
||||
} else {
|
||||
this.handleEraseDate(event)
|
||||
}
|
||||
|
||||
}
|
||||
handleDateChangeSuccess(formItem, response) {
|
||||
@ -514,8 +524,8 @@ class OrdenTrabajo {
|
||||
alertSuccess(response.message).fire()
|
||||
this._handleGetData();
|
||||
if (response.user) {
|
||||
formItem.parent().find(".form-text").remove()
|
||||
formItem.parent().append(`<div class="form-text">${[response.user.first_name, response.user.last_name].join(" ")}</div>`)
|
||||
formItem.parent().parent().find(".form-text").remove()
|
||||
formItem.parent().parent().append(`<div class="form-text">${[response.user.first_name, response.user.last_name].join(" ")}</div>`)
|
||||
}
|
||||
}
|
||||
handleDateChangeError(errors) { }
|
||||
@ -523,7 +533,8 @@ class OrdenTrabajo {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
const data = {}
|
||||
const element = $(event.currentTarget);
|
||||
data[key] = $(event.currentTarget).val()
|
||||
const value = element.val()
|
||||
data[key] = value
|
||||
data["orden_trabajo_id"] = this.modelId
|
||||
data["name"] = key;
|
||||
const ajax = new Ajax(
|
||||
@ -533,7 +544,11 @@ class OrdenTrabajo {
|
||||
this.handleDateChangeSuccess.bind(this, element),
|
||||
this.handleDateChangeError.bind(this)
|
||||
)
|
||||
ajax.post();
|
||||
if (value) {
|
||||
ajax.post();
|
||||
} else {
|
||||
this.handleErasePedidoDate(event)
|
||||
}
|
||||
}
|
||||
handlePedidoCheckChange(event) {
|
||||
const key = $(event.currentTarget).attr("name")
|
||||
@ -745,6 +760,68 @@ class OrdenTrabajo {
|
||||
this.tareaCommentModal.toggle()
|
||||
}
|
||||
}
|
||||
handleEraseDate(event) {
|
||||
let name = $(event.currentTarget).parent().find('input').attr('name')
|
||||
let ajax = new Ajax('/produccion/ordentrabajo/reset/date', {
|
||||
name: name,
|
||||
orden_trabajo_id: this.modelId
|
||||
},
|
||||
null,
|
||||
this.handleEraseDateSuccess.bind(this),
|
||||
this.handleEraseDateError.bind(this)
|
||||
)
|
||||
alertConfirmationDelete()
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
console.log(name)
|
||||
ajax.post()
|
||||
}
|
||||
})
|
||||
}
|
||||
handleEraseDateSuccess(response) {
|
||||
this.item.find(`input[name="${response.data.name}"]`).val(null)
|
||||
if (response.user) {
|
||||
this.item.find(`input[name="${response.data.name}"]`).parent().parent().find(".form-text").remove()
|
||||
this.item.find(`input[name="${response.data.name}"]`).parent().parent().append(`<div class="form-text">${[response.user.first_name, response.user.last_name].join(" ")}</div>`)
|
||||
}
|
||||
alertSuccess(response.message).fire()
|
||||
this._handleGetData()
|
||||
}
|
||||
handleEraseDateError(error) {
|
||||
alertError(error.message).fire()
|
||||
this._handleGetData()
|
||||
}
|
||||
handleErasePedidoDate(event) {
|
||||
let name = $(event.currentTarget).parent().find('input').attr('name')
|
||||
let ajax = new Ajax('/produccion/ordentrabajo/reset/pedido/date', {
|
||||
name: name,
|
||||
orden_trabajo_id: this.modelId
|
||||
},
|
||||
null,
|
||||
this.handleErasePedidoDateSuccess.bind(this),
|
||||
this.handleErasePedidoDateError.bind(this)
|
||||
)
|
||||
alertConfirmationDelete()
|
||||
.then(result => {
|
||||
if (result.isConfirmed) {
|
||||
console.log(name)
|
||||
ajax.post()
|
||||
}
|
||||
})
|
||||
}
|
||||
handleErasePedidoDateSuccess(response) {
|
||||
this.item.find(`input[name="${response.data.name}"]`).val(null)
|
||||
if (response.user) {
|
||||
this.item.find(`input[name="${response.data.name}"]`).parent().parent().find(".form-text").remove()
|
||||
this.item.find(`input[name="${response.data.name}"]`).parent().parent().append(`<div class="form-text">${[response.user.first_name, response.user.last_name].join(" ")}</div>`)
|
||||
}
|
||||
alertSuccess(response.message).fire()
|
||||
this._handleGetData()
|
||||
}
|
||||
handleErasePedidoDateError(error) {
|
||||
alertError(error.message).fire()
|
||||
this._handleGetData()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
9
httpdocs/themes/vuexy/css/maquinista.css
Normal file
9
httpdocs/themes/vuexy/css/maquinista.css
Normal file
@ -0,0 +1,9 @@
|
||||
.maquina-btn
|
||||
{
|
||||
height : 5rem;
|
||||
width : 100%;
|
||||
font-size : 20px;
|
||||
}
|
||||
.table-maquinista td{
|
||||
height : 10rem;
|
||||
}
|
||||
Reference in New Issue
Block a user