Merge branch 'fix/cargando_comparador' into 'main'

solucionado el problema

See merge request jjimenez/safekat!525
This commit is contained in:
2025-02-06 10:16:43 +00:00
2 changed files with 25 additions and 18 deletions

View File

@ -33,14 +33,14 @@ class PresupuestoAdminEdit {
this.datosGenerales = new DatosGenerales(this.domItem.find('#accordionDatosPresupuestoTip'));
this.datosLibro = new DatosLibro(this.domItem.find('#accordionDatosLibroTip'),
()=>{return this.cargandoPresupuesto},
() => { return this.cargandoPresupuesto },
{
checkPaginasPresupuesto: this.checkPaginasPresupuesto,
getDimensionLibro: this.getDimensionLibro,
calcularSolapas: this.calcularSolapas.bind(this),
});
this.comparador = new Comparador(this.domItem.find('#accordionDatosPresupuestoClienteTip'),
() => {return this.cargandoPresupuesto},
() => { return this.cargandoPresupuesto },
{
getDimensionLibro: this.getDimensionLibro,
});
@ -60,7 +60,7 @@ class PresupuestoAdminEdit {
this.guardar = $('#saveForm');
this.calcularPresupuesto = false;
this.configUploadDropzone = {
domElement: '#dropzone-presupuesto-admin-files',
nameId: "presupuesto_id",
@ -213,7 +213,7 @@ class PresupuestoAdminEdit {
}
if (this.datosLibro.tamanioPersonalizado.prop('checked')) {
datos.papel_formato_ancho = this.datosLibro.anchoPersonalizado.val(),
datos.papel_formato_alto = this.datosLibro.altoPersonalizado.val()
datos.papel_formato_alto = this.datosLibro.altoPersonalizado.val()
}
datos.selectedTirada = this.datosLibro.tirada.val();
datos.acabado_cubierta_id = this.datosLibro.acabadoCubierta.getVal();
@ -251,7 +251,7 @@ class PresupuestoAdminEdit {
datos.solapas_sobrecubierta = this.datosLibro.solapasSobrecubierta.is(':checked') ? 1 : 0;
datos.solapas_ancho_sobrecubierta = this.datosLibro.anchoSolapasSobrecubierta.val();
datos.faja_color = this.datosLibro.faja.prop('checked') ? 1: 0;
datos.faja_color = this.datosLibro.faja.prop('checked') ? 1 : 0;
datos.solapas_ancho_faja_color = this.datosLibro.fajaSolapasAncho.val();
datos.alto_faja_color = this.datosLibro.fajaAlto.val();
@ -305,7 +305,7 @@ class PresupuestoAdminEdit {
if (self.cargandoPresupuesto == false) {
self.comparador.updateComparador();
// Ejecutar los pasos de forma secuencial si están habilitados
if (update_lineas) {
$(document).trigger('update-lineas-presupuesto');
@ -339,6 +339,8 @@ class PresupuestoAdminEdit {
const self = this;
this.cargandoPresupuesto = true;
self.comparador.cargando = true;
self.datosLibro.cargando = true;
$('#loader').modal('show');
let id = window.location.href.split("/").pop()
@ -356,11 +358,10 @@ class PresupuestoAdminEdit {
self.POD.val(response.data.POD);
self.calcularPresupuesto = false;
self.comparador.cargando = true;
self.datosGenerales.cargarDatos(response.data.datosGenerales);
self.datosLibro.cargarDatos(response.data.datosLibro);
self.lineasPresupuesto.cargarDatos(response.data.lineasPresupuesto);
self.servicios.cargar(response.data.servicios);
@ -385,6 +386,10 @@ class PresupuestoAdminEdit {
self.calcularPresupuesto = true;
self.cargandoPresupuesto = false;
self.datosLibro.cargando = false;
self.comparador.cargando = false;
self.comparador.updateComparador();
}
@ -409,6 +414,8 @@ class PresupuestoAdminEdit {
$('#loader').modal('hide');
this.calcularPresupuesto = true;
self.cargandoPresupuesto = false;
self.datosLibro.cargando = false;
self.comparador.cargando = false;
}
).get();
}