Commit ad9fa28f by Billy Larru

consumiendo servicios rest en creacion de roles de policias

parent 4eeae39c
......@@ -7,6 +7,20 @@ const CODIGO_PROYECTO_ASISTENCIA = '7';
//const PATH_SERVICIO_REST = 'http://172.16.2.53:8080/security-rest/api/'//'http://app8.sacooliveros.edu.pe:8080/security-rest/api/';
const PATH_SERVICIO_REST = 'http://app9.sacooliveros.edu.pe:8080/security-rest/api/';
//<editor-fold> SERVICIOS REST
//<editor-fold> MODULO DE POLICIAS
const URI_LISTAR_ROL_POLICIA = "http://172.16.2.91:666/rolPolicias";
const URI_LISTAR_FRECUENCIA_ROL_POLICIA = "http://172.16.2.91:666/frecuenciaRolPolicias";
const URI_LISTAR_SEDES = "http://172.16.2.91:666/sedes";
const URI_LISTAR_ESTADO_ASISTENCIA = "http://172.16.2.91:666/estadoAsistencia";
const URI_LISTAR_POLICIAS = "http://172.16.2.91:666/policias";
//</editor-fold>
//</editor-fold>
/*Ajax genral*/
const ajaxRequestSendBody = obj => {
let body = JSON.stringify(obj.body);
......@@ -241,8 +255,8 @@ function defaultConfigDateRangePicker() {
// singleDatePicker: true,
autoApply: true,
locale: {
format: 'DD/MM/YYYY'
}
format: 'DD/MM/YYYY'
}
});
$('.calendar.right').hide();
}
......@@ -260,7 +274,7 @@ function defaultConfigDateRangePicker() {
})(jQuery);
function primeraLetraMayuscula(str){
function primeraLetraMayuscula(str) {
let strLower = str.toLowerCase();
let caracter = strLower.substr(0, 1).toUpperCase();
let cadena = caracter + strLower.substr(1);
......
let asistencias = [], sedes = [];
const URI_LISTAR_SEDES = "http://172.16.2.91:666/sedes";
const URI_LISTAR_ESTADO_ASISTENCIA = "http://172.16.2.91:666/estadoAsistencia";
let htmlSedes;
function init() {
......
function init() {
listarRoles();
listarFrecuenciaRol();
listarSedes();
listarPolicias();
}
function listarRoles() {
axios.get(URI_LISTAR_ROL_POLICIA).then((result) => {
let roles = result.data;
let html = "<option>[SELECCIONE]</option>";
roles.forEach(rol => html += `<option value="${rol.codigo}">${rol.descripcion}</option>`);
$("#cboRol").html(html);
});
}
function listarFrecuenciaRol() {
axios.get(URI_LISTAR_FRECUENCIA_ROL_POLICIA).then((result) => {
let frecuenciasRol = result.data;
let html = "<option>[SELECCIONE]</option>";
frecuenciasRol.forEach(f => html += `<option value="${f.codigo}">${f.descripcion}</option>`);
$("#cboFrecuenciaRol").html(html);
});
}
function listarSedes() {
axios.get(URI_LISTAR_SEDES).then((result) => {
let sedes = result.data;
let html = "<option>[SELECCIONE]</option>";
sedes.forEach(sede => html += `<option value="${sede.codigo}">${sede.descripcion}</option>`);
$("#cboSedes").html(html);
});
}
function listarPolicias() {
axios.get(URI_LISTAR_POLICIAS).then((result) => {
let policias = result.data;
let html = "<option>[SELECCIONE]</option>";
policias.forEach(p => html += `<option value="${p.id}">${p.nombres}</option>`);
$("#cboPolicias").html(html);
});
}
function modificarServicio() {
// debugger
$("#detalle_rol").addClass("hidden");
......@@ -7,7 +52,7 @@ function modificarServicio() {
$("#modal-header").addClass('bg-jade');
$("#botones-editar").removeClass('hidden');
$("#btnCerrar").addClass("hidden");
animar();
// e.preventDefault();
......@@ -15,7 +60,7 @@ function modificarServicio() {
}
function cancelar(){
function cancelar() {
$("#detalle_rol").removeClass("hidden");
$("#editar_rol").addClass("hidden");
$("#modal-title").html('Ver detalle rol');
......@@ -26,8 +71,8 @@ function cancelar(){
animar();
}
function animar(){
let animation = `fadeIn`;
function animar() {
let animation = `fadeIn`;
$("#modal_body_tombo2").addClass(`animated ${animation}`).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function () {
$(this).removeClass(`animated ${animation}`);
......@@ -35,7 +80,7 @@ function animar(){
}
function guardarCambios(){
function guardarCambios() {
cancelar();
$("#servicio13").css("background-color", "lightpink");
}
......@@ -43,6 +88,7 @@ function guardarCambios(){
$().ready(function () {
init();
$('.selectpicker').selectpicker({
style: 'btn-info',
size: 4
......
......@@ -23,13 +23,7 @@
<div class="row">
<div class="col-md-12 form-group">
<label>Policia</label>
<select class="select-search form-control">
<option>RAMIREZ MORALES ROLANDO</option>
<option>GUTIERREZ MEDINA JOSE ROSA</option>
<option>SALOME LAZO REGULO RIGOBERTO</option>
<option>DEZA CORREA OSCAR MIGUEL</option>
<option>CHAVEZ LEON CLARA MARIA</option>
</optgroup>
<select class="select-search form-control" id="cboPolicias">
</select>
</div>
</div>
......@@ -37,11 +31,7 @@
<div class="row">
<div class="col-md-6 form-group">
<label>Tipo de rol</label>
<select class="form-control" id="cboCriterio">
<option>[SELECCIONE]</option>
<option>REGULAR</option>
<option>AMANECIDA 12H</option>
<option>AMANECIDA 24H</option>
<select class="form-control" id="cboRol">
</select>
</div>
......@@ -59,24 +49,13 @@
<div class="row">
<div class="col-md-6 form-group">
<label>Frecuencia</label>
<select class="form-control" id="cboCriterio">
<option>[SELECCIONE]</option>
<option>IMPAR</option>
<option>PAR</option>
<option>DIARIO</option>
<!--<option>PERSONALIZADO</option>-->
<select class="form-control" id="cboFrecuenciaRol">
</select>
</div>
<div class="col-md-6 form-group">
<label>Sede</label>
<select class="select-search form-control">
<option>LINCE</option>
<option>AREQUIPA</option>
<option>ARENALES</option>
<option>MONTESORI</option>
<option>QUILCA</option>
</optgroup>
<select class="select-search form-control" id="cboSedes">
</select>
</div>
</div>
......@@ -901,20 +880,20 @@
<%@include file="templates/footer-body.jsp"%>
<!--js de la pagina-->
<script type="text/javascript" src="../plantilla/assets/js/core/libraries/jquery_ui/interactions.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js"></script>
<script src="../plantilla/assets/js/core/libraries/jquery_ui/interactions.min.js"></script>
<script src="../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js"></script>
<script src="../js/lib/bootstrap-select/bootstrap-select.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script src="../js/lib/bootstrap-select/bootstrap-select.min.js"></script>
<script src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/ui/moment/moment.min.js"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/pickers/daterangepicker.js"></script>
<script src="../js/lib/jquery-ui.multidatespicker.js" type="text/javascript"></script>
<script type="text/javascript" src="../plantilla/assets/js/plugins/extensions/contextmenu.js"></script>
<script src="../js/pages/crearRolPolicia.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/ui/moment/moment.min.js"></script>
<script src="../plantilla/assets/js/plugins/pickers/daterangepicker.js"></script>
<script src="../js/lib/jquery-ui.multidatespicker.js"></script>
<script src="../plantilla/assets/js/plugins/extensions/contextmenu.js"></script>
<script src="../js/lib/axios.min.js" type="text/javascript"></script>
<script src="../js/pages/crearRolPolicia.js"></script>
<!--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