mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglado bug
This commit is contained in:
@ -447,7 +447,31 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#compGramajeNegro').select2({
|
$('#compGramajeNegro').select2({
|
||||||
|
|
||||||
allowClear: false,
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'bn',
|
||||||
|
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({
|
$('#compPapelNegrohq').select2({
|
||||||
@ -456,6 +480,30 @@
|
|||||||
|
|
||||||
$('#compGramajeNegrohq').select2({
|
$('#compGramajeNegrohq').select2({
|
||||||
allowClear: false,
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'bnhq',
|
||||||
|
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({
|
$('#compPapelColor').select2({
|
||||||
@ -468,10 +516,56 @@
|
|||||||
|
|
||||||
$('#compGramajeColor').select2({
|
$('#compGramajeColor').select2({
|
||||||
allowClear: false,
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'color',
|
||||||
|
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({
|
$('#compGramajeColorhq').select2({
|
||||||
allowClear: false,
|
allowClear: false,
|
||||||
|
minimumResultsForSearch: Infinity,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
tipo: 'gramaje',
|
||||||
|
uso: 'colorhq',
|
||||||
|
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({
|
$('#compPapelCubierta').select2({
|
||||||
@ -561,6 +655,7 @@
|
|||||||
}catch(e){}
|
}catch(e){}
|
||||||
}catch(e){}
|
}catch(e){}
|
||||||
}catch(e){}
|
}catch(e){}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var tableCompIntPlana = new DataTable('#tableCompIntPlana',{
|
var tableCompIntPlana = new DataTable('#tableCompIntPlana',{
|
||||||
@ -734,7 +829,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getLineasIntPlana(is_color, is_hq){
|
async function getLineasIntPlana(is_color, is_hq){
|
||||||
|
|
||||||
const dimension = getDimensionLibro();
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
@ -783,7 +878,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLineasIntRot(is_hq){
|
async function getLineasIntRot(is_hq){
|
||||||
|
|
||||||
const dimension = getDimensionLibro();
|
const dimension = getDimensionLibro();
|
||||||
|
|
||||||
@ -976,6 +1071,7 @@
|
|||||||
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
||||||
checkDatosPedidoForComp()) {
|
checkDatosPedidoForComp()) {
|
||||||
|
|
||||||
|
|
||||||
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||||
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
||||||
if(!is_color)
|
if(!is_color)
|
||||||
@ -1002,7 +1098,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}catch(e){}
|
}catch(e){
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,63 +59,123 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>`;
|
</td>`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Setup - add a text input to each footer cell
|
||||||
|
$('#tableOfPresupuestos thead tr')
|
||||||
|
.clone(true)
|
||||||
|
.addClass('filters')
|
||||||
|
.appendTo('#tableOfPresupuestos thead');
|
||||||
|
|
||||||
|
|
||||||
theTable = $('#tableOfPresupuestos').DataTable({
|
theTable = $('#tableOfPresupuestos').DataTable({
|
||||||
processing: true,
|
orderCellsTop: true,
|
||||||
serverSide: true,
|
processing: true,
|
||||||
autoWidth: true,
|
serverSide: true,
|
||||||
responsive: true,
|
autoWidth: true,
|
||||||
scrollX: true,
|
responsive: true,
|
||||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
scrollX: true,
|
||||||
pageLength: 50,
|
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||||
lengthChange: true,
|
pageLength: 50,
|
||||||
"dom": 'lfBrtip',
|
lengthChange: true,
|
||||||
"buttons": [
|
"dom": 'lfBrtip',
|
||||||
'colvis', 'copy', 'csv', 'excel', 'print', {
|
"buttons": [
|
||||||
extend: 'pdfHtml5',
|
'colvis', 'copy', 'csv', 'excel', 'print', {
|
||||||
orientation: 'landscape',
|
extend: 'pdfHtml5',
|
||||||
pageSize: 'A4'
|
orientation: 'landscape',
|
||||||
}
|
pageSize: 'A4'
|
||||||
],
|
}
|
||||||
stateSave: true,
|
],
|
||||||
order: [[1, 'asc']],
|
stateSave: true,
|
||||||
language: {
|
order: [[1, 'asc']],
|
||||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
language: {
|
||||||
},
|
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||||
ajax : $.fn.dataTable.pipeline( {
|
},
|
||||||
url: '<?= route_to('dataTableOfCosidotapablanda') ?>',
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
method: 'POST',
|
url: '<?= route_to('dataTableOfCosidotapablanda') ?>',
|
||||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
method: 'POST',
|
||||||
async: true,
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
}),
|
async: true,
|
||||||
columnDefs: [
|
}),
|
||||||
{
|
columnDefs: [
|
||||||
orderable: false,
|
{
|
||||||
searchable: false,
|
orderable: false,
|
||||||
targets: [lastColNr]
|
searchable: false,
|
||||||
}
|
targets: [lastColNr]
|
||||||
],
|
}
|
||||||
columns : [
|
],
|
||||||
{ 'data': 'id' },
|
columns : [
|
||||||
{ 'data': 'fecha' },
|
{ 'data': 'id' },
|
||||||
{ 'data': 'cliente' },
|
{ 'data': 'fecha' },
|
||||||
{ 'data': 'comercial' },
|
{ 'data': 'cliente' },
|
||||||
{ 'data': 'titulo' },
|
{ 'data': 'comercial' },
|
||||||
{ 'data': 'pais' },
|
{ 'data': 'titulo' },
|
||||||
{ 'data': 'inc_rei' },
|
{ 'data': 'pais' },
|
||||||
{ 'data': 'paginas' },
|
{ 'data': 'inc_rei' },
|
||||||
{ 'data': 'tirada' },
|
{ 'data': 'paginas' },
|
||||||
{ 'data': 'total_presupuesto' },
|
{ 'data': 'tirada' },
|
||||||
{ 'data': 'estado' ,
|
{ 'data': 'total_presupuesto' },
|
||||||
'render': function ( data, type, row, meta ) {
|
{ 'data': 'estado' ,
|
||||||
if(data=='borrador')
|
'render': function ( data, type, row, meta ) {
|
||||||
return '<?= lang('Presupuestos.presupuestoEstadoBorrador') ?>';
|
if(data=='borrador')
|
||||||
else if(data=='aceptado')
|
return '<?= lang('Presupuestos.presupuestoEstadoBorrador') ?>';
|
||||||
return '<?= lang('Presupuestos.presupuestoEstadoAceptado') ?>';
|
else if(data=='aceptado')
|
||||||
}
|
return '<?= lang('Presupuestos.presupuestoEstadoAceptado') ?>';
|
||||||
},
|
}
|
||||||
{ 'data': actionBtns }
|
},
|
||||||
]
|
{ 'data': actionBtns }
|
||||||
});
|
],
|
||||||
|
initComplete: function () {
|
||||||
|
var api = this.api();
|
||||||
|
$("#tableOfPresupuestos").DataTable().columns.adjust();
|
||||||
|
|
||||||
|
// For each column
|
||||||
|
api
|
||||||
|
.columns()
|
||||||
|
.eq(0)
|
||||||
|
.each(function (colIdx) {
|
||||||
|
// Set the header cell to contain the input element
|
||||||
|
var cell = $('.filters th').eq(
|
||||||
|
$(api.column(colIdx).header()).index()
|
||||||
|
);
|
||||||
|
var title = $(cell).text();
|
||||||
|
$(cell).html('<input type="text" placeholder="' + title + '" />');
|
||||||
|
|
||||||
|
// On every keypress in this input
|
||||||
|
$(
|
||||||
|
'input',
|
||||||
|
$('.filters th').eq($(api.column(colIdx).header()).index())
|
||||||
|
)
|
||||||
|
.off('keyup change')
|
||||||
|
.on('change', function (e) {
|
||||||
|
// Get the search value
|
||||||
|
$(this).attr('title', $(this).val());
|
||||||
|
var regexr = '({search})'; //$(this).parents('th').find('select').val();
|
||||||
|
|
||||||
|
var cursorPosition = this.selectionStart;
|
||||||
|
// Search the column for that value
|
||||||
|
api
|
||||||
|
.column(colIdx)
|
||||||
|
.search(
|
||||||
|
this.value != ''
|
||||||
|
? regexr.replace('{search}', '(((' + this.value + ')))')
|
||||||
|
: '',
|
||||||
|
this.value != '',
|
||||||
|
this.value == ''
|
||||||
|
)
|
||||||
|
.draw();
|
||||||
|
})
|
||||||
|
.on('keyup', function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
$(this).trigger('change');
|
||||||
|
$(this)
|
||||||
|
.focus()[0]
|
||||||
|
.setSelectionRange(cursorPosition, cursorPosition);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
theTable.on( 'draw.dt', function () {
|
theTable.on( 'draw.dt', function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user