diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_previewItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_previewItems.php index 3ffd052c..3bc14229 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_previewItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_previewItems.php @@ -787,16 +787,6 @@ $('#tab-pv-esquema-cubierta').on( "click", function() { } ); - -$('#confirmDelete').on( "click", function() { - setTimeout(function (){ - getVisibleTabs(); - }, 1000); -} ); - - - - endSection() ?> diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js index 58214bfa..632ac054 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/previews.js @@ -79,9 +79,7 @@ function previewInteriorPlana(lpTagName) { _pvPlana.makeText(pvObj.anchoForma, (origenPlana.x + _offsetX), (origenPlana.y + _offsetY) + (pvObj.altoForma / 2 - 15), styleText); } - } - _pvPlana.update(); } @@ -177,13 +175,8 @@ function previewRotativa(lpTagName) { } - // Texts - //_pvPlana.makeText(cubiertaObj.altoLibro, origenPlana.x + (fullBookWith / 2 - 25), origenPlana.y, styles); - //_pvPlana.makeText(fullBookWith, origenPlana.x, origenPlana.y + (cubiertaObj.altoLibro / 2 - 15), styles); - _pvRotativa.update(); - } function getDecimalPart(floatNumber) { @@ -373,11 +366,31 @@ function getObjetoLP(lpName) { $('#tableLineasPresupuesto').DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) { - if (this.data().row_id.indexOf(lpName) >= 0) { - rowData = this.data(); + let lineaPresupuestoId = this.data().row_id; + + switch (lpName) { + case 'bn': + case 'bnhq': + case 'color': + case 'colorhq': + case 'cubierta': + case 'rot_bn': + case 'rot_color': + if (lineaPresupuestoId.indexOf(lpName) >= 0) { + rowData = this.data(); + } + break; + case 'ec': + if (lineaPresupuestoId.indexOf('cubierta') >= 0) { + rowData = this.data(); + } + break; + default: + //console.log(lineaPresupuestoId); + break; } - console.log(rowData); + //console.log(rowData); }); @@ -434,9 +447,9 @@ function getObjetoLP(lpName) { $(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma); break; case 'ec': - $(pvName + '_pg').attr("href", $(pvName + '_pg').attr('sk-url') + $('#lp_cubierta_papel').val()); - $(pvName + '_pi').attr("href", $(pvName + '_pi').attr('sk-url') + $('#lp_cubierta_papelImpresion').val()); - $(pvName + '_mi').attr("href", $(pvName + '_mi').attr('sk-url') + $('#lp_cubierta_maquina').val()); + $(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(pvObj.lomoLibro); break; @@ -449,9 +462,11 @@ function getObjetoLP(lpName) { } $(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma); pvObj.altoClick = 305; //parseFloat($('#lp_' + lpName + '_alto_click').val()); + pvObj.nFormas = (_isCosido) ? pvObj.nFormas/2 : pvObj.nFormas; + $(pvName + '_nFormas').text(pvObj.nFormas); pvObj.nFormasH = Math.trunc(pvObj.anchoImpresion / pvObj.anchoForma); pvObj.nFormasV = Math.trunc((pvObj.altoImpresion - 3) / (pvObj.altoForma + 4)); - console.log() + //console.log() break; case 'bn': @@ -465,6 +480,8 @@ function getObjetoLP(lpName) { pvObj.anchoForma = auxReg; } $(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma); + pvObj.nFormas = (_isCosido) ? pvObj.nFormas/2 : pvObj.nFormas; + $(pvName + '_nFormas').text(pvObj.nFormas); break; default: @@ -482,8 +499,9 @@ function getVisibleTabs() { $(this).removeClass('active'); }); - /*$("#pv_" + lpName).removeClass("active show"); - $("#pv_esquema_" + lpName).removeClass("active show");*/ + $('*[id*=pv_]').each(function () { + $(this).removeClass("active show"); + }); }); @@ -514,60 +532,6 @@ function getVisibleTabs() { }); - /* - $("#tableLineasPresupuesto tbody tr").each(function () { - let isVisible = $(this).is(":visible"); - let lpName = $(this).attr('id').replace('lp_', ''); - let tabName = lpName.replace('_', '-'); - - switch (lpName){ - case 'bn': - case 'bnhq': - case 'color': - case 'colorhq': - case 'rot_bn': - case 'rot_color': - if(isVisible) { - $("#tab-pv-" + tabName).show(); - }else{ - $("#tab-pv-" + tabName).hide(); - $("#tab-pv-" + tabName).children('.active').each(function () { - $(this).removeClass('active'); - }); - $("#pv_" + lpName).removeClass("active show"); - } - break; - - - case 'cubierta': - if(isVisible) { - $("#tab-pv-" + tabName).show(); - $("#tab-pv-esquema-" + tabName).show(); - }else{ - $("#tab-pv-" + tabName).hide(); - $("#tab-pv-esquema-" + tabName).hide(); - $("#tab-pv-" + tabName).children('.active').each(function () { - $(this).removeClass('active'); - }); - $("#tab-pv-esquema-" + tabName).children('.active').each(function () { - $(this).removeClass('active'); - }); - $("#pv_" + lpName).removeClass("active show"); - $("#pv_esquema_" + lpName).removeClass("active show"); - } - break; - - default: - //console.log(tabType + " visible? " +isVisible ); - break; - } - - //console.log(tabType + " visible? " +isVisible ); - - }); - - */ - }