Commit 4136fe99 by Billy Larru

[ADD listado justificacion, listando justificaciones]

parent adbed1f0
$(document).ready(function(){
})
\ No newline at end of file
function getColumns() {
let columns = [
{
title: `N°`,
data: `id`,
className: 'text-center'
},
{
title: `PERSONAL`,
data: null,
className: `text-center`,
render: (data) => {
let nombresCompletos;
let nombres = data.trabajador_nombres;
let apellidos = data.trabajador_apellidos;
nombresCompletos = `${apellidos} ${nombres}`;
return nombresCompletos;
}
},
{
title: "FECHA",
data: "fecha_inicio",
className: "text-center"
},
{
title: `MOTIVO`,
data: `motivo`,
className: 'text-center'
},
{
title: `ESTADO`,
data: `estado`,
className: 'text-center',
render: (data) => {
let label = "";
let contenido = ""
switch (data) {
case 0:
label = "label bg-purple"
contenido = "PENDIENTE"
break;
case 1:
label = "label label-success"
contenido = "ACEPTADO"
break;
case 2:
label = "label label-warning"
contenido = "RECHAZADO"
break;
}
return `<span class="${label}">${contenido}</span>`;
}
},
{
title: `ACCIONES`,
data: null,
className: 'text-center',
render: (data) => {
let acciones = "";
let registrar = "";
let verdetalle = "";
verdetalle = `<span data-toggle="tooltip" data-placement="left" title="Ver detalle" style="cursor: pointer"> <i class='verdetalle fa fa-list text-primary-700'></i>&nbsp;&nbsp; </span>`;
acciones = verdetalle;
return acciones;
}
}
];
return columns;
}
const listarJustificaciones = (objParams = {}) => {
ajaxWebService.get(URI_JUSTIFICACION, objParams).then((response) => {
let columns = getColumns();
let wrapsNameDatatable = `divDatatable`;
let classNameForDatatable = `display table table-bordered`;
makeDatatable(
wrapsNameDatatable,
{
data: response.data,
columns,
},
classNameForDatatable,
).then((nodes) => {
nodes.container
.off()
.on("click", ".verdetalle", function () {
let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
mostrarModalVerDetalleDescuentoAsistencia(data);
})
});
});
};
const formControls = {
init() {
}
}
$(document).ready(function () {
listarJustificaciones()
})
\ No newline at end of file
<jsp:include page="/vistas/templates/validar.jsp" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="/vistas/templates/header.jsp" />
<!--template-core-->
<!--css de la pagina-->
<link href="${pageContext.request.contextPath}/css/lib/sweetalert2.min.css" rel="stylesheet" type="text/css"/>
<!--css-->
</head>
<body>
<jsp:include page="/vistas/templates/header-body.jsp" />
<!-- content -->
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-primary">
<div class="panel-heading">
<h5 class="panel-title">Busqueda</h5>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-4 form-group">
<label>Periodo cierre</label>
<select class="select-search form-control" id="cboPeriodoCierreFiltro">
</select>
</div>
<div class="col-md-4 form-group">
<label>Fecha Inicio</label>
<div class="input-group">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
<input type="text" class="form-control" id="dpFechaInicioFiltro">
</div>
</div>
<div class="col-md-4 form-group">
<label>Fecha Fin</label>
<div class="input-group">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
<input type="text" class="form-control" id="dpFechaFinFiltro">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
<label>Sede</label>
<select class="form-control" id="cboSedesFiltro">
</select>
</div>
</div>
</div>
<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;
</div>
</div>
</div>
</div>
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-primary card-3" style="margin-top: 30px">
<div class="panel-heading" style="padding: 8px 15px">
<h6 class="panel-title" style="font-size: 15px; font-family: inherit">LISTADO DE JUSTIFICACIONES</h6>
</div>
<div id="divDatatable"></div>
</div>
</div>
<!-- / content -->
<jsp:include page="/vistas/templates/footer-body.jsp" />
<!--js de la pagina-->
<script src="${pageContext.request.contextPath}/plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/ui/moment/moment.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/pickers/datepicker.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/lib/bootstrap-select.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script src="${pageContext.request.contextPath}/js/lib/lodash.js" type="text/javascript"></script>
<script src="../js/pages/listado_justificacion.js" type="text/javascript"></script>
<!--js-->
</body>
</html>
\ No newline at end of file
<jsp:include page="/vistas/templates/validar.jsp" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="/vistas/templates/header.jsp" />
<!--template-core-->
<!--css de la pagina-->
<link href="../css/lib/sweetalert2.min.css" rel="stylesheet" type="text/css"/>
<!--css-->
</head>
<body>
<jsp:include page="/vistas/templates/header-body.jsp" />
<!-- content -->
<!-- / content -->
<jsp:include page="/vistas/templates/footer-body.jsp" />
<!--js de la pagina-->
<script src="../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/ui/moment/moment.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/pickers/datepicker.js" type="text/javascript"></script>
<script src="../js/lib/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script src="../js/lib/lodash.js" type="text/javascript"></script>
<script src="../../../js/pages/evaluar_justificacion.js" type="text/javascript"></script>
<!--js-->
</body>
</html>
\ 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