mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
corregido bug de foco lp. añadidos decimales gotas. cambiado a tipo number inputs rot
This commit is contained in:
@ -90,6 +90,18 @@ const papelGenericoRotativaColorList = <?php echo json_encode($papelGenericoRota
|
||||
// variable para controlar el foco en los inputs
|
||||
let focused = 0;
|
||||
|
||||
function change_focus(){
|
||||
// se comprueba que el elemento es un input
|
||||
if($('#'+focused).is('input')){
|
||||
if(focused){
|
||||
$('#'+focused).focus();
|
||||
$('#'+focused).select();
|
||||
focused = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Formatting function for row details - modify as you need
|
||||
function format(d) {
|
||||
|
||||
@ -167,7 +179,7 @@ function format(d) {
|
||||
'</div>'+
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.numPagColor') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_numPagColor" name="' + d.row_id +'_numPagColor" class="lp-cell lp-input' + (d.row_id.includes('color')?'" ':' lp-cell-disabled" readonly ') + ' value="' + d.numPagColor +'">' +
|
||||
'<input type="number" id="' + d.row_id +'_numPagColor" name="' + d.row_id +'_numPagColor" class="lp-cell lp-input no-spinner' + (d.row_id.includes('color')?'" ':' lp-cell-disabled" readonly ') + ' value="' + d.numPagColor +'">' +
|
||||
'</div>' +
|
||||
((d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.saturacion') ?>' +
|
||||
@ -175,32 +187,32 @@ function format(d) {
|
||||
'</div>':'') +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.cobNegro') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_cobNegro" name="' + d.row_id +'_cobNegro" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobNegro +'">' +
|
||||
'<input type="number" id="' + d.row_id +'_cobNegro" name="' + d.row_id +'_cobNegro" class="lp-cell lp-input no-spinner ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobNegro +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.cobCyan') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_cobCyan" name="' + d.row_id +'_cobCyan" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobCyan +'">' +
|
||||
'<input type="number" id="' + d.row_id +'_cobCyan" name="' + d.row_id +'_cobCyan" class="lp-cell lp-input no-spinner ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobCyan +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.cobMagenta') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_cobMagenta" name="' + d.row_id +'_cobMagenta" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobMagenta +'">' +
|
||||
'<input type="number" id="' + d.row_id +'_cobMagenta" name="' + d.row_id +'_cobMagenta" class="lp-cell lp-input no-spinner ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobMagenta +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.cobAmarillo') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_cobAmarillo" name="' + d.row_id +'_cobAmarillo" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobAmarillo +'">' +
|
||||
'<input type="number" id="' + d.row_id +'_cobAmarillo" name="' + d.row_id +'_cobAmarillo" class="lp-cell lp-input no-spinner ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobAmarillo +'">' +
|
||||
'</div>' +
|
||||
((!d.row_id.includes('rot'))?
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.cobCG') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_cobCG" name="' + d.row_id +'_cobCG" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobCG +'">' +
|
||||
'<input type="number" id="' + d.row_id +'_cobCG" name="' + d.row_id +'_cobCG" class="lp-cell lp-input no-spinner ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobCG +'">' +
|
||||
'</div>':'') +
|
||||
'<div class="col-md-12 col-lg-1">' +
|
||||
'<?= lang('Presupuestos.gotaNegro') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gotaNegro" name="' + d.row_id +'_gotaNegro" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.gotaNegro +'">' +
|
||||
'<input type="number" id="' + d.row_id +'_gotaNegro" name="' + d.row_id +'_gotaNegro" class="lp-cell lp-input no-spinner ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.gotaNegro +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1 ">' +
|
||||
'<?= lang('Presupuestos.gotaColor') ?>' +
|
||||
'<input type="text" id="' + d.row_id +'_gotaColor" name="' + d.row_id +'_gotaColor" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.gotaColor +'">' +
|
||||
'<input type="number" id="' + d.row_id +'_gotaColor" name="' + d.row_id +'_gotaColor" class="lp-cell lp-input no-spinner ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.gotaColor +'">' +
|
||||
'</div>' +
|
||||
'<div class="col-md-12 col-lg-1" style="display: grid;" >' +
|
||||
'<?= lang('Presupuestos.aFavorFibra') ?>' +
|
||||
@ -612,7 +624,7 @@ var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
||||
.addClass('form-control form-select-sm lp-cell lp-select ' + row.row_class + '-select')
|
||||
.css('min-width', '40px')
|
||||
|
||||
var option = '<option value="" selected>'+data+'</option>';
|
||||
var option = '<option value="" selected>'+ parseInt(data)+'</option>';
|
||||
select.append(option);
|
||||
|
||||
return select[0].outerHTML
|
||||
@ -812,8 +824,8 @@ function processRowData(row, rowId, rowClass){
|
||||
data.cobCyan = isNaN(parseFloat(row.datosTipologias.cyan)) ? "" : parseFloat(row.datosTipologias.cyan).toFixed(2)
|
||||
data.cobMagenta = isNaN(parseFloat(row.datosTipologias.magenta)) ? "" : parseFloat(row.datosTipologias.magenta).toFixed(2)
|
||||
data.cobAmarillo = isNaN(parseFloat(row.datosTipologias.amarillo)) ? "" : parseFloat(row.datosTipologias.amarillo).toFixed(2)
|
||||
data.gotaNegro = isNaN(parseFloat(row.datosTipologias.gota_negro)) ? "" : parseFloat(row.datosTipologias.gota_negro).toFixed(0)
|
||||
data.gotaColor = isNaN(parseFloat(row.datosTipologias.gota_color)) ? "" : parseFloat(row.datosTipologias.gota_color).toFixed(0)
|
||||
data.gotaNegro = isNaN(parseFloat(row.datosTipologias.gota_negro)) ? "" : parseFloat(row.datosTipologias.gota_negro).toFixed(2)
|
||||
data.gotaColor = isNaN(parseFloat(row.datosTipologias.gota_color)) ? "" : parseFloat(row.datosTipologias.gota_color).toFixed(2)
|
||||
|
||||
data.resolucion = isNaN(parseFloat(row.resolucion)) ? "" : parseFloat(row.resolucion).toFixed(0)
|
||||
data.areaPaginas = isNaN(parseFloat(row.superficie)) ? "" : parseFloat(row.superficie).toFixed(2)
|
||||
@ -859,7 +871,7 @@ function processRowData(row, rowId, rowClass){
|
||||
|
||||
if(!rowId.includes('rot')){
|
||||
data.cobCG = isNaN(parseFloat(row.datosTipologias.cg)) ? "" : parseFloat(row.datosTipologias.cg).toFixed(2)
|
||||
data.gotasCG = isNaN(parseFloat(row.num_gotas_cg)) ? "" : parseFloat(row.num_gotas_cg).toFixed(0)
|
||||
data.gotasCG = isNaN(parseFloat(row.num_gotas_cg)) ? "" : parseFloat(row.num_gotas_cg).toFixed(2)
|
||||
data.gTintaCG = isNaN(parseFloat(row.peso_gotas_cg)) ? "" : parseFloat(row.peso_gotas_cg).toFixed(2)
|
||||
data.gTintaCGPed = isNaN(parseFloat(row.peso_gotas_cg_pedido)) ? "" : parseFloat(row.peso_gotas_cg_pedido).toFixed(2)
|
||||
}
|
||||
@ -2221,11 +2233,7 @@ function fill_lp_bnhq(row, fromComparator=false){
|
||||
}
|
||||
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
if(focused){
|
||||
$('#'+focused).focus();
|
||||
$('#'+focused).select();
|
||||
focused = 0;
|
||||
}
|
||||
change_focus();
|
||||
}
|
||||
|
||||
function eventos_lp_bnhq(isInkjet = false){
|
||||
@ -2562,11 +2570,7 @@ function fill_lp_colorhq(row, fromComparator=false){
|
||||
}
|
||||
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
if(focused){
|
||||
$('#'+focused).focus();
|
||||
$('#'+focused).select();
|
||||
focused = 0;
|
||||
}
|
||||
change_focus();
|
||||
}
|
||||
|
||||
function eventos_lp_colorhq(isInkjet = false){
|
||||
@ -2909,12 +2913,7 @@ function fill_lp_rot_bn(row, fromComparador=false){
|
||||
|
||||
$('.lp_rot_bn').css('display', '')
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
if(focused){
|
||||
$('#'+focused).focus();
|
||||
$('#'+focused).select();
|
||||
focused = 0;
|
||||
}
|
||||
|
||||
change_focus();
|
||||
}
|
||||
|
||||
function eventos_lp_rot_bn(){
|
||||
@ -3258,12 +3257,7 @@ function fill_lp_rot_color(row, fromComparador=false){
|
||||
}
|
||||
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
if(focused){
|
||||
$('#'+focused).focus();
|
||||
$('#'+focused).select();
|
||||
focused = 0;
|
||||
}
|
||||
|
||||
change_focus();
|
||||
}
|
||||
|
||||
function eventos_lp_rot_color(){
|
||||
@ -3536,11 +3530,7 @@ function fill_lp_cubierta(row, fromComparador=false){
|
||||
}
|
||||
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
if(focused){
|
||||
$('#'+focused).focus();
|
||||
$('#'+focused).select();
|
||||
focused = 0;
|
||||
}
|
||||
change_focus();
|
||||
}
|
||||
|
||||
function eventos_lp_cubierta(){
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<p><?= lang('Presupuestos.tiradasInfoIVA') ?></p>
|
||||
<input type="hidden" name="tirada_alternativa_json_data" id="tirada_alternativa_json_data" class="form-control" value='<?= isset($presupuestoEntity->tirada_alternativa_json_data)?$presupuestoEntity->tirada_alternativa_json_data:'' ?>'></input>
|
||||
<div class='d-flex justify-content-end '>
|
||||
<input id="tirada_alt" type="number" style="width: 10% !important; display: inline-flex !important" class="form-control" value="1" min="1" step="1">
|
||||
<input id="tirada_alt" type="number" style="width: 120px !important; display: inline-flex !important" class="form-control" value="1" min="1" step="1">
|
||||
<button id="add_tirada_alt" type="button" class="btn btn-secondary waves-effect waves-light"><i class="ti ti-circle-plus"></i></button>
|
||||
</div>
|
||||
<table id="tableTiradas" class="comparator-table table dt-responsive dataTable" style="width: 100%;">
|
||||
|
||||
Reference in New Issue
Block a user