mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
resumen lateral terminado
This commit is contained in:
@ -58,10 +58,14 @@ class DatosGenerales {
|
||||
|
||||
this.rl_datos_generales = $(".rl-datos-generales");
|
||||
this.rl_tipo = $("#rl_tipo");
|
||||
this.rl_tipo_cubierta = $('#rl_tipo_cubierta');
|
||||
this.rl_tamanio = $("#rl_tamanio");
|
||||
this.rl_tiradas = $("#rl_tiradas");
|
||||
this.rl_paginas = $("#rl_paginas");
|
||||
|
||||
this.rl_servicios_extra = $(".rl-servicios-extra");
|
||||
this.rl_prototipo = $("#rl_prototipo");
|
||||
|
||||
this.initValidation();
|
||||
}
|
||||
|
||||
@ -388,7 +392,6 @@ class DatosGenerales {
|
||||
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'));
|
||||
@ -400,6 +403,13 @@ class DatosGenerales {
|
||||
else {
|
||||
this.rl_tipo.addClass('d-none');
|
||||
}
|
||||
if($('.tipo-cubierta.selected').length>0){
|
||||
this.rl_tipo_cubierta.text($($('.tipo-cubierta.selected').find('.form-label')).text());
|
||||
this.rl_tipo_cubierta.removeClass('d-none');
|
||||
}
|
||||
else{
|
||||
this.rl_tipo_cubierta.addClass('d-none');
|
||||
}
|
||||
if (this.checkFormatoPersonalizado.is(':checked')) {
|
||||
let ancho = parseFloat(this.anchoPersonalizado.val());
|
||||
let alto = parseFloat(this.altoPersonalizado.val());
|
||||
@ -441,6 +451,25 @@ class DatosGenerales {
|
||||
|
||||
if (!menu_off)
|
||||
this.rl_datos_generales.removeClass('d-none');
|
||||
else
|
||||
this.rl_datos_generales.addClass('d-none');
|
||||
|
||||
// servicios extra
|
||||
menu_off = true;
|
||||
if(this.prototipo.is(':checked')){
|
||||
this.rl_prototipo.removeClass("d-none");
|
||||
menu_off = false;
|
||||
}
|
||||
else{
|
||||
this.rl_prototipo.addClass('d-none');
|
||||
}
|
||||
if(!menu_off){
|
||||
this.rl_servicios_extra.removeClass('d-none');
|
||||
}
|
||||
else{
|
||||
this.rl_servicios_extra.addClass('d-none');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -66,6 +66,17 @@ class DisenioCubierta {
|
||||
this.fresado = $(this.domItem.find("#fresado")[0]);
|
||||
this.cosido = $(this.domItem.find("#cosido")[0]);
|
||||
|
||||
this.rl_cubierta = $(".rl-cubierta");
|
||||
this.rl_papel_cubierta = $("#rl_papel_cubierta");
|
||||
this.rl_caras_cubierta = $("#rl_caras_cubierta");
|
||||
this.rl_acabado_cubierta = $("#rl_acabado_cubierta");
|
||||
|
||||
this.rl_sobrecubierta = $(".rl-sobrecubierta");
|
||||
this.rl_no_sobrecubierta = $("#rl_no_sobrecubierta");
|
||||
this.rl_papel_sobrecubierta = $('#rl_papel_sobrecubierta');
|
||||
this.rl_tamanio_sobrecubierta = $('#rl_tamanio_sobrecubierta');
|
||||
this.rl_acabado_sobrecubierta = $("#rl_acabado_sobrecubierta");
|
||||
|
||||
this.initValidation();
|
||||
|
||||
// Creamos un nuevo observador que detecta cambios en los atributos
|
||||
@ -324,6 +335,69 @@ class DisenioCubierta {
|
||||
}
|
||||
|
||||
|
||||
processMenuLateral() {
|
||||
|
||||
let menu_off = true;
|
||||
|
||||
if($('.papel-cubierta.selected').length>0 && this.getGramaje() != null){
|
||||
this.rl_papel_cubierta.text($($('.papel-cubierta.selected').find('.form-label')).text() + " " +
|
||||
this.getGramaje() + " gr");
|
||||
this.rl_acabado_cubierta.text(this.domItem.find("#plastificado").children("option:selected").text());
|
||||
this.rl_papel_cubierta.removeClass('d-none');
|
||||
this.rl_acabado_cubierta.removeClass('d-none');
|
||||
|
||||
if(this.carasCubierta.find('option:selected').length>0){
|
||||
this.rl_caras_cubierta.text("Impresa " + this.carasCubierta.find('option:selected').text());
|
||||
this.rl_caras_cubierta.removeClass('d-none');
|
||||
menu_off = false;
|
||||
}
|
||||
else{
|
||||
this.rl_caras_cubierta.addClass('d-none');
|
||||
}
|
||||
|
||||
menu_off = false;
|
||||
}
|
||||
else{
|
||||
this.rl_papel_cubierta.addClass('d-none');
|
||||
this.rl_acabado_cubierta.addClass('d-none');
|
||||
}
|
||||
|
||||
if (!menu_off)
|
||||
this.rl_cubierta.removeClass('d-none');
|
||||
else
|
||||
this.rl_cubierta.addClass('d-none');
|
||||
|
||||
// Sobrecubierta solo se muestra si cubierta ok
|
||||
if(!this.rl_cubierta.hasClass('d-none')){
|
||||
this.rl_sobrecubierta.removeClass('d-none');
|
||||
if(!this.sobrecubierta.is(":checked")){
|
||||
this.rl_no_sobrecubierta.removeClass('d-none');
|
||||
this.rl_papel_sobrecubierta.addClass('d-none');
|
||||
this.rl_tamanio_sobrecubierta.addClass('d-none');
|
||||
this.rl_acabado_sobrecubierta.addClass('d-none');
|
||||
}
|
||||
else{
|
||||
this.rl_no_sobrecubierta.addClass('d-none');
|
||||
this.rl_papel_sobrecubierta.removeClass('d-none');
|
||||
this.rl_tamanio_sobrecubierta.removeClass('d-none');
|
||||
this.rl_acabado_sobrecubierta.removeClass('d-none');
|
||||
|
||||
const sobrecubierta = this.getSobrecubierta(true);
|
||||
this.rl_papel_sobrecubierta.text(sobrecubierta.papel + " " + sobrecubierta.gramaje + " gr")
|
||||
this.rl_tamanio_sobrecubierta.text("Solapas: " + sobrecubierta.solapas + " mm")
|
||||
let acabado_text = sobrecubierta.plastificado;
|
||||
if(acabado_text.includes("Sin plastificar"))
|
||||
acabado_text = "Sin plastificar";
|
||||
this.rl_acabado_sobrecubierta.text(acabado_text);
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.rl_sobrecubierta.addClass('d-none');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
getSolapasCubierta() {
|
||||
|
||||
try {
|
||||
|
||||
@ -59,6 +59,11 @@ class DisenioInterior {
|
||||
|
||||
this.checksGramaje = $('.gramaje-interior');
|
||||
|
||||
this.rl_interior = $(".rl-interior");
|
||||
this.rl_tipo_interior = $("#rl_tipo_interior");
|
||||
this.rl_papel_interior = $("#rl_papel_interior");
|
||||
this.rl_papel_interior_color = $("#rl_papel_interior_color");
|
||||
|
||||
this.initValidation();
|
||||
|
||||
// Creamos un nuevo observador que detecta cambios en los atributos
|
||||
@ -370,9 +375,7 @@ class DisenioInterior {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
getIsHq() {
|
||||
|
||||
try {
|
||||
@ -394,6 +397,43 @@ class DisenioInterior {
|
||||
}
|
||||
}
|
||||
|
||||
processMenuLateral() {
|
||||
|
||||
let menu_off = true;
|
||||
this.rl_tipo_interior.removeClass('d-none');
|
||||
|
||||
const HQ = this.getIsHq();
|
||||
const color = $("#paginasColor").val()>0?true:false;
|
||||
const papelInterior = this.getPapel(true);
|
||||
const gramajeInterior = this.getGramaje();
|
||||
if (HQ != null && papelInterior != null && gramajeInterior != null) {
|
||||
|
||||
menu_off = false;
|
||||
if ($(".interior-color").hasClass('d-none')) {
|
||||
if (!this.rl_papel_interior_color.hasClass('d-none')) {
|
||||
this.rl_papel_interior_color.addClass('d-none');
|
||||
}
|
||||
const impInterior = (color ? "Color " : "Blanco y Negro ") + (HQ ? "Premium" : "Estándar");
|
||||
this.rl_tipo_interior.text(impInterior);
|
||||
this.rl_papel_interior.text(papelInterior + " " + gramajeInterior + "gr");
|
||||
}
|
||||
else {
|
||||
this.rl_papel_interior_color.removeClass('d-none');
|
||||
|
||||
const impInterior = ("Negro " + (HQ.negro ? "Premium" : "Estándar") + " / Color " + (HQ.color ? "Premium" : "Estándar"));
|
||||
this.rl_tipo_interior.text(impInterior);
|
||||
this.rl_papel_interior.text(papelInterior.negro + " " + gramajeInterior.negro + "gr");
|
||||
this.rl_papel_interior_color.text(papelInterior.color + " " + gramajeInterior.color + "gr");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!menu_off)
|
||||
this.rl_interior.removeClass('d-none');
|
||||
else
|
||||
this.rl_interior.addClass('d-none');
|
||||
|
||||
}
|
||||
|
||||
getPapel(forResumen = false) {
|
||||
|
||||
|
||||
@ -113,8 +113,8 @@ class PresupuestoCliente {
|
||||
#processResumenLateral() {
|
||||
|
||||
this.datosGenerales.processMenuLateral();
|
||||
|
||||
|
||||
this.disenioInterior.processMenuLateral();
|
||||
this.disenioCubierta.processMenuLateral();
|
||||
}
|
||||
|
||||
|
||||
@ -225,7 +225,11 @@ class PresupuestoCliente {
|
||||
else {
|
||||
this.#goToForm(nextElement);
|
||||
}
|
||||
this.#processResumenLateral();
|
||||
if(!nextElement.includes('resumen-libro'))
|
||||
this.#processResumenLateral();
|
||||
else{
|
||||
$(".rl-item").addClass('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
#goToForm(form) {
|
||||
|
||||
@ -246,7 +246,7 @@ class Resumen {
|
||||
if ($(".interior-color").hasClass('d-none')) {
|
||||
this.domItem.find(".mismoInterior").removeClass('d-none');
|
||||
this.domItem.find(".diferenteInterior").addClass('d-none');
|
||||
const impInterior = (color ? "Color " : "Blanco y Negro") + (HQ ? "Premium" : "Estándar");
|
||||
const impInterior = (color ? "Color " : "Blanco y Negro ") + (HQ ? "Premium" : "Estándar");
|
||||
this.impresionInterior.text(impInterior);
|
||||
this.papelInterior.text(papelInterior);
|
||||
this.gramajeInterior.text(gramajeInterior);
|
||||
@ -254,7 +254,7 @@ class Resumen {
|
||||
else {
|
||||
this.domItem.find(".mismoInterior").addClass('d-none');
|
||||
this.domItem.find(".diferenteInterior").removeClass('d-none');
|
||||
const impInterior = ("Negro " + (HQ.negro ? "Premium" : "Estándar") + " / Color" + (HQ.color ? "Premium" : "Estándar"));
|
||||
const impInterior = ("Negro " + (HQ.negro ? "Premium" : "Estándar") + " / Color " + (HQ.color ? "Premium" : "Estándar"));
|
||||
this.impresionInterior.text(impInterior);
|
||||
this.papelInteriorNegro.text(papelInterior.negro);
|
||||
this.papelInteriorColor.text(papelInterior.color);
|
||||
|
||||
Reference in New Issue
Block a user