diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/admin/previews.js b/ci4/app/Views/themes/vuexy/form/presupuestos/admin/previews.js index b083774c..0997fef0 100644 --- a/ci4/app/Views/themes/vuexy/form/presupuestos/admin/previews.js +++ b/ci4/app/Views/themes/vuexy/form/presupuestos/admin/previews.js @@ -1098,10 +1098,13 @@ function getVisibleTabs() { if (['bn', 'bnhq', 'color', 'colorhq', 'rot_bn', 'rot_color', 'guardas', 'cubierta', 'sobrecubierta'].includes(lpName)) { $(`#tab-pv-${tabName}`).show(); + if (lpName === 'cubierta') { $(`#tab-pv-${tabName}`).show(); $(`#tab-pv-esquema-${tabName}`).show(); } } + + }); } \ No newline at end of file diff --git a/httpdocs/assets/js/safekat/components/preview.js b/httpdocs/assets/js/safekat/components/preview.js index c8153d4a..25e049e3 100644 --- a/httpdocs/assets/js/safekat/components/preview.js +++ b/httpdocs/assets/js/safekat/components/preview.js @@ -30,6 +30,8 @@ class previewFormas { } this.lomoRedondo = datos.lomoRedondo; + this.pvObj = null; + } setContainer(container) { @@ -53,176 +55,380 @@ class previewFormas { this.lomoRedondo = datos.lomoRedondo; } + getObjetoLP(lpName, _isCosido, _isTapaDura) { + + let rowData = null; + + $('#tableLineasPresupuesto').DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) { + + let lineaPresupuestoId = this.data().row_id.replace('lp_', ''); + + switch (lpName) { + case 'bn': + case 'bnhq': + case 'color': + case 'colorhq': + case 'cubierta': + case 'rot_bn': + case 'rot_color': + case 'guardas': + case 'sobrecubierta': + if (lineaPresupuestoId === lpName) { + rowData = this.data(); + } + break; + case 'ec': + if (lineaPresupuestoId === 'cubierta') { + rowData = this.data(); + } + break; + default: + //console.log(lineaPresupuestoId); + break; + } + + }); + + + this.pvObj = { + idIndex: lpName, + tipoImpresion: parseInt($('#tipo_impresion_id').val()), + gramajeLibro: parseInt(rowData.gramaje), + manoLP: parseFloat(rowData.lomo), + lomoLibro: this.lomo(), + anchoSolapa: $('#solapas').is(':checked') ? parseFloat($('#solapas_ancho').val()) : parseFloat(0), + nFormas: parseInt(rowData.formas), + nFormasH: parseInt(rowData.formas_h), + nFormasV: parseInt(rowData.formas_v), + orientacionFormas: rowData.formas_orientacion, + altoMaquina: parseFloat(rowData.maquina_alto), + anchoMaquina: parseFloat(rowData.maquina_ancho), + altoImpresion: parseFloat(rowData.maquina_impresion_alto), + anchoImpresion: parseFloat(rowData.maquina_impresion_ancho), + altoLibro: this.alto(), + anchoLibro: this.ancho(), + offsetSolapa: 0 + }; + + //console.log(pvObj); + + // Printing shape definition + this.pvObj.anchoForma = (this.isCosido) ? 2 * this.pvObj.anchoLibro : this.pvObj.anchoLibro; + this.pvObj.altoForma = this.pvObj.altoLibro; + + + // Update preview info fields + let pvName = '#pv_' + lpName; + $(pvName + '_pg').attr("href", $(pvName + '_pg').attr('sk-url') + rowData.papel); + $(pvName + '_pi').attr("href", $(pvName + '_pi').attr('sk-url') + rowData.papel_impresion_id); + $(pvName + '_mi').attr("href", $(pvName + '_mi').attr('sk-url') + rowData.maquina_id); + + $(pvName + '_gramaje').text(this.pvObj.gramajeLibro); + $(pvName + '_mano').text(this.pvObj.manoLP); + $(pvName + '_solapas').text(this.pvObj.anchoSolapa); + $(pvName + '_maquina').text(this.pvObj.anchoMaquina + "x" + this.pvObj.altoMaquina); + $(pvName + '_maquina_impresion').text(this.pvObj.anchoImpresion + "x" + this.pvObj.altoImpresion); + $(pvName + '_libro').text(this.pvObj.anchoLibro + "x" + this.pvObj.altoLibro); + $(pvName + '_forma').text(this.pvObj.anchoForma + "x" + this.pvObj.altoForma); + $(pvName + '_nFormas').text(this.pvObj.nFormas); + + if (this.pvObj.anchoSolapa != 0) { + $('.pv-solapas').show(); + this.pvObj.offsetSolapa = parseFloat(3); // 3mm + + } + + // Custom overwrites + switch (this.pvObj.idIndex) { + case 'cubierta': + // Fresado TD or Cosido TD + if (this.pvObj.tipoImpresion === 1 || this.pvObj.tipoImpresion === 3) { + let anchoPliegue = parseFloat(7); // mm + let altoPliegue = parseFloat(7); // mm + let sangre = parseFloat(20); // mm + if (this.isTapaDura && (this.ancho >= 210 || this.alto >= 297)) { + sangre = parseFloat(10); // mm + } + this.pvObj.anchoForma = ((2 * this.pvObj.anchoLibro) + (2 * anchoPliegue) + (2 * sangre) + this.pvObj.lomoLibro); + this.pvObj.altoForma += altoPliegue + (2 * sangre); + } + // Fresado TB y Cosido TB + else if (this.pvObj.tipoImpresion === 2 || this.pvObj.tipoImpresion === 4) { + let sangre = parseFloat(5); // mm + this.pvObj.anchoForma = ((2 * this.pvObj.anchoLibro) + (2 * (this.pvObj.anchoSolapa + this.pvObj.offsetSolapa)) + (2 * sangre) + this.pvObj.lomoLibro); + this.pvObj.altoForma += (2 * sangre); + } + // Grapado + else if (this.pvObj.tipoImpresion === 21) { + let sangre = parseFloat(5); // mm + this.pvObj.anchoForma = ((2 * this.pvObj.anchoLibro) + (2 * (this.pvObj.anchoSolapa + this.pvObj.offsetSolapa)) + (2 * sangre)); + this.pvObj.altoForma += (2 * sangre); + } + // Espiral TD y TB, Wire-o TD y TB + else if (this.pvObj.tipoImpresion === 5 || this.pvObj.tipoImpresion === 6 || + this.pvObj.tipoImpresion === 7 || this.pvObj.tipoImpresion === 8) { + let sangre = parseFloat(20); // mm + this.pvObj.anchoForma = this.pvObj.anchoLibro; + } else { + // ? + } + + // Update labels + $(pvName + '_forma').text(this.pvObj.anchoForma + "x" + this.pvObj.altoForma); + break; + + case 'sobrecubierta': + sangre = parseFloat(5); // mm + let anchoSolapaSobrecubierta = $('#solapas_sobrecubierta').is(':checked') ? parseFloat($('#solapas_ancho_sobrecubierta').val()) : parseFloat(0); // mm + if (_isTapaDura) { + let anchoPliegue = parseFloat(7); // mm + let altoPliegue = parseFloat(7); // mm + this.pvObj.anchoForma = ((2 * this.pvObj.anchoLibro) + (2 * anchoPliegue) + (2 * (anchoSolapaSobrecubierta + this.pvObj.offsetSolapa)) + (2 * sangre) + this.pvObj.lomoLibro); + this.pvObj.altoForma += altoPliegue + (2 * sangre); + } else { + this.pvObj.anchoForma = ((2 * this.pvObj.anchoLibro) + (2 * (anchoSolapaSobrecubierta + this.pvObj.offsetSolapa)) + (2 * sangre) + this.pvObj.lomoLibro); + this.pvObj.altoForma += (2 * sangre); + } + + // Update labels + $(pvName + '_solapas').text(anchoSolapaSobrecubierta); + anchoSolapaSobrecubierta != 0 ? $('.pv-solapas').show() : $('.pv-solapas').hide(); + $(pvName + '_forma').text(this.pvObj.anchoForma + "x" + this.pvObj.altoForma); + break; + case 'ec': + $(pvName + '_pg').attr("href", $(pvName + '_pg').attr('sk-url') + rowData.papel); + $(pvName + '_pi').attr("href", $(pvName + '_pi').attr('sk-url') + rowData.papel_impresion_id); + $(pvName + '_mi').attr("href", $(pvName + '_mi').attr('sk-url') + rowData.maquina_id); + $('#pv_ec_lomo').text(this.pvObj.lomoLibro); + break; + + case 'rot_bn': + case 'rot_color': + // Conditional assignements depending on rotation of the printing shape + if (this.pvObj.orientacionFormas == 'v') { + let auxReg = this.pvObj.altoForma; + this.pvObj.altoForma = pvObj.anchoForma; + this.pvObj.anchoForma = auxReg; + } + $(pvName + '_forma').text(this.pvObj.anchoForma + "x" + this.pvObj.altoForma); + this.pvObj.altoClick = isNaN(parseFloat(rowData.alto_click)) ? 305 : parseFloat(rowData.alto_click); + this.pvObj.nFormasH = Math.trunc(this.pvObj.anchoImpresion / this.pvObj.anchoForma); + this.pvObj.nFormasV = Math.trunc((this.pvObj.altoImpresion - 3) / (this.pvObj.altoForma + 4)); + break; + + case 'bn': + case 'bnhq': + case 'color': + case 'colorhq': + // Conditional assignements depending on rotation of the printing shape + if (this.pvObj.orientacionFormas == 'v') { + let auxReg = this.pvObj.altoForma; + this.pvObj.altoForma = this.pvObj.anchoForma; + this.pvObj.anchoForma = auxReg; + } + $(pvName + '_forma').text(this.pvObj.anchoForma + "x" + this.pvObj.altoForma); + break; + case 'guardas': + // Fresado TD y Cosido TD + if (this.pvObj.tipoImpresion === 1 || this.pvObj.tipoImpresion === 3) { + this.pvObj.anchoForma = 2 * this.pvObj.anchoLibro; + } + // Fresado TB y Cosido TB + else if (this.pvObj.tipoImpresion === 2 || this.pvObj.tipoImpresion === 4) { + this.pvObj.anchoForma = this.pvObj.anchoLibro; + } + // Espiral TD y TB, Wire-o TD y TB + else if (this.pvObj.tipoImpresion === 5 || this.pvObj.tipoImpresion === 6 || + this.pvObj.tipoImpresion === 7 || this.pvObj.tipoImpresion === 8) { + this.pvObj.anchoForma = this.pvObj.anchoLibro; + } else { + // ? + } + + // Conditional assignements depending on rotation of the printing shape + if (this.pvObj.orientacionFormas == 'v') { + let auxReg = this.pvObj.altoForma; + this.pvObj.altoForma = this.pvObj.anchoForma; + this.pvObj.anchoForma = auxReg; + } + $(pvName + '_forma').text(this.pvObj.anchoForma + "x" + this.pvObj.altoForma); + break; + + default: + break; + } + } + previewInteriorPlana(lpTagName, isCosido, isTapaDura) { // Local parameters let guardaV = 0; let guardaH = 0; - let styleText = {size: 12, family: 'Public Sans'}; - + let styleText = { size: 12, family: 'Public Sans' }; + // Get the preview Object parameters - getObjetoLP(lpTagName, isCosido, isTapaDura); - + this.getObjetoLP(lpTagName, isCosido, isTapaDura); + // Configuracion de las guardas // Guarda vertical - if (pvObj.nFormasV > 1) { + if (this.pvObj.nFormasV > 1) { guardaV = 3; } // Guarda horizontal - if (pvObj.nFormasH > 1) { + if (this.pvObj.nFormasH > 1) { guardaH = 3; } // Constantes relativas a las dimnesiones de la forma - let LVo = pvObj.altoForma / 2; - let LHo = pvObj.anchoForma / 2; - + let LVo = this.pvObj.altoForma / 2; + let LHo = this.pvObj.anchoForma / 2; + // Clear the canvas element - $('#pv_' + pvObj.idIndex + '_shape').empty(); + $('#pv_' + this.pvObj.idIndex + '_shape').empty(); // Get the element for placing the graphical elements - var divPlana = document.getElementById('pv_' + pvObj.idIndex + '_shape'); - var _pvPlana = new Two({fitted: true}).appendTo(divPlana); + var divPlana = document.getElementById('pv_' + this.pvObj.idIndex + '_shape'); + var _pvPlana = new Two({ fitted: true }).appendTo(divPlana); // Calculate the center of the canvas element var origenPlana = new Two.Vector(_pvPlana.width / 2, _pvPlana.height / 2); - + var areaMaquinaPlana = _pvPlana.makeRectangle( origenPlana.x, origenPlana.y, - pvObj.anchoMaquina, - pvObj.altoMaquina); + this.pvObj.anchoMaquina, + this.pvObj.altoMaquina); areaMaquinaPlana.stroke = 'black'; areaMaquinaPlana.fill = '#E69F6E'; areaMaquinaPlana.linewidth = 1; - + var areaImpresionPlana = _pvPlana.makeRectangle( origenPlana.x, origenPlana.y, - pvObj.anchoImpresion, - pvObj.altoImpresion); + this.pvObj.anchoImpresion, + this.pvObj.altoImpresion); areaImpresionPlana.stroke = 'red'; areaImpresionPlana.fill = '#FCEAF1'; areaImpresionPlana.linewidth = 1; - + var formas = []; - - for (let iV = 0; iV < pvObj.nFormasV; iV++) { - - for (let iH = 0; iH < pvObj.nFormasH; iH++) { - - let _offsetX = ((((pvObj.nFormasH - 1) - 2 * iH) * LHo) + (((pvObj.nFormasH - 1) / 2 - iH) * guardaH)); - let _offsetY = ((((pvObj.nFormasV - 1) - 2 * iV) * LVo) + (((pvObj.nFormasV - 1) / 2 - iV) * guardaV)); - + + for (let iV = 0; iV < this.pvObj.nFormasV; iV++) { + + for (let iH = 0; iH < this.pvObj.nFormasH; iH++) { + + let _offsetX = ((((this.pvObj.nFormasH - 1) - 2 * iH) * LHo) + (((this.pvObj.nFormasH - 1) / 2 - iH) * guardaH)); + let _offsetY = ((((this.pvObj.nFormasV - 1) - 2 * iV) * LVo) + (((this.pvObj.nFormasV - 1) / 2 - iV) * guardaV)); + formas[iV + iH] = _pvPlana.makeRectangle( origenPlana.x + _offsetX, origenPlana.y + _offsetY, - pvObj.anchoForma, - pvObj.altoForma); + this.pvObj.anchoForma, + this.pvObj.altoForma); formas[iV + iH].stroke = 'grey'; formas[iV + iH].fill = '#F4F8F2'; formas[iV + iH].linewidth = 1; - + // Texts - _pvPlana.makeText(pvObj.altoForma, (origenPlana.x + _offsetX) + (pvObj.anchoForma / 2 - 25), (origenPlana.y + _offsetY), styleText); - _pvPlana.makeText(pvObj.anchoForma, (origenPlana.x + _offsetX), (origenPlana.y + _offsetY) + (pvObj.altoForma / 2 - 15), styleText); - + _pvPlana.makeText(this.pvObj.altoForma, (origenPlana.x + _offsetX) + (this.pvObj.anchoForma / 2 - 25), (origenPlana.y + _offsetY), styleText); + _pvPlana.makeText(this.pvObj.anchoForma, (origenPlana.x + _offsetX), (origenPlana.y + _offsetY) + (this.pvObj.altoForma / 2 - 15), styleText); + } } _pvPlana.update(); } - + previewRotativa(lpTagName, isCosido, isTapaDura) { - + // Local parameters - let styleText = {size: 12, family: 'Public Sans'}; + let styleText = { size: 12, family: 'Public Sans' }; let margenTop = 3; let guardaV = 0; let guardaH = 0; - + // Get the preview Object parameters - getObjetoLP(lpTagName, isCosido, isTapaDura); - + this.getObjetoLP(lpTagName, isCosido, isTapaDura); + // Calculos // Configuracion de las guardas // Guarda vertical - if (pvObj.nFormasV > 1) { + if (this.pvObj.nFormasV > 1) { guardaV = 3; } // Guarda horizontal - if (pvObj.nFormasH > 1) { + if (this.pvObj.nFormasH > 1) { guardaH = 3; } // Constantes relativas al libro - let LVo = pvObj.altoForma / 2; - let LHo = pvObj.anchoForma / 2; - + let LVo = this.pvObj.altoForma / 2; + let LHo = this.pvObj.anchoForma / 2; + // offset Y - let nTopForms = (pvObj.altoImpresion / 2.0 - margenTop) / (LVo + guardaV); + let nTopForms = (this.pvObj.altoImpresion / 2.0 - margenTop) / (LVo + guardaV); let yOffset = LVo * getDecimalPart(nTopForms); - + //console.log(yOffset); - + // Clear the canvas element $('#pv_' + pvObj.idIndex + '_shape').empty(); // Get the element for placing the graphical elements - var divRotativa = document.getElementById('pv_' + pvObj.idIndex + '_shape'); - var _pvRotativa = new Two({fitted: true}).appendTo(divRotativa); + var divRotativa = document.getElementById('pv_' + this.pvObj.idIndex + '_shape'); + var _pvRotativa = new Two({ fitted: true }).appendTo(divRotativa); // Calculate the center of the canvas element var origenRotativa = new Two.Vector(_pvRotativa.width / 2, _pvRotativa.height / 2); - + var areaMaquinaRotativa = _pvRotativa.makeRectangle( origenRotativa.x, origenRotativa.y, - pvObj.anchoMaquina, - pvObj.altoMaquina); + this.pvObj.anchoMaquina, + this.pvObj.altoMaquina); areaMaquinaRotativa.stroke = 'black'; areaMaquinaRotativa.fill = '#E69F6E'; areaMaquinaRotativa.linewidth = 1; - + var areaImpresionRotativa = _pvRotativa.makeRectangle( origenRotativa.x, origenRotativa.y, - pvObj.anchoImpresion, - pvObj.altoImpresion); + this.pvObj.anchoImpresion, + this.pvObj.altoImpresion); areaImpresionRotativa.stroke = 'red'; areaImpresionRotativa.fill = '#FCEAF1'; areaImpresionRotativa.linewidth = 1; - + var areaClickRotativa = _pvRotativa.makeRectangle( origenRotativa.x, - origenRotativa.y - (pvObj.altoImpresion / 2 - pvObj.altoClick / 2), - pvObj.anchoImpresion - 10, - pvObj.altoClick); + origenRotativa.y - (this.pvObj.altoImpresion / 2 - this.pvObj.altoClick / 2), + this.pvObj.anchoImpresion - 10, + this.pvObj.altoClick); areaClickRotativa.stroke = 'blue'; //areaClickRotativa.fill = '#FCEAF1'; areaClickRotativa.linewidth = 2; - + var formas = []; - - for (let iV = 0; iV < pvObj.nFormasV; iV++) { - - for (let iH = 0; iH < pvObj.nFormasH; iH++) { - - let _offsetX = ((((pvObj.nFormasH - 1) - 2 * iH) * LHo) + (((pvObj.nFormasH - 1) / 2 - iH) * guardaH)); - let _offsetY = ((((pvObj.nFormasV - 1) - 2 * iV) * LVo) + (((pvObj.nFormasV - 1) / 2 - iV) * guardaV)); - + + for (let iV = 0; iV < this.pvObj.nFormasV; iV++) { + + for (let iH = 0; iH < this.pvObj.nFormasH; iH++) { + + let _offsetX = ((((this.pvObj.nFormasH - 1) - 2 * iH) * LHo) + (((this.pvObj.nFormasH - 1) / 2 - iH) * guardaH)); + let _offsetY = ((((this.pvObj.nFormasV - 1) - 2 * iV) * LVo) + (((this.pvObj.nFormasV - 1) / 2 - iV) * guardaV)); + formas[iV + iH] = _pvRotativa.makeRectangle( origenRotativa.x + _offsetX, (origenRotativa.y - yOffset) + _offsetY, - pvObj.anchoForma, - pvObj.altoForma); + this.pvObj.anchoForma, + this.pvObj.altoForma); formas[iV + iH].stroke = 'grey'; formas[iV + iH].fill = '#F4F8F2'; formas[iV + iH].linewidth = 1; - + // Texts - _pvRotativa.makeText(pvObj.altoForma, (origenRotativa.x + _offsetX) + (pvObj.anchoForma / 2 - 25), ((origenRotativa.y - yOffset) + _offsetY), styleText); - _pvRotativa.makeText(pvObj.anchoForma, (origenRotativa.x + _offsetX), ((origenRotativa.y - yOffset) + _offsetY) + (pvObj.altoForma / 2 - 15), styleText); - + _pvRotativa.makeText(this.pvObj.altoForma, (origenRotativa.x + _offsetX) + (this.pvObj.anchoForma / 2 - 25), ((origenRotativa.y - yOffset) + _offsetY), styleText); + _pvRotativa.makeText(this.pvObj.anchoForma, (origenRotativa.x + _offsetX), ((origenRotativa.y - yOffset) + _offsetY) + (this.pvObj.altoForma / 2 - 15), styleText); + } - + } - + _pvRotativa.update(); - + } previewEsquemaCubierta() { @@ -792,7 +998,7 @@ class previewFormas { let styleCotas = { size: 12, family: 'Public Sans' }; let sangradoTexto = "Sangrado 5 mm"; let sangradoValor = parseFloat(5); // mm - + // Definicion de los parametros del Esquema de Cubierta (EC) if (this.solapa == 0) { if (this.size == "thumbnail") { diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js index 28fd3c4e..76ee7931 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/presupuestoAdminEdit.js @@ -22,6 +22,8 @@ class PresupuestoAdminEdit { this.tipo_impresion = $("#tipo_impresion_id"); this.POD = $("#POD"); + this.tipoTapa = $('.card-title').text().toLowerCase().includes('dura') ? 'dura' : 'blanda'; + this.datosGenerales = new DatosGenerales(this.domItem.find('#accordionDatosPresupuestoTip')); this.datosLibro = new DatosLibro(this.domItem.find('#accordionDatosLibroTip'), { @@ -68,20 +70,15 @@ class PresupuestoAdminEdit { this.previewFormasAdmin = new PreviewFormasAdmin(tipoLibro, this.tipoTapa, { - ancho: ()=>{return this.getDimensionLibro().ancho}, - alto: ()=>{return this.getDimensionLibro().alto}, - lomo: ()=>{$('#lc').val() === '' ? parseFloat('0.0') : parseFloat($('#lc').val())}, - solapas: ()=>{ - $('#solapas').prop('checked')?parseFloat($('#solapas_ancho').val()):0 - }, - solapas_sobrecubierta: ()=>{ - $('#solapas_sobrecubierta').prop('checked')?parseFloat($('#solapas_ancho_sobrecubierta').val()):0 - }, - lomoRedondo: ()=>{ - (self.tipo_impresion == 1 || $self.tipo_impresion == 3)?parseFloat($('#compLomoRedondo').val()):0 - }, + ancho: () => this.getDimensionLibro().ancho, + alto: () => this.getDimensionLibro().alto, + lomo: () => $('#lc').val() === '' ? parseFloat('0.0') : parseFloat($('#lc').val()), + solapas: () => $('#solapas').prop('checked') ? parseFloat($('#solapas_ancho').val()) : 0, + solapas_sobrecubierta: () => $('#solapas_sobrecubierta').prop('checked') ? parseFloat($('#solapas_ancho_sobrecubierta').val()) : 0, + lomoRedondo: () => (this.tipo_impresion == 1 || this.tipo_impresion == 3) ? parseFloat($('#compLomoRedondo').val()) : 0, } ); + this.previewFormasAdmin.init(); if (window.location.href.includes("edit")) { @@ -112,7 +109,7 @@ class PresupuestoAdminEdit { self.lc.val(parseFloat(response.data.lc).toFixed(2)); self.lsc.val(parseFloat(response.data.lsc).toFixed(2)); - self.cosido.val(response.data.cosido); + self.cosido.val(response.data.cosido?1:0); self.tipo_impresion.val(response.data.tipo_impresion); self.POD.val(response.data.POD); diff --git a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js index 9e382c00..85bee124 100644 --- a/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js +++ b/httpdocs/assets/js/safekat/pages/presupuestoAdmin/sections/previewFormasAdmin.js @@ -1,4 +1,3 @@ -import previewFormas from '../../../components/preview.js'; import preview from '../../../components/preview.js'; class PreviewFormasAdmin{ @@ -9,7 +8,7 @@ class PreviewFormasAdmin{ this.isCosido = $("#isCosido").val(); this.tipoTapa = tipoTapa; - this.preview = new previewFormas(null, tipoLibro, tipoTapa, "thumbnail", data); + this.preview = new preview(null, tipoLibro, tipoTapa, "thumbnail", data); } setData(data){ @@ -21,65 +20,65 @@ class PreviewFormasAdmin{ const self = this; $('#tab-pv-bn').on( "click", function() { - - self.preview.setData(data); - self.preview.previewInteriorPlana('bn', self.isCosido, self.tipoTapa.constains("dura")?1:0); + self.preview.setData(self.data); + self.preview.previewInteriorPlana('bn', self.isCosido, self.tipoTapa.includes("dura")?1:0); } ); - /* + $('#tab-pv-bnhq').on( "click", function() { - - previewInteriorPlana('bnhq', , ); - + self.preview.setData(self.data); + self.preview.previewInteriorPlana('bnhq', self.isCosido, self.tipoTapa.includes("dura")?1:0); } ); $('#tab-pv-color').on( "click", function() { - - previewInteriorPlana('color', , ); - + self.preview.setData(self.data); + self.preview.previewInteriorPlana('color', self.isCosido, self.tipoTapa.includes("dura")?1:0); } ); $('#tab-pv-colorhq').on( "click", function() { - - - previewInteriorPlana('colorhq', , ); - + self.preview.setData(self.data); + self.preview.previewInteriorPlana('colorhq', self.isCosido, self.tipoTapa.includes("dura")?1:0); } ); $('#tab-pv-rot-bn').on( "click", function() { + self.preview.setData(self.data); + self.preview.previewRotativa('rot_bn', self.isCosido, self.tipoTapa.includes("dura")?1:0); - previewRotativa('rot_bn', , ); - - } );*/ + } ); $('#tab-pv-rot-color').on( "click", function() { - self.preview.setData(data); + self.preview.setData(self.data); self.preview.previewRotativa('rot_color', self.isCosido, self.tipoTapa.constains("dura")?1:0); } ); - /* + $('#tab-pv-guardas').on( "click", function() { - previewInteriorPlana('guardas', , ); - + self.preview.setData(self.data); + self.preview.previewInteriorPlana('guardas', self.isCosido, self.tipoTapa.includes("dura")?1:0); } ); $('#tab-pv-cubierta').on( "click", function() { - previewInteriorPlana('cubierta', , ); + self.preview.setData(self.data); + self.preview.previewInteriorPlana('cubierta', self.isCosido, self.tipoTapa.includes("dura")?1:0); } ); $('#tab-pv-esquema-cubierta').on( "click", function() { - previewEsquemaCubierta('ec', , ); + self.preview.setData(self.data); + self.preview.previewEsquemaCubierta('ec', self.isCosido, self.tipoTapa.includes("dura")?1:0); } ); $('#tab-pv-sobrecubierta').on( "click", function() { - previewInteriorPlana('sobrecubierta', , ); + self.preview.setData(self.data); + self.preview.previewInteriorPlana('sobrecubierta', self.isCosido, self.tipoTapa.includes("dura")?1:0); - } );*/ + } ); } -} \ No newline at end of file +} + +export default PreviewFormasAdmin; \ No newline at end of file