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:
@ -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();
|
||||
}
|
||||
|
||||
@ -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