mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
corregidos errores en logica
This commit is contained in:
@ -191,19 +191,39 @@ class DatosGenerales {
|
||||
callback: function (input) {
|
||||
// Get the selected options
|
||||
const value = $("#paginasColor").val();
|
||||
return value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0;
|
||||
if (value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0) {
|
||||
|
||||
if (parseInt(value) % 2 != 0) {
|
||||
return {
|
||||
valid: false,
|
||||
message: window.translations["validation"].paginas_pares
|
||||
};
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
paginasNegro: {
|
||||
validators: {
|
||||
callback: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.translations["validation"].integer_greatherThan_0,
|
||||
callback: function (input) {
|
||||
// Get the selected options
|
||||
const value = $("#paginasNegro").val();
|
||||
return value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0;
|
||||
if (value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0) {
|
||||
|
||||
if (parseInt(value) % 2 != 0) {
|
||||
return {
|
||||
valid: false,
|
||||
message: window.translations["validation"].paginas_pares
|
||||
};
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -228,9 +248,9 @@ class DatosGenerales {
|
||||
|
||||
divTipoLibro.find('.fv-plugins-message-container').remove();
|
||||
if ($('.tipo-libro.selected').length > 0) {
|
||||
if($('#cosido').hasClass('selected')){
|
||||
if ($('#cosido').hasClass('selected')) {
|
||||
const value = parseInt($("#paginas").val());
|
||||
if(value % 4 != 0){
|
||||
if (value % 4 != 0) {
|
||||
divTipoLibro.append(`
|
||||
<div class="fv-plugins-message-container invalid-feedback">
|
||||
<div data-field="div_tipo_libro" data-validator="callback" style="margin-top: 50px;">
|
||||
@ -329,10 +349,10 @@ class DatosGenerales {
|
||||
element.closest('.tipo-libro').toggleClass('selected');
|
||||
element.closest('.image-presupuesto').toggleClass('selected');
|
||||
|
||||
if(this.fresado.hasClass('selected') || this.cosido.hasClass('selected')){
|
||||
if (this.fresado.hasClass('selected') || this.cosido.hasClass('selected')) {
|
||||
$('#tapaDuraLomoRedondo').removeClass('d-none');
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$('#tapaDuraLomoRedondo').addClass('d-none');
|
||||
$('#tapaDuraLomoRedondo').removeClass('selected');
|
||||
}
|
||||
@ -388,8 +408,8 @@ class DatosGenerales {
|
||||
this.pagColorConsecutivas.prop('checked', false);
|
||||
}
|
||||
else {
|
||||
if(this.papelDiferente.is(":checked"))
|
||||
this.#handleInteriorLayout('mixto');
|
||||
if (this.papelDiferente.is(":checked"))
|
||||
this.#handleInteriorLayout('mixto');
|
||||
else
|
||||
this.#handleInteriorLayout('color');
|
||||
this.divPaginasColorConsecutivas.removeClass('d-none');
|
||||
@ -410,7 +430,7 @@ class DatosGenerales {
|
||||
|
||||
|
||||
#handlePapelDiferente() {
|
||||
if (this.papelDiferente.is(':checked')){
|
||||
if (this.papelDiferente.is(':checked')) {
|
||||
$(".interior-color").removeClass('d-none');
|
||||
this.#handleInteriorLayout('mixto');
|
||||
}
|
||||
|
||||
@ -353,11 +353,9 @@ class DisenioInterior {
|
||||
if ($('#fresado').hasClass('selected')) {
|
||||
if (this.estucadoMate.hasClass('selected') || this.estucadoMate_color.hasClass('selected')) {
|
||||
$('#tapaDuraLomoRedondo').addClass('d-none');
|
||||
$('#tapaDura').removeClass('d-none');
|
||||
}
|
||||
else {
|
||||
$('#tapaDuraLomoRedondo').removeClass('d-none');
|
||||
$('#tapaDura').addClass('d-none');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ class PresupuestoCliente {
|
||||
this.disenioInterior.init();
|
||||
this.disenioCubierta.init();
|
||||
|
||||
//this.RELLENAR_PRESUPUESTO();
|
||||
this.RELLENAR_PRESUPUESTO();
|
||||
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ class PresupuestoCliente {
|
||||
$("#titulo").trigger('change');
|
||||
|
||||
const clienteId = $("#clienteId");
|
||||
const newOption = new Option("Cliente 1", "1", true, true);
|
||||
const newOption = new Option("Cliente Potencial", "1", true, true);
|
||||
clienteId.append(newOption).trigger('change');
|
||||
|
||||
const papelFormatoId = $("#papelFormatoId");
|
||||
|
||||
Reference in New Issue
Block a user