trabajando en comparador

This commit is contained in:
2024-12-17 14:38:02 +01:00
parent 4e7f53ba6c
commit 643f84684a
11 changed files with 267 additions and 492 deletions

View File

@ -74,17 +74,10 @@
<p><?= lang('MaquinasTarifasImpresions.negro') ?></p>
</div>
<div class="col-md-12 col-lg-2 px-4">
<input type="text" id="compPaginasNegro" name="comp_paginas_negro" placeholder="0" maxLength="5" class="form-control comp_negro_items" value="<?= isset($comp_data->bn->paginas) ? (old(0, $comp_data->bn->paginas)) : '0' ?>">
<input type="text" id="compPaginasNegro" name="comp_paginas_negro" placeholder="0" maxLength="5" class="form-control comp_negro_items" value="">
</div>
<div class="col-md-12 col-lg-6 px-4">
<select id="compPapelNegro" name="comp_papel_negro" class="form-control select2bs2 comp_negro_items" style="width: 100%;">
<?php if (isset($papelGenericoNegroList) && is_array($papelGenericoNegroList) && !empty($papelGenericoNegroList)) :
foreach ($papelGenericoNegroList as $k => $v) : ?>
<option value="<?= $v->id ?>">
<?= $v->nombre ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div>
<div class="col-md-12 col-lg-2 px-4">
@ -578,161 +571,7 @@
allowClear: false,
});
$('#compPapelNegro').select2({
allowClear: false,
});
$('#compGramajeNegro').select2({
allowClear: false,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfPresupuestoAdmin") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
tipo: 'gramaje',
uso: 'bn',
tirada: parseInt($('#tirada').val()),
merma: parseInt($('#mermacubierta').val()),
datos: $('#compPapelNegro').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#compPapelNegrohq').select2({
allowClear: false,
});
$('#compGramajeNegrohq').select2({
allowClear: false,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfPresupuestoAdmin") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
tipo: 'gramaje',
uso: 'bnhq',
tirada: parseInt($('#tirada').val()),
merma: parseInt($('#mermacubierta').val()),
datos: $('#compPapelNegrohq').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#compPapelColor').select2({
allowClear: false,
});
$('#compPapelColorhq').select2({
allowClear: false,
});
$('#compGramajeColor').select2({
allowClear: false,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfPresupuestoAdmin") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
tipo: 'gramaje',
uso: 'color',
tirada: parseInt($('#tirada').val()),
merma: parseInt($('#mermacubierta').val()),
datos: $('#compPapelColor').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#compGramajeColorhq').select2({
allowClear: false,
minimumResultsForSearch: Infinity,
ajax: {
url: '<?= route_to("menuItemsOfPresupuestoAdmin") ?>',
type: 'post',
data: function (params) {
return {
tipo: 'gramaje',
uso: 'colorhq',
tirada: parseInt($('#tirada').val()),
merma: parseInt($('#mermacubierta').val()),
datos: $('#compPapelColorhq').select2('data')[0].text.trim() ,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
$('#compPapelCubierta').select2({
allowClear: false,
});
$('#compGramajeCubierta').select2({
allowClear: false,
});
$('#compPapelSobrecubierta').select2({
allowClear: false,
});
$('#compGramajeSobrecubierta').select2({
allowClear: false,
minimumResultsForSearch: Infinity,
});
$('#encuadernacion').select2({
allowClear: false,
});
<?php if($tipo_impresion_id == 1 || $tipo_impresion_id == 3 || $tipo_impresion_id == 5 || $tipo_impresion_id == 7): ?>
$('#compCarasCubierta').select2({
allowClear: false,
@ -1543,6 +1382,7 @@
function checkComparadorInt(is_color, is_hq, actualizarLineaPlana=false, actualizarLineaRot=false) {
/* TO-DO with select2 component
try{
clearIntLineas(is_color);
@ -1587,6 +1427,7 @@
}catch(e){
console.log(e)
}
*/
}

View File

@ -74,17 +74,17 @@
<!-- Código JS de las lineas de presupuesto. -->
<!------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
window.papelGenericoNegroList = <?php echo json_encode($papelGenericoNegroList); ?>;
window.papelGenericoNegroHQList = <?php echo json_encode($papelGenericoNegroHQList); ?>;
window.papelGenericoColorList = <?php echo json_encode($papelGenericoColorList); ?>;
window.papelGenericoColorHQList = <?php echo json_encode($papelGenericoColorHQList); ?>;
window.papelGenericoCubiertaList = <?php echo json_encode($papelGenericoCubiertaList); ?>;
window.papelGenericoSobrecubiertaList = <?php echo json_encode($papelGenericoSobrecubiertaList); ?>;
window.papelGenericoRotativaNegroList = <?php echo json_encode($papelGenericoRotativaNegroList); ?>;
window.papelGenericoRotativaColorList = <?php echo json_encode($papelGenericoRotativaColorList); ?>;
window.papelGenericoNegroList = [];
window.papelGenericoNegroHQList = [];
window.papelGenericoColorList = [];
window.papelGenericoColorHQList = [];
window.papelGenericoCubiertaList = [];
window.papelGenericoSobrecubiertaList = [];
window.papelGenericoRotativaNegroList = [];
window.papelGenericoRotativaColorList = [];
<?php if($tipo_impresion_id == 1 || $tipo_impresion_id == 3 || $tipo_impresion_id == 5 || $tipo_impresion_id == 7): ?>
window.papelGenericoGuardasList = <?php echo json_encode($papelGenericoGuardasList); ?>;
window.papelGenericoGuardasList = [];
<?php endif; ?>
window.lineasPresupuestoList = <?php echo json_encode($lineasPresupuesto); ?>;
@ -95,8 +95,11 @@ window.routes_lp = {
}
/*
fill_lp_from_bbdd()
checkPaginasPresupuesto()
*/
<?= $this->endSection() ?>

View File

@ -309,7 +309,7 @@
<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('themes/vuexy/vendor/libs/two/two.js') ?>"></script>