mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
correjidas cosas en cuanto a mostrar lomo. También añadido calculo de paginas pares
This commit is contained in:
@ -211,13 +211,23 @@ class DatosGenerales {
|
||||
if (this.paginasColor.val() == '' || isNaN(this.paginasColor.val()) || parseInt(this.paginasColor.val()) < 0) {
|
||||
this.errores.push(window.translations["validation"].paginasColor);
|
||||
this.paginasColor.addClass('is-invalid');
|
||||
} else {
|
||||
}
|
||||
else if (parseInt(this.paginasColor.val()) % 2 != 0) {
|
||||
this.errores.push(window.translations["validation"].paginas_pares);
|
||||
this.paginasColor.addClass('is-invalid');
|
||||
}
|
||||
else {
|
||||
this.paginasColor.removeClass('is-invalid');
|
||||
}
|
||||
if (this.paginasNegro.val() == '' || isNaN(this.paginasNegro.val()) || parseInt(this.paginasNegro.val()) < 0) {
|
||||
this.errores.push(window.translations["validation"].paginasNegro);
|
||||
this.paginasNegro.addClass('is-invalid');
|
||||
} else {
|
||||
}
|
||||
else if (parseInt(this.paginasNegro.val()) % 2 != 0) {
|
||||
this.errores.push(window.translations["validation"].paginas_pares);
|
||||
this.paginasNegro.addClass('is-invalid');
|
||||
}
|
||||
else {
|
||||
this.paginasNegro.removeClass('is-invalid');
|
||||
}
|
||||
if (this.paginas.val() == '' || isNaN(this.paginas.val()) || parseInt(this.paginas.val()) <= 0) {
|
||||
@ -637,6 +647,8 @@ class DatosGenerales {
|
||||
}
|
||||
}
|
||||
|
||||
this.validate(false);
|
||||
|
||||
// Para recalcular el presupuesto
|
||||
$('#paginas').trigger('change');
|
||||
}
|
||||
@ -680,6 +692,19 @@ class DatosGenerales {
|
||||
this.domItem.find('#grapado').show();
|
||||
}
|
||||
|
||||
if( totalPaginas < 20){
|
||||
this.domItem.find('#espiral').removeClass('selected');
|
||||
this.domItem.find('#espiral').find('.image-presupuesto').removeClass('selected');
|
||||
this.domItem.find('#espiral').hide();
|
||||
this.domItem.find('#wireo').removeClass('selected');
|
||||
this.domItem.find('#wireo').find('.image-presupuesto').removeClass('selected');
|
||||
this.domItem.find('#wireo').hide();
|
||||
}
|
||||
else {
|
||||
this.domItem.find('#espiral').show();
|
||||
this.domItem.find('#wireo').show();
|
||||
}
|
||||
|
||||
// Se configura dependiento si hay color o no
|
||||
const lastLayoutColor = $('#negroEstandar').hasClass('d-none');
|
||||
if (paginasColor == 0) {
|
||||
|
||||
@ -186,8 +186,39 @@ class PresupuestoCliente {
|
||||
|
||||
this.#processResumenLateral();
|
||||
|
||||
$(".divTiradasPrecio").empty();
|
||||
|
||||
if (this.calcularPresupuesto) {
|
||||
|
||||
const element = $('.fv-plugins-bootstrap5.fv-plugins-framework.active');
|
||||
|
||||
switch (element.attr('id')) {
|
||||
case 'datos-generales':
|
||||
if(!this.datosGenerales.validate(false)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'interior-libro':
|
||||
if(!this.disenioInterior.validate(false)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'cubierta-libro':
|
||||
if(!this.disenioCubierta.validate(false)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'direcciones-libro':
|
||||
if(!this.direcciones.validate(false)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (event.target.id === 'divDirecciones') {
|
||||
this.actualizarTiradasEnvio = false;
|
||||
|
||||
@ -209,7 +240,7 @@ class PresupuestoCliente {
|
||||
|
||||
// buscar elementos dentro de #mainContainer que tengan la clase is-invalid
|
||||
const invalidElements = $('#mainContainer').find('.is-invalid');
|
||||
if(invalidElements.length > 0) {
|
||||
if (invalidElements.length > 0) {
|
||||
// si hay elementos inválidos, no se procede con el
|
||||
return;
|
||||
}
|
||||
@ -552,6 +583,9 @@ class PresupuestoCliente {
|
||||
|
||||
this.lc.val(parseFloat(response.info.lomo_cubierta).toFixed(2));
|
||||
this.lsc.val(parseFloat(response.info.lomo_sobrecubierta).toFixed(2));
|
||||
|
||||
this.disenioCubierta.processMenuLateral();
|
||||
|
||||
$('.is-invalid').removeClass('is-invalid');
|
||||
const skAlert = document.getElementById('sk-alert');
|
||||
skAlert.innerHTML = '';
|
||||
|
||||
Reference in New Issue
Block a user