corregidos errores

This commit is contained in:
2024-10-24 08:50:13 +02:00
parent 3dd9f8f7e3
commit 0f00649f99
4 changed files with 371 additions and 301 deletions

View File

@ -79,6 +79,7 @@ class PresupuestoCliente {
}
$(".calcular-presupuesto").on('change', this.checkForm.bind(this));
}
@ -145,9 +146,21 @@ class PresupuestoCliente {
if (datos_to_check.direcciones) {
delete datos_to_check.direcciones;
}
if (datos_to_check.posPaginasColor) {
if (datos_to_check.posPaginasColor == "" || datos_to_check.posPaginasColor == null) {
delete datos_to_check.posPaginasColor;
}
if(datos_to_check.cubierta.acabados.barniz == undefined){
delete datos_to_check.cubierta.acabados.barniz;
}
if(datos_to_check.cubierta.acabados.plastificado == undefined){
delete datos_to_check.cubierta.acabados.plastificado;
}
if(datos_to_check.cubierta.acabados.estampado == undefined){
delete datos_to_check.cubierta.acabados.estampado;
}
if(datos_to_check.sobrecubierta.plastificado == undefined){
delete datos_to_check.sobrecubierta.plastificado;
}
if (Object.values(datos_to_check).every(this.#isValidDataForm)) {
try {
@ -352,7 +365,7 @@ class PresupuestoCliente {
$(`#containerTiradasEnvios .tirada-envio input[tirada="${response.tiradas[0]}"]`).trigger('click');
}, 0);
}
$('#loader').modal('hide');
// DEBUG
//console.log(response);
}
@ -420,7 +433,6 @@ class PresupuestoCliente {
cubierta: {
tipoCubierta: this.disenioCubierta.disenioCubierta.filter('.selected').attr('id'),
lomoRedondo: this.disenioCubierta.disenioCubierta.filter('.selected').attr('id').includes('Redondo') ? 1 : 0,
papelCubierta: this.disenioCubierta.getPapel(),
gramajeCubierta: this.disenioCubierta.getGramaje(),
cabezada: this.disenioCubierta.getCabezada(),
@ -438,6 +450,10 @@ class PresupuestoCliente {
'prototipo': this.datosGenerales.prototipo.is(':checked') ? 1 : 0,
},
};
let lomoRedondo = 0;
if(this.disenioCubierta.disenioCubierta.filter('.selected').length > 0)
lomoRedondo = this.disenioCubierta.disenioCubierta.filter('.selected').attr('id').includes('Redondo') ? 1 : 0;
this.datos.cubierta.lomoRedondo = lomoRedondo;
if (this.datos.tipo == "cosido") {
this.datos.paginasCuadernillo = this.datosGenerales.paginasCuadernillo.val();