Commit 74717651 by Billy Larru

[ADD justificacion, registro de justificacion]

parent 93c49878
......@@ -22,7 +22,6 @@ const ajaxModal = axios.create({
//<editor-fold> MODULO DE POLICIAS
const URI_TIPOROL_POLICIA = "tipoRolPolicias";
const URI_FRECUENCIA_ROL_POLICIA = "frecuenciaRolPolicias";
const URI_SEDES = "sedes";
const URI_ESTADO_ASISTENCIA = "estadoAsistencia";
const URI_POLICIAS = "policias";
const URI_ROL_POLICIA = "rolesPolicias";
......@@ -47,6 +46,8 @@ const URI_ADMINISTRATIVOS_DESCUENTO_MENSUAL = "descuentoMensualAdministrativos";
const URI_ADMINISTRATIVOS_DESCUENTO_MENSUAL_DETALLADO = "descuentoAsistenciaAdministrativaDetallado";
//</editor-fold>
const URI_SEDES = "sedes";
const URI_JUSTIFICACION_TIPO = "tipoJustificacion"
//</editor-fold>
......@@ -445,7 +446,7 @@ const cleanQueryParams = (params = {}) => {
return params;
}
let initDatePicker = (...selectorName) => {
const initDatePicker = (...selectorName) => {
selectorName.forEach(id => {
let options = {
format: "dd/mm/yyyy",
......@@ -462,6 +463,58 @@ let initDatePicker = (...selectorName) => {
}
const initDateRangePicker = (nodeIdentifier) => {
let options = {
"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"
};
$(nodeIdentifier).daterangepicker(options);
}
const pickersNoConflict = () => {
$.fn.datepicker.noConflict = function () {
$.fn.datepicker = old;
return this;
};
}
const initSelect2 = (nodeIdentifier, URI, {title, subtitle} = {}) => {
$(`${nodeIdentifier}`).select2({
containerCssClass: 'select-xs',
......
function getColumns() {
let columns = [
{
title: "N°",
data: "id",
className: "text-center"
},
{
title: `APELLIDOS Y NOMBRES`,
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 INICIO",
data: "fecha_asistencia",
className: "text-center"
},
{
title: `FECHA FIN`,
data: `marcacion_entrada`,
className: 'text-center'
},
{
title: `MOTIVO`,
data: `descuento`,
className: 'text-center',
render: (data) => {
return `<span class="text-danger">${parseFloat(data).toFixed(2)}</span>`;
}
},
{
title: `ESTADO`,
data: `tipo_registro`,
className: 'text-center',
render: (data) => {
let label = "";
let contenido = "";
if (data == 1) {
label = "label label-info"
contenido = "HUELLA"
} else {
label = "label label-warning"
contenido = "MANUAL"
}
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 icon-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", "#chkSelectAll", (e) => seleccionarCheckBoxTodo($(e.currentTarget)))
// .on("click", ".verdetalle", function () {
// let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
// mostrarModalVerDetalleDescuentoAsistencia(data);
// })
});
});
};
$(document).ready(function () {
});
\ No newline at end of file
const listarPersonal = (selectorName) => {
initSelect2(selectorName, baseURLRest + URI_TRABAJADORES, {title: "nombresapellidos", subtitle: "documentoidentidad"});
};
const listarTipoJustificacion = (nodeIdentifier) => {
ajaxWebService.get(URI_JUSTIFICACION_TIPO).then((response) => {
let data = response.data
let html = "<option>[SELECCIONE]</option>"
html += data.map((tipoJustificacion) => `<option value="${tipoJustificacion.id}">${tipoJustificacion.descripcion}</option>`)
$(nodeIdentifier).html(html)
})
}
const formControls = {
init() {
this.initializeRadioButton()
this.initializeChooseFile()
pickersNoConflict()
initDateRangePicker("#dpRangoFechas")
},
initializeRadioButton() {
$(".styled, .multiselect-container input").uniform({
radioClass: 'choice'
});
},
initializeChooseFile() {
$(".file-styled-primary").uniform({
fileButtonClass: 'action btn bg-blue'
});
}
}
$(document).ready(function () {
formControls.init()
listarTipoJustificacion("#cboTipoJustificacion")
listarPersonal("#cboPersonal")
});
\ 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 -->
<div class="col-md-4 col-md-offset-4">
<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-12 form-group">
<label>Personal</label>
<select class="select-search form-control" id="cboPersonalFiltro">
</select>
</div>
</div>
<div class="row">
<div class="col-md-6 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-6 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>
<div class="panel-footer">
<div class="text-center">
<button class="btn btn-info" id="btnAplicarFiltro"><i class="fa fa-search"></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 class="heading-elements">
<button type="button" class="btn btn-success btn-icon heading-btn"><i class="icon-plus2"></i></button>
</div>
</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/plugins/tables/datatables/datatables.min.js" type="text/javascript"></script>-->
<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/mantenimiento_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 -->
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading">
<h5 class="panel-title">REGISTRO DE JUSTIFICACIÓN</h5>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-4 form-group">
<label>Personal</label>
<select class="select-search form-control" id="cboPersonal">
</select>
</div>
<div class="col-md-4 form-group">
<label>Fecha(s) a justificar</label>
<div class="input-group">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
<input type="text" class="form-control"id="dpRangoFechas">
</div>
</div>
<div class="col-md-4 form-group">
<label>Justificacion por</label>
<select id="cboTipoJustificacion" class="form-control"></select>
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
<label>Motivo</label>
<input type="text" class="form-control" id="txtMotivo">
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
<label>Observación/Fundamento</label>
<textarea name="" id="" cols="30" rows="5" class="form-control" id="txtObservacion"></textarea>
</div>
</div>
<div class="row">
<div class="col-md-6 form-group">
<label>Nro documentos adjuntos</label>
<input type="text" class="form-control" id="txtNumeroDocumentosAdjuntos">
</div>
<div class="form-group col-md-6">
<label class="control-label">Adjuntar documentos</label>
<input type="file" class="file-styled-primary form-control">
</div>
</div>
</div>
<div class="panel-footer">
<div class="text-center">
<button class="btn btn-success" id="btnRegistrar"><i class="fa fa-plus"></i> Registrar</button>&nbsp;
<button class="btn btn-warning" id="btnMostrarTodo"><i class="fa fa-eraser"></i> Limpiar</button>&nbsp;
</div>
</div>
</div>
</div>
<!-- / content -->
<jsp:include page="/vistas/templates/footer-body.jsp" />
<!--js de la pagina-->
<!--<script src="${pageContext.request.contextPath}/plantilla/assets/js/plugins/tables/datatables/datatables.min.js" type="text/javascript"></script>-->
<script src="../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js"></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"></script>
<script src="../plantilla/assets/js/plugins/pickers/daterangepicker.js"></script>
<script src="../js/lib/sweetalert2.min.js" type="text/javascript"></script>
<script src="../js/lib/lodash.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script src="../js/lib/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../js/pages/registroJustificacion.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