mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'feat/printer-labels'
Main See merge request jjimenez/safekat!637
This commit is contained in:
@ -977,6 +977,9 @@ $routes->group('soporte', ['namespace' => 'App\Controllers\Soporte'], function (
|
||||
$routes->get('image/(:segment)', 'Ticketcontroller::image/$1');
|
||||
});
|
||||
|
||||
$routes->group('logistica', ['namespace' => 'App\Controllers\Logistica'], function ($routes) {
|
||||
$routes->get('panel', 'Logisticacontroller::panel', ['as' => 'LogisticaPanel']);
|
||||
});
|
||||
|
||||
$routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
$routes->group('ordentrabajo', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||
|
||||
70
ci4/app/Controllers/Logistica/Logisticacontroller.php
Normal file
70
ci4/app/Controllers/Logistica/Logisticacontroller.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers\Logistica;
|
||||
|
||||
use App\Models\Sistema\SettingsModel;
|
||||
use CodeIgniter\Controller;
|
||||
|
||||
|
||||
use App\Models\Collection;
|
||||
|
||||
class Logisticacontroller extends \App\Controllers\BaseResourceController
|
||||
{
|
||||
|
||||
protected $modelName = TicketModel::class;
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectNameCc = 'logistica';
|
||||
protected static $singularObjectName = 'Logistica';
|
||||
protected static $pluralObjectName = 'Logistica';
|
||||
protected static $controllerSlug = 'logistica';
|
||||
|
||||
protected static $viewPath = 'themes/vuexy/form/logistica/';
|
||||
|
||||
protected $indexRoute = 'panel';
|
||||
|
||||
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
$this->viewData['pageTitle'] = lang('Logistica.logistica');
|
||||
|
||||
// Breadcrumbs
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_logistica"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
//checkPermission('tickets.menu');
|
||||
|
||||
/*$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Tickets.tickets')]),
|
||||
'usingServerSideDataTable' => true,
|
||||
'userType' => auth()->user()->can('tickets.edit') ? 1 : 0,
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewTicketList', $viewData);*/
|
||||
}
|
||||
|
||||
public function panel()
|
||||
{
|
||||
//checkPermission('tickets.menu');
|
||||
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'boxTitle' => lang('Logistica.panel'),
|
||||
'pageSubTitle' => 'Panel',
|
||||
'usingServerSideDataTable' => true,
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewPanelLogistica', $viewData);
|
||||
}
|
||||
}
|
||||
@ -547,7 +547,7 @@ class Importadorpresupuestos extends \App\Controllers\BaseResourceController
|
||||
"clienteId" => intval($this->request->getPost('cliente_id') ?? 0),
|
||||
"isColor" => $isColor,
|
||||
"isHq" => $isHq,
|
||||
"papelDiferente" => $papel_interior_diferente,
|
||||
"papelInteriorDiferente" => $papel_interior_diferente,
|
||||
"paginasColor" => $paginas_color,
|
||||
"paginasCuadernillo" => 32,
|
||||
|
||||
|
||||
@ -729,6 +729,7 @@ return [
|
||||
|
||||
|
||||
"menu_logistica" => "Logística",
|
||||
"menu_logistica_panel" => "Panel",
|
||||
"menu_logistica_envios" => "Envíos conjuntos",
|
||||
"menu_logistica_etiquetas" => "Etiquetas",
|
||||
"menu_logistica_tracking" => "Tracking",
|
||||
|
||||
12
ci4/app/Language/es/Logistica.php
Normal file
12
ci4/app/Language/es/Logistica.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
return [
|
||||
'logistica' => 'Logística',
|
||||
'panel' => 'Panel',
|
||||
'envioSimple' => 'Envío simple',
|
||||
'envioMultiple' => 'Envío múltiple',
|
||||
'envioConjunto' => 'Envío conjunto',
|
||||
'etiquetasTitulos' => 'Etiquetas de títulos',
|
||||
'etiquetasEnvio' => 'Etiquetas de envío',
|
||||
'envioFerros' => 'Envío de ferros',
|
||||
'cerrarOTauto' => 'Cerrar OT automáticamente',
|
||||
];
|
||||
@ -0,0 +1,68 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4><?= $boxTitle ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-4">
|
||||
<button type="button" style="height: 80px;" class="btn btn-primary w-100 " data-toggle="modal" data-target="#modalCreate">
|
||||
<?= lang('Logistica.envioSimple') ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<button type="button" style="height: 80px;" class="btn btn-primary w-100 " data-toggle="modal" data-target="#modalCreate">
|
||||
<?= lang('Logistica.envioMultiple') ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<button type="button" style="height: 80px;" class="btn btn-primary w-100 " data-toggle="modal" data-target="#modalCreate">
|
||||
<?= lang('Logistica.envioConjunto') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-4">
|
||||
<button type="button" style="height: 80px;" class="btn btn-primary w-100 " data-toggle="modal" data-target="#modalCreate">
|
||||
<?= lang('Logistica.etiquetasTitulos') ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<button type="button" style="height: 80px;" class="btn btn-primary w-100 " data-toggle="modal" data-target="#modalCreate">
|
||||
<?= lang('Logistica.etiquetasEnvio') ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<button type="button" style="height: 80px;" class="btn btn-primary w-100 " data-toggle="modal" data-target="#modalCreate">
|
||||
<?= lang('Logistica.envioFerros') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<button type="button" style="height: 80px;" class="btn btn-primary w-100 " data-toggle="modal" data-target="#modalCreate">
|
||||
<?= lang('Logistica.cerrarOTauto') ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection(); ?>
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<?= $this->endSection() ?>
|
||||
@ -117,8 +117,8 @@
|
||||
|
||||
<div class="col-md-6">
|
||||
<label for="encuadernacion" class="form-label">Encuadernación propuesta</label>
|
||||
<select id="encuadernacion" name="encuadernacion" class="form-control select2bs2"
|
||||
style="width: 100%;">
|
||||
<select id="encuadernacion" name="encuadernacion"
|
||||
class="form-control select2bs2 warning-change" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
</div><!--//.row -->
|
||||
@ -129,7 +129,7 @@
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-2">
|
||||
<label for="interior_old" class="form-label">Calidad</label>
|
||||
<select id="isHq" name="isHq" class="form-control">
|
||||
<select id="isHq" name="isHq" class="form-control warning-change">
|
||||
<option value="0">Estándar</option>
|
||||
<option value="1">HQ</option>
|
||||
</select>
|
||||
@ -162,13 +162,16 @@
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<select id="compPapelNegroSelected" name="comp_papel_negro_selected"
|
||||
class="form-control select2bs2 comp_negro_items" style="width: 100%;">
|
||||
<select id="compPapelNegroSelected" name="comp_papel_negro_selected "
|
||||
class="form-control select2bs2 comp_negro_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="compGramajeNegro" name="comp_gramaje_negro"
|
||||
class="form-control comp_negro_items" value="" readonly>
|
||||
<select id="compGramajeNegro" name="comp_gramaje_negro "
|
||||
class="form-control select2bs2 comp_negro_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -184,13 +187,15 @@
|
||||
</td>
|
||||
<td>
|
||||
<select id="compPapelColorSelected" name="comp_papel_color_selected"
|
||||
class="form-control select2bs2 comp_color_items" style="width: 100%;">
|
||||
class="form-control select2bs2 comp_color_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="compGramajeColor" name="comp_gramaje_color"
|
||||
class="form-control comp_color_items" value="" readonly>
|
||||
</input>
|
||||
<select id="compGramajeColor" name="comp_papel_color_selected"
|
||||
class="form-control select2bs2 comp_color_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -233,13 +238,15 @@
|
||||
</td>
|
||||
<td>
|
||||
<select id="compPapelCubiertaSelected" name="comp_papel_cubierta_selected"
|
||||
class="form-control select2bs2 comp_cubierta_items"
|
||||
class="form-control select2bs2 comp_cubierta_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="compGramajeCubierta" name="comp_gramaje_cubierta"
|
||||
class="form-control comp_cubierta_items" value="" readonly>
|
||||
<select id="compGramajeCubierta" name="comp_papel_cubierta_selected"
|
||||
class="form-control select2bs2 comp_cubierta_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -264,14 +271,16 @@
|
||||
<td>
|
||||
<select id="compPapelSobrecubiertaSelected"
|
||||
name="comp_papel_sobrecubierta_selected"
|
||||
class="form-control select2bs2 comp_sobrecubierta_items"
|
||||
class="form-control select2bs2 comp_sobrecubierta_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="compGramajeSobrecubierta"
|
||||
name="comp_gramaje_sobrecubierta"
|
||||
class="form-control comp_sobrecubierta_items" value="" readonly>
|
||||
<select id="compGramajeSobrecubierta"
|
||||
name="comp_papel_sobrecubierta_selected"
|
||||
class="form-control select2bs2 comp_sobrecubierta_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@ -299,7 +308,7 @@
|
||||
<td>
|
||||
<select id="compAcabadoCubiertaSelected"
|
||||
name="comp_acabado_cubierta_selected"
|
||||
class="form-control select2bs2 comp_cubierta_items"
|
||||
class="form-control select2bs2 comp_cubierta_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
@ -314,7 +323,7 @@
|
||||
<td>
|
||||
<select id="compAcabadoSobrecubiertaSelected"
|
||||
name="comp_acabado_sobrecubierta_selected"
|
||||
class="form-control select2bs2 comp_sobrecubierta_items"
|
||||
class="form-control select2bs2 comp_sobrecubierta_items warning-change"
|
||||
style="width: 100%;">
|
||||
</select>
|
||||
</td>
|
||||
@ -369,7 +378,8 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3 mb-3">
|
||||
<button id="makeImport" class="btn btn-primary waves-effect waves-light mt-auto w-100" disabled>
|
||||
<button id="makeImport" class="btn btn-primary waves-effect waves-light mt-auto w-100"
|
||||
disabled>
|
||||
Importar presupuesto
|
||||
</button>
|
||||
</div>
|
||||
@ -389,7 +399,7 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $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/sweetalert2/sweetalert2.css') ?>" />
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
|
||||
@ -12,6 +12,9 @@ if (auth()->user()->inGroup('beta')) {
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to("LogisticaPanel") ?>" class="menu-link">
|
||||
<?= lang("App.menu_logistica_panel") ?>
|
||||
</a>
|
||||
<a href="<?= site_url("envioslogistica/logistica") ?>" class="menu-link">
|
||||
<?= lang("App.menu_logistica_envios") ?>
|
||||
</a>
|
||||
|
||||
@ -18,7 +18,18 @@ class Importador {
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: () => $('#hq').val() ? 'negrohq' : 'negro',
|
||||
tipo: () => $('#isHq').val() ? 'negrohq' : 'negro',
|
||||
});
|
||||
this.compGramajeNegro = new ClassSelect($('#compGramajeNegro'), '/presupuestoadmin/papelgramaje', 'Seleccione un gramaje', false,
|
||||
{
|
||||
tipo_impresion: () => this.encuadernacion.getVal(),
|
||||
papel_generico: () => this.compPapelNegroSelected.getVal(),
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: () => $('#isHq').val() ? 'negrohq' : 'negro',
|
||||
});
|
||||
this.compPapelColorSelected = new ClassSelect($("#compPapelColorSelected"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false,
|
||||
{
|
||||
@ -28,7 +39,18 @@ class Importador {
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: () => $('#hq').val() ? 'colorhq' : 'color',
|
||||
tipo: () => $('#isHq').val() ? 'colorhq' : 'color',
|
||||
});
|
||||
this.compGramajeColor = new ClassSelect($('#compGramajeColor'), '/presupuestoadmin/papelgramaje', 'Seleccione un gramaje', false,
|
||||
{
|
||||
tipo_impresion: () => this.encuadernacion.getVal(),
|
||||
papel_generico: () => this.compPapelColorSelected.getVal(),
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: 0,
|
||||
lomo: 0,
|
||||
tipo: () => $('#isHq').val() ? 'colorhq' : 'color',
|
||||
});
|
||||
this.compPapelCubiertaSelected = new ClassSelect($("#compPapelCubiertaSelected"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false,
|
||||
{
|
||||
@ -41,6 +63,17 @@ class Importador {
|
||||
tipo: 'colorhq',
|
||||
uso: 'cubierta',
|
||||
});
|
||||
this.compGramajeCubierta = new ClassSelect($('#compGramajeCubierta'), '/presupuestoadmin/papelgramaje', 'Seleccione un gramaje', false,
|
||||
{
|
||||
tipo_impresion: () => this.encuadernacion.getVal(),
|
||||
papel_generico: () => this.compPapelCubiertaSelected.getVal(),
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: () => $('#compSolapasCubierta').val(),
|
||||
lomo: 0,
|
||||
tipo: 'colorhq',
|
||||
});
|
||||
this.compSobrecubiertaSelected = new ClassSelect($("#compPapelSobrecubiertaSelected"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false,
|
||||
{
|
||||
tipo_impresion: this.encuadernacion.getVal(),
|
||||
@ -52,6 +85,17 @@ class Importador {
|
||||
tipo: 'colorhq',
|
||||
uso: 'sobrecubierta',
|
||||
});
|
||||
this.compGramajeSobrecubierta = new ClassSelect($('#compGramajeSobrecubierta'), '/presupuestoadmin/papelgramaje', 'Seleccione un gramaje', false,
|
||||
{
|
||||
tipo_impresion: () => this.encuadernacion.getVal(),
|
||||
papel_generico: () => this.compPapelCubiertaSelected.getVal(),
|
||||
tirada: () => $('#tirada').val(),
|
||||
ancho: () => this.getDimensionLibro().ancho,
|
||||
alto: () => this.getDimensionLibro().alto,
|
||||
sopalas: () => $('#compSolapasSobrecubierta').val(),
|
||||
lomo: 0,
|
||||
tipo: 'colorhq',
|
||||
});
|
||||
|
||||
this.acabadoCubierta = new ClassSelect($("#compAcabadoCubiertaSelected"),
|
||||
'/serviciosacabados/getacabados',
|
||||
@ -89,9 +133,13 @@ class Importador {
|
||||
this.encuadernacion.init();
|
||||
|
||||
this.compPapelNegroSelected.init();
|
||||
this.compGramajeNegro.init();
|
||||
this.compPapelColorSelected.init();
|
||||
this.compGramajeColor.init();
|
||||
this.compPapelCubiertaSelected.init();
|
||||
this.compGramajeCubierta.init();
|
||||
this.compSobrecubiertaSelected.init();
|
||||
this.compGramajeSobrecubierta.init();
|
||||
|
||||
this.acabadoCubierta.init();
|
||||
this.acabadosSobrecubierta.init();
|
||||
@ -124,6 +172,12 @@ class Importador {
|
||||
});
|
||||
|
||||
this.makeImport.on('click', this.importPresupuesto.bind(this));
|
||||
|
||||
$(document).on('change', '.warning-change', function () {
|
||||
$(this).addClass('bg-warning');
|
||||
let select2Container = $(this).next('.select2').find('.select2-selection');
|
||||
select2Container.addClass('bg-warning');
|
||||
});
|
||||
}
|
||||
|
||||
importPresupuesto() {
|
||||
@ -139,7 +193,7 @@ class Importador {
|
||||
const urlObj = new URL(window.location.href);
|
||||
Swal.fire({
|
||||
title: 'Atención!',
|
||||
text: 'Esto es una importación básica, por favor revisa los datos para comprobar que no hay errores. ' +
|
||||
text: 'Esto es una importación básica, por favor revisa los datos para comprobar que no hay errores. ' +
|
||||
'Tenga en cuenta que no todos los servicios se pueden importar.',
|
||||
icon: 'warning',
|
||||
showCancelButton: false,
|
||||
@ -197,25 +251,25 @@ class Importador {
|
||||
data.papel_formato_alto = $('#papelFormatoAlto').val();
|
||||
|
||||
data.encuadernacion = this.encuadernacion.getVal();
|
||||
data.isHq = $('#hq').val();
|
||||
data.isHq = $('#isHq').val();
|
||||
|
||||
data.paginas_bn = $('#compPaginasNegro').val();
|
||||
data.papel_bn = this.compPapelNegroSelected.getVal();
|
||||
data.gramaje_bn = $('#compGramajeNegro').val();
|
||||
data.gramaje_bn = this.compGramajeNegro.getVal();
|
||||
|
||||
data.paginas_color = $('#compPaginasColor').val();
|
||||
data.papel_color = this.compPapelColorSelected.getVal();
|
||||
data.gramaje_color = $('#compGramajeColor').val();
|
||||
data.gramaje_color = this.compGramajeColor.getVal();
|
||||
|
||||
data.paginas_cubierta = $('#compCarasCubierta').val();
|
||||
data.papel_cubierta = this.compPapelCubiertaSelected.getVal();
|
||||
data.gramaje_cubierta = $('#compGramajeCubierta').val();
|
||||
data.gramaje_cubierta = this.compGramajeCubierta.getVal();
|
||||
data.solapas_cubierta = $('#compSolapasCubierta').val();
|
||||
data.acabado_cubierta = this.acabadoCubierta.getVal();
|
||||
|
||||
data.sobrecubierta = $('#compSobrecubierta').val();
|
||||
data.papel_sobrecubierta = this.compSobrecubiertaSelected.getVal();
|
||||
data.gramaje_sobrecubierta = $('#compGramajeSobrecubierta').val();
|
||||
data.gramaje_sobrecubierta = this.compGramajeSobrecubierta.getVal();
|
||||
data.solapas_sobrecubierta = $('#compSolapasSobrecubierta').val();
|
||||
data.acabado_sobrecubierta = this.acabadosSobrecubierta.getVal();
|
||||
|
||||
@ -249,6 +303,7 @@ class Importador {
|
||||
if (response.success) {
|
||||
|
||||
this.fillInitialData(response.data);
|
||||
$('.bg-warning').removeClass('bg-warning');
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
@ -303,35 +358,39 @@ class Importador {
|
||||
|
||||
if (data.lineas) {
|
||||
if (data.lineas.isHq) {
|
||||
$('#hq').val(data.lineas.hq);
|
||||
$('#isHq').val(data.lineas.isHq);
|
||||
}
|
||||
else {
|
||||
$('#isHq').val(0);
|
||||
}
|
||||
|
||||
if (data.lineas.bn && data.lineas.bn.paginas) {
|
||||
$('#compPaginasNegro').val(data.lineas.bn.paginas);
|
||||
$('#compPapelNegroOrigen').val(data.lineas.bn.papel_nombre);
|
||||
$('#compGramajeNegro').val(parseFloat(data.lineas.bn.gramaje).toFixed(0));
|
||||
this.compGramajeNegro.setOption(parseFloat(data.lineas.bn.gramaje).toFixed(0), parseFloat(data.lineas.bn.gramaje).toFixed(0));
|
||||
this.compPapelNegroSelected.item.prop('disabled', false);
|
||||
this.compPapelNegroSelected.setOption(data.lineas.bn.new_papel_id, data.lineas.bn.new_papel_nombre);
|
||||
}
|
||||
else {
|
||||
$('#compPaginasNegro').val(0);
|
||||
$('#compPapelNegroOrigen').val("");
|
||||
$('#compGramajeNegro').val("");
|
||||
this.compGramajeNegro.empty();
|
||||
this.compPapelNegroSelected.empty();
|
||||
this.compPapelNegroSelected.item.prop('disabled', true);
|
||||
this.compGramajeNegro.item.prop('disabled', true);
|
||||
}
|
||||
|
||||
if (data.lineas.color && data.lineas.color.paginas) {
|
||||
$('#compPaginasColor').val(data.lineas.color.paginas);
|
||||
$('#compPapelColorOrigen').val(data.lineas.color.papel_nombre);
|
||||
$('#compGramajeColor').val(parseFloat(data.lineas.color.gramaje).toFixed(0));
|
||||
this.compGramajeColor.setOption(parseFloat(data.lineas.color.gramaje).toFixed(0), parseFloat(data.lineas.color.gramaje).toFixed(0));
|
||||
this.compPapelColorSelected.item.prop('disabled', false);
|
||||
this.compPapelColorSelected.setOption(data.lineas.color.new_papel_id, data.lineas.color.new_papel_nombre);
|
||||
}
|
||||
else {
|
||||
$('#compPaginasColor').val(0);
|
||||
$('#compPapelColorOrigen').val("");
|
||||
$('#compGramajeColor').val("");
|
||||
this.compGramajeColor.empty();
|
||||
this.compPapelColorSelected.empty();
|
||||
this.compPapelColorSelected.item.prop('disabled', true);
|
||||
}
|
||||
@ -339,7 +398,7 @@ class Importador {
|
||||
if (data.lineas.cubierta && data.lineas.cubierta.paginas) {
|
||||
$('#compPaginasCubierta').val(data.lineas.cubierta.paginas);
|
||||
$('#compPapelCubiertaOrigen').val(data.lineas.cubierta.papel_nombre);
|
||||
$('#compGramajeCubierta').val(parseFloat(data.lineas.cubierta.gramaje).toFixed(0));
|
||||
this.compGramajeCubierta.setOption(parseFloat(data.lineas.cubierta.gramaje).toFixed(0), parseFloat(data.lineas.cubierta.gramaje).toFixed(0));
|
||||
$('#compSolapasCubierta').val(parseFloat(data.lineas.cubierta.solapas).toFixed(0));
|
||||
this.compPapelCubiertaSelected.item.prop('disabled', false);
|
||||
this.compPapelCubiertaSelected.setOption(data.lineas.cubierta.new_papel_id, data.lineas.cubierta.new_papel_nombre);
|
||||
@ -347,7 +406,7 @@ class Importador {
|
||||
else {
|
||||
$('#compPaginasCubierta').val(0);
|
||||
$('#compPapelCubiertaOrigen').val("");
|
||||
$('#compGramajeCubierta').val("");
|
||||
this.compGramajeCubierta.empty();
|
||||
$('#compSolapasCubierta').val("");
|
||||
this.compPapelCubiertaSelected.empty();
|
||||
this.compPapelCubiertaSelected.item.prop('disabled', true);
|
||||
@ -356,7 +415,7 @@ class Importador {
|
||||
if (data.lineas.sobrecubierta && data.lineas.sobrecubierta.paginas) {
|
||||
$('#compSobrecubierta').val(1);
|
||||
$('#compPapelSobrecubiertaOrigen').val(data.lineas.sobrecubierta.papel_nombre);
|
||||
$('#compGramajeSobrecubierta').val(parseFloat(data.lineas.sobrecubierta.gramaje).toFixed(0));
|
||||
this.compGramajeSobrecubierta.setOption(parseFloat(data.lineas.sobrecubierta.gramaje).toFixed(0), parseFloat(data.lineas.sobrecubierta.gramaje).toFixed(0));
|
||||
$('#compSolapasSobrecubierta').val(parseFloat(data.lineas.sobrecubierta.solapas).toFixed(0));
|
||||
this.compSobrecubiertaSelected.item.prop('disabled', false);
|
||||
this.compSobrecubiertaSelected.setOption(data.lineas.sobrecubierta.new_papel_id, data.lineas.sobrecubierta.new_papel_nombre);
|
||||
@ -364,7 +423,7 @@ class Importador {
|
||||
else {
|
||||
$('#compSobrecubierta').val(0);
|
||||
$('#compPapelSobrecubiertaOrigen').val("");
|
||||
$('#compGramajeSobrecubierta').val("");
|
||||
this.compGramajeSobrecubierta.empty();
|
||||
$('#compSolapasSobrecubierta').val("");
|
||||
this.compSobrecubiertaSelected.empty();
|
||||
this.compSobrecubiertaSelected.item.prop('disabled', true);
|
||||
|
||||
@ -428,7 +428,7 @@ class DatosLibro {
|
||||
|
||||
|
||||
// para que se actualice el comparador
|
||||
if ($('#compGramajeSobrecubierta').select2('data').length > 0)
|
||||
if ($('#compGramajeSobrecubierta').select2('data') && $('#compGramajeSobrecubierta').select2('data').length > 0)
|
||||
$('#compGramajeSobrecubierta').trigger('change');
|
||||
|
||||
if (this.cargando)
|
||||
@ -446,7 +446,7 @@ class DatosLibro {
|
||||
changeAnchoSolapasFaja() {
|
||||
|
||||
// para que se actualice el comparador
|
||||
if ($('#compGramajeFaja').select2('data').length > 0) {
|
||||
if ($('#compGramajeFaja').select2('data') && $('#compGramajeFaja').select2('data').length > 0) {
|
||||
$('#compGramajeFaja').trigger('change');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user