mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
problema con los custom radiobutons
This commit is contained in:
@ -92,7 +92,32 @@ return [
|
||||
'retractilado' => 'Retractilado individual',
|
||||
'retractilado5' => 'Retractilado de 5',
|
||||
'Guardas' => 'Guardas',
|
||||
'papelGuardas' => 'Papel de guardas',
|
||||
'offsetBlancoGuardas' => 'Offset blanco 170 gr',
|
||||
'offsetAhuesadoGuardas' => 'Offset ahuesado 170 gr',
|
||||
'guardasImpresas' => "Guardas impresas",
|
||||
'imprimir_guardas' => 'Imprimir guardas',
|
||||
'cabezada' => 'Cabezada',
|
||||
'blanca' => 'Blanca',
|
||||
'verde' => 'Verde',
|
||||
'azul' => 'Azul',
|
||||
'rojaAmarilla' => 'Roja-Amarilla',
|
||||
'plastificado' => 'Plastificado',
|
||||
'brillo' => 'Brillo',
|
||||
'mate' => 'Mate',
|
||||
'antirrayado' => 'Anti-rayado',
|
||||
'rugoso' => 'Sandy (rugoso)',
|
||||
'sinPlastificar' => 'Sin plastificar',
|
||||
'barniz' => 'Barniz UVI',
|
||||
'relieve2D' => 'Relieve 2D',
|
||||
'relieve3D' => 'Relieve 3D',
|
||||
'barnizDescription' => 'Barnizado selectivo en zonas de la cubierta',
|
||||
'estampado' => 'Estampado',
|
||||
'oro' => 'Oro',
|
||||
'plata' => 'Plata',
|
||||
'cobre' => 'Cobre',
|
||||
'bronce' => 'Bronce',
|
||||
'retractiladoTitle' => 'Retractilado',
|
||||
'fajaColor' => 'Imprimir faja a color',
|
||||
'compInteriorPlana' => 'Interior en plana',
|
||||
'compInteriorRotativa' => 'Interior en rotativa',
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
<div class="col-12 pb-2 d-flex flex-column align-items-center">
|
||||
|
||||
<div class="col-sm-8 mb-3 d-flex flex-column align-items-center">
|
||||
<h5 class="mb-1 fw-bold titulo"></h5>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-8 mb-3 d-flex flex-column align-items-center">
|
||||
<h3 class="mb-1 fw-bold"> Diseño cubierta </h3>
|
||||
</div><!--//.mb-3 -->
|
||||
@ -34,7 +38,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div id="divSolapasCubierta" name="div_solapas_cubierta" class="row col-sm-10 mb-5 justify-content-center">
|
||||
<div id="divSolapasCubierta" name="div_solapas_cubierta" class="row col-sm-10 mb-5 justify-content-center d-none">
|
||||
|
||||
<div id="solapasCubiertaNo" class="d-flex flex-column align-items-center justify-content-center solapas-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/sinSolapasCubierta.png") ?>" alt="Sin solapas">
|
||||
@ -43,160 +47,207 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="solapasCubiertaNo" class="d-flex flex-column align-items-center justify-content-center solapas-cubierta imagen-selector image-container">
|
||||
<div id="solapasCubiertaSi" class="d-flex flex-column align-items-center justify-content-center solapas-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/conSolapasCubierta.png") ?>" alt="Con solapas">
|
||||
<label class="form-label">
|
||||
Con solapas
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex flex-column align-items-center justify-content-center imagen-selector image-container">
|
||||
<label for="tirada2" class="form-label">
|
||||
<div id="divTamanioSolapas" class="d-flex flex-column align-items-center justify-content-center image-container d-none">
|
||||
<label for="solapasCubierta" class="form-label">
|
||||
Tamaño solapas
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto form-control text-center num-input" id="solapasCubierta" name="solapas_cubierta" step="1" value="50">
|
||||
<input id="solapasCubierta" name="solapas_cubierta" type="number" class="calcular-presupuesto form-control text-center num-input" min="60" max="120" step="1" value="60">
|
||||
<div class="form-text">
|
||||
Entre 60 y 120 mm
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="divConfigTapaDura" class="row col-sm-10 mb-5 justify-content-center d-none">
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-3">
|
||||
<label for="paginasColor" class="form-label">
|
||||
<?= lang('Presupuestos.papelGuardas') ?>
|
||||
</label>
|
||||
<select class="form-select select2bs2 calcular-presupuesto" id="papelGuardas" name="papel_guardas">
|
||||
<option value="OFFWH"><?= lang('Presupuestos.offsetBlancoGuardas') ?></option>
|
||||
<option value="OFFAH"><?= lang('Presupuestos.offsetAhuesadoGuardas') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<label for="guardasImpresas" class="form-label">
|
||||
<?= lang('Presupuestos.guardasImpresas') ?>
|
||||
</label>
|
||||
<select class="form-select select2bs2 calcular-presupuesto" id="guardasImpresas" name="guardas_impresas">
|
||||
<option value="0"><?= lang('Presupuestos.sinImpresion') ?></option>
|
||||
<option value="1"><?= lang('Presupuestos.unaCara') ?></option>
|
||||
<option value="2"><?= lang('Presupuestos.dosCaras') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<label for="cabezada" class="form-label">
|
||||
<?= lang('Presupuestos.cabezada') ?>
|
||||
</label>
|
||||
<select class="form-select select2bs2 calcular-presupuesto" id="cabezada" name="cabezada">
|
||||
<option value="WHI"><?= lang('Presupuestos.blanca') ?></option>
|
||||
<option value="GRE"><?= lang('Presupuestos.verde') ?></option>
|
||||
<option value="BLUE"><?= lang('Presupuestos.azul') ?></option>
|
||||
<option value="REDYEL"><?= lang('Presupuestos.rojaAmarilla') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-8 mb-3 d-flex flex-column align-items-center">
|
||||
<h3 class="mb-1 fw-bold"> Papel interior </h3>
|
||||
<h3 class="mb-1 fw-bold"> Papel cubierta </h3>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div id="divPapelCubierta" name="div_papel_cubierta" class="row col-sm-10 mb-3 justify-content-center">
|
||||
|
||||
<div id="offsetBlanco" class="d-flex flex-column align-items-center justify-content-center papel-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/offset-blanco.png") ?>" alt="offsetBlanco">
|
||||
<label for="titulo" class="form-label">
|
||||
Offset Blanco
|
||||
<div id="cartulinaEstucada" class="min-width-fit d-flex flex-column align-items-center justify-content-center papel-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/cartulina-grafica.png") ?>" alt="Cartulina estucada">
|
||||
<label class="form-label">
|
||||
Cartulina gráfica estucada a una cara
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="offsetAhuesado" class="d-flex flex-column align-items-center justify-content-center papel-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/offset-ahuesado.png") ?>" alt="offsetAhuesado">
|
||||
<label for="titulo" class="form-label">
|
||||
Offset Ahuesado
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="offsetAhuesadoVolumen" class="d-flex flex-column align-items-center justify-content-center papel-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/offset-ahuesado-volumen.png") ?>" alt="offsetAhuesadoVolumen">
|
||||
<label for="titulo" class="form-label">
|
||||
Offset Ahuesado Volumen
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="estucadoMate" class="d-flex flex-column align-items-center justify-content-center papel-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/estucado-mate.png") ?>" alt="estucadoMate">
|
||||
<label for="titulo" class="form-label">
|
||||
<div id="estucadoMate" class="min-width-fit d-flex flex-column align-items-center justify-content-center papel-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/estucado-mate-cubierta.png") ?>" alt="Estucado mate">
|
||||
<label class="form-label">
|
||||
Estucado Mate
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="divGramajeCubierta" name="div_gramaje_cubierta" class="row col-sm-10 mb-3 justify-content-center">
|
||||
|
||||
<div class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje70">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 70 gr </span>
|
||||
</span>
|
||||
<input id="gramaje70" name="customRadioIcon" data-value="70" class="form-check-input" type="radio" value="" checked />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="divGramajeCubierta" name="div_gramaje_interior_color" class="row col-sm-10 mb-3 justify-content-center d-none">
|
||||
|
||||
<div class="checkbox-presupuesto-container mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje80">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 80 gr </span>
|
||||
</span>
|
||||
<input id="gramaje80" name="customRadioIcon" data-value="80" class="form-check-input" type="radio" value="" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-md-0 mb-2 checkbox-presupuesto-container">
|
||||
<div id="divGramaje170Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje90">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 90 gr </span>
|
||||
</span>
|
||||
<input id="gramaje90" name="customRadioIcon" data-value="90" class="form-check-input" type="radio" value="" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-presupuesto-container mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje100">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 100 gr </span>
|
||||
</span>
|
||||
<input id="gramaje100" name="customRadioIcon" data-value="100" class="form-check-input" type="radio" value="" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-presupuesto-container mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje115">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 115 gr </span>
|
||||
</span>
|
||||
<input id="gramaje115" name="customRadioIcon" data-value="115" class="form-check-input" type="radio" value="" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-presupuesto-container mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje120">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 120 gr </span>
|
||||
</span>
|
||||
<input id="gramaje120" name="customRadioIcon" data-value="120" class="form-check-input" type="radio" value="" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-presupuesto-container mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje135">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 135 gr </span>
|
||||
</span>
|
||||
<input id="gramaje135" name="customRadioIcon" data-value="135" class="form-check-input" type="radio" value="" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-presupuesto-container mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje150">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 150 gr </span>
|
||||
</span>
|
||||
<input id="gramaje150" name="customRadioIcon" data-value="150" class="form-check-input" type="radio" value="" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-presupuesto-container mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje170">
|
||||
<label class="form-check-label custom-option-content" for="gramaje170Cubierta">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 170 gr </span>
|
||||
</span>
|
||||
<input id="gramaje170" name="customRadioIcon" data-value="170" class="form-check-input" type="radio" value="" />
|
||||
<input id="gramaje170Cubierta" name="gramajeCubiertaRadio" data-value="170" class="form-check-input" type="radio" value="170" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divGramaje240Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje240Cubierta">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 240 gr </span>
|
||||
</span>
|
||||
<input id="gramaje240Cubierta" name="gramajeCubiertaRadio" data-value="240" class="form-check-input" type="radio" value="240" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divGramaje270Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje270Cubierta">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 270 gr </span>
|
||||
</span>
|
||||
<input id="gramaje270Cubierta" name="gramajeCubiertaRadio" data-value="270" class="form-check-input" type="radio" value="270" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divGramaje300Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje300Cubierta">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 300 gr </span>
|
||||
</span>
|
||||
<input id="gramaje300Cubierta" name="gramajeCubiertaRadio" data-value="300" class="form-check-input" type="radio" value="300" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-text">
|
||||
Recomendado
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divGramaje350Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-icon">
|
||||
<label class="form-check-label custom-option-content" for="gramaje350Cubierta">
|
||||
<span class="custom-option-body">
|
||||
<span class="custom-option-title"> 350 gr </span>
|
||||
</span>
|
||||
<input id="gramaje350Cubierta" name="gramajeCubiertaRadio" data-value="350" class="form-check-input" type="radio" value="350" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<hr class="col-sm-10 my-10">
|
||||
|
||||
<div class="col-sm-8 mb-3 d-flex flex-column align-items-center">
|
||||
<h3 class="mb-1 fw-bold"> Acabados </h3>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="row col-sm-12 mb-5 justify-content-center">
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-3">
|
||||
<label for="plastificado" class="form-label">
|
||||
<?= lang('Presupuestos.plastificado') ?>
|
||||
</label>
|
||||
<select class="form-select select2bs2 calcular-presupuesto" id="plastificado" name="plastificado">
|
||||
<option value="BRIL"><?= lang('Presupuestos.brillo') ?></option>
|
||||
<option value="MATE"><?= lang('Presupuestos.mate') ?></option>
|
||||
<option value="ANTI"><?= lang('Presupuestos.antirrayado') ?></option>
|
||||
<option value="SAND"><?= lang('Presupuestos.rugoso') ?></option>
|
||||
<option value="SINP"><?= lang('Presupuestos.sinPlastificar') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<label for="barniz" class="form-label">
|
||||
<?= lang('Presupuestos.barniz') ?>
|
||||
</label>
|
||||
<select class="form-select select2bs2 calcular-presupuesto" id="barniz" name="barniz">
|
||||
<option value=""> - </option>
|
||||
<option value="R2D"><?= lang('Presupuestos.relieve2D') ?></option>
|
||||
<option value="R3D"><?= lang('Presupuestos.relieve3D') ?></option>
|
||||
</select>
|
||||
<div class="form-text">
|
||||
<?= lang('Presupuestos.barnizDescription') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<label for="estampado" class="form-label">
|
||||
<?= lang('Presupuestos.estampado') ?>
|
||||
</label>
|
||||
<select class="form-select select2bs2 calcular-presupuesto" id="estampado" name="estampado">
|
||||
<option value=""> - </option>
|
||||
<option value="GOLD"><?= lang('Presupuestos.oro') ?></option>
|
||||
<option value="SILV"><?= lang('Presupuestos.plata') ?></option>
|
||||
<option value="COPP"><?= lang('Presupuestos.cobre') ?></option>
|
||||
<option value="BRON"><?= lang('Presupuestos.bronce') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="solapasCubiertaNo" class="d-flex flex-column align-items-center justify-content-center solapas-cubierta imagen-selector image-container">
|
||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/retractilado.png") ?>" alt="Retractilado">
|
||||
<label class="form-label">
|
||||
Retractilado
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
BIN
httpdocs/assets/img/presupuestoCliente/cartulina-grafica.png
Normal file
BIN
httpdocs/assets/img/presupuestoCliente/cartulina-grafica.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 233 KiB |
BIN
httpdocs/assets/img/presupuestoCliente/retractilado.png
Normal file
BIN
httpdocs/assets/img/presupuestoCliente/retractilado.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 278 KiB |
@ -19,6 +19,9 @@ class DatosGenerales {
|
||||
this.anchoPersonalizado = this.domItem.find("#papelFormatoAncho");
|
||||
this.altoPersonalizado = this.domItem.find("#papelFormatoAlto");
|
||||
|
||||
this.fresado = $(this.domItem.find("#fresado")[0]);
|
||||
this.cosido = $(this.domItem.find("#cosido")[0]);
|
||||
|
||||
this.tiposLibro = this.domItem.find(".tipo-libro");
|
||||
|
||||
this.paginas = this.domItem.find("#paginas");
|
||||
@ -313,6 +316,14 @@ class DatosGenerales {
|
||||
|
||||
element.closest('.tipo-libro').toggleClass('selected');
|
||||
element.closest('.image-presupuesto').toggleClass('selected');
|
||||
|
||||
if(this.fresado.hasClass('selected') || this.cosido.hasClass('selected')){
|
||||
$('#tapaDuraLomoRedondo').removeClass('d-none');
|
||||
}
|
||||
else{
|
||||
$('#tapaDuraLomoRedondo').addClass('d-none');
|
||||
$('#tapaDuraLomoRedondo').removeClass('selected');
|
||||
}
|
||||
}
|
||||
|
||||
#handlePaginas() {
|
||||
|
||||
@ -0,0 +1,498 @@
|
||||
class DisenioCubierta {
|
||||
|
||||
constructor(domItem, wizardForm, validatorStepper) {
|
||||
this.domItem = domItem;
|
||||
|
||||
this.wizardStep = wizardForm.querySelector('#cubierta-libro');
|
||||
this.validatorStepper = validatorStepper;
|
||||
|
||||
this.disenioCubierta = this.domItem.find(".tipo-cubierta");
|
||||
this.solapasCubierta = this.domItem.find(".solapas-cubierta");
|
||||
this.papelCubierta = this.domItem.find(".papel-cubierta");
|
||||
|
||||
this.divSolapas = this.domItem.find("#divSolapasCubierta");
|
||||
this.divConfigTapaDura = this.domItem.find("#divConfigTapaDura");
|
||||
|
||||
this.tapaBlanda = this.domItem.find("#tapaBlanda");
|
||||
this.tapaDuraLomoRecto = this.domItem.find("#tapaDura");
|
||||
this.tapaDuraLomoRedondo = this.domItem.find("#tapaDuraLomoRedondo");
|
||||
|
||||
this.sinSolapas = this.domItem.find("#solapasCubiertaNo");
|
||||
this.conSolapas = this.domItem.find("#solapasCubiertaSi");
|
||||
this.divTamanioSolapas = this.domItem.find("#divTamanioSolapas");
|
||||
this.tamanioSolapasCubierta = this.domItem.find("#solapasCubierta");
|
||||
|
||||
this.cartulinaEstucada = this.domItem.find("#cartulinaEstucada");
|
||||
this.estucadoMate = this.domItem.find("#estucadoMate");
|
||||
|
||||
this.divGramajeCubierta = this.domItem.find("#divGramajeCubierta");
|
||||
this.gramaje170 = $(this.domItem.find("#divGramaje170Cubierta"));
|
||||
this.gramaje240 = $(this.domItem.find("#divGramaje240Cubierta"));
|
||||
this.gramaje270 = $(this.domItem.find("#divGramaje270Cubierta"));
|
||||
this.gramaje300 = $(this.domItem.find("#divGramaje300Cubierta"));
|
||||
this.gramaje350 = $(this.domItem.find("#divGramaje350Cubierta"));
|
||||
|
||||
this.initValidation();
|
||||
|
||||
// Creamos un nuevo observador que detecta cambios en los atributos
|
||||
this.observer = new MutationObserver(mutations => {
|
||||
mutations.forEach(mutation => {
|
||||
if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
|
||||
const targetElement = mutation.target;
|
||||
// check if targetElement has class 'selected'
|
||||
if (targetElement.classList.contains('tipo-cubierta')) {
|
||||
this.#handleMenuTipoCubierta();
|
||||
}
|
||||
else if (targetElement.classList.contains('solapas-cubierta')) {
|
||||
this.#handleMenuSolapas();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
init() {
|
||||
|
||||
// Eventos
|
||||
this.disenioCubierta.on('click', this.#handleDisenioCubierta.bind(this));
|
||||
this.solapasCubierta.on('click', this.#handleSolapasCubierta.bind(this));
|
||||
this.papelCubierta.on('click', this.#handlePapelCubierta.bind(this));
|
||||
this.tamanioSolapasCubierta.on('change', this.#handleTamanioSolapas.bind(this));
|
||||
|
||||
// Observadores
|
||||
this.observer.observe(this.tapaBlanda[0], { attributes: true });
|
||||
this.observer.observe(this.tapaDuraLomoRecto[0], { attributes: true });
|
||||
this.observer.observe(this.tapaDuraLomoRedondo[0], { attributes: true });
|
||||
this.observer.observe(this.cartulinaEstucada[0], { attributes: true });
|
||||
this.observer.observe(this.conSolapas[0], { attributes: true });
|
||||
this.observer.observe(this.sinSolapas[0], { attributes: true });
|
||||
}
|
||||
|
||||
initValidation() {
|
||||
|
||||
const stepper = this.validatorStepper;
|
||||
|
||||
this.formValidation = FormValidation.formValidation(this.wizardStep, {
|
||||
fields: {
|
||||
div_impresion_interior: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (input) {
|
||||
const divImpresionInterior = $('#divImpresionInterior'); // Selecciona el div
|
||||
|
||||
divImpresionInterior.find('.fv-plugins-message-container').remove();
|
||||
if ($('.disenio-interior.selected').length > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
divImpresionInterior.append(`
|
||||
<div class="fv-plugins-message-container invalid-feedback">
|
||||
<div data-field="div_impresion_interior" data-validator="callback" style="margin-top: 50px;">
|
||||
${window.translations["validation"].disenio_interior}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
div_papel_interior: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (input) {
|
||||
const divPapelInterior = $('#divPapelInterior'); // Selecciona el div
|
||||
|
||||
divPapelInterior.find('.fv-plugins-message-container').remove();
|
||||
if ($('.papel-interior.selected').length > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
divPapelInterior.append(`
|
||||
<div class="fv-plugins-message-container invalid-feedback">
|
||||
<div data-field="div_impresion_interior" data-validator="callback" style="margin-top: 50px;">
|
||||
${window.translations["validation"].papel_interior}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
div_gramaje_interior: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (input) {
|
||||
const divGramajeInterior = $('#divGramajeInterior'); // Selecciona el div
|
||||
if ($("#divGramajeInterior").hasClass("d-none")) return true;
|
||||
|
||||
divGramajeInterior.find('.fv-plugins-message-container').remove();
|
||||
if ($('.check-interior-gramaje:checked').length > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
divGramajeInterior.append(`
|
||||
<div class="fv-plugins-message-container invalid-feedback">
|
||||
<div data-field="div_impresion_interior" data-validator="callback" style="margin-top: 50px;">
|
||||
${window.translations["validation"].gramaje_interior}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
div_impresion_interior_color: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (input) {
|
||||
const divImpresionInterior = $('#divImpresionInteriorColor'); // Selecciona el div
|
||||
if (divImpresionInterior.hasClass("d-none")) return true;
|
||||
|
||||
divImpresionInterior.find('.fv-plugins-message-container').remove();
|
||||
if ($('.disenio-interior-color.selected').length > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
divImpresionInterior.append(`
|
||||
<div class="fv-plugins-message-container invalid-feedback">
|
||||
<div data-field="div_impresion_interior_color" data-validator="callback" style="margin-top: 50px;">
|
||||
${window.translations["validation"].disenio_interior}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
div_papel_interior_color: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (input) {
|
||||
const divPapelInterior = $('#divPapelInteriorColor'); // Selecciona el div
|
||||
if (divPapelInterior.hasClass("d-none")) return true;
|
||||
|
||||
divPapelInterior.find('.fv-plugins-message-container').remove();
|
||||
if ($('.papel-interior.selected').length > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
divPapelInterior.append(`
|
||||
<div class="fv-plugins-message-container invalid-feedback">
|
||||
<div data-field="div_impresion_interior" data-validator="callback" style="margin-top: 50px;">
|
||||
${window.translations["validation"].papel_interior}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
div_gramaje_interior_color: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (input) {
|
||||
const divGramajeInterior = $('#divGramajeInteriorColor'); // Selecciona el div
|
||||
if ($("#divGramajeInterior").hasClass("d-none")) return true;
|
||||
|
||||
divGramajeInterior.find('.fv-plugins-message-container').remove();
|
||||
if ($('.check-interior-gramaje:checked').length > 0) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
divGramajeInterior.append(`
|
||||
<div class="fv-plugins-message-container invalid-feedback">
|
||||
<div data-field="div_impresion_interior" data-validator="callback" style="margin-top: 50px;">
|
||||
${window.translations["validation"].gramaje_interior}
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: function (field, ele) {
|
||||
// field is the field name
|
||||
// ele is the field element
|
||||
switch (field) {
|
||||
case 'div_impresion_interior':
|
||||
case 'div_papel_interior':
|
||||
case 'div_gramaje_interior':
|
||||
case 'div_impresion_interior_color':
|
||||
case 'div_papel_interior_color':
|
||||
case 'div_gramaje_interior_color':
|
||||
return '.col-sm-10';
|
||||
default:
|
||||
return '.col-sm-3';
|
||||
}
|
||||
}
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', () => {
|
||||
stepper.next();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#handleDisenioCubierta(event) {
|
||||
// Accede al ID del elemento que disparó el evento
|
||||
const element = $(event.target);
|
||||
|
||||
let class2Find = '.tipo-cubierta';
|
||||
|
||||
let containers = element.closest(class2Find).parent().find(class2Find);
|
||||
for (let container of containers) {
|
||||
if (container != element.closest(class2Find)[0]) {
|
||||
$(container).removeClass('selected');
|
||||
$(container).find('.image-presupuesto').removeClass('selected');
|
||||
}
|
||||
}
|
||||
|
||||
element.closest(class2Find).toggleClass('selected');
|
||||
element.closest('.image-presupuesto').toggleClass('selected');
|
||||
|
||||
$(".papel-cubierta").removeClass("selected");
|
||||
|
||||
if(this.tapaBlanda.hasClass("selected")){
|
||||
this.cartulinaEstucada.removeClass("d-none");
|
||||
this.divGramajeCubierta.addClass("d-none");
|
||||
}
|
||||
else{
|
||||
this.cartulinaEstucada.addClass("d-none");
|
||||
this.estucadoMate.addClass("selected");
|
||||
this.divGramajeCubierta.removeClass("d-none");
|
||||
this.gramaje170.removeClass("d-none");
|
||||
this.gramaje170.closest(".checkbox-presupuesto-container").addClass("checked");
|
||||
this.gramaje240.addClass("d-none");
|
||||
this.gramaje270.addClass("d-none");
|
||||
this.gramaje300.addClass("d-none");
|
||||
this.gramaje350.addClass("d-none");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#handleSolapasCubierta(event) {
|
||||
// Accede al ID del elemento que disparó el evento
|
||||
const element = $(event.target);
|
||||
|
||||
let class2Find = '.solapas-cubierta';
|
||||
|
||||
let containers = element.closest(class2Find).parent().find(class2Find);
|
||||
for (let container of containers) {
|
||||
if (container != element.closest(class2Find)[0]) {
|
||||
$(container).removeClass('selected');
|
||||
$(container).find('.image-presupuesto').removeClass('selected');
|
||||
}
|
||||
}
|
||||
|
||||
element.closest(class2Find).toggleClass('selected');
|
||||
element.closest('.image-presupuesto').toggleClass('selected');
|
||||
}
|
||||
|
||||
|
||||
#handlePapelCubierta(event) {
|
||||
// Accede al ID del elemento que disparó el evento
|
||||
const element = $(event.target);
|
||||
|
||||
let class2Find = '.papel-cubierta';
|
||||
|
||||
let containers = element.closest(class2Find).parent().find(class2Find);
|
||||
for (let container of containers) {
|
||||
if (container != element.closest(class2Find)[0]) {
|
||||
$(container).removeClass('selected');
|
||||
$(container).find('.image-presupuesto').removeClass('selected');
|
||||
}
|
||||
}
|
||||
|
||||
element.closest(class2Find).toggleClass('selected');
|
||||
element.closest('.image-presupuesto').toggleClass('selected');
|
||||
}
|
||||
|
||||
#handleMenuTipoCubierta(){
|
||||
|
||||
if(this.tapaBlanda.hasClass("selected")){
|
||||
this.divSolapas.removeClass("d-none");
|
||||
this.divConfigTapaDura.addClass("d-none");
|
||||
}
|
||||
else if(this.tapaDuraLomoRecto.hasClass("selected") || this.tapaDuraLomoRedondo.hasClass("selected")){
|
||||
this.solapasCubierta.removeClass("selected");
|
||||
this.divSolapas.addClass("d-none");
|
||||
this.divConfigTapaDura.removeClass("d-none");
|
||||
}
|
||||
else{
|
||||
this.divSolapas.addClass("d-none");
|
||||
this.divConfigTapaDura.addClass("d-none");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#handleMenuSolapas(){
|
||||
|
||||
if(this.conSolapas.hasClass("selected")){
|
||||
this.divTamanioSolapas.removeClass("d-none");
|
||||
}
|
||||
else{
|
||||
this.divTamanioSolapas.addClass("d-none");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#handleTamanioSolapas() {
|
||||
|
||||
const min = parseInt(this.tamanioSolapasCubierta[0].min);
|
||||
const max = parseInt(this.tamanioSolapasCubierta[0].max);
|
||||
|
||||
if (this.tamanioSolapasCubierta.val() < min || this.tamanioSolapasCubierta.val() == '' || isNaN(this.tamanioSolapasCubierta.val())) {
|
||||
this.tamanioSolapasCubierta.val(min);
|
||||
}
|
||||
|
||||
else if (this.tamanioSolapasCubierta.val() > max)
|
||||
this.tamanioSolapasCubierta.val(max);
|
||||
}
|
||||
|
||||
|
||||
#handleUpdateGramaje() {
|
||||
|
||||
let showGramaje = false;
|
||||
|
||||
$(".check-interior-gramaje ").prop("checked", false);
|
||||
|
||||
if (this.negroEstandar.hasClass("selected") || this.colorEstandar.hasClass("selected")) {
|
||||
|
||||
if (this.offsetBlanco.hasClass("selected")) {
|
||||
this.gramaje70.addClass("d-none");
|
||||
this.gramaje80.removeClass("d-none");
|
||||
this.gramaje90.removeClass("d-none");
|
||||
this.gramaje100.addClass("d-none");
|
||||
this.gramaje115.addClass("d-none");
|
||||
this.gramaje120.removeClass("d-none");
|
||||
this.gramaje135.addClass("d-none");
|
||||
this.gramaje150.addClass("d-none");
|
||||
this.gramaje170.addClass("d-none");
|
||||
showGramaje = true;
|
||||
}
|
||||
else if (this.offsetAhuesado.hasClass("selected")) {
|
||||
this.gramaje70.addClass("d-none");
|
||||
this.gramaje80.removeClass("d-none");
|
||||
this.gramaje90.removeClass("d-none");
|
||||
this.gramaje100.addClass("d-none");
|
||||
this.gramaje115.addClass("d-none");
|
||||
this.gramaje120.addClass("d-none");
|
||||
this.gramaje135.addClass("d-none");
|
||||
this.gramaje150.addClass("d-none");
|
||||
this.gramaje170.addClass("d-none");
|
||||
showGramaje = true;
|
||||
}
|
||||
else if (this.offsetAhuesadoVolumen.hasClass("selected")) {
|
||||
this.gramaje70.removeClass("d-none");
|
||||
this.gramaje80.addClass("d-none");
|
||||
this.gramaje90.addClass("d-none");
|
||||
this.gramaje100.addClass("d-none");
|
||||
this.gramaje115.addClass("d-none");
|
||||
this.gramaje120.addClass("d-none");
|
||||
this.gramaje135.addClass("d-none");
|
||||
this.gramaje150.addClass("d-none");
|
||||
this.gramaje170.addClass("d-none");
|
||||
showGramaje = true;
|
||||
}
|
||||
else if (this.estucadoMate.hasClass("selected")) {
|
||||
this.gramaje70.addClass("d-none");
|
||||
this.gramaje80.addClass("d-none");
|
||||
this.gramaje90.removeClass("d-none");
|
||||
this.gramaje100.addClass("d-none");
|
||||
this.gramaje115.addClass("d-none");
|
||||
this.gramaje120.removeClass("d-none");
|
||||
this.gramaje135.addClass("d-none");
|
||||
this.gramaje150.addClass("d-none");
|
||||
this.gramaje170.addClass("d-none");
|
||||
showGramaje = true;
|
||||
}
|
||||
}
|
||||
|
||||
else if (this.negroPremium.hasClass("selected") || this.colorPremium.hasClass("selected")) {
|
||||
|
||||
if (this.offsetBlanco.hasClass("selected")) {
|
||||
this.gramaje70.addClass("d-none");
|
||||
this.gramaje80.removeClass("d-none");
|
||||
this.gramaje90.removeClass("d-none");
|
||||
this.gramaje100.removeClass("d-none");
|
||||
this.gramaje115.addClass("d-none");
|
||||
this.gramaje120.addClass("d-none");
|
||||
this.gramaje135.addClass("d-none");
|
||||
this.gramaje150.removeClass("d-none");
|
||||
this.gramaje170.removeClass("d-none");
|
||||
showGramaje = true;
|
||||
}
|
||||
else if (this.offsetAhuesado.hasClass("selected")) {
|
||||
this.gramaje70.addClass("d-none");
|
||||
this.gramaje80.removeClass("d-none");
|
||||
this.gramaje90.removeClass("d-none");
|
||||
this.gramaje100.removeClass("d-none");
|
||||
this.gramaje115.addClass("d-none");
|
||||
this.gramaje120.addClass("d-none");
|
||||
this.gramaje135.addClass("d-none");
|
||||
this.gramaje150.addClass("d-none");
|
||||
this.gramaje170.addClass("d-none");
|
||||
showGramaje = true;
|
||||
}
|
||||
else if (this.offsetAhuesadoVolumen.hasClass("selected")) {
|
||||
this.gramaje70.addClass("d-none");
|
||||
this.gramaje80.addClass("d-none");
|
||||
this.gramaje90.addClass("d-none");
|
||||
this.gramaje100.addClass("d-none");
|
||||
this.gramaje115.addClass("d-none");
|
||||
this.gramaje120.addClass("d-none");
|
||||
this.gramaje135.addClass("d-none");
|
||||
this.gramaje150.addClass("d-none");
|
||||
this.gramaje170.addClass("d-none");
|
||||
showGramaje = true;
|
||||
}
|
||||
else if (this.estucadoMate.hasClass("selected")) {
|
||||
this.gramaje70.addClass("d-none");
|
||||
this.gramaje80.addClass("d-none");
|
||||
this.gramaje90.removeClass("d-none");
|
||||
this.gramaje100.addClass("d-none");
|
||||
this.gramaje115.removeClass("d-none");
|
||||
this.gramaje120.addClass("d-none");
|
||||
this.gramaje135.removeClass("d-none");
|
||||
this.gramaje150.removeClass("d-none");
|
||||
this.gramaje170.removeClass("d-none");
|
||||
showGramaje = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($("#divGramajeInterior").hasClass("d-none") && showGramaje) {
|
||||
$("#divGramajeInterior").removeClass("d-none");
|
||||
}
|
||||
else if (!showGramaje) {
|
||||
$("#divGramajeInterior").addClass("d-none");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
export default DisenioCubierta;
|
||||
@ -318,6 +318,17 @@ class DisenioInterior {
|
||||
|
||||
element.closest(class2Find).toggleClass('selected');
|
||||
element.closest('.image-presupuesto').toggleClass('selected');
|
||||
|
||||
if($('#fresado').hasClass('selected')) {
|
||||
if(this.estucadoMate.hasClass('selected') || this.estucadoMate_color.hasClass('selected')) {
|
||||
$('#tapaDuraLomoRedondo').addClass('d-none');
|
||||
$('#tapaDura').removeClass('d-none');
|
||||
}
|
||||
else{
|
||||
$('#tapaDuraLomoRedondo').removeClass('d-none');
|
||||
$('#tapaDura').addClass('d-none');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#handleUpdateGramaje() {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import DatosGenerales from './datosGenerales.js';
|
||||
import DisenioInterior from './disenioInterior.js';
|
||||
import DisenioCubierta from './disenioCubierta.js';
|
||||
import Ajax from '../../components/ajax.js';
|
||||
|
||||
class PresupuestoCliente {
|
||||
@ -19,6 +20,7 @@ class PresupuestoCliente {
|
||||
|
||||
this.datosGenerales = new DatosGenerales($("#datos-generales"), this.clientePresupuestoWizard, this.validationStepper);
|
||||
this.disenioInterior = new DisenioInterior($("#interior-libro"), this.clientePresupuestoWizard, this.validationStepper);
|
||||
this.disenioCubierta = new DisenioCubierta($("#cubierta-libro"), this.clientePresupuestoWizard, this.validationStepper);
|
||||
}
|
||||
|
||||
|
||||
@ -36,6 +38,7 @@ class PresupuestoCliente {
|
||||
|
||||
this.datosGenerales.init();
|
||||
this.disenioInterior.init();
|
||||
this.disenioCubierta.init();
|
||||
|
||||
this.RELLENAR_PRESUPUESTO();
|
||||
|
||||
@ -43,7 +46,10 @@ class PresupuestoCliente {
|
||||
|
||||
|
||||
RELLENAR_PRESUPUESTO() {
|
||||
|
||||
$("#titulo").val("Titulo del libro");
|
||||
$("#titulo").trigger('change');
|
||||
|
||||
const clienteId = $("#clienteId");
|
||||
const newOption = new Option("Cliente 1", "1", true, true);
|
||||
clienteId.append(newOption).trigger('change');
|
||||
@ -113,26 +119,8 @@ class PresupuestoCliente {
|
||||
}
|
||||
|
||||
#prevtStep() {
|
||||
switch (this.validationStepper._currentIndex) {
|
||||
case 4:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
this.validationStepper.previous();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(this.validationStepper._currentIndex >= 1 && this.validationStepper._currentIndex <= 4)
|
||||
this.validationStepper.previous();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -43,3 +43,7 @@
|
||||
min-width: 110px !important;
|
||||
}
|
||||
|
||||
.min-width-fit {
|
||||
min-width: fit-content !important;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user