mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
menu lateral datos generales
This commit is contained in:
@ -29,7 +29,7 @@
|
||||
|
||||
<div class="bs-stepper-header">
|
||||
|
||||
<div <?= ($state == 2)? 'hidden': '' ?> class="step active titulos-menu" data-target="#datos-generales">
|
||||
<div <?= ($state == 2) ? 'hidden' : '' ?> class="step active titulos-menu" data-target="#datos-generales">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-info-circle ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
@ -38,7 +38,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div <?= ($state == 2)? 'hidden': '' ?> class="step titulos-menu" data-target="#interior-libro">
|
||||
<div <?= ($state == 2) ? 'hidden' : '' ?> class="step titulos-menu" data-target="#interior-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
@ -47,7 +47,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div <?= ($state == 2)? 'hidden': '' ?> class="step titulos-menu" data-target="#cubierta-libro">
|
||||
<div <?= ($state == 2) ? 'hidden' : '' ?> class="step titulos-menu" data-target="#cubierta-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-books ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
@ -56,7 +56,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div <?= ($state == 2)? 'hidden': '' ?> class="step titulos-menu" data-target="#direcciones-libro">
|
||||
<div <?= ($state == 2) ? 'hidden' : '' ?> class="step titulos-menu" data-target="#direcciones-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-map-pins ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
@ -78,6 +78,73 @@
|
||||
|
||||
<div id='divTiradasPrecio'></div>
|
||||
|
||||
<div id='resumenLateral' class="container align-items-center">
|
||||
|
||||
|
||||
<div class="rl-datos-generales rl-item d-none">
|
||||
<div class="row">Libro</div>
|
||||
<div class="row">
|
||||
<ul class="list-group list-group-timeline">
|
||||
<li id="rl_tipo" class="list-group-item list-group-timeline-primary texto-resumen-lateral">Rustica
|
||||
Fresado</li>
|
||||
<li id="rl_tamanio" class="list-group-item list-group-timeline-primary texto-resumen-lateral">170.0
|
||||
x
|
||||
240.0</li>
|
||||
<li id="rl_tiradas" class="list-group-item list-group-timeline-primary texto-resumen-lateral">10,
|
||||
50,
|
||||
100, 200</li>
|
||||
<li id="rl_paginas" class="list-group-item list-group-timeline-primary texto-resumen-lateral">340
|
||||
páginas</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rl-interior rl-item d-none">
|
||||
<div class="row">Interior</div>
|
||||
<div class="row">
|
||||
<ul class="list-group list-group-timeline">
|
||||
<li id="rl_tipo_interior" class="list-group-item list-group-timeline-primary texto-resumen-lateral">Blanco y
|
||||
negro estándar</li>
|
||||
<li id="rl_papel_interior" class="list-group-item list-group-timeline-primary texto-resumen-lateral">Offset
|
||||
blanco 90 gr.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rl-cubierta rl-item d-none">
|
||||
<div class="row">Cubierta</div>
|
||||
<div class="row">
|
||||
<ul class="list-group list-group-timeline">
|
||||
<li id="rl_tipo" class="list-group-item list-group-timeline-primary texto-resumen-lateral">Estucado
|
||||
Mate
|
||||
300 gr.</li>
|
||||
<li id="rl_tamanio" class="list-group-item list-group-timeline-primary texto-resumen-lateral">Impresa
|
||||
1
|
||||
cara</li>
|
||||
<li id="rl_tamanio" class="list-group-item list-group-timeline-primary texto-resumen-lateral">
|
||||
Plastificado brillo</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rl-sobrecubierta rl-item d-none">
|
||||
<div class="row">Sobrecubierta</div>
|
||||
<div class="row">
|
||||
<ul class="list-group list-group-timeline">
|
||||
<li id="rl_tipo" class="list-group-item list-group-timeline-primary texto-resumen-lateral">Faja: No</li>
|
||||
<li id="rl_tamanio" class="list-group-item list-group-timeline-primary texto-resumen-lateral">Impresa
|
||||
1
|
||||
cara</li>
|
||||
<li id="rl_tamanio" class="list-group-item list-group-timeline-primary texto-resumen-lateral">
|
||||
Plastificado brillo</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!--//.bs-stepper-header -->
|
||||
|
||||
|
||||
@ -56,6 +56,12 @@ class DatosGenerales {
|
||||
this.excluirRotativa = this.domItem.find("#excluirRotativa");
|
||||
this.prototipo = this.domItem.find("#prototipo");
|
||||
|
||||
this.rl_datos_generales = $(".rl-datos-generales");
|
||||
this.rl_tipo = $("#rl_tipo");
|
||||
this.rl_tamanio = $("#rl_tamanio");
|
||||
this.rl_tiradas = $("#rl_tiradas");
|
||||
this.rl_paginas = $("#rl_paginas");
|
||||
|
||||
this.initValidation();
|
||||
}
|
||||
|
||||
@ -373,10 +379,72 @@ class DatosGenerales {
|
||||
}
|
||||
}).on('core.form.valid', () => {
|
||||
if (this.allowNext)
|
||||
|
||||
stepper.next();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
processMenuLateral() {
|
||||
|
||||
let menu_off = true;
|
||||
this.rl_datos_generales.removeClass('d-none');
|
||||
|
||||
if (this.tiposLibro.filter('.selected').length > 0) {
|
||||
let tipo = String(this.tiposLibro.filter('.selected').attr('id'));
|
||||
tipo = tipo.charAt(0).toUpperCase() + tipo.slice(1);
|
||||
this.rl_tipo.text(tipo);
|
||||
this.rl_tipo.removeClass('d-none');
|
||||
menu_off = false;
|
||||
}
|
||||
else {
|
||||
this.rl_tipo.addClass('d-none');
|
||||
}
|
||||
if (this.checkFormatoPersonalizado.is(':checked')) {
|
||||
let ancho = parseFloat(this.anchoPersonalizado.val());
|
||||
let alto = parseFloat(this.altoPersonalizado.val());
|
||||
if (!isNaN(ancho) && !isNaN(alto)) {
|
||||
this.rl_tamanio.text(ancho + ' x ' + alto);
|
||||
this.rl_tamanio.removeClass('d-none');
|
||||
menu_off = false;
|
||||
}
|
||||
else {
|
||||
this.rl_tamanio.addClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
if (this.papelFormatoId.val() != null) {
|
||||
this.rl_tamanio.text(this.papelFormatoId.find('option:selected').text());
|
||||
this.rl_tamanio.removeClass('d-none');
|
||||
menu_off = false;
|
||||
}
|
||||
else {
|
||||
this.rl_tamanio.addClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
const tiradas = this.getTiradas();
|
||||
if (tiradas.length > 0) {
|
||||
this.rl_tiradas.text(tiradas.join(', '));
|
||||
this.rl_tiradas.removeClass('d-none');
|
||||
}
|
||||
else
|
||||
this.rl_tiradas.addClass('d-none');
|
||||
|
||||
if (this.paginas.val() > 0) {
|
||||
this.rl_paginas.text(this.paginas.val() + " páginas");
|
||||
this.rl_paginas.removeClass('d-none');
|
||||
}
|
||||
else
|
||||
this.rl_paginas.addClass('d-none');
|
||||
|
||||
if (!menu_off)
|
||||
this.rl_datos_generales.removeClass('d-none');
|
||||
|
||||
}
|
||||
|
||||
|
||||
cargarDatos(datos) {
|
||||
|
||||
this.titulo.val(datos.titulo);
|
||||
|
||||
@ -27,6 +27,10 @@ class PresupuestoCliente {
|
||||
this.lc = $("#lc");
|
||||
this.lsc = $("#lsc");
|
||||
|
||||
this.rl_interior = $(".rl-interior");
|
||||
this.rl_cubierta = $(".rl-cubierta");
|
||||
this.rl_sobrecubierta = $(".rl-sobrecubierta");
|
||||
|
||||
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);
|
||||
@ -45,6 +49,10 @@ class PresupuestoCliente {
|
||||
|
||||
this.actualizarTiradasEnvio = false;
|
||||
this.calcularPresupuesto = false;
|
||||
|
||||
if(!window.location.href.includes("edit")) {
|
||||
this.#processResumenLateral();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +92,10 @@ class PresupuestoCliente {
|
||||
|
||||
if (window.location.href.includes("edit")) {
|
||||
|
||||
this.#cargarPresupuesto();
|
||||
setTimeout(() => {
|
||||
this.#cargarPresupuesto();
|
||||
}, 0);
|
||||
|
||||
const successMessage = sessionStorage.getItem('message');
|
||||
if (successMessage) {
|
||||
popSuccessAlert(successMessage);
|
||||
@ -99,6 +110,14 @@ class PresupuestoCliente {
|
||||
}
|
||||
|
||||
|
||||
#processResumenLateral() {
|
||||
|
||||
this.datosGenerales.processMenuLateral();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#checkTiradas() {
|
||||
|
||||
let tiradas = [parseInt(this.datosGenerales.tirada1.val())];
|
||||
@ -135,6 +154,8 @@ class PresupuestoCliente {
|
||||
|
||||
checkForm(event) {
|
||||
|
||||
this.#processResumenLateral();
|
||||
|
||||
if (!this.#checkTiradas()) {
|
||||
return;
|
||||
}
|
||||
@ -192,12 +213,17 @@ class PresupuestoCliente {
|
||||
return;
|
||||
}
|
||||
|
||||
if (nextElement === 'resumen-libro') {
|
||||
$(".rl-item").addClass('d-none');
|
||||
}
|
||||
|
||||
if (currentElement !== 'resumen-libro') {
|
||||
this.#validateCurrentForm(currentElement, nextElement);
|
||||
}
|
||||
else {
|
||||
this.#goToForm(nextElement);
|
||||
}
|
||||
this.#processResumenLateral();
|
||||
}
|
||||
|
||||
#goToForm(form) {
|
||||
@ -682,6 +708,8 @@ class PresupuestoCliente {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function validateForm(formValidation) {
|
||||
try {
|
||||
const validationResult = await formValidation.validate();
|
||||
|
||||
@ -201,7 +201,7 @@ class Resumen {
|
||||
generate() {
|
||||
|
||||
this.titulo.text(this.datosGenerales.titulo.val());
|
||||
this.tipoLibro.text(this.#capitalizeFirstLetter(this.datosGenerales.tiposLibro.filter('.selected').attr('id')));
|
||||
this.tipoLibro.text(this.capitalizeFirstLetter(this.datosGenerales.tiposLibro.filter('.selected').attr('id')));
|
||||
|
||||
let ancho = 0, alto = 0;
|
||||
if (this.datosGenerales.checkFormatoPersonalizado.is(':checked')) {
|
||||
@ -346,7 +346,7 @@ class Resumen {
|
||||
}
|
||||
|
||||
|
||||
#capitalizeFirstLetter(string) {
|
||||
capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
|
||||
@ -472,4 +472,8 @@
|
||||
background-color: var(--white);
|
||||
transform: translate3d(0, 0, 1px) rotateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.texto-resumen-lateral{
|
||||
font-size: 0.9em;
|
||||
}
|
||||
8390
xdebug.log
8390
xdebug.log
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user