Commit 3b33e2d0 by Billy Larru

[ADD registro de vacaciones masivas]

parent 30b7a755
const listarPersonal = (selectorName) => { const listarCargos = () => {
initSelect2(selectorName, baseURLRest + URI_TRABAJADORES, {title: "nombresapellidos", subtitle: "documentoidentidad"}); $(`#cboCargo`).select2({
containerCssClass: 'select-xs',
ajax: {
url: baseURLRest + URI_CARGOS,
dataType: `json`,
delay: 1000,
data: function (params) {
return {
q: params.term, // search term
page: params.page
};
},
processResults: function (data, params) {
// parse the results into the format expected by Select2
// since we are using custom formatting functions we do not need to
// alter the remote JSON data, except to indicate that infinite
// scrolling can be used
params.page = params.page || 1;
return {
results: data,
pagination: {
more: (params.page * 30) < data.length
}
};
},
cache: true
},
placeholder: `Buscar`,
allowClear: true,
escapeMarkup: function (markup) {
return markup;
}, // let our custom formatter work
minimumInputLength: 1,
templateResult: formatRepo,
templateSelection: formatRepoSelection
});
function formatRepo(repo) {
if (repo.loading) {
return repo.text;
}
var markup = `
<div class='select2-result-repository clearfix'>
<div class='select2-result-repository__title'>${repo.nombre}</div>
</div>`;
return markup;
}
function formatRepoSelection(repo) {
if (repo.id) {
return repo.nombre;
} else {
return repo.text;
}
}
}; };
function listarVacacionesIndividuales(objParams = {}){
const formControls = {
init() {
this.initDatePickers()
this.initSedes()
this.initCargos()
},
initDatePickers() {
initDatePicker("#dpFechaInicio", "#dpFechaFin")
},
initSedes() {
listarSedes("#cboSede");
},
initCargos() {
listarCargos()
}
} }
const aplicarFiltro = () => { const registrar = () => {
}; let sede_id
let cargo_id
let fecha_inicio
let fecha_fin
const mostrarModalNuevo = () => { swal({
type: 'success',
title: '¡Vacaciones masivas registradas exitosamente!',
showConfirmButton: false,
timer: 1500
});
}; }
$(() => { $(document).ready(function () {
initDatePicker("#dpFechaInicioFiltro", "#dpFechaFinFiltro"); formControls.init()
listarPersonal("#cboPersonalFiltro"); $("#btnRegistrar").click(registrar)
listarSedes("#cboSedesFiltro"); })
$("#btnMostrarTodo").click(listarVacacionesIndividuales); \ No newline at end of file
$("#btnAplicarFiltro").click(aplicarFiltro);
$("#btnNuevo").click(mostrarModalNuevo);
});
\ No newline at end of file
...@@ -12,11 +12,62 @@ ...@@ -12,11 +12,62 @@
<body> <body>
<jsp:include page="/vistas/templates/header-body.jsp" /> <jsp:include page="/vistas/templates/header-body.jsp" />
<!-- content --> <!-- content -->
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-primary">
<div class="panel-heading">
<h5 class="panel-title">Registro masivo de vacaciones</h5>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-6 form-group">
<label>Sede</label>
<select class="select-search form-control" id="cboSede">
</select>
</div>
<div class="col-md-6 form-group">
<label>Cargo</label>
<select id="cboCargo" class="select-search form-control">
</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="dpFechaInicio">
</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="dpFechaFin">
</div>
</div>
</div>
</div>
<div class="panel-footer">
<div class="text-center">
<button class="btn btn-success" id="btnRegistrar"><i class="glyphicon glyphicon-plus"></i> Registrar</button>&nbsp;
<button class="btn btn-warning" id="btnLimpiar"><i class="fa fa-eraser"></i> Limpiar</button>&nbsp;
</div>
</div>
</div>
</div>
<!-- / content --> <!-- / content -->
<jsp:include page="/vistas/templates/footer-body.jsp" /> <jsp:include page="/vistas/templates/footer-body.jsp" />
<!--js de la pagina--> <!--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/vacaciones_administrativas_masivas.js" type="text/javascript"></script> <script src="../js/pages/vacaciones_administrativas_masivas.js" type="text/javascript"></script>
<!--js--> <!--js-->
......
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