Commit 5656abe9 by Billy Larru

[FIX montosPolicias, filtro por rango de fechas]

parent 895c5e12
......@@ -78,7 +78,20 @@ function getColumns() {
{
title: `ESTADO EXTRAS`,
data: `estado_extras`,
className: 'text-center'
className: 'text-center',
render: (data) => {
let label = "";
let contenido = "";
if (data == 1) {
label = "label label-success";
contenido = "APROBADO";
} else {
label = "label label-danger";
contenido = "SIN APROBAR";
}
return `<span class="${label}">${contenido}</span>`;
}
},
{
title: `MONTO TOTAL`,
......@@ -157,7 +170,7 @@ function defaultConfigDateRangePicker(selectorName) {
}
function mostrarReporte(objParams = {}) {
function mostrarTodos(objParams = {}) {
ajaxWebService.get(URI_POLICIA_REPORTE_MONTOS, objParams).then((response) => {
let columns = getColumns();
......@@ -165,42 +178,43 @@ function mostrarReporte(objParams = {}) {
let classNameForDatatable = `display table table-bordered`;
makeDatatable(
wrapsNameDatatable,
{
data: response.data,
columns
},
classNameForDatatable,
);
wrapsNameDatatable,
{
data: response.data,
columns
},
classNameForDatatable,
);
});
}
function verReporte() {
function aplicarFiltro() {
debugger
let rango_fechas = $("#dpRangoFechas").val();
let split_fechas = rango_fechas.split("-").map(f => f.trim());
let fecha_inicio = split_fechas[0];
let fecha_fin = split_fechas[1];
let policia_nombres = $("#cboPoliciasFiltro option:selected").text();
let sede_descripcion = $("#cboSedesFiltro option:selected").text();
let intervalo_fechas = generarFechas(fecha_inicio, fecha_fin);
policia_nombres = policia_nombres.includes("TODOS") ? "" : policia_nombres
sede_descripcion = sede_descripcion.includes("TODOS") ? "" : sede_descripcion
let params = cleanQueryParams({
fecha_entrada: fecha_inicio,
fecha_entrada: intervalo_fechas,
policia_nombres,
sede_descripcion
});
mostrarReporte({params});
mostrarTodos({params});
}
$().ready(function () {
listarPolicias("#cboPoliciasFiltro");
listarSedes("#cboSedesFiltro");
defaultConfigDateRangePicker("#dpRangoFechas");
$("#btnVerTodos").click(mostrarReporte);
$("#btnVerReporte").click(verReporte);
$("#btnMostrarTodos").click(mostrarTodos);
$("#btnAplicarFiltro").click(aplicarFiltro);
});
\ No newline at end of file
......@@ -45,8 +45,8 @@
</div>
<div class="panel-footer">
<div class="text-center">
<button class="btn btn-primary" id="btnVerReporte"><i class="icon-eye4"></i> Ver reporte</button>&nbsp;
<button class="btn btn-primary" id="btnVerTodos"><i class="icon-eye4"></i> Ver Todos</button>&nbsp;
<button class="btn btn-primary" id="btnAplicarFiltro"><i class="icon-eye4"></i> Aplicar filtro</button>&nbsp;
<button class="btn btn-primary" id="btnMostrarTodos"><i class="icon-eye4"></i> Mostrar todos</button>&nbsp;
</div>
</div>
</div>
......
......@@ -34,7 +34,7 @@
<div class="panel-footer">
<div class="text-center">
<button class="btn btn-primary" id="btnAplicarFiltro"><i class="icon-eye4"></i> Aplicar filtro</button>&nbsp;
<button class="btn btn-primary" id="btnMostrarTodo"><i class="icon-eye4"></i> Mostrar Todo</button>&nbsp;
<button class="btn btn-warning" id="btnMostrarTodo"><i class="icon-eye4"></i> Limpiar</button>&nbsp;
</div>
</div>
</div>
......@@ -53,24 +53,6 @@
<div class="row">
<div class="col-md-12 form-group">
<select multiple="multiple" class="form-control" id="lista">
<!-- <option value="option1" selected="selected">Classical mechanics</option>
<option value="option2">Electromagnetism</option>
<option value="option4">Relativity</option>
<option value="option5" selected="selected">Quantum mechanics</option>
<option value="option7">Astrophysics</option>
<option value="option8" selected="selected">Biophysics</option>
<option value="option9">Chemical physics</option>
<option value="option10">Econophysics</option>
<option value="option11">Geophysics</option>
<option value="option12">Medical physics</option>
<option value="option13">Physical chemistry</option>
<option value="option14" selected="selected">Continuum mechanics</option>
<option value="option15">Electrodynamics</option>
<option value="option16" selected="selected">Quantum field theory</option>
<option value="option17">Scattering theory</option>
<option value="option18" selected="selected">Chaos theory</option>
<option value="option19" selected="selected">Newton's laws of motion</option>
<option value="option20">Thermodynamics</option>-->
</select>
</div>
</div>
......
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