From 7ad551238d6a42f9bf11875e5e071b0033077e91 Mon Sep 17 00:00:00 2001 From: imnavajas Date: Wed, 22 May 2024 11:28:56 +0200 Subject: [PATCH] Terminado previews listos para verificar por cliente --- .../cliente/presupuestoCliente.js | 4 +- .../form/presupuestos/cliente/previews.js | 66 +++++++------------ 2 files changed, 27 insertions(+), 43 deletions(-) diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/presupuestoCliente.js b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/presupuestoCliente.js index ace8796f..ba7b9585 100644 --- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/presupuestoCliente.js +++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/presupuestoCliente.js @@ -279,7 +279,7 @@ item.addEventListener('click', event => { // When click the Next button, we will validate the current step switch (validationStepper._currentIndex) { - /*case 0: + case 0: FormValidation2.validate(); break; @@ -293,7 +293,7 @@ case 3: FormValidation5.validate(); - break;*/ + break; default: validationStepper.next(); diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/previews.js b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/previews.js index 74c0f872..a8b2c8f1 100644 --- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/previews.js +++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/previews.js @@ -2,49 +2,34 @@ var pvObj; $('#toReview').on("click", function () { - - portadaGrapado(true); - - //previewEsquemaCubierta('ec', '',''); - + previewEsquemaCubierta(true); }); $(document).on('shown.bs.modal', function (e) { - - portadaGrapado(false); + previewEsquemaCubierta(false); }) +function previewEsquemaCubierta(isThumbnail = false) { -function previewEsquemaCubierta(isThumbnail) { - - /*let tipoImpresion; - - if ($("#tipoCosido").is(":checked")) { - tipoImpresion = parseInt() + if ($('#cosidoDiv').hasClass('checked') || $("#fresadoDiv").hasClass('checked')) { + console.log("Cosido/Fresado"); + if ($("#tapaBlanda").is(":checked")) { + portadaTapaBlanda(isThumbnail); + } else if ($("#tapaDura").is(":checked")) { + portadaTapaDura(isThumbnail);3 + } + } else if ($('#espiralDiv').hasClass('checked') || $('#wireoDiv').hasClass('checked')) { + console.log("Espiral/Wireo"); + if ($("#tapaBlanda").is(":checked")) { + portadaEspiral(isThumbnail, false); + } else if ($("#tapaDura").is(":checked")) { + portadaEspiral(isThumbnail, true); + } + } else if ($('#grapadoDiv').hasClass('checked')) { + portadaGrapado(isThumbnail); } - let tipoImpresion = parseInt($('#tipo_impresion_id').val()); - - // Fresado TD y Cosido TD - if (tipoImpresion === 1 || tipoImpresion === 3) { - portadaTapaDura(); - } - // Fresado TB y Cosido TB - else if (tipoImpresion === 2 || tipoImpresion === 4) { - portadaTapaBlanda(); - } - // Espiral TD y TB, Wire-o TD y TB - else if (tipoImpresion === 5 || tipoImpresion === 6 || - tipoImpresion === 7 || tipoImpresion === 8) { - portadaEspiral(); - } - else if (tipoImpresion === 21) { - portadaGrapado(); - } - else { - // ? - }*/ } @@ -178,7 +163,7 @@ function portadaTapaDura(isThumbnail = false) { previewEC.makeText(pvObj.anchoLibro + anchoPliegue + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas); previewEC.makeText(pvObj.anchoLibro + anchoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas); previewEC.makeText(pvObj.altoLibro + altoPliegue + " mm", origenEC.x + (lomoLibro / 2) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2; - previewEC.makeText(pvObj.altoLibro + (2 * sangradoValor) + altoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro) + 55 , origenEC.y, styleCotas).rotation = -Math.PI / 2; + previewEC.makeText(pvObj.altoLibro + (2 * sangradoValor) + altoPliegue + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro) + 55, origenEC.y, styleCotas).rotation = -Math.PI / 2; previewEC.makeText((2 * pvObj.anchoLibro) + pvObj.lomoLibro + (2 * sangradoValor) + +(2 * anchoPliegue) + anchoCarton + " mm", origenEC.x, origenEC.y + (altoLibro / 2) + 50, @@ -205,7 +190,6 @@ function portadaTapaBlanda(isThumbnail = false) { getObjetoToPreview(); - // Definicion de los parametros del Esquema de Cubierta (EC) if (pvObj.anchoSolapa == 0) { if (isThumbnail) { @@ -789,11 +773,11 @@ function portadaGrapado(isThumbnail = false) { function getObjetoToPreview() { pvObj = { - lomoLibro: 30,//parseFloat($('#lomo_cubierta').val()), - anchoSolapa: 0, //$('#solapasCubierta').is(':checked') ? parseFloat($('#anchoSolapasCubierta').val()) : parseFloat(0), - altoLibro: 148, //getDimensionLibro().alto, - anchoLibro: 190, //getDimensionLibro().ancho + lomoLibro: $('#lomo_cubierta').val() === '' ? parseFloat('0.0') : parseFloat($('#lomo_cubierta').val()), + anchoSolapa: $('#solapasCubierta').is(':checked') ? parseFloat($('#anchoSolapasCubierta').val()) : parseFloat(0), + altoLibro: getDimensionLibro().alto, + anchoLibro: getDimensionLibro().ancho }; - //console.log(pvObj); + console.log(pvObj); }