mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
menu lateral datos generales
This commit is contained in:
@ -56,6 +56,12 @@ class DatosGenerales {
|
||||
this.excluirRotativa = this.domItem.find("#excluirRotativa");
|
||||
this.prototipo = this.domItem.find("#prototipo");
|
||||
|
||||
this.rl_datos_generales = $(".rl-datos-generales");
|
||||
this.rl_tipo = $("#rl_tipo");
|
||||
this.rl_tamanio = $("#rl_tamanio");
|
||||
this.rl_tiradas = $("#rl_tiradas");
|
||||
this.rl_paginas = $("#rl_paginas");
|
||||
|
||||
this.initValidation();
|
||||
}
|
||||
|
||||
@ -373,10 +379,72 @@ class DatosGenerales {
|
||||
}
|
||||
}).on('core.form.valid', () => {
|
||||
if (this.allowNext)
|
||||
|
||||
stepper.next();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
processMenuLateral() {
|
||||
|
||||
let menu_off = true;
|
||||
this.rl_datos_generales.removeClass('d-none');
|
||||
|
||||
if (this.tiposLibro.filter('.selected').length > 0) {
|
||||
let tipo = String(this.tiposLibro.filter('.selected').attr('id'));
|
||||
tipo = tipo.charAt(0).toUpperCase() + tipo.slice(1);
|
||||
this.rl_tipo.text(tipo);
|
||||
this.rl_tipo.removeClass('d-none');
|
||||
menu_off = false;
|
||||
}
|
||||
else {
|
||||
this.rl_tipo.addClass('d-none');
|
||||
}
|
||||
if (this.checkFormatoPersonalizado.is(':checked')) {
|
||||
let ancho = parseFloat(this.anchoPersonalizado.val());
|
||||
let alto = parseFloat(this.altoPersonalizado.val());
|
||||
if (!isNaN(ancho) && !isNaN(alto)) {
|
||||
this.rl_tamanio.text(ancho + ' x ' + alto);
|
||||
this.rl_tamanio.removeClass('d-none');
|
||||
menu_off = false;
|
||||
}
|
||||
else {
|
||||
this.rl_tamanio.addClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
if (this.papelFormatoId.val() != null) {
|
||||
this.rl_tamanio.text(this.papelFormatoId.find('option:selected').text());
|
||||
this.rl_tamanio.removeClass('d-none');
|
||||
menu_off = false;
|
||||
}
|
||||
else {
|
||||
this.rl_tamanio.addClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
const tiradas = this.getTiradas();
|
||||
if (tiradas.length > 0) {
|
||||
this.rl_tiradas.text(tiradas.join(', '));
|
||||
this.rl_tiradas.removeClass('d-none');
|
||||
}
|
||||
else
|
||||
this.rl_tiradas.addClass('d-none');
|
||||
|
||||
if (this.paginas.val() > 0) {
|
||||
this.rl_paginas.text(this.paginas.val() + " páginas");
|
||||
this.rl_paginas.removeClass('d-none');
|
||||
}
|
||||
else
|
||||
this.rl_paginas.addClass('d-none');
|
||||
|
||||
if (!menu_off)
|
||||
this.rl_datos_generales.removeClass('d-none');
|
||||
|
||||
}
|
||||
|
||||
|
||||
cargarDatos(datos) {
|
||||
|
||||
this.titulo.val(datos.titulo);
|
||||
|
||||
@ -27,6 +27,10 @@ class PresupuestoCliente {
|
||||
this.lc = $("#lc");
|
||||
this.lsc = $("#lsc");
|
||||
|
||||
this.rl_interior = $(".rl-interior");
|
||||
this.rl_cubierta = $(".rl-cubierta");
|
||||
this.rl_sobrecubierta = $(".rl-sobrecubierta");
|
||||
|
||||
this.datosGenerales = new DatosGenerales($("#datos-generales"), this.clientePresupuestoWizard, this.validationStepper);
|
||||
this.disenioInterior = new DisenioInterior($("#interior-libro"), this.clientePresupuestoWizard, this.validationStepper);
|
||||
this.disenioCubierta = new DisenioCubierta($("#cubierta-libro"), this.clientePresupuestoWizard, this.validationStepper);
|
||||
@ -45,6 +49,10 @@ class PresupuestoCliente {
|
||||
|
||||
this.actualizarTiradasEnvio = false;
|
||||
this.calcularPresupuesto = false;
|
||||
|
||||
if(!window.location.href.includes("edit")) {
|
||||
this.#processResumenLateral();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -84,7 +92,10 @@ class PresupuestoCliente {
|
||||
|
||||
if (window.location.href.includes("edit")) {
|
||||
|
||||
this.#cargarPresupuesto();
|
||||
setTimeout(() => {
|
||||
this.#cargarPresupuesto();
|
||||
}, 0);
|
||||
|
||||
const successMessage = sessionStorage.getItem('message');
|
||||
if (successMessage) {
|
||||
popSuccessAlert(successMessage);
|
||||
@ -99,6 +110,14 @@ class PresupuestoCliente {
|
||||
}
|
||||
|
||||
|
||||
#processResumenLateral() {
|
||||
|
||||
this.datosGenerales.processMenuLateral();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#checkTiradas() {
|
||||
|
||||
let tiradas = [parseInt(this.datosGenerales.tirada1.val())];
|
||||
@ -135,6 +154,8 @@ class PresupuestoCliente {
|
||||
|
||||
checkForm(event) {
|
||||
|
||||
this.#processResumenLateral();
|
||||
|
||||
if (!this.#checkTiradas()) {
|
||||
return;
|
||||
}
|
||||
@ -192,12 +213,17 @@ class PresupuestoCliente {
|
||||
return;
|
||||
}
|
||||
|
||||
if (nextElement === 'resumen-libro') {
|
||||
$(".rl-item").addClass('d-none');
|
||||
}
|
||||
|
||||
if (currentElement !== 'resumen-libro') {
|
||||
this.#validateCurrentForm(currentElement, nextElement);
|
||||
}
|
||||
else {
|
||||
this.#goToForm(nextElement);
|
||||
}
|
||||
this.#processResumenLateral();
|
||||
}
|
||||
|
||||
#goToForm(form) {
|
||||
@ -682,6 +708,8 @@ class PresupuestoCliente {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function validateForm(formValidation) {
|
||||
try {
|
||||
const validationResult = await formValidation.validate();
|
||||
|
||||
@ -201,7 +201,7 @@ class Resumen {
|
||||
generate() {
|
||||
|
||||
this.titulo.text(this.datosGenerales.titulo.val());
|
||||
this.tipoLibro.text(this.#capitalizeFirstLetter(this.datosGenerales.tiposLibro.filter('.selected').attr('id')));
|
||||
this.tipoLibro.text(this.capitalizeFirstLetter(this.datosGenerales.tiposLibro.filter('.selected').attr('id')));
|
||||
|
||||
let ancho = 0, alto = 0;
|
||||
if (this.datosGenerales.checkFormatoPersonalizado.is(':checked')) {
|
||||
@ -346,7 +346,7 @@ class Resumen {
|
||||
}
|
||||
|
||||
|
||||
#capitalizeFirstLetter(string) {
|
||||
capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
|
||||
|
||||
@ -472,4 +472,8 @@
|
||||
background-color: var(--white);
|
||||
transform: translate3d(0, 0, 1px) rotateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.texto-resumen-lateral{
|
||||
font-size: 0.9em;
|
||||
}
|
||||
Reference in New Issue
Block a user