corregido el texto del error del tipo de libro y que se borre el error

This commit is contained in:
2025-06-27 08:38:23 +02:00
parent 33a196667e
commit 4a60bcdd61
8 changed files with 147 additions and 49 deletions

View File

@ -17,9 +17,10 @@ class ConfigVariableDatatable
init(){
this.datatable = this.datatableItem.DataTable({
processing: true,
dom: 'Brtip',
dom: 'Blrtip',
serverSide: true,
lengthMenu: [ 25, 50, 100, 200 ],
pageLength: 50,
language: {
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
},

View File

@ -103,6 +103,34 @@ class DatosGenerales {
this.pagColorConsecutivas.on('change', this.#handPaginasConsecutivas.bind(this));
this.papelDiferente.on('change', this.#handlePapelDiferente.bind(this));
// 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);
if ((current.data('tarifa-nombre')?.toString().toLowerCase() || '').includes('2')) {
$('#direccionesFerroPrototipo2').removeClass('d-none');
}
$('#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();
}
}
}
});
$('.tirada-presupuesto').on('change', () => {
@ -110,7 +138,7 @@ class DatosGenerales {
this.removeError(window.translations["validation"].tirada_integer_greatherThan_0);
this.removeError(window.translations["validation"].tirada_pod_nopod);
}
else{
else {
this.addErrors();
}
let tiradas = self.getTiradas();
@ -141,7 +169,7 @@ class DatosGenerales {
if (this.validateCliente()) {
this.removeError(window.translations["validation"].cliente);
}
else{
else {
this.addErrors();
}
});
@ -176,7 +204,7 @@ class DatosGenerales {
this.addErrors();
if (this.errores.length > 0) {
return false;
}
else {
@ -210,6 +238,8 @@ class DatosGenerales {
this.domItem.find('#divTipoLibro').addClass('is-invalid');
noError = false;
}
return noError;
}
validatePaginas() {
@ -658,7 +688,7 @@ class DatosGenerales {
this.removeError(window.translations["validation"].papelFormatoAncho);
this.removeError(window.translations["validation"].papelFormatoAlto);
}
else{
else {
this.addErrors();
}
}
@ -730,11 +760,11 @@ class DatosGenerales {
}
}
if(this.validateTipoLibro()) {
if (this.validateTipoLibro()) {
this.removeError(window.translations["validation"].tipo_libro);
this.removeError(window.translations["validation"].paginas_multiplo_4);
}
else{
else {
this.addErrors();
}
@ -829,13 +859,13 @@ class DatosGenerales {
}
$('.calcular-lomo').trigger('change');
if(this.validatePaginas()) {
if (this.validatePaginas()) {
this.removeError(window.translations["validation"].paginas);
this.removeError(window.translations["validation"].paginasColor);
this.removeError(window.translations["validation"].paginasNegro);
this.removeError(window.translations["validation"].paginas_pares);
}
else{
else {
this.addErrors();
}
}
@ -955,7 +985,7 @@ class DatosGenerales {
</ul>`;
popErrorAlert(message, 'sk-alert', false);
}
else{
else {
skAlert.innerHTML = '';
}
}