Terminado previews listos para verificar por cliente

This commit is contained in:
imnavajas
2024-05-22 11:28:56 +02:00
parent 889ad57adc
commit 7ad551238d
2 changed files with 27 additions and 43 deletions

View File

@ -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();

View File

@ -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);
}