Commit e1d2e2ea by Billy Larru

mostrando filtros en montos de policias

parent 6159a3be
function listarPolicias(selectorName) {
axios.get(URI_POLICIAS).then((result) => {
let policias = result.data;
policias = _.orderBy(policias, p => p.nombres);
let html = `<option value="">[TODOS]</option>`;
policias.forEach(p => html += `<option documento_identidad="${p.dni}" value="${p.id}">${p.nombres}</option>`);
$(`${selectorName}`).html(html);
$('.select-search').select2();
});
}
function listarSedes(selectorName) {
axios.get(URI_SEDES).then((result) => {
let sedes = result.data;
sedes = _.orderBy(sedes, s => s.descripcion);
let html = `<option value="">[TODOS]</option>`;
sedes.forEach(sede => html += `<option value="${sede.codigo}">${sede.descripcion}</option>`);
$(`${selectorName}`).html(html);
});
}
function defaultConfigDateRangePicker(selectorName) {
$(selectorName).daterangepicker({
"autoApply": true,
"locale": {
"format": "DD/MM/YYYY",
"separator": " - ",
"applyLabel": "Apply",
"cancelLabel": "Cancel",
"fromLabel": "From",
"toLabel": "To",
"customRangeLabel": "Custom",
"weekLabel": "W",
"daysOfWeek": [
"Do",
"Lu",
"Ma",
"Mi",
"Ju",
"Vi",
"Sa"
],
"monthNames": [
"Enero",
"Febrero",
"Marzo",
"Abril",
"Mayo",
"Junio",
"Julio",
"Agosto",
"Setiembre",
"Octubre",
"Noviembre",
"Diciembre"
],
"firstDay": 1
},
"startDate": "17/08/2018",
"endDate": "23/08/2018"
}, function (start, end, label) {
// console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
});
$(selectorName).datepicker('setDate', 'now');
}
$().ready(function () {
defaultConfigDataTable();
listarPolicias("#cboPoliciasFiltro");
listarSedes("#cboSedesFiltro");
defaultConfigDateRangePicker("#dpRangoFechas")
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment