primera version del calculo del lomo

This commit is contained in:
2024-12-26 18:29:32 +01:00
parent 93d3793ef9
commit a29df443bd
7 changed files with 155 additions and 13 deletions

View File

@ -113,6 +113,7 @@ class PresupuestoCliente {
$(".calcular-presupuesto").on('change', this.checkForm.bind(this));
$(".calcular-solapas").on('change', this.calcularSolapas.bind(this));
$(".calcular-lomo").on('change', this.checkLomoInterior.bind(this));
}
@ -180,6 +181,29 @@ class PresupuestoCliente {
}
}
checkLomoInterior() {
/* Limites lomo */
this.#getDatos(false, true);
if (Object.values(this.datos).every(this.#isValidDataForm)) {
new Ajax('/presupuestocliente/checklomo',
this.datos,
{},
(response) => {
if (response === null || response === undefined || response === "") {
console.log("Error en el calculo del lomo interior.");
return;
}
if(response.errors.status == 1){
popErrorAlert('' + response.errors.value, "sk-alert", false);
}
console.log(response.errors);
},
() => { }
).post();
}
}
checkForm(event) {
this.#processResumenLateral();
@ -526,9 +550,6 @@ class PresupuestoCliente {
}
}
popAlert2Hide();
if (response.tiradas && response.tiradas.length) {
let tiradas = { ...response.tiradas };
@ -536,6 +557,8 @@ class PresupuestoCliente {
tiradas.sort((a, b) => a - b);
this.divTiradasPrecios.empty();
popAlert2Hide();
for (let i = 0; i < tiradas.length; i++) {
new tarjetaTiradasPrecio(
this.divTiradasPrecios,
@ -550,7 +573,7 @@ class PresupuestoCliente {
}
}
this.lc.val(parseFloat(response.info.lomo_cubierta).toFixed(2));
this.lsc.val(parseFloat(response.info.lomo_sobrecubierta).toFixed(2));
setTimeout(() => {