mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'feat/ot-pdf-zip' into 'main'
Feat/ot pdf zip See merge request jjimenez/safekat!785
This commit is contained in:
@ -804,6 +804,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
|||||||
* PDF
|
* PDF
|
||||||
*========================**/
|
*========================**/
|
||||||
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
|
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
|
||||||
|
$routes->get('pdf/content/(:num)', 'Ordentrabajo::get_ot_pdf_content/$1');
|
||||||
$routes->get('pdf/ferro/(:num)', 'Ordentrabajo::get_ferro_pdf/$1');
|
$routes->get('pdf/ferro/(:num)', 'Ordentrabajo::get_ferro_pdf/$1');
|
||||||
$routes->get('pdf/prototipo/(:num)', 'Ordentrabajo::get_prototipo_pdf/$1');
|
$routes->get('pdf/prototipo/(:num)', 'Ordentrabajo::get_prototipo_pdf/$1');
|
||||||
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
|
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
|
||||||
|
|||||||
@ -243,6 +243,7 @@ class Ordentrabajo extends BaseController
|
|||||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
|
->add("pdf_check", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
public function datatable_pendientes()
|
public function datatable_pendientes()
|
||||||
@ -258,6 +259,7 @@ class Ordentrabajo extends BaseController
|
|||||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
|
->add("pdf_check", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
public function datatable_ferro_pendiente()
|
public function datatable_ferro_pendiente()
|
||||||
@ -273,6 +275,7 @@ class Ordentrabajo extends BaseController
|
|||||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
|
->add("pdf_check", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
public function datatable_ferro_ok()
|
public function datatable_ferro_ok()
|
||||||
@ -288,6 +291,7 @@ class Ordentrabajo extends BaseController
|
|||||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
|
->add("pdf_check", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
public function datatable_news()
|
public function datatable_news()
|
||||||
@ -302,6 +306,7 @@ class Ordentrabajo extends BaseController
|
|||||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
|
->add("pdf_check", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
public function datatable_prod()
|
public function datatable_prod()
|
||||||
@ -316,6 +321,7 @@ class Ordentrabajo extends BaseController
|
|||||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
|
->add("pdf_check", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
public function datatable_waiting()
|
public function datatable_waiting()
|
||||||
@ -330,6 +336,7 @@ class Ordentrabajo extends BaseController
|
|||||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
|
->add("pdf_check", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
public function datatable_revision_com()
|
public function datatable_revision_com()
|
||||||
@ -344,6 +351,7 @@ class Ordentrabajo extends BaseController
|
|||||||
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
|
->add("pdf_check", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
public function papel_gramaje_datatable()
|
public function papel_gramaje_datatable()
|
||||||
@ -784,8 +792,8 @@ class Ordentrabajo extends BaseController
|
|||||||
);
|
);
|
||||||
$tareaEntity = $this->otTarea->find($tareaId);
|
$tareaEntity = $this->otTarea->find($tareaId);
|
||||||
$tiempo_trabajado = $tareaEntity->tiempo_trabajado();
|
$tiempo_trabajado = $tareaEntity->tiempo_trabajado();
|
||||||
$responseData['tiempo_total_estimado']+=$tareaEntity->tiempo_estimado;
|
$responseData['tiempo_total_estimado'] += $tareaEntity->tiempo_estimado;
|
||||||
$responseData['tiempo_total_real']+=$tiempo_trabajado;
|
$responseData['tiempo_total_real'] += $tiempo_trabajado;
|
||||||
$responseData["estado"] = $validatedData["estado"];
|
$responseData["estado"] = $validatedData["estado"];
|
||||||
$tareaEntity->tiempo_real = $tiempo_trabajado / count($validatedData['tareas']);
|
$tareaEntity->tiempo_real = $tiempo_trabajado / count($validatedData['tareas']);
|
||||||
$tareaEntity->click_init = $validatedData['click_init'] / count($validatedData['tareas']);
|
$tareaEntity->click_init = $validatedData['click_init'] / count($validatedData['tareas']);
|
||||||
@ -823,7 +831,7 @@ class Ordentrabajo extends BaseController
|
|||||||
$validatedData = $this->validation->getValidated();
|
$validatedData = $this->validation->getValidated();
|
||||||
|
|
||||||
foreach ($validatedData['ordenes_trabajo'] as $key => $orden_trabajo_id) {
|
foreach ($validatedData['ordenes_trabajo'] as $key => $orden_trabajo_id) {
|
||||||
$maquinaOtTarea = $this->maquinaOtTareaModel->where('orden_trabajo_id', $orden_trabajo_id)->where('maquina_id', $validatedData['maquina_id'])->where('deleted_at',null)->countAllResults();
|
$maquinaOtTarea = $this->maquinaOtTareaModel->where('orden_trabajo_id', $orden_trabajo_id)->where('maquina_id', $validatedData['maquina_id'])->where('deleted_at', null)->countAllResults();
|
||||||
if ($maquinaOtTarea) {
|
if ($maquinaOtTarea) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -855,17 +863,15 @@ class Ordentrabajo extends BaseController
|
|||||||
$tarea->click_init = $bodyData['click_init'];
|
$tarea->click_init = $bodyData['click_init'];
|
||||||
$tarea->click_end = $bodyData['click_end'];
|
$tarea->click_end = $bodyData['click_end'];
|
||||||
$totalTareas[] = $tarea;
|
$totalTareas[] = $tarea;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
foreach ($totalTareas as $key => $tarea) {
|
foreach ($totalTareas as $key => $tarea) {
|
||||||
$tiempo_trabajado = $tarea->tiempo_trabajado();
|
$tiempo_trabajado = $tarea->tiempo_trabajado();
|
||||||
$tarea->tiempo_real = $tiempo_trabajado / count($totalTareas);
|
$tarea->tiempo_real = $tiempo_trabajado / count($totalTareas);
|
||||||
$tarea->click_init = $tarea->click_init / count($totalTareas);
|
$tarea->click_init = $tarea->click_init / count($totalTareas);
|
||||||
$tarea->click_end = $tarea->click_end / count($totalTareas);
|
$tarea->click_end = $tarea->click_end / count($totalTareas);
|
||||||
|
|
||||||
$this->otTarea->save($tarea);
|
$this->otTarea->save($tarea);
|
||||||
}
|
}
|
||||||
if ($estado == "F") {
|
if ($estado == "F") {
|
||||||
$this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->delete();
|
$this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->delete();
|
||||||
@ -889,7 +895,7 @@ class Ordentrabajo extends BaseController
|
|||||||
$this->produccionService->deleteOrdenTrabajoTareaProgressDates($tarea->id);
|
$this->produccionService->deleteOrdenTrabajoTareaProgressDates($tarea->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$status = $this->maquinaOtTareaModel->where('maquina_id',$maquina_id)->delete();
|
$status = $this->maquinaOtTareaModel->where('maquina_id', $maquina_id)->delete();
|
||||||
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]);
|
return $this->response->setJSON(["message" => lang("App.user_alert_delete"), "status" => $status]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -916,23 +922,22 @@ class Ordentrabajo extends BaseController
|
|||||||
$tareas = $this->produccionService->init($maquina_ot->orden_trabajo_id)
|
$tareas = $this->produccionService->init($maquina_ot->orden_trabajo_id)
|
||||||
->getTareasWithMaquina($maquina_id, ['P', 'I', 'S', 'D']);
|
->getTareasWithMaquina($maquina_id, ['P', 'I', 'S', 'D']);
|
||||||
foreach ($tareas as $key => $tarea) {
|
foreach ($tareas as $key => $tarea) {
|
||||||
$responseData['tiempo_total_estimado']+= $tarea->tiempo_estimado;
|
$responseData['tiempo_total_estimado'] += $tarea->tiempo_estimado;
|
||||||
$responseData['tiempo_total_real']+= $tarea->tiempo_real;
|
$responseData['tiempo_total_real'] += $tarea->tiempo_real;
|
||||||
$responseData["estado"] = $tarea->lastState()->estado;
|
$responseData["estado"] = $tarea->lastState()->estado;
|
||||||
if($tarea->presupuesto_linea_id){
|
if ($tarea->presupuesto_linea_id) {
|
||||||
$responseData["clicks_total"] += $tarea->presupuesto_linea()->rotativa_clicks_total;
|
$responseData["clicks_total"] += $tarea->presupuesto_linea()->rotativa_clicks_total;
|
||||||
$responseData["tirada_total"] += $tarea->orden_trabajo()->presupuesto()->tirada;
|
$responseData["tirada_total"] += $tarea->orden_trabajo()->presupuesto()->tirada;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$responseData['tiempo_total_estimado'] = float_seconds_to_hhmmss_string($responseData['tiempo_total_estimado']);
|
$responseData['tiempo_total_estimado'] = float_seconds_to_hhmmss_string($responseData['tiempo_total_estimado']);
|
||||||
$responseData['tiempo_total_real'] = float_seconds_to_hhmmss_string($responseData['tiempo_total_real']);
|
$responseData['tiempo_total_real'] = float_seconds_to_hhmmss_string($responseData['tiempo_total_real']);
|
||||||
return $this->response->setJSON($responseData);
|
return $this->response->setJSON($responseData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function printPackagingLabels(){
|
public function printPackagingLabels()
|
||||||
|
{
|
||||||
|
|
||||||
$ot_id = $this->request->getPost('ot_id') ?? null;
|
$ot_id = $this->request->getPost('ot_id') ?? null;
|
||||||
$unidades_caja = $this->request->getPost('unidades_caja') ?? null;
|
$unidades_caja = $this->request->getPost('unidades_caja') ?? null;
|
||||||
@ -963,4 +968,8 @@ class Ordentrabajo extends BaseController
|
|||||||
|
|
||||||
return $this->response->setJSON($result);
|
return $this->response->setJSON($result);
|
||||||
}
|
}
|
||||||
|
public function get_ot_pdf_content($orden_trabajo_id)
|
||||||
|
{
|
||||||
|
return $this->produccionService->init($orden_trabajo_id)->getPdfContent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
"downloadPdf" => "Descargar",
|
||||||
"navs" => [
|
"navs" => [
|
||||||
'finalizadas' => 'Finalizadas',
|
'finalizadas' => 'Finalizadas',
|
||||||
'pendientes' => 'Pendientes',
|
'pendientes' => 'Pendientes',
|
||||||
|
|||||||
@ -621,6 +621,10 @@ class ProductionService extends BaseService
|
|||||||
{
|
{
|
||||||
return view("themes/vuexy/pdfs/orden_trabajo", $this->getDataPdf());
|
return view("themes/vuexy/pdfs/orden_trabajo", $this->getDataPdf());
|
||||||
}
|
}
|
||||||
|
public function getPdfContent()
|
||||||
|
{
|
||||||
|
return view("themes/vuexy/pdfs/orden_trabajo_view", $this->getDataPdf());
|
||||||
|
}
|
||||||
public function getFerroPdf()
|
public function getFerroPdf()
|
||||||
{
|
{
|
||||||
return view("themes/vuexy/pdfs/ferro", $this->getDataPdf());
|
return view("themes/vuexy/pdfs/ferro", $this->getDataPdf());
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
<table id="<?= $id ?>" class="table table-hover text-dark" style="width: 100%;">
|
<table id="<?= $id ?>" class="table table-hover text-dark" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= lang('Produccion.datatable.ot_id') ?></th>
|
<th></th>
|
||||||
|
<th><?= lang('Produccion.datatable.ot_id') ?></th>
|
||||||
<th><?= lang('Produccion.datatable.pedido_id') ?></th>
|
<th><?= lang('Produccion.datatable.pedido_id') ?></th>
|
||||||
<th><?= lang('Produccion.datatable.fecha_encuadernacion') ?></th>
|
<th><?= lang('Produccion.datatable.fecha_encuadernacion') ?></th>
|
||||||
<th><?= lang('Produccion.datatable.cliente') ?></th>
|
<th><?= lang('Produccion.datatable.cliente') ?></th>
|
||||||
|
|||||||
@ -6,41 +6,46 @@
|
|||||||
|
|
||||||
<?= $this->section('content'); ?>
|
<?= $this->section('content'); ?>
|
||||||
<!--Content Body-->
|
<!--Content Body-->
|
||||||
<div class="row">
|
<div class="row section-block">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 justify-content-end d-flex flex-row">
|
||||||
|
<button type="button" id="btn-download-pdf-zip" class="btn btn-primary mb-2"><span class="icon-base ti ti-download ti-xs me-1"></span><?= lang('Produccion.downloadPdf') ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="nav-tabs-shadow nav-align-top">
|
<div class="nav-tabs-shadow nav-align-top">
|
||||||
<ul class="nav nav-tabs" role="tablist">
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-news-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-news"><?= lang("Produccion.navs.news") ?></button>
|
<button type="button" data-order="0" class="nav-link active" role="tab" id="navs-top-align-news-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-news"><?= lang("Produccion.navs.news") ?></button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link active" role="tab" id="navs-top-align-pendientes-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-pendientes"><?= lang("Produccion.pendientes") ?></button>
|
<button type="button" data-order="1" class="nav-link" role="tab" id="navs-top-align-pendientes-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-pendientes"><?= lang("Produccion.pendientes") ?></button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-waiting-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-waiting"><?= lang("Produccion.navs.waiting") ?></button>
|
<button type="button" data-order="2" class="nav-link" role="tab" id="navs-top-align-waiting-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-waiting"><?= lang("Produccion.navs.waiting") ?></button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ferro-pendiente-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-pendiente"><?= lang("Produccion.pendiente_ferro") ?></button>
|
<button type="button" data-order="3" class="nav-link" role="tab" id="navs-top-align-ferro-pendiente-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-pendiente"><?= lang("Produccion.pendiente_ferro") ?></button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-ferro-ok-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-ok"><?= lang("Produccion.ferro_ok") ?></button>
|
<button type="button" data-order="4" class="nav-link" role="tab" id="navs-top-align-ferro-ok-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-ferro-ok"><?= lang("Produccion.ferro_ok") ?></button>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item d-none">
|
<li class="nav-item d-none">
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-revision-com-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-revision-com"><?= lang("Produccion.navs.revision_com") ?></button>
|
<button type="button" data-order="5" class="nav-link" role="tab" id="navs-top-align-revision-com-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-revision-com"><?= lang("Produccion.navs.revision_com") ?></button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-prod-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-prod"><?= lang("Produccion.navs.prod") ?></button>
|
<button type="button" data-order="6" class="nav-link" role="tab" id="navs-top-align-prod-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-prod"><?= lang("Produccion.navs.prod") ?></button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
<button type="button" data-order="7" class="nav-link" role="tab" id="navs-top-align-finalizados-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-finalizados"><?= lang("Produccion.finalizadas") ?></button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content" id="ots-datatables-container">
|
<div class="tab-content" id="ots-datatables-container">
|
||||||
<div class="tab-pane fade show" id="navs-top-align-finalizados">
|
<div class="tab-pane fade show" id="navs-top-align-finalizados">
|
||||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-finalizados"]) ?>
|
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-finalizados"]) ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade show active" id="navs-top-align-pendientes">
|
<div class="tab-pane fade show" id="navs-top-align-pendientes">
|
||||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-pendientes"]) ?>
|
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-pendientes"]) ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade show" id="navs-top-align-ferro-pendiente">
|
<div class="tab-pane fade show" id="navs-top-align-ferro-pendiente">
|
||||||
@ -49,7 +54,7 @@
|
|||||||
<div class="tab-pane fade show" id="navs-top-align-ferro-ok">
|
<div class="tab-pane fade show" id="navs-top-align-ferro-ok">
|
||||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-ferro-ok"]) ?>
|
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-ferro-ok"]) ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade show" id="navs-top-align-news">
|
<div class="tab-pane fade show active" id="navs-top-align-news">
|
||||||
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-news"]) ?>
|
<?= view("themes/vuexy/components/tables/ot_table.php", ["id" => "ot-datatable-news"]) ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade show" id="navs-top-align-waiting">
|
<div class="tab-pane fade show" id="navs-top-align-waiting">
|
||||||
@ -71,14 +76,21 @@
|
|||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('css') ?>
|
<?= $this->section('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') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/notiflix/notiflix.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/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/ot.css') ?>" />
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/ot.css') ?>" />
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
<?= $this->section("additionalExternalJs") ?>
|
||||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/index.js") ?>"></script>
|
<script src="<?= site_url("themes/vuexy/vendor/libs/notiflix/notiflix.js") ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||||
|
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||||
|
<script src=<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.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/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/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/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||||
|
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/index.js") ?>"></script>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
407
ci4/app/Views/themes/vuexy/pdfs/orden_trabajo_view.php
Executable file
407
ci4/app/Views/themes/vuexy/pdfs/orden_trabajo_view.php
Executable file
@ -0,0 +1,407 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use CodeIgniter\I18n\Time;
|
||||||
|
|
||||||
|
$session = session();
|
||||||
|
$settings = $session->get('settings');
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html
|
||||||
|
lang="<?= $session->get('lang') ?>"
|
||||||
|
data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<!-- Icons -->
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
|
||||||
|
|
||||||
|
<!-- Core CSS -->
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
|
||||||
|
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
|
||||||
|
|
||||||
|
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="page">
|
||||||
|
<div class="col-md-12 pdf-wrapper" data-id="<?= $ot->id . "_" . "_" . $presupuesto->id . "_" . $presupuesto->titulo ?>">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 d-flex justify-content-between align-items-center">
|
||||||
|
<h5><?= $presupuesto->titulo ?></h5>
|
||||||
|
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="row mb-2 d-flex flex align-items-stretch">
|
||||||
|
<div class="col-2">
|
||||||
|
<?php if ($ot->full_path): ?>
|
||||||
|
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
|
||||||
|
<?php else: ?>
|
||||||
|
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
|
||||||
|
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span>
|
||||||
|
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<div class="px-2 d-flex flex justify-content-center align-items-center w-100">
|
||||||
|
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
|
||||||
|
<?php if ($isPOD): ?>
|
||||||
|
<strong>POD</strong>
|
||||||
|
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
|
||||||
|
<strong>ROTATIVA</strong>
|
||||||
|
<?php else: ?>
|
||||||
|
<strong>GENERAL</strong>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row p-2">
|
||||||
|
<div class="col-3 h-100">
|
||||||
|
<div class="row px-2 d-flex flex justify-content-between align-items-center">
|
||||||
|
<div class="col-6 w-100 text-center">
|
||||||
|
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row px-2 mt-2 h-100">
|
||||||
|
<table class="h-100 bg-white">
|
||||||
|
<tr>
|
||||||
|
<th class="bg-white">IN</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>PORT.</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>ACABAD.</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>ENCUAD.</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>MANIPUL.</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||||
|
<strong><?= $encuadernacionCode ?></strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row h-75">
|
||||||
|
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
|
||||||
|
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
|
||||||
|
<?= $tiempo_impresion ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
|
||||||
|
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
|
||||||
|
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
|
||||||
|
</div>
|
||||||
|
<?php foreach ($acabados as $key => $acabado): ?>
|
||||||
|
<?php if ($acabado->tarifa()->isUVI()): ?>
|
||||||
|
<div class="col-6 square offset-md-6 text-center" style="background-color:<?= $acabado->tarifa()->code == "R2D" ? "#4D93D9" : "#0070C0" ?>;color:white;">
|
||||||
|
+ <?= $acabado->tarifa()->code ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
|
||||||
|
<div class="row h-100">
|
||||||
|
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
|
||||||
|
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white">
|
||||||
|
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8">
|
||||||
|
<table class="h-50">
|
||||||
|
<tr>
|
||||||
|
<th>IDSK</th>
|
||||||
|
<td class="t-cell">
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>CLIENTE</th>
|
||||||
|
<td class="t-cell">
|
||||||
|
<?= $cliente->alias ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>TITULO</th>
|
||||||
|
<td class="t-cell">
|
||||||
|
<?= $presupuesto->titulo ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>ISBN</th>
|
||||||
|
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>PEDIDO CLIENTE</th>
|
||||||
|
<td class="t-cell"><?= $pedido->id ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<div class="col-12 d-flex justify-content-center" style="width: 100%">
|
||||||
|
<?php if ($imposicion): ?>
|
||||||
|
|
||||||
|
<?php if ($imposicion->imposicion_esquema()): ?>
|
||||||
|
<?= $imposicion->imposicion_esquema()->svg_schema ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="imposicion">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th class="w-50">Imposicion</th>
|
||||||
|
<td><?= $imposicion?->full_name ?? "" ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="section-title impresion">IMP. INTERIOR</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th>
|
||||||
|
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
|
||||||
|
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th>
|
||||||
|
<td class="t-cell text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td>
|
||||||
|
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
|
||||||
|
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
|
||||||
|
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
|
||||||
|
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||||
|
<th>Páginas</th>
|
||||||
|
<th>Ejemplares</th>
|
||||||
|
<th>Tintas</th>
|
||||||
|
<th>Formas</th>
|
||||||
|
<th>Máquina</th>
|
||||||
|
<th>Clics</th>
|
||||||
|
<th>Tiempo</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
|
||||||
|
<td><?= $presupuesto->tirada ?> </td>
|
||||||
|
<td><?= $linea_impresion->tinta() ?></td>
|
||||||
|
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
|
||||||
|
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
|
||||||
|
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
|
||||||
|
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
|
||||||
|
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||||
|
<td colspan="2">
|
||||||
|
<?php if ($linea_impresion->isRotativa()): ?>
|
||||||
|
<?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="comments <?=$ot->comment_interior ? '' : 'd-none' ?>">
|
||||||
|
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div>
|
||||||
|
<div class=" w-100">
|
||||||
|
<p>
|
||||||
|
<?= $ot->comment_interior ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php if ($linea_cubierta): ?>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="section-title cubierta">IMP. CUBIERTA</div>
|
||||||
|
<div class="col-12">
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||||
|
<th>Tintas</th>
|
||||||
|
<th>Ejemplares</th>
|
||||||
|
<th>Maquina</th>
|
||||||
|
<th>Marcapaginas</th>
|
||||||
|
<th>Tiempo</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?= $linea_cubierta->tinta() ?></td>
|
||||||
|
<td><?= $presupuesto->tirada ?></td>
|
||||||
|
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
|
||||||
|
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
||||||
|
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
|
||||||
|
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
|
||||||
|
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
|
||||||
|
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="comments <?=$ot->comment_cubierta ? '' : 'd-none' ?>">
|
||||||
|
<div class="flex-row cubierta"><?= lang('Produccion.comentariosCubierta') ?></div>
|
||||||
|
|
||||||
|
<div class="">
|
||||||
|
<p>
|
||||||
|
<?= $ot->comment_cubierta ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<div class="row">
|
||||||
|
<div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
|
||||||
|
<span class="fs-bold"><?= $encuadernacionCode ?></span>
|
||||||
|
</div>
|
||||||
|
<table>
|
||||||
|
<?php foreach ($acabados as $key => $acabado): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="w-10 encuadernacion">Plastificado</td>
|
||||||
|
<td><?= $acabado->tarifa()->nombre ?></td>
|
||||||
|
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">UVI</td>
|
||||||
|
<td style="color:red;width:100px" class="bg-encuadernacion"> <?= $uvi ? 'SI' : "NO" ?> </td>
|
||||||
|
<td class="encuadernacion bg-encuadernacion" style="width: 100px;">EXTERNO:</td>
|
||||||
|
<td class="bg-encuadernacion" style="width: 100px;"><?= $acabado->proveedor() ? $acabado->proveedor()->nombre : "" ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="text-start" colspan="2"><?=$ot->info_solapa_guillotina?></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="t-header">CORTE PIE:</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
foreach ($encuadernaciones as $key => $encuadernacion) {
|
||||||
|
$encuadernacion_code = $encuadernacion->tarifa()->code;
|
||||||
|
try {
|
||||||
|
if ($encuadernacion_code) {
|
||||||
|
echo view("/themes/vuexy/pdfs/encuadernados/$encuadernacion_code.php", ["encuadernacion" => $encuadernacion]);
|
||||||
|
} else {
|
||||||
|
echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
|
||||||
|
}
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
$error_message = $th->getMessage();
|
||||||
|
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
|
||||||
|
// echo "<br><span style='color:red'>$error_message</span>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<?php if (count($encuadernaciones) > 0): ?>
|
||||||
|
|
||||||
|
<div class="comments <?=$ot->comment_encuadernacion ? '' : 'd-none' ?>" >
|
||||||
|
<div class="flex-row encuadernacion"><?= lang('Produccion.comentariosEncuadernacion') ?></div>
|
||||||
|
<div class="">
|
||||||
|
<p>
|
||||||
|
<?= $ot->comment_encuadernacion ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="section-title">LOGISTICA</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Peso Unidad</th>
|
||||||
|
<th>Peso Pedido</th>
|
||||||
|
<th>Cajas</th>
|
||||||
|
<th>Corte Pie</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
|
||||||
|
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="comments <?=$ot->comment_logistica ? '' : 'd-none' ?>">
|
||||||
|
<div class="flex-row logistica"><?= lang('Produccion.comentariosLogistica') ?></div>
|
||||||
|
|
||||||
|
<div class="">
|
||||||
|
<p>
|
||||||
|
<?= $ot->comment_logistica ?>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||||
|
|
||||||
|
</html>
|
||||||
@ -12,10 +12,11 @@ class OrdenTrabajoDatatable {
|
|||||||
this.datatableRevisionComerical = this.item.find("#ot-datatable-revision-com")
|
this.datatableRevisionComerical = this.item.find("#ot-datatable-revision-com")
|
||||||
|
|
||||||
|
|
||||||
|
this.columnIdIndex = 1;
|
||||||
|
|
||||||
this.datatableColumns = [
|
this.datatableColumns = [
|
||||||
{ data: 'id', searchable: false, sortable: false },
|
{ data: 'pdf_check', searchable: false, sortable: false, render: d => `<input class="form-check-input pdf-check" data-id="${d}" type="checkbox">` },
|
||||||
|
{ data: 'id', searchable: false, sortable: true },
|
||||||
{ data: 'pedido_id', searchable: false, sortable: false },
|
{ data: 'pedido_id', searchable: false, sortable: false },
|
||||||
{ data: 'fecha_encuadernado_at', searchable: false, sortable: false },
|
{ data: 'fecha_encuadernado_at', searchable: false, sortable: false },
|
||||||
{ data: 'cliente_nombre', searchable: false, sortable: false },
|
{ data: 'cliente_nombre', searchable: false, sortable: false },
|
||||||
@ -51,8 +52,27 @@ class OrdenTrabajoDatatable {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
actualDatatable(event) {
|
||||||
|
let order = $(event.currentTarget).data('order')
|
||||||
|
console.log(order)
|
||||||
|
this.focusDatatable = this.datatableOrder[order]
|
||||||
|
}
|
||||||
|
events(){
|
||||||
|
this.datatableOrder = [
|
||||||
|
this.datatableN,
|
||||||
|
this.datatableP,
|
||||||
|
this.datatableW,
|
||||||
|
this.datatableFP,
|
||||||
|
this.datatableFO,
|
||||||
|
this.datatableRC,
|
||||||
|
this.datatableProduccion,
|
||||||
|
this.datatable
|
||||||
|
]
|
||||||
|
this.focusDatatable = this.datatableN
|
||||||
|
$('.nav-link').on('click', this.actualDatatable.bind(this))
|
||||||
|
}
|
||||||
init() {
|
init() {
|
||||||
this.datatableItem.DataTable({
|
this.datatable = this.datatableItem.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
layout: {
|
layout: {
|
||||||
topStart: 'pageLength',
|
topStart: 'pageLength',
|
||||||
@ -60,6 +80,7 @@ class OrdenTrabajoDatatable {
|
|||||||
bottomStart: 'info',
|
bottomStart: 'info',
|
||||||
bottomEnd: 'paging'
|
bottomEnd: 'paging'
|
||||||
},
|
},
|
||||||
|
order: [[this.columnIdIndex, 'desc']],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ className: 'dt-center', targets: '_all' },
|
{ className: 'dt-center', targets: '_all' },
|
||||||
|
|
||||||
@ -71,14 +92,14 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/datatable',
|
ajax: '/produccion/ordentrabajo/datatable',
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
$(row).css("border-left",`10px solid ${data.logo.color}`)
|
$(row).css("border-left", `10px solid ${data.logo.color}`)
|
||||||
$(row).css("border-right",`10px solid ${data.logo.color}`)
|
$(row).css("border-right", `10px solid ${data.logo.color}`)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initPendientes() {
|
initPendientes() {
|
||||||
this.datatablePendientesItem.DataTable({
|
this.datatableP = this.datatablePendientesItem.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
layout: {
|
layout: {
|
||||||
topStart: 'pageLength',
|
topStart: 'pageLength',
|
||||||
@ -86,6 +107,7 @@ class OrdenTrabajoDatatable {
|
|||||||
bottomStart: 'info',
|
bottomStart: 'info',
|
||||||
bottomEnd: 'paging'
|
bottomEnd: 'paging'
|
||||||
},
|
},
|
||||||
|
order: [[this.columnIdIndex, 'desc']],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ className: 'dt-center', targets: '_all' },
|
{ className: 'dt-center', targets: '_all' },
|
||||||
|
|
||||||
@ -97,15 +119,15 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/datatable_pendientes',
|
ajax: '/produccion/ordentrabajo/datatable_pendientes',
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
$(row).css("border-left", `20px solid ${data.logo.color}`)
|
||||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
$(row).css("border-right", `20px solid ${data.logo.color}`)
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initFerroPendiente() {
|
initFerroPendiente() {
|
||||||
this.datatableFerroPendienteItem.DataTable({
|
this.datatableFP = this.datatableFerroPendienteItem.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
layout: {
|
layout: {
|
||||||
topStart: 'pageLength',
|
topStart: 'pageLength',
|
||||||
@ -115,6 +137,7 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
pageLength: 25,
|
pageLength: 25,
|
||||||
|
order: [[this.columnIdIndex, 'desc']],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ className: 'dt-center', targets: '_all' },
|
{ className: 'dt-center', targets: '_all' },
|
||||||
|
|
||||||
@ -124,14 +147,14 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/datatable_ferro_pendiente',
|
ajax: '/produccion/ordentrabajo/datatable_ferro_pendiente',
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
$(row).css("border-left", `20px solid ${data.logo.color}`)
|
||||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
$(row).css("border-right", `20px solid ${data.logo.color}`)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initFerroOk() {
|
initFerroOk() {
|
||||||
this.datatableFerroOkItem.DataTable({
|
this.datatableFO = this.datatableFerroOkItem.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
layout: {
|
layout: {
|
||||||
topStart: 'pageLength',
|
topStart: 'pageLength',
|
||||||
@ -140,6 +163,7 @@ class OrdenTrabajoDatatable {
|
|||||||
bottomEnd: 'paging'
|
bottomEnd: 'paging'
|
||||||
},
|
},
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
|
order: [[this.columnIdIndex, 'desc']],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ className: 'dt-center', targets: '_all' },
|
{ className: 'dt-center', targets: '_all' },
|
||||||
|
|
||||||
@ -150,14 +174,14 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/datatable_ferro_ok',
|
ajax: '/produccion/ordentrabajo/datatable_ferro_ok',
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
$(row).css("border-left", `20px solid ${data.logo.color}`)
|
||||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
$(row).css("border-right", `20px solid ${data.logo.color}`)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initNews() {
|
initNews() {
|
||||||
this.datatableNews.DataTable({
|
this.datatableN = this.datatableNews.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
layout: {
|
layout: {
|
||||||
topStart: 'pageLength',
|
topStart: 'pageLength',
|
||||||
@ -166,6 +190,7 @@ class OrdenTrabajoDatatable {
|
|||||||
bottomEnd: 'paging'
|
bottomEnd: 'paging'
|
||||||
},
|
},
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
|
order: [[this.columnIdIndex, 'desc']],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ className: 'dt-center', targets: '_all' },
|
{ className: 'dt-center', targets: '_all' },
|
||||||
|
|
||||||
@ -176,14 +201,16 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/datatable_news',
|
ajax: '/produccion/ordentrabajo/datatable_news',
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
$(row).css("border-left", `20px solid ${data.logo.color}`)
|
||||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
$(row).css("border-right", `20px solid ${data.logo.color}`)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.focusDatatable = this.datatableN
|
||||||
|
|
||||||
}
|
}
|
||||||
initWaiting() {
|
initWaiting() {
|
||||||
this.datatableWaiting.DataTable({
|
this.datatableW = this.datatableWaiting.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
layout: {
|
layout: {
|
||||||
topStart: 'pageLength',
|
topStart: 'pageLength',
|
||||||
@ -192,6 +219,7 @@ class OrdenTrabajoDatatable {
|
|||||||
bottomEnd: 'paging'
|
bottomEnd: 'paging'
|
||||||
},
|
},
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
|
order: [[this.columnIdIndex, 'desc']],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ className: 'dt-center', targets: '_all' },
|
{ className: 'dt-center', targets: '_all' },
|
||||||
|
|
||||||
@ -202,14 +230,14 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/datatable_waiting',
|
ajax: '/produccion/ordentrabajo/datatable_waiting',
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
$(row).css("border-left", `20px solid ${data.logo.color}`)
|
||||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
$(row).css("border-right", `20px solid ${data.logo.color}`)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initProd() {
|
initProd() {
|
||||||
this.datatableProd.DataTable({
|
this.datatableProduccion = this.datatableProd.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
layout: {
|
layout: {
|
||||||
topStart: 'pageLength',
|
topStart: 'pageLength',
|
||||||
@ -218,6 +246,7 @@ class OrdenTrabajoDatatable {
|
|||||||
bottomEnd: 'paging'
|
bottomEnd: 'paging'
|
||||||
},
|
},
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
|
order: [[this.columnIdIndex, 'desc']],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ className: 'dt-center', targets: '_all' },
|
{ className: 'dt-center', targets: '_all' },
|
||||||
|
|
||||||
@ -228,14 +257,14 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/datatable_prod',
|
ajax: '/produccion/ordentrabajo/datatable_prod',
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
$(row).css("border-left", `20px solid ${data.logo.color}`)
|
||||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
$(row).css("border-right", `20px solid ${data.logo.color}`)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initRevisionComercial() {
|
initRevisionComercial() {
|
||||||
this.datatableRevisionComerical.DataTable({
|
this.datatableRC = this.datatableRevisionComerical.DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
layout: {
|
layout: {
|
||||||
topStart: 'pageLength',
|
topStart: 'pageLength',
|
||||||
@ -244,6 +273,7 @@ class OrdenTrabajoDatatable {
|
|||||||
bottomEnd: 'paging'
|
bottomEnd: 'paging'
|
||||||
},
|
},
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
|
order: [[this.columnIdIndex, 'desc']],
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
{ className: 'dt-center', targets: '_all' },
|
{ className: 'dt-center', targets: '_all' },
|
||||||
|
|
||||||
@ -254,12 +284,18 @@ class OrdenTrabajoDatatable {
|
|||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/datatable_revision_com',
|
ajax: '/produccion/ordentrabajo/datatable_revision_com',
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
$(row).css("border-left",`20px solid ${data.logo.color}`)
|
$(row).css("border-left", `20px solid ${data.logo.color}`)
|
||||||
$(row).css("border-right",`20px solid ${data.logo.color}`)
|
$(row).css("border-right", `20px solid ${data.logo.color}`)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
getSelectIDs() {
|
||||||
|
return this.focusDatatable.rows((idx, data, node) => {
|
||||||
|
return $(node).find('input[type="checkbox"]').prop('checked');
|
||||||
|
}).data().toArray().map((e) => parseInt(e.id))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import OrdenTrabajoDatatable from '../../components/datatables/otDatatable.js'
|
import OrdenTrabajoDatatable from '../../components/datatables/otDatatable.js'
|
||||||
|
import Ajax from '../../components/ajax.js'
|
||||||
|
import { alertError, alertSuccessMessage } from '../../components/alerts/sweetAlert.js'
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
const otDatatable = new OrdenTrabajoDatatable($("#ots-datatables-container"))
|
const otDatatable = new OrdenTrabajoDatatable($("#ots-datatables-container"))
|
||||||
@ -9,5 +11,59 @@ $(function () {
|
|||||||
otDatatable.initNews()
|
otDatatable.initNews()
|
||||||
otDatatable.initProd()
|
otDatatable.initProd()
|
||||||
otDatatable.initWaiting()
|
otDatatable.initWaiting()
|
||||||
|
otDatatable.events()
|
||||||
// otDatatable.initRevisionComercial()
|
// otDatatable.initRevisionComercial()
|
||||||
|
$("#btn-download-pdf-zip").on('click', async () => {
|
||||||
|
let zip = new JSZip()
|
||||||
|
let ordenesTrabajo = otDatatable.getSelectIDs()
|
||||||
|
for (let element of ordenesTrabajo) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
// Create hidden iframe
|
||||||
|
Notiflix.Block.circle('.section-block',{opacity : 1});
|
||||||
|
const response = await getPdf(element);
|
||||||
|
var opt = {
|
||||||
|
margin: 2,
|
||||||
|
filename: $(response).find(".pdf-wrapper").data("id") + ".pdf",
|
||||||
|
image: { type: 'jpeg', quality: 1 },
|
||||||
|
html2canvas: { scale: 4, logging: false },
|
||||||
|
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
||||||
|
};
|
||||||
|
let pdf = await html2pdf().set(opt).from(response).outputPdf('blob');
|
||||||
|
zip.file(opt.filename, pdf);
|
||||||
|
} catch (error) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (ordenesTrabajo.length > 0) {
|
||||||
|
|
||||||
|
Notiflix.Block.remove('.section-block');
|
||||||
|
zip.generateAsync({ type: "blob" }).then(function (blob) {
|
||||||
|
const now = new Date();
|
||||||
|
const pad = (n) => String(n).padStart(2, '0');
|
||||||
|
const timestamp = `${now.getFullYear()}_${pad(now.getMonth() + 1)}_${pad(now.getDate())}_${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
||||||
|
const filename = `ordenes_trabajo_${timestamp}.zip`;
|
||||||
|
|
||||||
|
const link = document.createElement("a");
|
||||||
|
link.href = URL.createObjectURL(blob);
|
||||||
|
link.download = filename;
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
alertError('Seleccione una OT para descargar').fire()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const getPdf = (otId) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
new Ajax('/produccion/ordentrabajo/pdf/content/' + otId, null, null, resolve, reject).get()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
@media print {
|
@media print {
|
||||||
body,
|
.page,
|
||||||
html {
|
{
|
||||||
width: 210mm;
|
width: 210mm;
|
||||||
height: 297mm;
|
height: 297mm;
|
||||||
max-width: 210mm;
|
max-width: 210mm;
|
||||||
@ -22,7 +22,8 @@ html {
|
|||||||
max-height: 297mm;
|
max-height: 297mm;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
body {
|
|
||||||
|
.page {
|
||||||
border: 0px solid;
|
border: 0px solid;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin : 10px;
|
margin : 10px;
|
||||||
|
|||||||
Reference in New Issue
Block a user