trabajando en cubierta

This commit is contained in:
2025-06-25 10:06:21 +02:00
parent ff9ce9eda2
commit 83753d1784
3 changed files with 33 additions and 9 deletions

View File

@ -200,7 +200,7 @@
<div class="row col-sm-2 mb-3 d-flex flex-column align-items-center sobrecubierta-items">
<div class="form-check form-switch mb-2">
<input class="calcular-presupuesto form-check-input" type="checkbox" id="addSobrecubierta"
<input class="form-check-input" type="checkbox" id="addSobrecubierta"
name="add_sobrecubierta" value="1">
<label class="form-check-label" for="addSobrecubierta"><?= lang('Presupuestos.sobrecubierta') ?></label>
</div>
@ -211,7 +211,7 @@
<label for="papelSobrecubierta" class="form-label">
<?= lang('Presupuestos.papelSobrecubierta') ?>
</label>
<select class="form-select select2bs2 calcular-presupuesto" id="papelSobrecubierta" name="papel_sobrecubierta">
<select class="form-select select2bs2" id="papelSobrecubierta" name="papel_sobrecubierta">
</select>
</div>
<div class="">
@ -251,7 +251,7 @@
<div class="col-sm-2 mb-3 d-flex flex-column align-items-center">
<div class="form-check form-switch mb-2">
<input class="calcular-presupuesto form-check-input" type="checkbox" id="addFaja" name="add_faja"
<input class="form-check-input" type="checkbox" id="addFaja" name="add_faja"
value="1">
<label class="form-check-label" for="addFaja"><?= lang('Presupuestos.faja') ?></label>
</div>
@ -262,7 +262,7 @@
<label for="papelFaja" class="form-label">
<?= lang('Presupuestos.papelFaja') ?>
</label>
<select class="form-select select2bs2 calcular-presupuesto" id="papelFaja" name="papel_faja">
<select class="form-select select2bs2" id="papelFaja" name="papel_faja">
</select>
</div>
<div class="">

View File

@ -570,8 +570,11 @@ class DatosGenerales {
this.formatoEstandar.removeClass('d-none');
this.formatoPersonalizado.addClass('d-none');
}
const alto = this.getDimensionLibro().alto;
$('#altoFaja').closest('.config-faja').find('.form-text').text('Entre 50 y ' + alto + ' mm');
const dimensionLibro = this.getDimensionLibro();
if (dimensionLibro && dimensionLibro.alto) {
$('#altoFaja').closest('.config-faja').find('.form-text').text('Entre 50 y ' + dimensionLibro.alto + ' mm');
}
}
#checkValue(event) {

View File

@ -309,11 +309,32 @@ class DisenioCubierta {
this.carasCubierta.on('change', this.#handleCarasCubierta.bind(this));
this.sobrecubierta.on('change', () => {
this.sobrecubierta.is(":checked") ? this.configuracionSobrecubierta.removeClass("d-none") : this.configuracionSobrecubierta.addClass("d-none")
if (this.sobrecubierta.is(":checked")) {
this.configuracionSobrecubierta.removeClass("d-none");
if (this.papelSobrecubierta.getVal() && this.gramajeSobrecubierta.getVal()) {
$('#tirada').trigger('change'); // recalcular presupuesto
}
}
else {
this.configuracionSobrecubierta.addClass("d-none");
$('#tirada').trigger('change'); // recalcular presupuesto
}
}
);
this.faja.on('change', () => {
this.faja.is(":checked") ? this.configuracionFaja.removeClass("d-none") : this.configuracionFaja.addClass("d-none");
if(this.faja.is(":checked")) {
this.configuracionFaja.removeClass("d-none");
if (this.papelFaja.getVal() && this.gramajeFaja.getVal()) {
$('#tirada').trigger('change'); // recalcular presupuesto
}
}
else{
this.configuracionFaja.addClass("d-none");
$('#tirada').trigger('change'); // recalcular presupuesto
}
const div = $('#divExtras'); // Selecciona el div
div.find('.fv-plugins-message-container').remove();
});
@ -1025,7 +1046,7 @@ class DisenioCubierta {
this.divGramajeCubierta.empty();
this.divPapelCubierta.removeClass('is-invalid');
this.divGramajeCubierta.removeClass('is-invalid');
this.divPapelEspecial.removeClass('is-invalid');
this.divPapelEspecial.removeClass('is-invalid');
if (response.papeles.length > 0) {
this.textoPapelCubierta.removeClass('d-none');