From 67a7cda036db7d2c95445a6fa187c95731e531c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Apr 2025 15:39:02 +0200 Subject: [PATCH] Cambios parciales --- .../catalogo/_configuracionLibroFormItems.php | 2 - .../js/safekat/pages/catalogo/catalogo.js | 72 ++++++------------- 2 files changed, 21 insertions(+), 53 deletions(-) diff --git a/ci4/app/Views/themes/vuexy/form/catalogo/_configuracionLibroFormItems.php b/ci4/app/Views/themes/vuexy/form/catalogo/_configuracionLibroFormItems.php index 40a26cbf..38856b25 100644 --- a/ci4/app/Views/themes/vuexy/form/catalogo/_configuracionLibroFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/catalogo/_configuracionLibroFormItems.php @@ -139,7 +139,6 @@ -

@@ -176,7 +175,6 @@

-

diff --git a/httpdocs/assets/js/safekat/pages/catalogo/catalogo.js b/httpdocs/assets/js/safekat/pages/catalogo/catalogo.js index 297dc533..932d8053 100644 --- a/httpdocs/assets/js/safekat/pages/catalogo/catalogo.js +++ b/httpdocs/assets/js/safekat/pages/catalogo/catalogo.js @@ -23,7 +23,7 @@ class Catalogo { alto: () => this.getDimensionLibro().alto, sopalas: 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, @@ -34,10 +34,9 @@ class Catalogo { alto: () => this.getDimensionLibro().alto, sopalas: 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, { tipo_impresion: () => this.encuadernacion.getVal(), @@ -47,8 +46,9 @@ class Catalogo { alto: () => this.getDimensionLibro().alto, sopalas: 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, { tipo_impresion: () => this.encuadernacion.getVal(), @@ -57,8 +57,9 @@ class Catalogo { alto: () => this.getDimensionLibro().alto, sopalas: 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, { tipo_impresion: () => this.encuadernacion.getVal(), @@ -68,8 +69,9 @@ class Catalogo { alto: () => this.getDimensionLibro().alto, sopalas: 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, { tipo_impresion: this.encuadernacion.getVal(), @@ -149,7 +151,7 @@ class Catalogo { this.cliente.init(); this.tipo_impresion.select2(); this.caras_cubierta.select2(); - this.compPaginasSobrecubierta .select2(); + this.compPaginasSobrecubierta.select2(); this.encuadernacion.init(); @@ -165,7 +167,7 @@ class Catalogo { this.acabadoCubierta.init(); this.acabadosSobrecubierta.init(); - + // Al cargar la página this.toggleSobrecubiertaFields(); @@ -197,57 +199,25 @@ class Catalogo { updateOpcionesComparador() { $('.comp_negro_items').off('change'); - $('.comp_negrohq_items').off('change'); $('.comp_color_items').off('change'); - $('.comp_colorhq_items').off('change'); const selValue = this.tipo_impresion.val(); const elements_negro = $('.comp-negro-selected'); - const elements_negrohq = $('.comp-negrohq-selected'); const elements_color = $('.comp-color-selected'); - const elements_colorhq = $('.comp-colorhq-selected'); - if (selValue.includes("hq")) { - Array.from(elements_negro).forEach(element => { - $(element).addClass('d-none'); - }); + + if (selValue.includes('color')) { 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'); }); } else { - Array.from(elements_negrohq).forEach(element => { + Array.from(elements_color).forEach(element => { $(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() { - if (this.compPaginasSobrecubierta.val() === '1') { - this.sobrecubiertaItems.prop('disabled', false).trigger('change.select2'); - } else { - this.sobrecubiertaItems.prop('disabled', true).trigger('change.select2'); + if (this.compPaginasSobrecubierta.val() === '1') { + this.sobrecubiertaItems.prop('disabled', false).trigger('change.select2'); + } else { + this.sobrecubiertaItems.prop('disabled', true).trigger('change.select2'); + } } -} }