Cambios parciales

This commit is contained in:
unknown
2025-04-21 15:39:02 +02:00
parent 753aafe05d
commit 67a7cda036
2 changed files with 21 additions and 53 deletions

View File

@ -139,7 +139,6 @@
</div> </div>
</div> </div>
<div class="row comp-color-selected"> <div class="row comp-color-selected">
<div class="col-md-12 col-lg-2 px-4"> <div class="col-md-12 col-lg-2 px-4">
<p> <p>
@ -176,7 +175,6 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12 col-lg-2 px-4"> <div class="col-md-12 col-lg-2 px-4">
<p> <p>

View File

@ -23,7 +23,7 @@ class Catalogo {
alto: () => this.getDimensionLibro().alto, alto: () => this.getDimensionLibro().alto,
sopalas: 0, sopalas: 0,
lomo: 0, lomo: 0,
tipo: () => $('#isHq').val() ? 'negrohq' : 'negro', tipo: () => this.tipo_impresion.val().includes('hq') ? 'negrohq' : 'negro',
}); });
this.compPapelNegroPod = new ClassSelect($("#compPapelNegroPod"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false, this.compPapelNegroPod = new ClassSelect($("#compPapelNegroPod"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false,
@ -34,10 +34,9 @@ class Catalogo {
alto: () => this.getDimensionLibro().alto, alto: () => this.getDimensionLibro().alto,
sopalas: 0, sopalas: 0,
lomo: 0, lomo: 0,
tipo: () => $('#isHq').val() ? 'negrohq' : 'negro', tipo: () => this.tipo_impresion.val().includes('hq') ? 'negrohq' : 'negro',
}); });
this.compGramajeNegro = new ClassSelect($('#compGramajeNegro'), '/presupuestoadmin/papelgramaje', 'Seleccione un gramaje', false, this.compGramajeNegro = new ClassSelect($('#compGramajeNegro'), '/presupuestoadmin/papelgramaje', 'Seleccione un gramaje', false,
{ {
tipo_impresion: () => this.encuadernacion.getVal(), tipo_impresion: () => this.encuadernacion.getVal(),
@ -47,8 +46,9 @@ class Catalogo {
alto: () => this.getDimensionLibro().alto, alto: () => this.getDimensionLibro().alto,
sopalas: 0, sopalas: 0,
lomo: 0, lomo: 0,
tipo: () => $('#isHq').val() ? 'negrohq' : 'negro', tipo: () => this.tipo_impresion.val().includes('hq') ? 'negrohq' : 'negro',
}); });
this.compPapelColor = new ClassSelect($("#compPapelColor"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false, this.compPapelColor = new ClassSelect($("#compPapelColor"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false,
{ {
tipo_impresion: () => this.encuadernacion.getVal(), tipo_impresion: () => this.encuadernacion.getVal(),
@ -57,8 +57,9 @@ class Catalogo {
alto: () => this.getDimensionLibro().alto, alto: () => this.getDimensionLibro().alto,
sopalas: 0, sopalas: 0,
lomo: 0, lomo: 0,
tipo: () => $('#isHq').val() ? 'colorhq' : 'color', tipo: () => this.tipo_impresion.val().includes('hq') ? 'colorhq' : 'color',
}); });
this.compGramajeColor = new ClassSelect($('#compGramajeColor'), '/presupuestoadmin/papelgramaje', 'Seleccione un gramaje', false, this.compGramajeColor = new ClassSelect($('#compGramajeColor'), '/presupuestoadmin/papelgramaje', 'Seleccione un gramaje', false,
{ {
tipo_impresion: () => this.encuadernacion.getVal(), tipo_impresion: () => this.encuadernacion.getVal(),
@ -68,8 +69,9 @@ class Catalogo {
alto: () => this.getDimensionLibro().alto, alto: () => this.getDimensionLibro().alto,
sopalas: 0, sopalas: 0,
lomo: 0, lomo: 0,
tipo: () => $('#isHq').val() ? 'colorhq' : 'color', tipo: () => this.tipo_impresion.val().includes('hq') ? 'colorhq' : 'color',
}); });
this.compPapelCubierta = new ClassSelect($("#compPapelCubierta"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false, this.compPapelCubierta = new ClassSelect($("#compPapelCubierta"), '/presupuestoadmin/papelgenerico', "Seleccione un papel", false,
{ {
tipo_impresion: this.encuadernacion.getVal(), tipo_impresion: this.encuadernacion.getVal(),
@ -149,7 +151,7 @@ class Catalogo {
this.cliente.init(); this.cliente.init();
this.tipo_impresion.select2(); this.tipo_impresion.select2();
this.caras_cubierta.select2(); this.caras_cubierta.select2();
this.compPaginasSobrecubierta .select2(); this.compPaginasSobrecubierta.select2();
this.encuadernacion.init(); this.encuadernacion.init();
@ -165,7 +167,7 @@ class Catalogo {
this.acabadoCubierta.init(); this.acabadoCubierta.init();
this.acabadosSobrecubierta.init(); this.acabadosSobrecubierta.init();
// Al cargar la página // Al cargar la página
this.toggleSobrecubiertaFields(); this.toggleSobrecubiertaFields();
@ -197,57 +199,25 @@ class Catalogo {
updateOpcionesComparador() { updateOpcionesComparador() {
$('.comp_negro_items').off('change'); $('.comp_negro_items').off('change');
$('.comp_negrohq_items').off('change');
$('.comp_color_items').off('change'); $('.comp_color_items').off('change');
$('.comp_colorhq_items').off('change');
const selValue = this.tipo_impresion.val(); const selValue = this.tipo_impresion.val();
const elements_negro = $('.comp-negro-selected'); const elements_negro = $('.comp-negro-selected');
const elements_negrohq = $('.comp-negrohq-selected');
const elements_color = $('.comp-color-selected'); const elements_color = $('.comp-color-selected');
const elements_colorhq = $('.comp-colorhq-selected');
if (selValue.includes("hq")) { if (selValue.includes('color')) {
Array.from(elements_negro).forEach(element => {
$(element).addClass('d-none');
});
Array.from(elements_color).forEach(element => { Array.from(elements_color).forEach(element => {
$(element).addClass('d-none');
});
if (selValue.includes('color')) {
Array.from(elements_colorhq).forEach(element => {
$(element).removeClass('d-none');
});
}
else {
Array.from(elements_colorhq).forEach(element => {
$(element).addClass('d-none');
});
}
Array.from(elements_negrohq).forEach(element => {
$(element).removeClass('d-none'); $(element).removeClass('d-none');
}); });
} }
else { else {
Array.from(elements_negrohq).forEach(element => { Array.from(elements_color).forEach(element => {
$(element).addClass('d-none'); $(element).addClass('d-none');
}); });
Array.from(elements_colorhq).forEach(element => {
$(element).addClass('d-none');
});
if (selValue.includes('color')) {
Array.from(elements_color).forEach(element => {
$(element).removeClass('d-none');
});
}
else {
Array.from(elements_color).forEach(element => {
$(element).addClass('d-none');
});
}
Array.from(elements_negro).forEach(element => {
$(element).removeClass('d-none');
});
} }
Array.from(elements_negro).forEach(element => {
$(element).removeClass('d-none');
});
} }
@ -259,12 +229,12 @@ class Catalogo {
} }
toggleSobrecubiertaFields() { toggleSobrecubiertaFields() {
if (this.compPaginasSobrecubierta.val() === '1') { if (this.compPaginasSobrecubierta.val() === '1') {
this.sobrecubiertaItems.prop('disabled', false).trigger('change.select2'); this.sobrecubiertaItems.prop('disabled', false).trigger('change.select2');
} else { } else {
this.sobrecubiertaItems.prop('disabled', true).trigger('change.select2'); this.sobrecubiertaItems.prop('disabled', true).trigger('change.select2');
}
} }
}
} }