mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
planning plana
This commit is contained in:
@ -194,6 +194,8 @@ const SK_PERMISSION_MATRIX = [
|
||||
"pedidos-cancelados.menu",
|
||||
"pedidos-todos.view",
|
||||
"pedidos-todos.menu",
|
||||
"pedidos-gestion.toprod",
|
||||
"pedidos-gestion.menu",
|
||||
"tarifa-preimpresion.create",
|
||||
"tarifa-preimpresion.edit",
|
||||
"tarifa-preimpresion.menu",
|
||||
|
||||
@ -1001,7 +1001,10 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
||||
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->get('rotativa', 'Ordentrabajo::index_planning_rotativa');
|
||||
$routes->get('papel/datatable', 'Ordentrabajo::papel_gramaje_datatable');
|
||||
$routes->get('papel/plana/datatable', 'Ordentrabajo::papel_pliego_datatable');
|
||||
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
|
||||
$routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable');
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -193,8 +193,16 @@ class Ordentrabajo extends BaseController
|
||||
|
||||
$q = $this->produccionService->papelGramajeDatatableQuery();
|
||||
return DataTable::of($q)
|
||||
->edit("tiempoReal", fn($q) => float_seconds_to_hhmm_string($q->tiempoReal * 3600))
|
||||
->add("metros", fn($q) => $q->papel_ancho*$q->totalTirada/1000)
|
||||
->edit("tiempoReal", fn($q) => $q->tiempoReal * 3600)
|
||||
->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_task'), 'data' => $q])
|
||||
->toJson(true);
|
||||
}
|
||||
public function papel_pliego_datatable()
|
||||
{
|
||||
|
||||
$q = $this->produccionService->papelPliegoDatatableQuery();
|
||||
return DataTable::of($q)
|
||||
->edit("tiempoReal", fn($q) => $q->tiempoReal * 3600)
|
||||
->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_task'), 'data' => $q])
|
||||
->toJson(true);
|
||||
}
|
||||
@ -266,9 +274,17 @@ class Ordentrabajo extends BaseController
|
||||
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
|
||||
->add("metros_check", fn($q) => $q->otId)
|
||||
->add("corte", fn($q) => $q->otId)
|
||||
->add("metros", fn($q) => $q->papel_ancho*$q->ot_tirada/1000)
|
||||
|
||||
->add("action", fn($q) => $q)
|
||||
->toJson(true);
|
||||
}
|
||||
public function planning_plana_datatable()
|
||||
{
|
||||
$q = $this->produccionService->planningPlanaQueryDatatable();
|
||||
return DataTable::of($q)
|
||||
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
|
||||
->add("pliegos_check", fn($q) => $q->otId)
|
||||
->add("action", fn($q) => $q)
|
||||
->toJson(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,4 +221,8 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
|
||||
return $nombre;
|
||||
}
|
||||
public function isRotativa() : bool
|
||||
{
|
||||
return in_array($this->attributes['tipo'],['lp_rot_color','lp_rot_bn']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -791,6 +791,8 @@ return [
|
||||
"menu_orden_trabajo_finalizados" => "OTs finalizados",
|
||||
"menu_orden_trabajo_pendientes" => "OTs pendientes",
|
||||
"menu_planning_rotativa" => "Planning rotativa",
|
||||
"menu_planning" => "Plannings",
|
||||
|
||||
|
||||
"menu_ordentrabajomaquetacion" => "Orden de trabajo maquetación",
|
||||
"menu_ordenmaquina" => "Orden máquina",
|
||||
|
||||
@ -25,7 +25,9 @@ return [
|
||||
"logo" => "Logo impresion",
|
||||
"filter_by_task" => "Filtrar por tarea",
|
||||
"metros" => "Metros",
|
||||
"corte" => "Corte"
|
||||
"corte" => "Corte",
|
||||
"pliegos" => "Pliegos",
|
||||
"pliegos_libro" => "Pliegos"
|
||||
|
||||
|
||||
],
|
||||
@ -71,7 +73,8 @@ return [
|
||||
"preview_pdf" => "Previsualizar PDF",
|
||||
"imprimir_codigo_safekat" => "Imprimir código SAFEKAT",
|
||||
"imprimir_ferro" => "Imprimir ferro",
|
||||
"planning_rotativa" => "Tareas rotativa",
|
||||
"planning_rotativa" => "Planificación rotativa",
|
||||
"planning_plana" => "Planificación plana",
|
||||
"solapa" => "Solapa",
|
||||
"papel_gramajes" => "Papel y gramajes"
|
||||
|
||||
|
||||
@ -61,9 +61,9 @@ class OrdenTrabajoDate extends Model
|
||||
// Callbacks
|
||||
protected $allowCallbacks = true;
|
||||
protected $beforeInsert = [];
|
||||
protected $afterInsert = ["updateOrdenTrabajoUser"];
|
||||
protected $afterInsert = [];
|
||||
protected $beforeUpdate = [];
|
||||
protected $afterUpdate = ["updateOrdenTrabajoUser"];
|
||||
protected $afterUpdate = [];
|
||||
protected $beforeFind = [];
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
@ -102,7 +102,7 @@ class OrdenTrabajoDate extends Model
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
protected function updateUserDateMap($data,$values){
|
||||
public function updateUserDateMap($orden_trabajo_id,$data){
|
||||
$mapping = [
|
||||
"fecha_encuadernado_at" => "encuadernacion_user_id",
|
||||
// "fecha_externo_at" => "null",
|
||||
@ -121,10 +121,10 @@ class OrdenTrabajoDate extends Model
|
||||
];
|
||||
$otUser = model(OrdenTrabajoUser::class);
|
||||
$auth_user_id = auth()->user()->id;
|
||||
foreach ($values as $key => $value) {
|
||||
foreach ($data as $key => $value) {
|
||||
if(isset($mapping[$key])){
|
||||
if($value){
|
||||
$otUser->where('orden_trabajo_id',$data['orden_trabajo_id'])
|
||||
$otUser->where('orden_trabajo_id',$orden_trabajo_id)
|
||||
->set([$mapping[$key] => $auth_user_id])
|
||||
->update();
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ use CodeIgniter\Model;
|
||||
|
||||
class TarifaExtraMaquinaModel extends Model
|
||||
{
|
||||
protected $table = 'tarifa_acabado_maquinas';
|
||||
protected $table = 'tarifa_extra_maquinas';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = TarifaExtraMaquinaEntity::class;
|
||||
|
||||
@ -22,7 +22,7 @@ use CodeIgniter\Email\Email;
|
||||
class ChatService extends BaseService
|
||||
{
|
||||
protected ?ChatEntity $chatEntity;
|
||||
protected Email $emailService;
|
||||
protected EmailService $emailService;
|
||||
protected UserModel $userModel;
|
||||
protected ChatModel $chatModel;
|
||||
protected ChatMessageModel $chatMessageModel;
|
||||
|
||||
@ -13,10 +13,14 @@ use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||
use App\Models\OrdenTrabajo\OrdenTrabajoUser;
|
||||
use App\Models\Usuarios\UserModel;
|
||||
use CodeIgniter\Config\BaseService;
|
||||
use App\Entities\Configuracion\Maquina as MaquinaEntity;
|
||||
use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
||||
use App\Models\Configuracion\MaquinaModel;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Database\BaseResult;
|
||||
use CodeIgniter\Database\Exceptions\DatabaseException;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use CodeIgniter\Model;
|
||||
use Dompdf\Dompdf;
|
||||
|
||||
/**
|
||||
@ -24,12 +28,19 @@ use Dompdf\Dompdf;
|
||||
*/
|
||||
class ProductionService extends BaseService
|
||||
{
|
||||
public array $TIPOS_PLANA = ['lp_bn','lp_color','lp_colorhq'];
|
||||
public array $TIPOS_ROTATIVA = ['lp_rot_bn','lp_rot_color'];
|
||||
|
||||
protected OrdenTrabajoModel $otModel;
|
||||
|
||||
protected OrdenTrabajoTarea $otTarea;
|
||||
protected OrdenTrabajoDate $otDate;
|
||||
protected OrdenTrabajoUser $otUser;
|
||||
protected OrdenTrabajoEntity $ot;
|
||||
protected UserModel $userModel;
|
||||
protected string $defaultMaquinaCorteName = 'HT-1000';
|
||||
protected MaquinaEntity $defaultMaquinaCorte;
|
||||
protected MaquinaModel $maquinaModel;
|
||||
protected array $MAPPING_DATE_USER = [
|
||||
"fecha_encuadernado_at" => "encuadernacion_user_id",
|
||||
// "fecha_externo_at" => "null",
|
||||
@ -70,10 +81,12 @@ class ProductionService extends BaseService
|
||||
}
|
||||
public function init(int $orden_trabajo_id): self
|
||||
{
|
||||
$this->maquinaModel = model(MaquinaModel::class);
|
||||
$this->otModel = model(OrdenTrabajoModel::class);
|
||||
$this->ot = $this->otModel->find($orden_trabajo_id);
|
||||
$pedido = $this->ot->pedido();
|
||||
$this->setPedido($pedido);
|
||||
$this->defaultMaquinaCorte = $this->maquinaModel->where('nombre',$this->defaultMaquinaCorteName)->first();
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
@ -140,14 +153,17 @@ class ProductionService extends BaseService
|
||||
$fecha_encuadernado = Time::now()->addDays(2)->format("Y-m-d");
|
||||
$fecha_entrega_real = Time::now()->addDays(5)->format("Y-m-d");
|
||||
$fecha_embalaje_at = Time::now()->addDays(4)->format("Y-m-d");
|
||||
return $this->otDate->insert([
|
||||
$data = [
|
||||
"orden_trabajo_id" => $this->ot->id,
|
||||
"fecha_encuadernado_at" => $fecha_encuadernado,
|
||||
"fecha_entrega_real_at" => $fecha_entrega_real,
|
||||
"fecha_impresion_at" => Time::now()->format("Y-m-d"),
|
||||
"embalaje_at" => $fecha_embalaje_at,
|
||||
"fecha_entrega_externo" => $this->pedido->fecha_entrega_externo,
|
||||
]);
|
||||
];
|
||||
$otDateId = $this->otDate->insert($data);
|
||||
$this->otDate->updateUserDateMap($this->ot->id,$data);
|
||||
return $otDateId;
|
||||
}
|
||||
protected function storeOrdenTrabajoUsers(): int|bool|string
|
||||
{
|
||||
@ -171,7 +187,7 @@ class ProductionService extends BaseService
|
||||
return $r;
|
||||
}
|
||||
/**
|
||||
* Inserta las tareas de la orden de trabajo.
|
||||
* Inserta las tareas de la orden de trabajo.p
|
||||
* Acepta como argumento una entidad de la orden de trabajo OrdenTrabajoEntity
|
||||
*
|
||||
*
|
||||
@ -196,9 +212,28 @@ class ProductionService extends BaseService
|
||||
$ot_tareas["tiempo_real"] = $p_linea->horas_maquina; //? Tiempo real se inserta manual?
|
||||
$insert_query_result = $this->otTarea->insert($ot_tareas);
|
||||
$ot_tareas = [];
|
||||
$this->storeTareaCorte($p_linea);
|
||||
}
|
||||
return $insert_query_result;
|
||||
}
|
||||
protected function storeTareaCorte(PresupuestoLineaEntity $pLinea): ?OrdenTrabajoTareaEntity
|
||||
{
|
||||
$otCorte = null;
|
||||
if($pLinea->isRotativa()){
|
||||
$tareaId = $this->otTarea->insert([
|
||||
'orden_trabajo_id' => $this->ot->id,
|
||||
'presupuesto_linea_id' => $pLinea->id,
|
||||
'nombre' => 'Corte',
|
||||
'maquina_id' => $this->defaultMaquinaCorte->id,
|
||||
'orden' => $this->defaultMaquinaCorte->orden_planning,
|
||||
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte,
|
||||
'tiempo_real' => $pLinea->rotativa_tiempo_corte
|
||||
]);
|
||||
$otCorte = $this->otTarea->find($tareaId);
|
||||
}
|
||||
return $otCorte;
|
||||
}
|
||||
|
||||
protected function storeOrdenTrabajoAcabadoTareas(): bool
|
||||
{
|
||||
$p_lineas = $this->presupuesto_lineas_acabado();
|
||||
@ -404,6 +439,7 @@ class ProductionService extends BaseService
|
||||
"ordenes_trabajo.total_tirada as ot_tirada",
|
||||
"lg_papel_formato.ancho as papel_ancho",
|
||||
"lg_papel_formato.alto as papel_alto",
|
||||
"presupuesto_linea.rotativa_metros_total as metros",
|
||||
// "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') as maquina_ancho",
|
||||
// "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') as maquina_alto",
|
||||
"lg_papel_impresion.nombre as papel_impresion",
|
||||
@ -422,7 +458,49 @@ class ProductionService extends BaseService
|
||||
->join("lg_maquinas as lgmp", "lgmp.id = presupuesto_linea.maquina_id", "left")
|
||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
||||
// ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo", ["lp_rot_bn", "lp_rot_color"])
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
||||
->where('lg_maquinas.is_rotativa',true)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
return $q;
|
||||
}
|
||||
/**
|
||||
* Query para mostrar en datatable
|
||||
*
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function planningPlanaQueryDatatable(): BaseBuilder
|
||||
{
|
||||
$q = $this->otModel->builder()->select([
|
||||
"ordenes_trabajo.id as otId",
|
||||
"orden_trabajo_dates.fecha_entrega_real_at",
|
||||
"presupuestos.titulo as presupuesto_titulo",
|
||||
"orden_trabajo_tareas.maquina_id",
|
||||
"lg_maquinas.nombre as maquina_planning_nombre",
|
||||
"ordenes_trabajo.total_tirada as ot_tirada",
|
||||
"lg_papel_formato.ancho as papel_ancho",
|
||||
"lg_papel_formato.alto as papel_alto",
|
||||
"presupuesto_linea.pliegos_pedido as pliegosPedido",
|
||||
// "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') as maquina_ancho",
|
||||
// "JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') as maquina_alto",
|
||||
"lg_papel_impresion.nombre as papel_impresion",
|
||||
"presupuesto_linea.gramaje as papel_gramaje",
|
||||
|
||||
|
||||
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("orden_trabajo_dates", "orden_trabajo_dates.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||
->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left")
|
||||
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||
->join("lg_papel_impresion", "lg_papel_impresion.id = presupuesto_linea.papel_impresion_id", "left")
|
||||
->join("lg_maquinas as lgmp", "lgmp.id = presupuesto_linea.maquina_id", "left")
|
||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
||||
// ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||
->where('lg_maquinas.is_rotativa',false)
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||
return $q;
|
||||
@ -472,6 +550,7 @@ class ProductionService extends BaseService
|
||||
"lg_papel_formato.alto as papel_alto",
|
||||
// "CAST(JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_ancho') AS DOUBLE) as maquina_ancho",
|
||||
// "CAST(JSON_EXTRACT(presupuesto_linea.formas,'$.maquina_alto') AS DOUBLE) as maquina_alto",
|
||||
"presupuesto_linea.rotativa_metros_total as metros",
|
||||
"SUM(ordenes_trabajo.total_tirada) as totalTirada",
|
||||
"SUM(orden_trabajo_tareas.tiempo_real) as tiempoReal"
|
||||
])
|
||||
@ -482,6 +561,34 @@ class ProductionService extends BaseService
|
||||
->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left")
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL, FALSE)
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
||||
->groupBy('lg_papel_impresion.id');
|
||||
|
||||
|
||||
|
||||
return $q;
|
||||
}
|
||||
public function papelPliegoDatatableQuery(): BaseBuilder
|
||||
{
|
||||
$q = $this->otModel->builder()->select([
|
||||
"lg_papel_impresion.id as papelImpresionId",
|
||||
"lg_papel_impresion.nombre as papelImpresionNombre",
|
||||
"lg_papel_impresion.gramaje as papelImpresionGramaje",
|
||||
"COUNT(orden_trabajo_tareas.id) as tareasCount",
|
||||
"lg_papel_formato.ancho as papel_ancho",
|
||||
"lg_papel_formato.alto as papel_alto",
|
||||
"presupuesto_linea.pliegos_pedido as pliegosPedido",
|
||||
"SUM(ordenes_trabajo.total_tirada) as totalTirada",
|
||||
"SUM(orden_trabajo_tareas.tiempo_real) as tiempoReal"
|
||||
])
|
||||
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||
->join("lg_papel_impresion", "presupuesto_linea.papel_impresion_id = lg_papel_impresion.id", "left")
|
||||
->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left")
|
||||
->where("orden_trabajo_tareas.deleted_at", null)
|
||||
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL, FALSE)
|
||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||
->groupBy('lg_papel_impresion.id');
|
||||
|
||||
|
||||
@ -614,18 +721,23 @@ class ProductionService extends BaseService
|
||||
|
||||
public function updateOrdenTrabajoDate($data)
|
||||
{
|
||||
// // return $this->otDate->find($this->ot->id);
|
||||
$result = [];
|
||||
$otDate = $this->otDate->where('orden_trabajo_id', $this->ot->id)
|
||||
->set([$data['name'] => $data[$data['name']]])
|
||||
->update($data);
|
||||
$this->otDate->updateUserDateMap($this->ot->id,$data);
|
||||
$ot_users = $this->ot->users();
|
||||
if($this->MAPPING_DATE_USER[$data["name"]]){
|
||||
if(isset($this->MAPPING_DATE_USER[$data["name"]])){
|
||||
$user_id = $ot_users->{$this->MAPPING_DATE_USER[$data["name"]]};
|
||||
$user = $this->userModel->find($user_id);
|
||||
return ["user" => $user, "status" => $otDate];
|
||||
if($user_id){
|
||||
$result = ["user" => null, "status" => false];
|
||||
}
|
||||
$result = ["user" => $user, "status" => $otDate];
|
||||
}else{
|
||||
return ["user" => null, "status" => false];
|
||||
$result = ["user" => null, "status" => false];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function updateOrdenTrabajo($data): bool
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="4" style="text-align:right">Total:</th>
|
||||
<th><span class="autonumeric" id="total-metros"></span>(m)</th>
|
||||
<th><span id="total-metros"></span></th>
|
||||
<th id="total-tiempo-papel"></th>
|
||||
<th></th>
|
||||
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Produccion.datatable.papel') ?></th>
|
||||
<th><?= lang('Produccion.datatable.gramaje') ?> (gr)</th>
|
||||
<th><?= lang('Produccion.datatable.tareas') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tirada') ?></th>
|
||||
<th><?= lang('Produccion.datatable.pliegos_libro') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tiempo') ?>(HH:MM)</th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="4" style="text-align:right">Total:</th>
|
||||
<th><span id="total-pliegos"></span></th>
|
||||
<th id="total-tiempo-pliego"></th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
@ -0,0 +1,43 @@
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ID') ?></th>
|
||||
<th><?= lang('Produccion.datatable.fecha_entrega_at') ?></th>
|
||||
<th><?= lang('Produccion.datatable.titulo') ?></th>
|
||||
<th><?= lang('Produccion.datatable.maquina') ?></th>
|
||||
<th><?= lang('Produccion.datatable.tirada') ?></th>
|
||||
<th><?= lang('Produccion.datatable.ancho') ?></th>
|
||||
<th><?= lang('Produccion.datatable.alto') ?></th>
|
||||
<th><?= lang('Produccion.datatable.papel') ?></th>
|
||||
<th><?= lang('Produccion.datatable.gramaje') ?></th>
|
||||
<th></th>
|
||||
<th><?= lang('Produccion.datatable.pliegos') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><input type="text" class="form-control planning-filter" name="otId" placeholder="ID"></th>
|
||||
<th></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="presupuesto_titulo" placeholder="Titulo"></th>
|
||||
<th><select class="select2 form-select-sm planning-maquina-select" name="maquina_planning_nombre"></select></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><select class="select2 form-select-sm planning-papel-select" name="papel_impresion"></select></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="gramaje"></th>
|
||||
<th>
|
||||
<div class="form-check mt-4">
|
||||
<input class="form-check-input" id="pliegos-check-all" type="checkbox" value="" />
|
||||
</div>
|
||||
</th>
|
||||
<th><span id="pliegos-sel-total"></span></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
@ -19,16 +19,16 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><input type="text" class="form-control planning-filter" name="otId" placeholder="ID"></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="fecha_entrega_real_at" placeholder="d/m/Y"></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="presupuesto_titulo" placeholder="Titulo"></th>
|
||||
<th><select class="select2 form-select select-maquina" id="maquina-select-filter" name="maquina_planning_nombre"></select></th>
|
||||
<th></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="maquina_ancho" placeholder="Ancho"></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="maquina_alto" placeholder="Alto"></th>
|
||||
<th><select class="select2 form-select select-maquina" id="papel-impresion-select-filter" name="papel_impresion"></select></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="presupuesto_titulo" placeholder="Titulo"></th>
|
||||
<th><select class="select2 form-select-sm planning-maquina-select" name="maquina_planning_nombre"></select></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><select class="select2 form-select-sm planning-papel-select" name="papel_impresion"></select></th>
|
||||
<th><input type="text" class="form-control planning-filter" name="gramaje"></th>
|
||||
<th>
|
||||
<select class="select2 form-select w-100" name="corte">
|
||||
<select class="select2 form-select-sm w-100" name="corte">
|
||||
<option value="0" default></option>
|
||||
<option value="1">Guillotina</option>
|
||||
<option value="2">Bobina</option>
|
||||
@ -39,7 +39,7 @@
|
||||
<input class="form-check-input" id="metros-check-all" type="checkbox" value="" />
|
||||
</div>
|
||||
</th>
|
||||
<th><span class="autonumeric" id="metros-sel-total"></span></th>
|
||||
<th><span id="metros-sel-total"></span></th>
|
||||
<th></th>
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,10 @@
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtCostTip" aria-expanded="false" aria-controls="accordionOtCostTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-receipt ti-xs ti">Costes producción</i> </h4>
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-currency-euro ti-md ti"></i></span>
|
||||
<h4> Costes producción </h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
||||
@ -3,7 +3,10 @@
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtDatesTip" aria-expanded="false" aria-controls="accordionOtDatesTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-calendar ti-xs ti">Fechas</i> </h4>
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-calendar ti-md ti"></i></span>
|
||||
<h4> Fechas </h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
||||
@ -3,37 +3,79 @@
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtDetailsTip" aria-expanded="false" aria-controls="accordionOtDetailsTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-file-info ti-xs ti">Detalles</i> </h4>
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-file-description ti-md ti"></i></span>
|
||||
<h4> Detalles </h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOtDetailsTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtDetails">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
<!-- Detail 1-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
||||
<label for="ot-formato" class="form-label"><?= @lang("Produccion.formato") ?></label>
|
||||
<input type="text" class="form-control" name="formato" id="ot-formato" disabled>
|
||||
</div>
|
||||
<!-- Detail 2-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
||||
<label for="ot-paginas" class="form-label"><?= @lang("Produccion.paginas") ?></label>
|
||||
<input type="text" class="form-control" name="paginas" id="ot-paginas" name="presupuesto.paginas" disabled>
|
||||
</div>
|
||||
<!-- Detail 3-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
||||
<label for="ot-solapa" class="form-label"><?= @lang("Produccion.solapa") ?></label>
|
||||
<input type="text" class="form-control" name="solapa" id="ot-solapa" disabled>
|
||||
</div>
|
||||
<!-- Detail 4-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
||||
<label for="ot-tirada" class="form-label"><?= @lang("Produccion.tirada") ?></label>
|
||||
<input type="text" class="form-control" name="tirada" id="ot-tirada" name="presupuesto.tirada" disabled>
|
||||
</div>
|
||||
<!-- Detail 5-->
|
||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
||||
<label for="ot-merma" class="form-label"><?= @lang("Produccion.merma") ?></label>
|
||||
<input type="text" class="form-control" name="merma" id="ot-merma" name="presupuesto.merma" disabled>
|
||||
<div class="col-lg-12 mb-4 col-md-12 ">
|
||||
<div class="card">
|
||||
<div class="card-body pt-2">
|
||||
<div class="row gy-3 justify-content-center">
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-primary me-3 p-2">
|
||||
<i class="ti ti-dimensions ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-formato"><?=$presupuesto->papel_formato()->ancho?>x<?=$presupuesto->papel_formato()->alto?></h5>
|
||||
<span class="fx-large"><?= @lang("Produccion.formato") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-info me-3 p-2">
|
||||
<i class="ti ti-box-multiple ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-paginas"><?=$presupuesto->merma?></h5>
|
||||
<span class="fx-large"><?= @lang("Produccion.paginas") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-danger me-3 p-2">
|
||||
<i class="ti ti-bookmark ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-solapa"><?=$presupuesto->solapas?></h5>
|
||||
|
||||
<span class="fx-large"><?= @lang("Produccion.solapa") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-success me-3 p-2">
|
||||
<i class="ti ti-books ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-tirada"></h5>
|
||||
|
||||
<span class="fx-large"><?= @lang("Produccion.tirada") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="badge rounded-pill bg-label-success me-3 p-2">
|
||||
<i class="ti ti-notebook ti-lg"></i>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h5 class="mb-0" id="ot-merma"><?=$presupuesto->merma?></h5>
|
||||
|
||||
<span class="fx-large"><?= @lang("Produccion.merma") ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
45
ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php
Normal file
45
ci4/app/Views/themes/vuexy/form/produccion/ot/otHeader.php
Normal file
@ -0,0 +1,45 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card mb-3" id="alert-orden-trabajo">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-2 d-flex align-items-center justify-content-center " style="max-height: 50%;">
|
||||
<div class="sk-wave sk-primary portada-loader">
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
</div>
|
||||
<img class="card-img card-img-left img-thumbnail" id="portada-orden-trabajo" src="" hidden>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body">
|
||||
<h1 class="card-title mb-0">[<?= $presupuesto->id ?>]<?= $presupuesto->titulo ?></h1>
|
||||
<h4 class="card-title mb-0 text-secondary"><?= $cliente->nombre ?></h4>
|
||||
<h3 class="card-title mb-3">OT : <?= $ot->id ?></h3>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="card-info">
|
||||
<h3 class="mb-0"><?= $ot->progreso ?> %</h3>
|
||||
<span class="fx-large">Progreso</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-column justify-content-start gap-2">
|
||||
<a target="_blank" type="button" href="<?= route_to('editarPresupuestoAdmin', $presupuesto->id) ?>" class="btn btn-primary text-white w-100">
|
||||
<span class="ti-sm ti ti-currency-dollar me-1"></span>
|
||||
Presupuesto
|
||||
</a>
|
||||
<a target="_blank" href="<?= route_to('editarPedido', $ot->pedido()->id) ?>" class="btn btn-primary text-white w-100">
|
||||
<span class="ti-sm ti ti-truck-delivery me-1"></span>
|
||||
Pedido
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
@ -2,8 +2,10 @@
|
||||
<div class="card accordion-item">
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtPortadaTip" aria-expanded="false" aria-controls="accordionOtPortadaTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-photo ti-xs ti">Portada</i> </h4>
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-photo ti-md ti"></i></span>
|
||||
<h4> Portada </h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
||||
@ -3,7 +3,10 @@
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtProgressTip" aria-expanded="false" aria-controls="accordionOtProgressTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-hourglass ti-xs ti">Progreso</i> </h4>
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-list-details ti-md ti"></i></span>
|
||||
<h4> Progreso </h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
||||
@ -3,7 +3,10 @@
|
||||
<h2 class="accordion-header">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtTasksTip" aria-expanded="false" aria-controls="accordionOtTasksTip">
|
||||
|
||||
<h4> <i class="tf-icon ti-list-check ti-xs ti">Tareas</i> </h4>
|
||||
<div class="d-flex flex-row justify-content-start align-items-stretch gap-2">
|
||||
<span><i class="ti-subtask ti-md ti"></i></span>
|
||||
<h4> Tareas </h4>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
||||
@ -12,11 +12,24 @@
|
||||
<div class="nav-tabs-shadow nav-align-top">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" id="navs-top-align-prot-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-prot"><?= lang("Produccion.planning_rotativa") ?></button>
|
||||
<button type="button"
|
||||
class="nav-link active"
|
||||
role="tab"
|
||||
id="navs-top-align-rot-tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#prot-datatables-container-rot"><?= lang("Produccion.planning_rotativa") ?></button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
id="navs-top-align-plana-tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#prot-datatables-container-plana"><?= lang("Produccion.planning_plana") ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="prot-datatables-container">
|
||||
<div class="tab-pane fade show active" id="navs-top-align-prot">
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="prot-datatables-container-rot" role="tabpanel">
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionPapelGramaje">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
@ -35,8 +48,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade show active" id="navs-top-align-prot">
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionPlanningRotativa">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
@ -58,15 +69,52 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="prot-datatables-container-plana" role="tabpanel">
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionPapelPliego">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionPapelPliegoContainer" aria-expanded="false"
|
||||
aria-controls="accordionPapelPliegoContainer">
|
||||
<h4><?= lang("Produccion.papel_gramajes") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionPapelPliegoContainer" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionPapelPliego">
|
||||
<div class="accordion-body">
|
||||
<?= view("themes/vuexy/components/tables/planning_papel_pliego_table.php", ["id" => "planning-pliego-datatable"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionPlanningPlana">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionPlanningPlanaContainer" aria-expanded="false"
|
||||
aria-controls="accordionPlanningPlanaContainer">
|
||||
<h4><?= lang("Produccion.planning_plana") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionPlanningPlanaContainer" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionPlanningPlana">
|
||||
<div class="accordion-body">
|
||||
<h6 id="papel-impresion-name-plana-header" class="text-secondary "></h6>
|
||||
<?= view("themes/vuexy/components/tables/planning_plana_table.php", ["id" => "planning-plana-datatable"]) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!--//.card -->
|
||||
</div>
|
||||
</div>
|
||||
<!--//.col -->
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
|
||||
@ -5,79 +5,8 @@
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<div id="ot-edit" data-id="<?= $modelId ?>">
|
||||
<div class="row">
|
||||
<div class="col-md-2 d-flex align-items-center justify-content-center">
|
||||
<div class="sk-wave sk-primary portada-loader">
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
<div class="sk-wave-rect"></div>
|
||||
</div>
|
||||
<?= view("themes/vuexy/form/produccion/ot/otHeader") ?>
|
||||
|
||||
<img class="rounded" id="portada-orden-trabajo" src="" width="100%" height="100%" hidden>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
|
||||
<div class="alert alert-info h-100" role="alert" id="alert-orden-trabajo">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="d-flex flex-row bd-highlight gap-2">
|
||||
<div class="bd-highlight">
|
||||
<h4>OT : </h4>
|
||||
</div>
|
||||
<div class="bd-highlight">
|
||||
<h4><?= $ot->id ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="d-flex flex-row bd-highlight justify-content-end">
|
||||
<h4><?= $ot->progreso ?> %</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
|
||||
<div class="d-flex flex-row bd-highlight gap-2">
|
||||
<div class="bd-highlight">
|
||||
<span><i class="tf-icons ti-md ti ti-building-factory-2"></i></span>
|
||||
</div>
|
||||
<div class="bd-highlight">
|
||||
<h4><?= $presupuesto->titulo ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="d-flex flex-row bd-highlight justify-content-end">
|
||||
<button class="btn btn-sm btn-warning w-100">Presupuesto</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="d-flex flex-row bd-highlight">
|
||||
<div class="bd-highlight">
|
||||
<span><i class="tf-icons ti-md ti ti-user"></i></span>
|
||||
</div>
|
||||
<div>
|
||||
<h4><?= $cliente->nombre ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-2 ">
|
||||
<div class="d-flex flex-row bd-highlight justify-content-end">
|
||||
<button class="btn btn-sm btn-warning w-100">Pedido</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!--//.row -->
|
||||
<div class="row">
|
||||
<form id="ot-edit-form">
|
||||
<div class="col-md-12">
|
||||
|
||||
@ -33,7 +33,7 @@ if (auth()->user()->inGroup('beta')) {
|
||||
</li> -->
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("produccion/ordentrabajo/planning/rotativa") ?>" class="menu-link">
|
||||
<?= lang("App.menu_planning_rotativa") ?>
|
||||
<?= lang("App.menu_planning") ?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
BIN
httpdocs/assets/img/cortadora_bobinas.png
Normal file
BIN
httpdocs/assets/img/cortadora_bobinas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
BIN
httpdocs/assets/img/guillotina.png
Normal file
BIN
httpdocs/assets/img/guillotina.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.9 KiB |
@ -1,7 +1,7 @@
|
||||
import Ajax from "../../components/ajax.js"
|
||||
import ClassSelect from "../../components/select2.js";
|
||||
import DatePicker from "../../components/datepicker.js";
|
||||
import { alertConfirmationDelete } from "../../components/alerts/sweetAlert.js";
|
||||
import { alertConfirmationDelete, alertSuccess } from "../../components/alerts/sweetAlert.js";
|
||||
import Modal from "../../components/modal.js"
|
||||
|
||||
class OrdenTrabajo {
|
||||
@ -100,7 +100,7 @@ class OrdenTrabajo {
|
||||
this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this))
|
||||
this.otForm.on("click", ".ot-tarea-comment", this.handleNoteTarea.bind(this))
|
||||
$("#btn-update-tarea-comment").on("click", this.handleTareaNoteSubmit.bind(this))
|
||||
this.otForm.on("keyup","#ot-comment",this.handleOtComment.bind(this))
|
||||
this.otForm.on("change", "#ot-comment", this.handleOtComment.bind(this))
|
||||
|
||||
this._handleGetData()
|
||||
this.handleGetPortada()
|
||||
@ -116,7 +116,7 @@ class OrdenTrabajo {
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
serverSide: true,
|
||||
responsive : true,
|
||||
responsive: true,
|
||||
createdRow: this.filterCreatedRow.bind(this),
|
||||
pageLength: 10,
|
||||
language: {
|
||||
@ -231,10 +231,10 @@ class OrdenTrabajo {
|
||||
}
|
||||
fillOtDetails() {
|
||||
const progreso = this.summaryData.ot.progreso
|
||||
this.otForm.find("#ot-progress-bar").attr('aria-valuenow',progreso).text(progreso + "%").css("width",progreso + "%")
|
||||
this.otForm.find("#ot-paginas").val(this.summaryData.presupuesto.paginas)
|
||||
this.otForm.find("#ot-tirada").val(this.summaryData.presupuesto.tirada)
|
||||
this.otForm.find("#ot-merma").val(this.summaryData.presupuesto.merma)
|
||||
this.otForm.find("#ot-progress-bar").attr('aria-valuenow', progreso).text(progreso + "%").css("width", progreso + "%")
|
||||
this.otForm.find("#ot-paginas").text(this.summaryData.presupuesto.paginas)
|
||||
this.otForm.find("#ot-tirada").text(this.summaryData.presupuesto.tirada)
|
||||
this.otForm.find("#ot-merma").text(this.summaryData.presupuesto.merma)
|
||||
}
|
||||
fillOtDates() {
|
||||
this.fechaImpresion.setDate(this.summaryData.dates.fecha_impresion_at)
|
||||
@ -275,7 +275,7 @@ class OrdenTrabajo {
|
||||
handleTareaNoteSubmit(event) {
|
||||
const data = {}
|
||||
data["comment"] = $("#comment-tarea").val()
|
||||
data["orden_trabajo_tarea_id"] = $("#comment-tarea").data("id")
|
||||
data["orden_trabajo_tarea_id"] = this.tareaIdComment
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update/tarea",
|
||||
data,
|
||||
@ -291,17 +291,19 @@ class OrdenTrabajo {
|
||||
this._handleGetData();
|
||||
}
|
||||
handleTareaChangeError(error) { }
|
||||
handleOtComment(event){
|
||||
handleOtComment(event) {
|
||||
console.log($(event.currentTarget).val())
|
||||
const ajax = new Ajax(
|
||||
"/produccion/ordentrabajo/update",
|
||||
{
|
||||
"orden_trabajo_id" : this.modelId,
|
||||
"name" : $(event.currentTarget).attr("name"),
|
||||
"comentarios" : $(event.currentTarget).val()
|
||||
"orden_trabajo_id": this.modelId,
|
||||
"name": $(event.currentTarget).attr("name"),
|
||||
"comentarios": $(event.currentTarget).val()
|
||||
},
|
||||
null,
|
||||
null,
|
||||
(response) => {
|
||||
alertSuccess(response.message).fire()
|
||||
},
|
||||
null
|
||||
)
|
||||
ajax.post();
|
||||
@ -326,7 +328,11 @@ class OrdenTrabajo {
|
||||
}
|
||||
handleDateChangeSuccess(formItem, response) {
|
||||
formItem.addClass("is-valid")
|
||||
formItem.parent().append(`<div class="form-text">${[response.user.first_name, response.user.last_name].join(" ")}</div>`)
|
||||
alertSuccess(response.message).fire()
|
||||
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>`)
|
||||
}
|
||||
}
|
||||
handleDateChangeError(errors) { }
|
||||
handlePreimpresionReviewChange(event) {
|
||||
@ -455,10 +461,10 @@ class OrdenTrabajo {
|
||||
}
|
||||
handleDeleteTareaError() { }
|
||||
handleNoteTarea(event) {
|
||||
let tarea_id = $(event.currentTarget).data("id");
|
||||
const tarea = this.summaryData.tasks.find(task => task.id == tarea_id)
|
||||
this.tareaIdComment = $(event.currentTarget).data("id");
|
||||
const tarea = this.summaryData.tasks.find(task => task.id == this.tareaIdComment)
|
||||
if (tarea) {
|
||||
$("#comment-tarea").attr("data-id", tarea_id)
|
||||
$("#comment-tarea").attr("data-id", this.tareaIdComment)
|
||||
$("#comment-type").text(tarea.nombre ?? "")
|
||||
$("#comment-tarea").val(tarea.comment)
|
||||
this.tareaCommentModal.toggle()
|
||||
|
||||
@ -6,24 +6,45 @@ class PlanningRotativa {
|
||||
constructor(domItem) {
|
||||
this.item = domItem
|
||||
this.tablePlanningRot = this.item.find("#planning-rotativa-datatable")
|
||||
this.tablePlanningPlana = this.item.find("#planning-plana-datatable")
|
||||
this.papelGramajeTablePlanning = this.item.find("#planning-papel-datatable")
|
||||
this.papelPliegoTablePlanning = this.item.find("#planning-pliego-datatable")
|
||||
this.papelImpresionHeader = this.item.find('#papel-impresion-name-header')
|
||||
this.papelImpresionPlanaHeader = this.item.find('#papel-impresion-name-plana-header')
|
||||
|
||||
this.checkAllMetros = this.item.find("#metros-check-all")
|
||||
this.checkAllPliegos = this.item.find("#pliegos-check-all")
|
||||
|
||||
this.datatableColumns = [
|
||||
{ data: 'otId', searchable: false, sortable: false },
|
||||
{ data: 'fecha_entrega_real_at', searchable: true, sortable: false },
|
||||
{ data: 'presupuesto_titulo', searchable: true, sortable: false },
|
||||
{ data: 'maquina_planning_nombre', searchable: true, sortable: false },
|
||||
{ data: 'ot_tirada', searchable: false, sortable: false, },
|
||||
{ data: 'papel_ancho', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_alto', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'otId', searchable: false, sortable: false, width: "3rem" },
|
||||
{ data: 'fecha_entrega_real_at', searchable: true, sortable: false, width: "15rem" },
|
||||
{ data: 'presupuesto_titulo', searchable: true, sortable: false, width: "20rem" },
|
||||
{ data: 'maquina_planning_nombre', searchable: true, sortable: false, width: "10rem" },
|
||||
{ data: 'ot_tirada', searchable: false, sortable: false, width: "5rem" },
|
||||
{ data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_impresion', searchable: false, sortable: false },
|
||||
{ data: 'papel_gramaje', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'corte', searchable: false, sortable: false, render: d => d },
|
||||
{ data: 'papel_gramaje', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'corte', searchable: false, sortable: false, render: this.renderCorteImage.bind(this), width: "10rem" },
|
||||
{ data: 'metros_check', searchable: false, sortable: false, render: d => `<input class="form-check-input metros-check" data-id="${d}" type="checkbox" value="" />` },
|
||||
{ data: 'metros', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'action', searchable: false, sortable: false, render: this._renderBtnAction },
|
||||
|
||||
]
|
||||
this.datatablePlanaColumns = [
|
||||
{ data: 'otId', searchable: false, sortable: false, width: "3rem" },
|
||||
{ data: 'fecha_entrega_real_at', searchable: true, sortable: false, width: "15rem" },
|
||||
{ data: 'presupuesto_titulo', searchable: true, sortable: false, width: "20rem" },
|
||||
{ data: 'maquina_planning_nombre', searchable: true, sortable: false, width: "10rem" },
|
||||
{ data: 'ot_tirada', searchable: false, sortable: false, width: "5rem" },
|
||||
{ data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'papel_impresion', searchable: false, sortable: false },
|
||||
{ data: 'papel_gramaje', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'pliegos_check', searchable: false, sortable: false, render: d => `<input class="form-check-input pliegos-check" data-id="${d}" type="checkbox" value="" />` },
|
||||
{ data: 'pliegosPedido', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'action', searchable: false, sortable: false, render: this._renderBtnAction },
|
||||
|
||||
]
|
||||
this.papelGramajeDatatableColumns = [
|
||||
{ data: 'papelImpresionNombre', searchable: true, sortable: true },
|
||||
@ -31,7 +52,7 @@ class PlanningRotativa {
|
||||
{ data: 'tareasCount', searchable: true, sortable: true },
|
||||
{ data: 'totalTirada', searchable: false, sortable: false },
|
||||
{ data: 'metros', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'tiempoReal', searchable: false, sortable: false },
|
||||
{ data: 'tiempoReal', searchable: false, sortable: false, render: d => this.formatSeconds(d) },
|
||||
{
|
||||
data: 'action', searchable: false, sortable: false, render: (d) => {
|
||||
return `<button type="button" class="btn btn-primary btn-sm w-100 papel-gramaje-btn" data-id="${d.data.papelImpresionId}" data-bs-toggle="button">${d.title}</button>`
|
||||
@ -40,32 +61,82 @@ class PlanningRotativa {
|
||||
|
||||
|
||||
]
|
||||
this.maquinaSelectFilter = new ClassSelect($("#maquina-select-filter"), `/maquinas/select`, "Seleccione una maquina", true, {}, $('body'));
|
||||
this.papelImpresionFilter = new ClassSelect($("#papel-impresion-select-filter"), `/papelesimpresion/select`, "Seleccione un papel", true, {}, $('body'));
|
||||
this.papelPliegoDatatableColumns = [
|
||||
{ data: 'papelImpresionNombre', searchable: true, sortable: true },
|
||||
{ data: 'papelImpresionGramaje', searchable: true, sortable: true },
|
||||
{ data: 'tareasCount', searchable: true, sortable: true },
|
||||
{ data: 'totalTirada', searchable: false, sortable: false },
|
||||
{ data: 'pliegosPedido', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||
{ data: 'tiempoReal', searchable: false, sortable: false, render: d => this.formatSeconds(d) },
|
||||
{
|
||||
data: 'action', searchable: false, sortable: false, render: (d) => {
|
||||
return `<button type="button" class="btn btn-primary btn-sm w-100 papel-pliego-btn" data-id="${d.data.papelImpresionId}" data-bs-toggle="button">${d.title}</button>`
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
this.maquinaSelectFilter = new ClassSelect(
|
||||
this.tablePlanningRot.find(".planning-maquina-select"),
|
||||
`/maquinas/select`,
|
||||
"Seleccione una maquina",
|
||||
true, {
|
||||
dropdownCssClass: "h-2"
|
||||
}, $('body'));
|
||||
this.papelImpresionFilter = new ClassSelect(this.tablePlanningRot.find(".planning-papel-select"), `/papelesimpresion/select`, "Seleccione un papel", true, {}, $('body'));
|
||||
this.maquinaSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-select"), `/maquinas/select`, "Seleccione una maquina", true, {}, $('body'));
|
||||
this.papelImpresionFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-papel-select"), `/papelesimpresion/select`, "Seleccione un papel", true, {}, $('body'));
|
||||
this.maquinaSelectFilter.config.dropdownParent = this.item
|
||||
}
|
||||
init() {
|
||||
const autoNumericOptions = {
|
||||
digitGroupSeparator: ".",
|
||||
decimalCharacter: ",",
|
||||
allowDecimalPadding: 'floats',
|
||||
currencySymbol: '(m)',
|
||||
currencySymbolPlacement: 's',
|
||||
decimalPlaces: 2,
|
||||
unformatOnSubmit: true,
|
||||
|
||||
}
|
||||
const autoNumericPliegosOptions = {
|
||||
digitGroupSeparator: ".",
|
||||
decimalCharacter: ",",
|
||||
allowDecimalPadding: 'floats',
|
||||
decimalPlaces: 0,
|
||||
unformatOnSubmit: true,
|
||||
|
||||
}
|
||||
this.totalMetros = new AutoNumeric(this.item.find('#total-metros')[0], autoNumericOptions);
|
||||
this.totalMetrosSel = new AutoNumeric(this.item.find('#metros-sel-total')[0], autoNumericOptions);
|
||||
this.totalPliegos = new AutoNumeric(this.item.find('#total-pliegos')[0], autoNumericPliegosOptions);
|
||||
this.totalPliegosSel = new AutoNumeric(this.item.find('#pliegos-sel-total')[0], autoNumericPliegosOptions);
|
||||
this.maquinaSelectFilter.init()
|
||||
this.papelImpresionFilter.init()
|
||||
this.maquinaSelectFilterPlana.init()
|
||||
this.papelImpresionFilterPlana.init()
|
||||
this.checkAllMetros.on('change', () => {
|
||||
let isChecked = this.checkAllMetros.prop('checked')
|
||||
this.item.find(".metros-check").prop('checked', isChecked).trigger("change")
|
||||
})
|
||||
this.checkAllPliegos.on('change', () => {
|
||||
let isChecked = this.checkAllPliegos.prop('checked')
|
||||
this.item.find(".pliegos-check").prop('checked', isChecked).trigger("change")
|
||||
})
|
||||
this.papelGramajeTablePlanning.on('click', '.papel-gramaje-btn', this.filterPapelGramaje.bind(this))
|
||||
this.papelPliegoTablePlanning.on('click', '.papel-pliego-btn', this.filterPapelGramajePlana.bind(this))
|
||||
|
||||
this.papelImpresionFilter.onChange(() => {
|
||||
this.papelImpresionHeader.text(this.papelImpresionFilter.getText())
|
||||
})
|
||||
this.papelImpresionFilterPlana.onChange(() => {
|
||||
this.papelImpresionPlanaHeader.text(this.papelImpresionFilter.getText())
|
||||
})
|
||||
|
||||
this.datatablePlanningRot = this.tablePlanningRot.DataTable({
|
||||
processing: true,
|
||||
orderCellsTop: true,
|
||||
layout: {
|
||||
topStart: 'info',
|
||||
topEnd: null,
|
||||
bottomStart: 'pageLength',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
|
||||
dom: 'lrtip',
|
||||
serverSide: true,
|
||||
responsive: true,
|
||||
pageLength: 10,
|
||||
@ -75,17 +146,23 @@ class PlanningRotativa {
|
||||
columns: this.datatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/rotativa/datatable'
|
||||
});
|
||||
this.datatablePlanningPlana = this.tablePlanningPlana.DataTable({
|
||||
processing: true,
|
||||
orderCellsTop: true,
|
||||
dom: 'lrtip',
|
||||
serverSide: true,
|
||||
responsive: true,
|
||||
pageLength: 10,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.datatablePlanaColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/plana/datatable'
|
||||
});
|
||||
this.papelGramajeDatatable = this.papelGramajeTablePlanning.DataTable({
|
||||
processing: true,
|
||||
orderCellsTop: true,
|
||||
|
||||
layout: {
|
||||
topStart: 'info',
|
||||
topEnd: null,
|
||||
bottomStart: 'pageLength',
|
||||
bottomEnd: 'paging'
|
||||
},
|
||||
|
||||
dom: 'lrtip',
|
||||
serverSide: true,
|
||||
responsive: true,
|
||||
pageLength: 10,
|
||||
@ -95,22 +172,58 @@ class PlanningRotativa {
|
||||
columns: this.papelGramajeDatatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/papel/datatable'
|
||||
});
|
||||
this.item.on("keyup", ".planning-filter", (event) => {
|
||||
this.papelPliegoDatatable = this.papelPliegoTablePlanning.DataTable({
|
||||
processing: true,
|
||||
orderCellsTop: true,
|
||||
dom: 'lrtip',
|
||||
serverSide: true,
|
||||
responsive: true,
|
||||
pageLength: 10,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columns: this.papelPliegoDatatableColumns,
|
||||
ajax: '/produccion/ordentrabajo/planning/papel/plana/datatable'
|
||||
});
|
||||
/**
|
||||
* PLANNING ROTATIVA
|
||||
*/
|
||||
this.tablePlanningRot.on("keyup", ".planning-filter", (event) => {
|
||||
console.log(this.datatablePlanningRot.column($(event.currentTarget).attr("name")))
|
||||
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||
this.datatablePlanningRot.column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||
})
|
||||
this.item.on("change", "#maquina-select-filter", (event) => {
|
||||
this.tablePlanningRot.on("change", ".planning-maquina-select", (event) => {
|
||||
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||
this.datatablePlanningRot.column(columnIndex).search(this.maquinaSelectFilter.getText()).draw()
|
||||
})
|
||||
this.item.on("change", "#papel-impresion-select-filter", (event) => {
|
||||
this.tablePlanningRot.on("change", ".planning-papel-select", (event) => {
|
||||
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||
this.datatablePlanningRot.column(columnIndex).search(this.papelImpresionFilter.getText()).draw()
|
||||
})
|
||||
this.papelGramajeDatatable.on('draw', this.addTotalFooter.bind(this))
|
||||
|
||||
this.tablePlanningRot.on('change', ".metros-check", this.calcMetrosCheck.bind(this))
|
||||
|
||||
/**
|
||||
* PLANNING PLANA
|
||||
*/
|
||||
this.tablePlanningPlana.on("keyup", ".planning-filter", (event) => {
|
||||
console.log(this.datatablePlanningRot.column($(event.currentTarget).attr("name")))
|
||||
let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||
this.datatablePlanningPlana.column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||
})
|
||||
this.tablePlanningPlana.on("change", ".planning-maquina-select", (event) => {
|
||||
let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||
this.datatablePlanningPlana.column(columnIndex).search(this.maquinaSelectFilterPlana.getText()).draw()
|
||||
})
|
||||
this.tablePlanningPlana.on("change", ".planning-papel-select", (event) => {
|
||||
let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||
this.datatablePlanningPlana.column(columnIndex).search(this.papelImpresionFilterPlana.getText()).draw()
|
||||
})
|
||||
this.papelPliegoDatatable.on('draw', this.addTotalFooterPliego.bind(this))
|
||||
|
||||
this.tablePlanningPlana.on('change', ".pliegos-check", this.calcPliegosCheck.bind(this))
|
||||
}
|
||||
_renderBtnAction(d) {
|
||||
return `<a href="/produccion/ordentrabajo/edit/${d.otId}" class="ot-tarea-comment" data-id="${d.otId}"><i class="ti ti-eye"></i></a>`
|
||||
@ -123,6 +236,10 @@ class PlanningRotativa {
|
||||
const papelImpresionId = $(event.currentTarget).data('id')
|
||||
this.getPapelImpresion(papelImpresionId)
|
||||
}
|
||||
filterPapelGramajePlana(event) {
|
||||
const papelImpresionId = $(event.currentTarget).data('id')
|
||||
this.getPapelImpresionPlana(papelImpresionId)
|
||||
}
|
||||
getPapelImpresion(papelImpresionId) {
|
||||
let ajax = new Ajax('/papelesimpresion/show/' + papelImpresionId,
|
||||
null,
|
||||
@ -132,43 +249,74 @@ class PlanningRotativa {
|
||||
)
|
||||
ajax.get()
|
||||
}
|
||||
getPapelImpresionPlana(papelImpresionId) {
|
||||
let ajax = new Ajax('/papelesimpresion/show/' + papelImpresionId,
|
||||
null,
|
||||
null,
|
||||
this.getPapelImpresionPlanaSuccess.bind(this),
|
||||
this.getPapelImpresionPlanaError.bind(this)
|
||||
)
|
||||
ajax.get()
|
||||
}
|
||||
getPapelImpresionSuccess(response) {
|
||||
this.papelImpresionFilter.setOption(response.id, response.nombre)
|
||||
this.tablePlanningRot.find('input[name=gramaje]').val(response.gramaje).trigger("change")
|
||||
this.papelImpresionHeader.text(response.nombre)
|
||||
}
|
||||
getPapelImpresionError(response) { }
|
||||
getPapelImpresionPlanaSuccess(response) {
|
||||
this.papelImpresionFilterPlana.setOption(response.id, response.nombre)
|
||||
this.tablePlanningPlana.find('input[name=gramaje]').val(response.gramaje).trigger("change")
|
||||
this.papelImpresionPlanaHeader.text(response.nombre)
|
||||
}
|
||||
getPapelImpresionPlanaError(response) { }
|
||||
formatSeconds(s) {
|
||||
return [parseInt(s / 60 / 60), parseInt(s / 60 % 60)].join(':').replace(/\b(\d)\b/g, '0$1');
|
||||
}
|
||||
addTotalFooter() {
|
||||
const data = this.papelGramajeDatatable.column(5).data().reduce((a, b) => {
|
||||
let sa = a.split(":")
|
||||
let ha = parseInt(sa[0]) * 3600
|
||||
let ma = parseInt(sa[1]) * 60
|
||||
let sb = b.split(":")
|
||||
let hb = parseInt(sb[0]) * 3600
|
||||
let mb = parseInt(sb[1]) * 60
|
||||
return hb + mb + ha + ma
|
||||
})
|
||||
const metros = this.papelGramajeDatatable.column(4).data().reduce((a, b) => {
|
||||
const seconds = this.papelGramajeDatatable.column(5).data().reduce((a, b) => {
|
||||
return parseFloat(a) + parseFloat(b)
|
||||
}, 0)
|
||||
const metros = this.papelGramajeDatatable.column(4).data().map((e) => parseFloat(e))
|
||||
$('#total-tiempo-papel').text(this.formatSeconds(seconds))
|
||||
this.totalMetros.set(metros.reduce((a, b) => a + b, 0))
|
||||
|
||||
|
||||
}
|
||||
addTotalFooterPliego() {
|
||||
const seconds = this.papelPliegoDatatable.column(5).data().reduce((a, b) => {
|
||||
return parseFloat(a) + parseFloat(b)
|
||||
}, 0)
|
||||
const pliegos = this.papelPliegoDatatable.column(4).data().map((e) => parseFloat(e))
|
||||
$('#total-tiempo-pliego').text(this.formatSeconds(seconds))
|
||||
this.totalPliegos.set(pliegos.reduce((a, b) => a + b, 0))
|
||||
|
||||
return a + b
|
||||
})
|
||||
$('#total-tiempo-papel').text(this.formatSeconds(data))
|
||||
$('#total-metros').text(metros)
|
||||
|
||||
}
|
||||
calcMetrosCheck() {
|
||||
const metros_sel = this.datatablePlanningRot.rows((idx, data, node) => {
|
||||
return $(node).find('input[type="checkbox"]').prop('checked');
|
||||
}).data().toArray().reduce((a, b) => {
|
||||
a = a?.metros ?? 0
|
||||
b = b?.metros ?? 0
|
||||
return a + b
|
||||
}, null)
|
||||
this.item.find('#metros-sel-total').text(metros_sel)
|
||||
}).data().toArray().map((e) => parseFloat(e.metros))
|
||||
this.totalMetrosSel.set(metros_sel.reduce((a, b) => a + b, 0))
|
||||
|
||||
}
|
||||
calcPliegosCheck() {
|
||||
const metros_sel = this.datatablePlanningPlana.rows((idx, data, node) => {
|
||||
return $(node).find('input[type="checkbox"]').prop('checked');
|
||||
}).data().toArray().map((e) => parseInt(e.pliegosPedido))
|
||||
this.totalPliegosSel.set(metros_sel.reduce((a, b) => a + b, 0))
|
||||
|
||||
}
|
||||
renderCorteImage() {
|
||||
return `
|
||||
<a type="button" class="btn btn-outline-secondary bg-white btn-xs change-corte">
|
||||
<div class="avatar avatar-size-xs">
|
||||
<img src="/assets/img/cortadora_bobinas.png" alt="Guillotina" width="10px" height="10px">
|
||||
</div>
|
||||
</a>
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user