Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Asistencia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Billy Larru
Asistencia
Commits
6a717e57
Commit
6a717e57
authored
Aug 24, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mantenimientos de sedes listado y edicion
parent
ece24294
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
227 additions
and
19 deletions
+227
-19
RedireccionarServlet.java
src/main/java/asistencia/servlets/RedireccionarServlet.java
+1
-1
general.js
src/main/webapp/js/general.js
+1
-0
crearRolPolicia.js
src/main/webapp/js/pages/crearRolPolicia.js
+2
-1
mantenimiento_sede.js
src/main/webapp/js/pages/mantenimiento_sede.js
+178
-0
mantenimientoSede.jsp
src/main/webapp/vistas/mantenimientoSede.jsp
+24
-17
editarConceptoSede.jsp
...modals/policias/mantenimientoSedes/editarConceptoSede.jsp
+21
-0
No files found.
src/main/java/asistencia/servlets/RedireccionarServlet.java
View file @
6a717e57
...
...
@@ -58,7 +58,7 @@ public class RedireccionarServlet extends HttpServlet {
session
.
setAttribute
(
"nombre"
,
nombre
);
session
.
setAttribute
(
"roles"
,
roles
.
substring
(
0
,
roles
.
length
()-
2
));
session
.
setAttribute
(
"Authorization"
,
"Bearer "
+
respuesta
.
getString
(
"token"
));
session
.
setMaxInactiveInterval
(
120
*
60
);
//
session.setMaxInactiveInterval(120*60);
cookieAuth
=
new
Cookie
(
"Authorization"
,
"Bearer "
+
respuesta
.
getString
(
"token"
));
cookieAuth
.
setMaxAge
(
36000
);
//10horas
response
.
addCookie
(
cookieAuth
);
...
...
src/main/webapp/js/general.js
View file @
6a717e57
...
...
@@ -19,6 +19,7 @@ const URI_POLICIAS = "http://172.16.2.91:666/policias";
const
URI_ROL_POLICIA
=
"http://172.16.2.91:666/rolesPolicias"
;
const
URI_POLICIAS_ASISTENCIA
=
"http://sistem16:666/asistenciaPolicias"
;
const
URI_POLICIA_MONTOS_AMANECIDAS
=
"http://sistem16:666/montoAmanecidas"
;
const
URI_POLICIA_CONCEPTOSEDES
=
"http://sistem16:666/conceptoSedes"
;
//</editor-fold>
...
...
src/main/webapp/js/pages/crearRolPolicia.js
View file @
6a717e57
...
...
@@ -15,8 +15,9 @@ function initDatePicker(selectorName) {
}
function
listarRolesPolicias
(
objParams
=
{})
{
debugger
axios
.
get
(
URI_ROL_POLICIA
,
objParams
).
then
((
response
)
=>
{
debugger
let
columns
=
[
{
title
:
`N°`
,
...
...
src/main/webapp/js/pages/mantenimiento_sede.js
0 → 100644
View file @
6a717e57
let
htmlConceptos
=
""
;
function
getColumns
()
{
let
columns
=
[
{
title
:
`N°`
,
data
:
`id`
,
className
:
'text-center'
},
{
title
:
`SEDE`
,
data
:
`sede_descripcion`
,
className
:
`text-center`
,
},
{
title
:
`CONCEPTO`
,
data
:
`montoamanecidas_descripcion`
,
className
:
'text-center'
},
{
title
:
'ESTADO'
,
data
:
`estado`
,
className
:
"text-center"
,
render
:
(
data
)
=>
{
let
label
=
""
;
let
contenido
=
""
;
if
(
data
===
1
)
{
label
=
`label label-success`
;
contenido
=
"ACTIVO"
;
}
else
if
(
data
===
0
)
{
label
=
`label label-danger`
;
contenido
=
"INACTIVO"
;
}
return
`<span class="
${
label
}
">
${
contenido
}
</span>`
;
}
},
{
title
:
`ACCIONES`
,
data
:
null
,
className
:
'text-center'
,
render
:
(
data
)
=>
{
let
acciones
=
`<span data-placement="left" title="Editar" style="cursor: pointer"> <i class="editar icon-pencil text-slate-800"></i> </span>
<span data-placement="left" title="Eliminar" style="cursor: pointer"> <i class="eliminar icon-cancel-circle2 text-danger-700"></i> </span>`
;
return
acciones
;
}
}
];
return
columns
;
}
function
getColumnDefs
()
{
let
columnDefs
=
[
{
orderable
:
false
,
width
:
'3%'
,
targets
:
0
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'10%'
,
targets
:
1
,
className
:
"text-center"
},
{
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"
},
];
return
columnDefs
;
}
function
inicializarInputsModal
(
data
=
{}){
debugger
$
(
"#spanSede"
).
html
(
data
.
sede_descripcion
);
$
(
"#cboEditarConceptos"
).
html
(
htmlConceptos
);
$
(
"#cboEditarConceptos"
).
val
(
data
.
montoamanecidas_id
);
// $("#txtEditarMonto12h").val(data.monto12h);
// $("#txtEditarMonto24h").val(data.monto24h);
// debugger
}
function
mostrarMensajeResultadoModal
(
result
=
{}){
if
(
result
.
value
)
{
swal
({
type
:
'success'
,
title
:
'¡Se realizó la actualización correctamente!'
,
showConfirmButton
:
false
,
timer
:
1500
});
}
}
function
mostrarModalEdicion
(
data
=
{})
{
axios
.
get
(
"modals/policias/mantenimientoSedes/editarConceptoSede.jsp"
).
then
((
response
)
=>
{
swal
({
title
:
'<strong>Editar</strong>'
,
html
:
response
.
data
,
showCloseButton
:
true
,
showCancelButton
:
true
,
focusConfirm
:
false
,
confirmButtonText
:
'<i class="fa fa-thumbs-up"></i> Guardar cambios'
,
confirmButtonAriaLabel
:
'Thumbs up, great!'
,
cancelButtonText
:
'Cancelar'
,
cancelButtonAriaLabel
:
'Thumbs down'
,
width
:
'15%'
,
onOpen
:
()
=>
{
inicializarInputsModal
(
data
);
}
}).
then
((
result
)
=>
{
mostrarMensajeResultadoModal
(
result
);
});
});
}
function
mostrarModalEliminacion
(
data
)
{
swal
({
type
:
'success'
,
title
:
'¡Eliminado correctamente!'
,
showConfirmButton
:
false
,
timer
:
1500
});
}
function
listarAsignacionesConceptosSede
(
objParams
=
{})
{
axios
.
get
(
URI_POLICIA_CONCEPTOSEDES
,
objParams
).
then
((
response
)
=>
{
response
.
data
=
formatResponse
(
response
);
let
columns
=
getColumns
();
let
columnDefs
=
getColumnDefs
();
let
wrapsNameDatatable
=
`divDatatable`
;
let
classNameForDatatable
=
`display table table-bordered`
;
let
footer
=
false
;
makeDatatable
(
{
data
:
response
.
data
.
data
,
columns
,
columnDefs
,
wrapsNameDatatable
,
classNameForDatatable
,
footer
}
).
then
((
datatable
)
=>
{
$
(
datatable
).
on
(
"click"
,
".editar"
,
function
()
{
let
data
=
$
(
datatable
).
DataTable
().
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
mostrarModalEdicion
(
data
);
});
$
(
datatable
).
on
(
"click"
,
".eliminar"
,
function
()
{
let
data
=
$
(
datatable
).
DataTable
().
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
mostrarModalEliminacion
(
data
);
});
});
});
}
function
listarSedes
(
selectorName
)
{
axios
.
get
(
URI_SEDES
).
then
((
result
)
=>
{
let
sedes
=
result
.
data
;
sedes
=
_
.
orderBy
(
sedes
,
s
=>
s
.
descripcion
);
let
html
=
`<option value="">[TODOS]</option>`
;
sedes
.
forEach
(
sede
=>
html
+=
`<option value="
${
sede
.
codigo
}
">
${
sede
.
descripcion
}
</option>`
);
$
(
selectorName
).
html
(
html
);
$
(
'.select-search'
).
select2
();
});
}
function
listarConceptos
(
selectorName
)
{
axios
.
get
(
URI_POLICIA_MONTOS_AMANECIDAS
).
then
((
response
)
=>
{
let
data
=
response
.
data
;
data
=
_
.
orderBy
(
data
,
d
=>
d
.
descripcion
);
let
html
=
`<option value="">[TODOS]</option>`
;
data
.
forEach
(
amanecida
=>
htmlConceptos
=
html
+=
`<option value="
${
amanecida
.
id
}
">
${
amanecida
.
descripcion
}
</option>`
);
$
(
selectorName
).
html
(
html
);
$
(
'.select-search'
).
select2
();
});
}
$
().
ready
(
function
()
{
defaultConfigDataTable
();
listarSedes
(
"#cboSedes"
);
listarConceptos
(
"#cboConceptos"
);
$
(
"#btnVerTodos"
).
click
(
listarAsignacionesConceptosSede
)
}
);
\ No newline at end of file
src/main/webapp/vistas/mantenimientoSede.jsp
View file @
6a717e57
...
...
@@ -6,7 +6,7 @@
<
%@
include
file=
"templates/header.jsp"
%
>
<!--template-core-->
<!--css de la pagina-->
<link
href=
"../css/lib/sweetalert2.min.css"
rel=
"stylesheet"
type=
"text/css"
/>
<!--css-->
</head>
<body>
...
...
@@ -16,29 +16,28 @@
<div
class=
"col-md-4 col-md-offset-4"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h5
class=
"panel-title"
>
Control de Asistencia de Policia
s
</h5>
<h5
class=
"panel-title"
>
Filtro
s
</h5>
</div>
<form
id=
"frm
AsistenciaPolicias
"
onsubmit=
"return false;"
autocomplete=
"off"
>
<form
id=
"frm"
onsubmit=
"return false;"
autocomplete=
"off"
>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-5 form-group"
>
<label>
Busqueda por
</label>
<select
class=
"form-control"
id=
"cboCriterio"
>
<option>
SEDE
</option>
<option>
CONDICION DE SEDE
</option>
<div
class=
"col-md-6 form-group"
>
<label>
Sede
</label>
<select
id=
"cboSedes"
class=
"select-search form-control"
>
</select>
</div>
<div
class=
"form-group col-md-7"
>
<label
for=
""
>
Sede
</label>
<input
type=
"text"
class=
"form-control"
></input>
<div
class=
"col-md-6 form-group"
>
<label
for=
""
>
Concepto
</label>
<select
class=
"select-search form-control"
id=
"cboConceptos"
>
</select>
</div>
</div>
</div>
<div
class=
"panel-footer"
>
<div
class=
"text-center"
>
<button
class=
"btn btn-primary"
id=
"btn
Buscar"
><i
class=
"fa fa-search"
></i>
Buscar
</button>
<button
class=
"btn btn-
warning"
id=
"btnLimpiar"
><i
class=
"fa fa-eraser"
></i>
Limpiar
</button>
<button
class=
"btn btn-primary"
id=
"btn
VerSede"
><i
class=
"fa fa-search"
></i>
Ver sede
</button>
<button
class=
"btn btn-
primary"
id=
"btnVerTodos"
><i
class=
"fa fa-search"
></i>
Ver todos
</button>
</div>
</div>
...
...
@@ -53,8 +52,8 @@
<div
class=
"panel-heading"
style=
"padding: 8px 15px"
>
<h6
class=
"panel-title"
style=
"font-size: 15px; font-family: inherit"
><i
class=
"icon icon-search4"
></i>
LISTADO DE SEDES
</h6>
</div>
<div>
<table
class=
"table dataTable table-striped table-hover table-sm table-bordered display"
id=
"tblAsistenciaPolicias"
>
<div
id=
"divDatatable"
>
<!--
<table class="table dataTable table-striped table-hover table-sm table-bordered display" id="tblAsistenciaPolicias">
<thead>
<tr>
<th class="text-center">Nº</th>
...
...
@@ -112,7 +111,7 @@
</td>
</tr>
</tbody>
</table>
</table>
-->
</div>
</div>
</div>
...
...
@@ -174,7 +173,15 @@
<
%@
include
file=
"templates/footer-body.jsp"
%
>
<!--js de la pagina-->
<script
src=
"../plantilla/assets/js/plugins/tables/datatables/datatables.min.js"
type=
"text/javascript"
></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/sweetalert2.min.js"
type=
"text/javascript"
></script>
<script
src=
"../js/lib/lodash.js"
type=
"text/javascript"
></script>
<script
src=
"../js/lib/axios.min.js"
type=
"text/javascript"
></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
src=
"../js/pages/mantenimiento_sede.js"
type=
"text/javascript"
></script>
<!--js-->
</body>
...
...
src/main/webapp/vistas/modals/policias/mantenimientoSedes/editarConceptoSede.jsp
0 → 100644
View file @
6a717e57
<form id="frmAsistenciaDocentes" onsubmit="return false;" autocomplete="off">
<div class="panel-body">
<div class="row">
<div class="col-md-12 form-group">
<label>Sede</label>
<span class="label label-left border-left-primary label-striped form-control" id="spanSede"></span>
</select>
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
<label>Concepto</label>
<select class="select-search form-control" id="cboEditarConceptos">
</select>
</div>
</div>
</div>
</form>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment