corregidos algunos fallos en admin y añadido selector papel y gramaje faja cliente

This commit is contained in:
2025-02-02 12:20:35 +01:00
parent af3eea3e12
commit 264838e62a
11 changed files with 271 additions and 131 deletions

View File

@ -98,6 +98,7 @@ class DatosLibro {
this.anchoSolapasCubierta.on('change', this.changeAnchoSolapasCubierta.bind(this));
this.anchoSolapasSobrecubierta.on('change', this.changeAnchoSolapasSobrecubierta.bind(this));
this.fajaSolapasAncho.on('change', this.changeAnchoSolapasFaja.bind(this));
this.paginas.on('change', this.changePaginas.bind(this));
this.tirada.on('change', this.changeTirada.bind(this));
@ -116,10 +117,13 @@ class DatosLibro {
if (this.faja.prop('checked')) {
this.div_faja.removeClass('d-none');
$('#compFaja').val(1).trigger('change');
$(document).trigger('add-servicio-lineas', 'solapas_faja');
}
else {
this.div_faja.addClass('d-none');
$('#compFaja').val(0).trigger('change');
$(document).trigger('remove-servicio-lineas', 'solapas_faja');
$(document).trigger('remove-servicio-lineas', 'solapas_grandes_faja');
}
}
@ -300,7 +304,7 @@ class DatosLibro {
changeAnchoSolapasSobrecubierta() {
if (this.checkSolapasGrandes('cubierta')) {
if (this.checkSolapasGrandes('sobrecubierta')) {
$(document).trigger('add-servicio-lineas', 'solapas_grandes_sobrecubierta');
}
else {
@ -311,18 +315,38 @@ class DatosLibro {
$('#compSobrecubierta').trigger('change');
}
changeAnchoSolapasFaja() {
if (this.checkSolapasGrandes('faja')) {
$(document).trigger('add-servicio-lineas', 'solapas_grandes_faja');
}
else {
$(document).trigger('remove-servicio-lineas', 'solapas_grandes_faja');
}
// para que se actualice el comparador
if($('#compGramajeFaja').select2('data').length > 0){
$('#compGramajeFaja').trigger('change');
}
}
checkSolapasGrandes(elemento) {
const ancho_libro = 2 * this.getDimensionLibro().ancho;
let ancho_solapas = 0.0;
let lomo = 0.0;
if (elemento == 'cubierta') {
ancho_solapas = 2 * parseFloat($('solapas_ancho').val());
lomo = parseFloat($('lomo_cubierta').val());
ancho_solapas = 2 * parseFloat($('#solapas_ancho').val());
lomo = parseFloat($('#lomo_cubierta').val());
}
else if (elemento == 'sobrecubierta') {
ancho_solapas = 2 * parseFloat($('solapas_ancho_sobrecubierta').val());
lomo = parseFloat($('lomo_sobrecubierta').val());
ancho_solapas = 2 * parseFloat($('#solapas_ancho_sobrecubierta').val());
lomo = parseFloat($('#lomo_sobrecubierta').val());
}
else if (elemento == 'faja') {
ancho_solapas = 2 * parseFloat($('#faja_solapas_ancho').val());
lomo = parseFloat($('#lomo_sobrecubierta').val());
}
else
return false;