modificados todos los buscadores de papeles y gramajes para ver el alto y el ancho (admin y cliente)

This commit is contained in:
2025-01-28 18:47:20 +01:00
parent 2df3f5914e
commit e87e278dd0
8 changed files with 249 additions and 25 deletions

View File

@ -32,8 +32,12 @@ class PresupuestoAdminEdit {
this.datosLibro = new DatosLibro(this.domItem.find('#accordionDatosLibroTip'),
{
checkPaginasPresupuesto: this.checkPaginasPresupuesto,
getDimensionLibro: this.getDimensionLibro,
});
this.comparador = new Comparador(this.domItem.find('#accordionDatosPresupuestoClienteTip'),
{
getDimensionLibro: this.getDimensionLibro,
});
this.comparador = new Comparador(this.domItem.find('#accordionDatosPresupuestoClienteTip'));
this.lineasPresupuesto = new LineasPresupuesto(this.domItem.find('#accordionLineasPresupuestoTip'),
{
getDimensionLibro: this.getDimensionLibro,

View File

@ -4,10 +4,12 @@ import Ajax from '../../../components/ajax.js';
class Comparador {
constructor(domItem) {
constructor(domItem, functions = {}) {
this.domItem = domItem;
this.getDimensionLibro = functions.getDimensionLibro;
this.tipo_impresion_id = parseInt($('#tipo_impresion_id').val());
this.csrf_token = getToken();
@ -23,6 +25,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'negro',
});
@ -33,6 +39,10 @@ class Comparador {
papel_generico: () => this.papelNegro.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'negro',
});
this.paginasColor = $('#compPaginasColor');
@ -42,6 +52,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'color',
});
@ -52,6 +66,10 @@ class Comparador {
papel_generico: () => this.papelColor.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'color',
});
@ -62,6 +80,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'negrohq',
});
@ -72,6 +94,10 @@ class Comparador {
papel_generico: () => this.papelNegrohq.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'negrohq',
});
@ -82,6 +108,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'colorhq',
});
@ -92,6 +122,10 @@ class Comparador {
papel_generico: () => this.papelColorhq.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'colorhq',
});
@ -102,6 +136,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
lomo: () => $('#lomo_cubierta').val(),
tipo: 'colorhq',
uso: 'cubierta',
});
@ -112,6 +150,10 @@ class Comparador {
papel_generico: () => this.papelCubierta.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
lomo: () => $('#lomo_cubierta').val(),
tipo: 'colorhq',
uso: 'cubierta',
});
@ -123,6 +165,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
lomo: () => $('#lomo_sobrecubierta').val(),
tipo: 'colorhq',
uso: 'sobrecubierta',
});
@ -133,6 +179,10 @@ class Comparador {
papel_generico: () => this.papelSobrecubierta.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: () => $('#solapas').prop('checked') ? $('#solapas_ancho').val() : 0,
lomo: () => $('#lomo_sobrecubierta').val(),
tipo: 'colorhq',
uso: 'sobrecubierta',
});
@ -145,6 +195,10 @@ class Comparador {
[this.csrf_token]: this.csrf_hash,
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'colorhq',
uso: 'guardas',
});
@ -155,6 +209,10 @@ class Comparador {
papel_generico: () => this.papelCubierta.getVal(),
tipo_impresion: this.tipo_impresion_id,
tirada: () => $('#tirada').val(),
ancho: () => this.getDimensionLibro().ancho,
alto: () => this.getDimensionLibro().alto,
sopalas: 0,
lomo: 0,
tipo: 'colorhq',
uso: 'guardas',
});
@ -245,7 +303,7 @@ class Comparador {
this.papelSobrecubierta.onChange(() => self.gramajeSobrecubierta.empty());
this.sobrecubierta.on('change', () => {
if (this.sobrecubierta.select2('data')[0].id == 1) {
if($('#solapas_sobrecubierta').prop('checked') == false){
if ($('#solapas_sobrecubierta').prop('checked') == false) {
this.sobrecubierta.val(0);
popErrorAlert(window.language.Presupuestos.errores.error_sobrecubierta_sin_solapas, 'divAlarmasComparador')
}
@ -1492,7 +1550,7 @@ class Comparador {
}
}
catch (e) {
}
$.extend(data, bn_obj);
}

View File

@ -8,6 +8,7 @@ class DatosLibro {
this.domItem = domItem;
this.checkPaginasPresupuesto = functions.checkPaginasPresupuesto;
this.getDimensionLibro = functions.getDimensionLibro;
this.csrf_token = getToken();
this.csrf_hash = $('#mainContainer').find('input[name="' + this.csrf_token + '"]').val();

View File

@ -33,6 +33,12 @@ class DisenioCubierta {
[this.csrf_token]: this.csrf_hash,
tipo: 'colorhq',
cubierta: 1,
ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
solapas: () => {return $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val()},
lomo: () => {return $('#lc').val()},
tapa_dura: () => {return this.tapaBlanda.hasClass("selected") ? 0 : 1},
tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
}
);
@ -758,7 +764,12 @@ class DisenioCubierta {
[this.csrf_token]: this.csrf_hash,
tipo: 'colorhq',
cubierta: 1,
tapa_dura: tapa_dura
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
lomo: $('#lc').val(),
tapa_dura: tapa_dura,
tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
},
{},
(response) => { this.fillPapeles(response); },
@ -780,7 +791,12 @@ class DisenioCubierta {
papel: this.papelCubierta,
tipo: 'colorhq',
cubierta: 1,
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
lomo: $('#lc').val(),
tapa_dura: tapa_dura,
tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
},
{},
this.fillGramajes.bind(context),
@ -907,7 +923,12 @@ class DisenioCubierta {
papel: papel,
tipo: 'colorhq',
cubierta: 1,
tapa_dura: tapa_dura
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: $('#solapas_cubierta').hasClass("d-none") ? 0 : $('#solapas_cubierta').val(),
lomo: $('#lc').val(),
tapa_dura: tapa_dura,
tirada: this.presupuestoCliente.datosGenerales.getTiradas()[0],
},
{},
this.fillGramajes.bind(context),

View File

@ -57,6 +57,11 @@ class DisenioInterior {
{
[this.csrf_token]: this.csrf_hash,
tipo: this.getTipoImpresion(),
tirada: () => {return $('#tirada').val()},
ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
solapas: 0,
lomo: 0,
cubierta: 0,
}
);
@ -67,6 +72,11 @@ class DisenioInterior {
{
[this.csrf_token]: this.csrf_hash,
tipo: this.getTipoImpresionColor(),
tirada: () => {return $('#tirada').val()},
ancho: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho},
alto: () => {return this.presupuestoCliente.datosGenerales.getDimensionLibro().alto},
solapas: 0,
lomo: 0,
cubierta: 0,
}
);
@ -116,6 +126,10 @@ class DisenioInterior {
[this.csrf_token]: this.csrf_hash,
tirada: $('#tirada').val(),
tipo: this.getTipoImpresion(),
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: 0,
lomo: 0,
cubierta: 0,
},
{},
@ -131,6 +145,10 @@ class DisenioInterior {
[this.csrf_token]: this.csrf_hash,
tirada: $('#tirada').val(),
tipo: this.getTipoImpresion(),
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: 0,
lomo: 0,
cubierta: 0,
},
{},
@ -888,6 +906,10 @@ class DisenioInterior {
tirada: $('#tirada').val(),
papel: papel,
tipo: tipo,
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: 0,
lomo: 0,
cubierta: 0,
},
{},
@ -916,6 +938,10 @@ class DisenioInterior {
tirada: $('#tirada').val(),
papel: this.papelInterior,
tipo: tipo,
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: 0,
lomo: 0,
cubierta: 0,
},
{},
@ -962,6 +988,10 @@ class DisenioInterior {
tirada: $('#tirada').val(),
papel: papel,
tipo: tipo,
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: 0,
lomo: 0,
cubierta: 0,
},
{},
@ -986,6 +1016,10 @@ class DisenioInterior {
tirada: $('#tirada').val(),
papel: this.papelInterior,
tipo: tipo,
ancho: this.presupuestoCliente.datosGenerales.getDimensionLibro().ancho,
alto: this.presupuestoCliente.datosGenerales.getDimensionLibro().alto,
solapas: 0,
lomo: 0,
cubierta: 0,
},
{},