mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en el comparador
This commit is contained in:
@ -158,7 +158,7 @@
|
||||
<!-- Código JS comportamiento ?????. -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
/*
|
||||
$("textarea[name*='comentarios_']").each(function(){
|
||||
if (!$.trim($(this).val())) {
|
||||
// textarea is empty or contains only white-space
|
||||
@ -167,7 +167,7 @@ $("textarea[name*='comentarios_']").each(function(){
|
||||
$("#mostrar_" + $(this).attr('name')).show();
|
||||
}
|
||||
});
|
||||
|
||||
*/
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
<!-- Código JS comportamiento general pag. -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
/*
|
||||
window.paisList = <?php echo json_encode($paisList); ?>;
|
||||
window.direccionesList = <?php echo json_encode($direccionesList); ?>;
|
||||
|
||||
@ -74,5 +74,5 @@ window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
||||
$( document ).ready(function() {
|
||||
load_datos_envios();
|
||||
});
|
||||
|
||||
*/
|
||||
<?= $this->endSection() ?>
|
||||
File diff suppressed because it is too large
Load Diff
@ -286,6 +286,7 @@
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
// Generación de la lista de servicios de acabado (id, nombre)
|
||||
<?php /*
|
||||
window.acabadosList = <?php echo json_encode($serviciosAcabado); ?>;
|
||||
window.serviciosacabadosList = <?php echo json_encode($serviciosAcabadosList); ?>;
|
||||
window.serviciosAutomaticos = <?php echo json_encode($serviciosAutomaticos); ?>;
|
||||
@ -318,7 +319,7 @@
|
||||
|
||||
init_servicio_extra()
|
||||
|
||||
/* ELIMINADO PARA COMPROBAR EL MAXIMO DE SOLAPAS DESDE EL BACKEND
|
||||
/// ELIMINADO PARA COMPROBAR EL MAXIMO DE SOLAPAS DESDE EL BACKEND
|
||||
PENDIENTE
|
||||
$('.solapas_cubierta').on('change', function(){
|
||||
|
||||
@ -364,6 +365,6 @@
|
||||
$('#compGramajeSobrecubierta').trigger('change')
|
||||
})
|
||||
|
||||
*/
|
||||
*/?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
<!-- Código JS de las lineas de presupuesto. -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
window.papelGenericoNegroList = [];
|
||||
/*window.papelGenericoNegroList = [];
|
||||
window.papelGenericoNegroHQList = [];
|
||||
window.papelGenericoColorList = [];
|
||||
window.papelGenericoColorHQList = [];
|
||||
@ -95,7 +95,7 @@ window.routes_lp = {
|
||||
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
/*
|
||||
fill_lp_from_bbdd()
|
||||
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
/*
|
||||
$('#cancelAdd').on('click', function(){
|
||||
$('#addressForm').modal("hide");
|
||||
})
|
||||
@ -394,5 +394,5 @@ $('#addressForm').on('hidden.bs.modal', function () {
|
||||
$('#add_saveDirection').prop('checked', false)
|
||||
$('#add_entregaPieCalle').prop('checked', false)
|
||||
})
|
||||
|
||||
*/
|
||||
<?=$this->endSection() ?>
|
||||
@ -918,7 +918,7 @@
|
||||
<!-- Código JS comportamiento ?????. -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
/*
|
||||
|
||||
$('#tab-pv-bn').on( "click", function() {
|
||||
|
||||
@ -980,6 +980,7 @@ $('#tab-pv-sobrecubierta').on( "click", function() {
|
||||
previewInteriorPlana('sobrecubierta', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
*/
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
@ -52,14 +52,14 @@
|
||||
<!-- Código JS comportamiento ?????. -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
window.datatable_lang_url = "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json";
|
||||
/* window.datatable_lang_url = "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json";
|
||||
|
||||
window.datatable_TA_url = "<?= route_to('dataTableOfPresupuestoTiradasAlternativas') ?>";
|
||||
window.get_tirada_url = "<?= route_to('getTiradaData') ?>";
|
||||
|
||||
window.error_lang_tirada_alt_duplicada = "<?= lang('Presupuestos.errores.tirada_alt_duplicada') ?>";
|
||||
window.error_lang_tirada_alt_tipo = "<?= lang('Presupuestos.errores.tirada_alt_tipo') ?>";
|
||||
|
||||
*/
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
@ -1,81 +1,11 @@
|
||||
/*******************************
|
||||
* Eventos asociados a elementos HTML
|
||||
*******************************/
|
||||
$('#compPaginasNegro').on("change", function () {
|
||||
var negro = parseInt(document.getElementById('compPaginasNegro').value);
|
||||
const paginas = parseInt(document.getElementById('paginas').value);
|
||||
if (paginas < negro) {
|
||||
document.getElementById('compPaginasNegro').value = paginas;
|
||||
negro = paginas;
|
||||
}
|
||||
var color = parseInt(document.getElementById('compPaginasColor').value);
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
|
||||
var newValue = paginas - negro;
|
||||
if (newValue != color) {
|
||||
document.getElementById('compPaginasColor').value = newValue >= 0 ? newValue : 0;
|
||||
$('#compPaginasColor').change();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#compPaginasColor').on("change", function () {
|
||||
const paginas = parseInt(document.getElementById('paginas').value);
|
||||
var color = parseInt(document.getElementById('compPaginasColor').value);
|
||||
var negro = parseInt(document.getElementById('compPaginasNegro').value);
|
||||
|
||||
if (paginas < color) {
|
||||
document.getElementById('compPaginasColor').value = paginas;
|
||||
color = paginas
|
||||
}
|
||||
var newValue = paginas - color;
|
||||
if (newValue != negro) {
|
||||
document.getElementById('compPaginasNegro').value = newValue >= 0 ? newValue : 0;
|
||||
$('#compPaginasNegro').change();
|
||||
}
|
||||
});
|
||||
|
||||
$('#compPaginasNegrohq').on("change", function () {
|
||||
|
||||
var negro = parseInt(document.getElementById('compPaginasNegrohq').value);
|
||||
const paginas = parseInt(document.getElementById('paginas').value);
|
||||
if (paginas < negro) {
|
||||
document.getElementById('compPaginasNegrogq').value = paginas;
|
||||
negro = paginas;
|
||||
}
|
||||
var color = parseInt(document.getElementById('compPaginasColorhq').value);
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
|
||||
var newValue = paginas - negro;
|
||||
if (newValue != color) {
|
||||
document.getElementById('compPaginasColorhq').value = newValue >= 0 ? newValue : 0;
|
||||
$('#compPaginasColorhq').change();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#compPaginasColorhq').on("change", function () {
|
||||
const paginas = parseInt(document.getElementById('paginas').value);
|
||||
var color = parseInt(document.getElementById('compPaginasColorhq').value);
|
||||
var negro = parseInt(document.getElementById('compPaginasNegrohq').value);
|
||||
|
||||
if (paginas < color) {
|
||||
document.getElementById('compPaginasColorhq').value = paginas;
|
||||
color = paginas
|
||||
}
|
||||
var newValue = paginas - color;
|
||||
if (newValue != negro) {
|
||||
document.getElementById('compPaginasNegrohq').value = newValue >= 0 ? newValue : 0;
|
||||
$('#compPaginasNegrohq').change();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#prototipo').on("change", function () {
|
||||
$('#ferro').prop('checked', true)
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -84,28 +14,6 @@ $('#compPosPaginasColor').on("keyup", function () {
|
||||
});
|
||||
|
||||
|
||||
// Este evento recoloca los headers de las tablas cuando se pulsa el
|
||||
// boton del acordeon
|
||||
$('.accordion-button').on('click', function (e) {
|
||||
|
||||
if (e.target.id.includes("plana")) {
|
||||
$("#tableCompIntPlana").DataTable().columns.adjust();
|
||||
}
|
||||
else if (e.target.id.includes("rotativa")) {
|
||||
$("#tableCompIntRotativa").DataTable().columns.adjust();
|
||||
}
|
||||
else if (e.target.id.includes("cubierta")) {
|
||||
$("#tableCompCubierta").DataTable().columns.adjust();
|
||||
}
|
||||
else if (e.target.id.includes("guardas")) {
|
||||
$("#tableCompGuardas").DataTable().columns.adjust();
|
||||
}
|
||||
else if (e.target.id.includes("LineasPresupuesto")) {
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -189,110 +97,11 @@ function getRowFromLineaRot(linea) {
|
||||
|
||||
|
||||
|
||||
function computarPaginasColor(string) {
|
||||
|
||||
var numbers = [];
|
||||
for (const [, beginStr, endStr] of string.matchAll(/(\d+)(?:-(\d+))?/g)) {
|
||||
const [begin, end] = [beginStr, endStr].map(Number);
|
||||
numbers.push(begin);
|
||||
if (endStr !== undefined) {
|
||||
for (let num = begin + 1; num <= end; num++) {
|
||||
numbers.push(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
var numbers2 = [];
|
||||
numbers.forEach(function (value, i) {
|
||||
// Si es impar y no está el siguiente par hay que añadirlo
|
||||
if (value % 2 != 0 && numbers[i + 1] != value + 1) {
|
||||
numbers2.push(value + 1);
|
||||
}
|
||||
});
|
||||
numbers = numbers.concat(numbers2);
|
||||
numbers.sort(function (a, b) {
|
||||
return a - b;
|
||||
});
|
||||
calPagesTextarea = document.getElementById('compCalPaginasColor');
|
||||
calPagesTextarea.value = numbers;
|
||||
autosize.update(calPagesTextarea);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function updatePapelesComparador() {
|
||||
|
||||
var e = document.getElementById("tipoImpresion");
|
||||
elements_negro = document.getElementsByClassName('comp-negro-selected');
|
||||
elements_negrohq = document.getElementsByClassName('comp-negrohq-selected');
|
||||
elements_color = document.getElementsByClassName('comp-color-selected');
|
||||
elements_colorhq = document.getElementsByClassName('comp-colorhq-selected');
|
||||
switch (e.value) {
|
||||
case "negro":
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
break;
|
||||
|
||||
case "negrohq":
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "none";
|
||||
|
||||
});
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
break;
|
||||
|
||||
case "color":
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
break;
|
||||
|
||||
case "colorhq":
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -304,14 +304,14 @@
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/translate_js/Presupuestos') ?>"></script>
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<script src="<?= site_url('js_loader/datosEnvios_js') ?>"></script>
|
||||
<!---<script src="<?= site_url('js_loader/datosEnvios_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/resumenPresupuestos_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestos_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/comparadorPresupuestoAdmin_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/previsualizador_js') ?>"></script>
|
||||
<!---<script src="<?= site_url('js_loader/lineasPresupuesto_js') ?>"></script> -->
|
||||
<script src="<?= site_url('js_loader/lineasPresupuesto_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/tiradasAlternativas_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/datosServicios_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/datosServicios_js') ?>"></script> -->
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/two/two.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user