Commit 8971d075 by Billy Larru

listando asistencia de policias

parent b893705d
...@@ -17,6 +17,7 @@ const URI_SEDES = "http://172.16.2.91:666/sedes"; ...@@ -17,6 +17,7 @@ const URI_SEDES = "http://172.16.2.91:666/sedes";
const URI_ESTADO_ASISTENCIA = "http://172.16.2.91:666/estadoAsistencia"; const URI_ESTADO_ASISTENCIA = "http://172.16.2.91:666/estadoAsistencia";
const URI_POLICIAS = "http://172.16.2.91:666/policias"; const URI_POLICIAS = "http://172.16.2.91:666/policias";
const URI_ROL_POLICIA = "http://172.16.2.91:666/rolesPolicias"; const URI_ROL_POLICIA = "http://172.16.2.91:666/rolesPolicias";
const URI_POLICIAS_ASISTENCIA = "http://sistem16:666/asistenciaPolicias";
//</editor-fold> //</editor-fold>
......
...@@ -5,49 +5,168 @@ function init() { ...@@ -5,49 +5,168 @@ function init() {
listarEstadoAsistencia(); listarEstadoAsistencia();
} }
//function listarSedes() { function listarAsistencias(objParams = {}) {
//
// if (Object.is(htmlSedes, undefined)) { axios.get(URI_POLICIAS_ASISTENCIA, objParams).then((response) => {
// axios.get(URI_LISTAR_SEDES).then((result) => { response.data = formatResponse(response);
// debugger debugger
// let sedes = result.data; let columns = [
// htmlSedes = `<label>Sede</label> {
// <select class="selectpicker form-control" name="busqueda" id="busqueda" multiple>`; title: `N°`,
// sedes.forEach((s) => { data: `id`
// htmlSedes += `<option value="${s.codigo}">${s.descripcion}</option>`; },
// }); {
// htmlSedes += `</select>`; title: `APELLIDOS Y NOMBRES`,
// debugger data: `policia_nombres`
// $('#divCriterio').html(htmlSedes); },
// $('.selectpicker').selectpicker({ {
// style: 'btn-info', title: `SEDE`,
// size: 4 data: `sede_descripcion`
// }); },
// {
// $(".btn.dropdown-toggle.bs-placeholder").removeClass("btn-info"); title: `HORARIO`,
// $(".btn.dropdown-toggle.bs-placeholder").css({ data: `horario`
// border: "1px solid #ddd", },
// backgroundColor: "#fff" {
// }); title: `TIPO`,
// data: `tiporol_descripcion`
// }).catch((error) => { },
// console.log(error); {
// }); title: `FRECUENCIA`,
// } else { data: `frecuencia_descripcion`
// $('#divCriterio').html(htmlSedes); },
// $('.selectpicker').selectpicker({ {
// style: 'btn-info', title: `FECHA ENTRADA`,
// size: 4 data: `fecha_entrada`
// }); },
// $(".btn.dropdown-toggle.bs-placeholder").removeClass("btn-info"); {
// $(".btn.dropdown-toggle.bs-placeholder").css({ title: `MARC. ENTRADA`,
// border: "1px solid #ddd", data: null,
// backgroundColor: "#fff" render: data => {
// }); let clase = "";
// }
//
//}
if (data.marcacion_entrada === null) {
return null;
}
if (data.huella_entrada === 1) {
clase = "text-migration font-weight-bold";
} else if (data.huella_entrada === 0) {
clase = "text-default";
}
return `<span class="${clase}">${data.marcacion_entrada}</span>`;
}
},
{
title: `MARC. SALIDA`,
data: `marcacion_salida`
},
{
title: `FECHA SALIDA`,
data: `fecha_salida`
},
{
title: `ESTADO`,
data: null,
render: (data) => {
// if (data.marcacion_entrada == null && data.marcacion_salida == null) {
// return `<span class="label bg-purple">PENDIENTE</span>`;
// }
// else if (data.marcacion_entrada == null) {
// return `<span class="label bg-purple">ENTRADA PENDIENTE</span>`;
// } else if (data.marcacion_salida == null) {
// return `<span class="label bg-purple">SALIDA PENDIENTE</span>`;
// }
let label = "";
let estado = "";
switch (data.estado) {
case 1:
label = "label label-success";
estado = "TEMPRANO";
break;
case 2:
label = "label label-warning";
estado = "TARDANZA";
break;
case 3:
label = "label label-danger";
estado = "FCA";
break;
case 4:
label = "label label-danger";
estado = "FSA";
break;
case 5:
label = "label label-default";
estado = "NO MARCÓ";
break;
case 9:
label = "label label-info";
estado = "LSGH";
break;
case 10:
label = "label bg-purple";
estado = "ENTRADA PENDIENTE";
break;
case 11:
label = "label bg-purple";
estado = "SALIDA PENDIENTE";
break;
case null:
label = "label bg-purple";
estado = "PENDIENTE";
break;
}
return `<span class="${label}">${estado}</span>`;
}
},
{
title: `ACCIONES`,
data: null,
render: (data) => {
return null;
}
}
];
let columnDefs = [
{orderable: false, width: '5%', targets: 0, className: "text-center"},
{orderable: false, width: '5%', targets: 1},
{orderable: false, width: '30%', targets: 2, className: "text-center"},
{orderable: false, width: '7%', targets: 3, className: "text-center"},
{orderable: false, width: '7%', targets: 4, className: "text-center"},
{orderable: false, width: '10%', targets: 5, className: "text-center"},
{orderable: false, width: '8%', targets: 6, className: "text-center"},
{orderable: false, width: '8%', targets: 7, className: "text-center"},
{orderable: false, width: '8%', targets: 8, className: "text-center"},
{orderable: false, width: '8%', targets: 9, className: "text-center"},
{orderable: false, width: '8%', targets: 10, className: "text-center"},
{orderable: false, width: '8%', targets: 11, className: "text-center"},
{orderable: false, width: '8%', targets: 12, className: "text-center"}
];
let wrapsNameDatatable = `divAsistencias`;
let classNameForDatatable = `display table table-bordered`;
let footer = false;
makeDatatable({
data: response.data.data,
columns: columns,
columnDefs: columnDefs,
wrapsNameDatatable: wrapsNameDatatable,
classNameForDatatable: classNameForDatatable,
footer: footer
}).then((response) => {
});
});
}
function listarSedes(selectorName) { function listarSedes(selectorName) {
axios.get(URI_SEDES).then((result) => { axios.get(URI_SEDES).then((result) => {
...@@ -287,11 +406,6 @@ function evtChange() { ...@@ -287,11 +406,6 @@ function evtChange() {
} }
$().ready(function () { $().ready(function () {
listarPolicias("#cboPoliciasFiltro"); listarPolicias("#cboPoliciasFiltro");
listarSedes("#cboSedesFiltro"); listarSedes("#cboSedesFiltro");
...@@ -341,7 +455,7 @@ $().ready(function () { ...@@ -341,7 +455,7 @@ $().ready(function () {
defaultConfigDatePicker(); defaultConfigDatePicker();
seleccionCriterio(); seleccionCriterio();
$("#btnVerTodos").click(listarAsistencias);
}); });
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