mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado
This commit is contained in:
@ -3,8 +3,9 @@ import ClassSelect from '../../components/select2.js';
|
||||
|
||||
$(() => {
|
||||
|
||||
let otsFilter = '';
|
||||
|
||||
const selectPedidos = new ClassSelect($('#buscadorPedidos'), '/logistica/selectPedidosForEnvio', "");
|
||||
const selectPedidos = new ClassSelect($('#buscadorPedidos'), '/logistica/selectForNewEnvio', "");
|
||||
selectPedidos.init();
|
||||
const selectDirecciones = new ClassSelect($('#selectDirecciones'), '/logistica/selectDireccionForEnvio', "", true, {
|
||||
pedido_id: () => selectPedidos.getVal()
|
||||
@ -63,10 +64,13 @@ $(() => {
|
||||
"dom": 'lBrtip',
|
||||
"ajax": {
|
||||
"url": "/logistica/datatableEnvios",
|
||||
"data": function (d) {
|
||||
d.otsFilter = otsFilter;
|
||||
}
|
||||
},
|
||||
"columns": [
|
||||
{ "data": "id" },
|
||||
{ "data": "pedidos" },
|
||||
{ "data": "ots" },
|
||||
{ "data": "num_lineas" },
|
||||
{ "data": "att" },
|
||||
{ "data": "direccion" },
|
||||
@ -99,6 +103,26 @@ $(() => {
|
||||
window.location.href = '/logistica/envio/' + $(this).attr('data-id');
|
||||
});
|
||||
|
||||
$(document).on("keyup", ".envio-filter", (event) => {
|
||||
let columnName = $(event.currentTarget).attr("name");
|
||||
let columnIndex = $('#tableOfEnvios').DataTable().columns().eq(0).filter(function (index) {
|
||||
return $('#tableOfEnvios').DataTable().column(index).dataSrc() === columnName;
|
||||
})[0];
|
||||
$('#tableOfEnvios').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||
})
|
||||
|
||||
|
||||
$(document).on("keyup", ".envio-filter-ots", (event) => {
|
||||
otsFilter = $(event.currentTarget).val();
|
||||
$('#tableOfEnvios').DataTable().ajax.reload();
|
||||
})
|
||||
|
||||
$(document).on("change", ".envio-filter-select", (event) => {
|
||||
let columnName = $(event.currentTarget).attr("name");
|
||||
let columnIndex = $('#tableOfEnvios').DataTable().columns().eq(0).filter(function (index) {
|
||||
return $('#tableOfEnvios').DataTable().column(index).dataSrc() === columnName;
|
||||
})[0];
|
||||
$('#tableOfEnvios').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw();
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user