mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/cargando_comparador' into 'main'
solucionado el problema See merge request jjimenez/safekat!525
This commit is contained in:
@ -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,7 +358,6 @@ 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);
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -1089,7 +1089,7 @@ class Comparador {
|
||||
for (let element of papeles) {
|
||||
if (element.getVal() == 0 || element.getVal() == null) {
|
||||
const tipo = element.item.attr('id').split('Papel')[1];
|
||||
if ($('#compPaginas' + tipo).val() > 0) {
|
||||
if ($('#compPaginas' + tipo).val() > 0 && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
@ -1099,7 +1099,7 @@ class Comparador {
|
||||
|
||||
if (element.getVal() == 0 || element.getVal() == null) {
|
||||
const tipo = element.item.attr('id').split('Gramaje')[1];
|
||||
if ($('#compPaginas' + tipo).val() > 0) {
|
||||
if ($('#compPaginas' + tipo).val() > 0 && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccioneGramaje, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
@ -1131,11 +1131,11 @@ class Comparador {
|
||||
|
||||
}
|
||||
else if (uso == 'cubierta') {
|
||||
if (this.papelCubierta.getVal() == 0 || this.papelCubierta.getVal() == null) {
|
||||
if ((this.papelCubierta.getVal() == 0 || this.papelCubierta.getVal() == null) && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
if (this.gramajeCubierta.getVal() == 0 || this.gramajeCubierta.getVal() == null) {
|
||||
if ((this.gramajeCubierta.getVal() == 0 || this.gramajeCubierta.getVal() == null) && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccioneGramaje, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
@ -1147,11 +1147,11 @@ class Comparador {
|
||||
}
|
||||
|
||||
else if (uso == 'sobrecubierta') {
|
||||
if (this.papelSobrecubierta.getVal() == 0 || this.papelSobrecubierta.getVal() == null) {
|
||||
if ((this.papelSobrecubierta.getVal() == 0 || this.papelSobrecubierta.getVal() == null) && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
if (this.gramajeSobrecubierta.getVal() == 0 || this.gramajeSobrecubierta.getVal() == null) {
|
||||
if ((this.gramajeSobrecubierta.getVal() == 0 || this.gramajeSobrecubierta.getVal() == null) && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccioneGramaje, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
@ -1163,11 +1163,11 @@ class Comparador {
|
||||
}
|
||||
|
||||
else if (uso == 'faja') {
|
||||
if (this.papelFaja.getVal() == 0 || this.papelFaja.getVal() == null) {
|
||||
if ((this.papelFaja.getVal() == 0 || this.papelFaja.getVal() == null) && this.faja.getVal()>0 && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
if (this.gramajeFaja.getVal() == 0 || this.gramajeFaja.getVal() == null) {
|
||||
if ((this.gramajeFaja.getVal() == 0 || this.gramajeFaja.getVal() == null) && this.faja.getVal()>0 && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccioneGramaje, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
@ -1180,11 +1180,11 @@ class Comparador {
|
||||
}
|
||||
|
||||
else if (uso == 'guardas') {
|
||||
if (this.papelGuardas.getVal() == 0 || this.papelGuardas.getVal() == null) {
|
||||
if ((this.papelGuardas.getVal() == 0 || this.papelGuardas.getVal() == null) && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccionePapel, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
if (this.gramajeGuardas.getVal() == 0 || this.gramajeGuardas.getVal() == null) {
|
||||
if ((this.gramajeGuardas.getVal() == 0 || this.gramajeGuardas.getVal() == null) && !this.cargando) {
|
||||
popErrorAlert(window.language.Presupuestos.errores.seleccioneGramaje, 'divAlarmasComparador');
|
||||
return { error: true, data: {} };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user