funcionalidad completa de ferro prototipo en cliente a excepción de guardar los checks de usar la misma dirección

This commit is contained in:
2025-06-28 18:15:49 +02:00
parent 4e2003b8b8
commit 47eafa75ec
6 changed files with 129 additions and 47 deletions

View File

@ -105,27 +105,26 @@ class DatosGenerales {
// check ferro y prototipo
this.domItem.on('change', 'input[type="checkbox"][data-tarifa-extra-excluyente="1"]', (e) => {
if (!this.cargando) {
const current = $(e.target);
if (current.is(':checked')) {
this.domItem.find('input[type="checkbox"][data-tarifa-extra-excluyente="1"]')
.not(current)
.prop('checked', false);
const current = $(e.target);
if ((current.data('tarifa-nombre')?.toString().toLowerCase() || '').includes('2')) {
$('#direccionesFerroPrototipo2').removeClass('d-none');
}
$('#direccionesFerroPrototipo').removeClass('d-none');
if (current.is(':checked')) {
this.domItem.find('input[type="checkbox"][data-tarifa-extra-excluyente="1"]')
.not(current)
.prop('checked', false);
if ((current.data('tarifa-nombre')?.toString().toLowerCase() || '').includes('2')) {
$('#direccionesFerroPrototipo2').removeClass('d-none');
}
else {
if (this.domItem.find('input[type="checkbox"][data-tarifa-extra-excluyente="1"]').prop('checked').length === 0) {
$('#direccionesFerroPrototipo').removeClass('d-none');
}
else {
if (this.domItem.find('input[type="checkbox"][data-tarifa-extra-excluyente="1"]').prop('checked').length === 0) {
$('#direccionesFerroPrototipo').addClass('d-none');
$('#divDireccionesFerroPrototipo').empty();
$('#direccionesFerroPrototipo2').addClass('d-none');
$('#divDireccionesFerroPrototipo2').empty();
}
$('#direccionesFerroPrototipo').addClass('d-none');
$('#divDireccionesFerroPrototipo').empty();
$('#direccionesFerroPrototipo2').addClass('d-none');
$('#divDireccionesFerroPrototipo2').empty();
}
}
});
@ -597,6 +596,7 @@ class DatosGenerales {
if (datos.serviciosExtra.includes(tarifaId)) {
$(this).prop('checked', true);
$(this).trigger('change');
}
});
}