terminado incluyendo el menu lateral

This commit is contained in:
jaimejimenezortega
2025-03-04 20:13:11 +01:00
parent 2587a6b4ac
commit 2edde4943d
4 changed files with 101 additions and 55 deletions

View File

@ -165,7 +165,7 @@ class DatosGenerales {
if (value4.length > 0 && Number.isInteger(parseInt(value4)) && parseInt(value4) > 0) {
tiradas.push(value4);
}
// comprobar si hay valores > 30
// comprobar si hay valores > 30
const noPOD = (tiradas.some(tirada => parseInt(tirada) > 30));
const siPOD = (tiradas.some(tirada => parseInt(tirada) <= 30));
if (noPOD && siPOD) {
@ -362,7 +362,7 @@ class DatosGenerales {
`);
return false;
}
},
}
}
@ -478,7 +478,7 @@ class DatosGenerales {
// servicios extra
menu_off = true;
if(this.prototipo.is(':checked')){
/*if(this.prototipo.is(':checked')){
this.rl_prototipo.removeClass("d-none");
menu_off = false;
}
@ -493,7 +493,7 @@ class DatosGenerales {
else{
this.rl_ferro.addClass('d-none');
}
if(this.ferroDigital.is(':checked')){
this.rl_ferroDigital.removeClass("d-none");
menu_off = false;
@ -501,29 +501,67 @@ class DatosGenerales {
else{
this.rl_ferroDigital.addClass('d-none');
}
*/
$('#rl-servicios-extra-items').empty();
if(this.marcapaginas.is(':checked')){
this.rl_marcapaginas.removeClass("d-none");
let $ul = $('<ul>', {
class: 'list-group list-group-timeline'
});
let $li = $('<li>', {
class: 'list-group-item list-group-timeline-primary texto-resumen-lateral',
text: 'Marcapáginas'
});
$ul.append($li);
$('#rl-servicios-extra-items').append($ul);
menu_off = false;
}
else{
this.rl_marcapaginas.addClass('d-none');
}
if(this.retractilado.is(':checked')){
this.rl_retractilado.removeClass("d-none");
let $ul = $('<ul>', {
class: 'list-group list-group-timeline'
});
let $li = $('<li>', {
class: 'list-group-item list-group-timeline-primary texto-resumen-lateral',
text: 'Retractilado'
});
$ul.append($li);
$('#rl-servicios-extra-items').append($ul);
menu_off = false;
}
else{
this.rl_retractilado.addClass('d-none');
}
if(this.retractilado5.is(':checked')){
this.rl_retractilado5.removeClass("d-none");
let $ul = $('<ul>', {
class: 'list-group list-group-timeline'
});
let $li = $('<li>', {
class: 'list-group-item list-group-timeline-primary texto-resumen-lateral',
text: 'Retractilado de 5'
});
$ul.append($li);
$('#rl-servicios-extra-items').append($ul);
menu_off = false;
}
else{
this.rl_retractilado5.addClass('d-none');
const serviciosExtra = $('input[type="checkbox"][data-tarifa-tipo="extra"]:checked');
for(let i=0; i<serviciosExtra.length; i++){
let $ul = $('<ul>', {
class: 'list-group list-group-timeline'
});
let $li = $('<li>', {
class: 'list-group-item list-group-timeline-primary texto-resumen-lateral',
text: '' + $(serviciosExtra[i]).data('tarifa-nombre')
});
$ul.append($li);
$('#rl-servicios-extra-items').append($ul);
}
if(!menu_off){
@ -603,9 +641,23 @@ class DatosGenerales {
}
}
this.prototipo.prop('checked', datos.prototipo);
this.ferro.prop('checked', datos.ferro);
this.ferroDigital.prop('checked', datos.ferroDigital);
if(datos.serviciosExtra){
let serviciosExtra = $('input[type="checkbox"][data-tarifa-tipo="extra"]');
$(serviciosExtra).each(function() {
let tarifaId = $(this).data('tarifa-id') + "";
if (datos.serviciosExtra.includes(tarifaId)) {
$(this).prop('checked', true);
}
});
}
//this.prototipo.prop('checked', datos.prototipo);
//this.ferro.prop('checked', datos.ferro);
//this.ferroDigital.prop('checked', datos.ferroDigital);
this.marcapaginas.prop('checked', datos.marcapaginas);
this.retractilado.prop('checked', datos.retractilado);
this.retractilado5.prop('checked', datos.retractilado5);
@ -805,7 +857,7 @@ class DatosGenerales {
this.pagColorConsecutivas.prop('checked', false);
if(lastLayoutColor && !this.cargando){
$('#divPapelInterior').empty();
$('#divGramajeInterior').empty();
$('#negroEstandar').trigger('click');
@ -820,7 +872,7 @@ class DatosGenerales {
this.divPosPaginasColor.removeClass('d-none');
if(!lastLayoutColor && !this.cargando){
$('#divPapelInterior').empty();
$('#divGramajeInterior').empty();
$('#colorEstandar').trigger('click');
@ -836,7 +888,7 @@ class DatosGenerales {
const divTipoLibro = $('#divTipoLibro'); // Selecciona el div
divTipoLibro.find('.fv-plugins-message-container').remove();
if ($('#cosido').hasClass('selected') || $('#grapado').hasClass('selected')) {
const value = parseInt($("#paginas").val());
if (value % 4 != 0) {
@ -920,6 +972,26 @@ class DatosGenerales {
}
}
getServiciosExtra() {
let serviciosExtra = $('input[type="checkbox"][data-tarifa-tipo="extra"]:checked');
if (serviciosExtra.length === 0) {
return [];
}
let servicios = [];
$(serviciosExtra).each(function() {
let tarifaId = $(this).data('tarifa-id');
if (tarifaId) {
servicios.push(tarifaId);
}
});
return servicios;
}
}

View File

@ -632,7 +632,7 @@ class PresupuestoCliente {
}
}
}
}
this.lc.val(parseFloat(response.info.lomo_cubierta).toFixed(2));
this.lsc.val(parseFloat(response.info.lomo_sobrecubierta).toFixed(2));
@ -773,12 +773,13 @@ class PresupuestoCliente {
this.datos.excluirRotativa = this.datosGenerales.excluirRotativa.is(':checked') ? 1 : 0;
this.datos.ivaReducido = this.datosGenerales.ivaReducido.find('option:selected').val();
this.datos.servicios = {
'prototipo': this.datosGenerales.prototipo.is(':checked') ? 1 : 0,
'ferro': this.datosGenerales.ferro.is(':checked') ? 1 : 0,
'ferroDigital': this.datosGenerales.ferroDigital.is(':checked') ? 1 : 0,
//'prototipo': this.datosGenerales.prototipo.is(':checked') ? 1 : 0,
//'ferro': this.datosGenerales.ferro.is(':checked') ? 1 : 0,
//'ferroDigital': this.datosGenerales.ferroDigital.is(':checked') ? 1 : 0,
'marcapaginas': this.datosGenerales.marcapaginas.is(':checked') ? 1 : 0,
'retractilado': this.datosGenerales.retractilado.is(':checked') ? 1 : 0,
'retractilado5': this.datosGenerales.retractilado5.is(':checked') ? 1 : 0,
'serviciosExtra': this.datosGenerales.getServiciosExtra(),
};
let lomoRedondo = 0;