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:
@ -360,6 +360,7 @@ return [
|
|||||||
'tipo_cubierta' => 'Seleccione tipo de cubierta',
|
'tipo_cubierta' => 'Seleccione tipo de cubierta',
|
||||||
'opcion_solapas' => 'Seleccione la opción para las solapas',
|
'opcion_solapas' => 'Seleccione la opción para las solapas',
|
||||||
'paginas_cosido' => 'El número de páginas para <b>cosido</b> debe ser múltiplo de 4',
|
'paginas_cosido' => 'El número de páginas para <b>cosido</b> debe ser múltiplo de 4',
|
||||||
|
'paginas_pares' => 'El número de páginas debe ser par',
|
||||||
],
|
],
|
||||||
|
|
||||||
'errores' => [
|
'errores' => [
|
||||||
|
|||||||
@ -191,7 +191,17 @@ class DatosGenerales {
|
|||||||
callback: function (input) {
|
callback: function (input) {
|
||||||
// Get the selected options
|
// Get the selected options
|
||||||
const value = $("#paginasColor").val();
|
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;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,7 +213,17 @@ class DatosGenerales {
|
|||||||
callback: function (input) {
|
callback: function (input) {
|
||||||
// Get the selected options
|
// Get the selected options
|
||||||
const value = $("#paginasNegro").val();
|
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();
|
divTipoLibro.find('.fv-plugins-message-container').remove();
|
||||||
if ($('.tipo-libro.selected').length > 0) {
|
if ($('.tipo-libro.selected').length > 0) {
|
||||||
if($('#cosido').hasClass('selected')){
|
if ($('#cosido').hasClass('selected')) {
|
||||||
const value = parseInt($("#paginas").val());
|
const value = parseInt($("#paginas").val());
|
||||||
if(value % 4 != 0){
|
if (value % 4 != 0) {
|
||||||
divTipoLibro.append(`
|
divTipoLibro.append(`
|
||||||
<div class="fv-plugins-message-container invalid-feedback">
|
<div class="fv-plugins-message-container invalid-feedback">
|
||||||
<div data-field="div_tipo_libro" data-validator="callback" style="margin-top: 50px;">
|
<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('.tipo-libro').toggleClass('selected');
|
||||||
element.closest('.image-presupuesto').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');
|
$('#tapaDuraLomoRedondo').removeClass('d-none');
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
$('#tapaDuraLomoRedondo').addClass('d-none');
|
$('#tapaDuraLomoRedondo').addClass('d-none');
|
||||||
$('#tapaDuraLomoRedondo').removeClass('selected');
|
$('#tapaDuraLomoRedondo').removeClass('selected');
|
||||||
}
|
}
|
||||||
@ -388,7 +408,7 @@ class DatosGenerales {
|
|||||||
this.pagColorConsecutivas.prop('checked', false);
|
this.pagColorConsecutivas.prop('checked', false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(this.papelDiferente.is(":checked"))
|
if (this.papelDiferente.is(":checked"))
|
||||||
this.#handleInteriorLayout('mixto');
|
this.#handleInteriorLayout('mixto');
|
||||||
else
|
else
|
||||||
this.#handleInteriorLayout('color');
|
this.#handleInteriorLayout('color');
|
||||||
@ -410,7 +430,7 @@ class DatosGenerales {
|
|||||||
|
|
||||||
|
|
||||||
#handlePapelDiferente() {
|
#handlePapelDiferente() {
|
||||||
if (this.papelDiferente.is(':checked')){
|
if (this.papelDiferente.is(':checked')) {
|
||||||
$(".interior-color").removeClass('d-none');
|
$(".interior-color").removeClass('d-none');
|
||||||
this.#handleInteriorLayout('mixto');
|
this.#handleInteriorLayout('mixto');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -353,11 +353,9 @@ class DisenioInterior {
|
|||||||
if ($('#fresado').hasClass('selected')) {
|
if ($('#fresado').hasClass('selected')) {
|
||||||
if (this.estucadoMate.hasClass('selected') || this.estucadoMate_color.hasClass('selected')) {
|
if (this.estucadoMate.hasClass('selected') || this.estucadoMate_color.hasClass('selected')) {
|
||||||
$('#tapaDuraLomoRedondo').addClass('d-none');
|
$('#tapaDuraLomoRedondo').addClass('d-none');
|
||||||
$('#tapaDura').removeClass('d-none');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#tapaDuraLomoRedondo').removeClass('d-none');
|
$('#tapaDuraLomoRedondo').removeClass('d-none');
|
||||||
$('#tapaDura').addClass('d-none');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class PresupuestoCliente {
|
|||||||
this.disenioInterior.init();
|
this.disenioInterior.init();
|
||||||
this.disenioCubierta.init();
|
this.disenioCubierta.init();
|
||||||
|
|
||||||
//this.RELLENAR_PRESUPUESTO();
|
this.RELLENAR_PRESUPUESTO();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ class PresupuestoCliente {
|
|||||||
$("#titulo").trigger('change');
|
$("#titulo").trigger('change');
|
||||||
|
|
||||||
const clienteId = $("#clienteId");
|
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');
|
clienteId.append(newOption).trigger('change');
|
||||||
|
|
||||||
const papelFormatoId = $("#papelFormatoId");
|
const papelFormatoId = $("#papelFormatoId");
|
||||||
|
|||||||
Reference in New Issue
Block a user