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
c206fa00
Commit
c206fa00
authored
Aug 27, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mostrando roles en la proyeccion, se agrega boton guardar cambios
parent
c422a8ee
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
19 deletions
+37
-19
crearRolPolicia.js
src/main/webapp/js/pages/crearRolPolicia.js
+26
-12
proyectar_asistencia_policias.js
src/main/webapp/js/pages/proyectar_asistencia_policias.js
+7
-6
proyectarAsistenciaPolicias.jsp
src/main/webapp/vistas/proyectarAsistenciaPolicias.jsp
+4
-1
No files found.
src/main/webapp/js/pages/crearRolPolicia.js
View file @
c206fa00
...
...
@@ -94,13 +94,13 @@ function listarRolesPolicias(objParams = {}) {
makeDatatable
({
data
:
response
.
data
,
columns
:
columns
,
columnDefs
:
columnDefs
,
wrapsNameDatatable
:
wrapsNameDatatable
,
classNameForDatatable
:
classNameForDatatable
,
footer
:
footer
columns
,
columnDefs
,
wrapsNameDatatable
,
classNameForDatatable
,
footer
}).
then
((
nodes
)
=>
{
nodes
.
container
.
on
(
"click"
,
".ver-detalle"
,
function
()
{
nodes
.
container
.
o
ff
().
o
n
(
"click"
,
".ver-detalle"
,
function
()
{
let
data
=
nodes
.
datatable
.
DataTable
().
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
console
.
log
(
data
);
...
...
@@ -136,10 +136,10 @@ function listarRolesPolicias(objParams = {}) {
}
function
listarTipoRoles
()
{
ajaxWebService
.
get
(
URI_TIPOROL_POLICIA
).
then
((
res
ult
)
=>
{
let
roles
=
result
.
data
;
ajaxWebService
.
get
(
URI_TIPOROL_POLICIA
).
then
((
res
ponse
)
=>
{
let
tipoRoles
=
response
.
data
;
let
html
=
"<option>[SELECCIONE]</option>"
;
roles
.
forEach
(
rol
=>
html
+=
`<option value="
${
rol
.
codigo
}
">
${
rol
.
descripcion
}
</option>`
);
tipoRoles
.
forEach
(
tp
=>
html
+=
`<option data-hora-entrada="
${
tp
.
hora_entrada
}
" data-hora-salida="
${
tp
.
hora_salida
}
" value="
${
tp
.
codigo
}
">
${
tp
.
descripcion
}
</option>`
);
$
(
"#cboTipoRol"
).
html
(
html
);
});
}
...
...
@@ -205,16 +205,30 @@ function registrarRolPolicia() {
let
sede_descripcion
=
$
(
"#cboSedesModal option:selected"
).
text
();
let
estado
=
1
;
let
policia_dni
=
$
(
"#cboPolicias option:selected"
).
attr
(
"documento_identidad"
);
let
hora_entrada
=
$
(
"#cboTipoRol option:selected"
).
data
(
'hora-entrada'
);
let
hora_salida
=
$
(
"#cboTipoRol option:selected"
).
data
(
'hora-salida'
);
debugger
let
fechas
=
generarFechas
(
fecha_inicio
,
fecha_fin
);
let
detalles_rol
=
[];
let
numero
=
1
;
fechas
.
forEach
((
f
)
=>
{
fechas
.
map
((
f
)
=>
{
let
obj
=
{
fecha_entrada
:
`
${
f
}
${
hora_entrada
}
`
,
fecha_salida
:
`
${
f
}
${
hora_salida
}
`
}
return
obj
;
})
.
forEach
((
f
)
=>
{
debugger
let
detalle_rol
=
{
id
:
numero
++
,
fecha_entrada
:
f
,
fecha_salida
:
f
,
fecha_entrada
:
f
.
fecha_entrada
,
fecha_salida
:
f
.
fecha_salida
,
estado
:
1
};
detalles_rol
.
push
(
detalle_rol
);
...
...
src/main/webapp/js/pages/proyectar_asistencia_policias.js
View file @
c206fa00
...
...
@@ -53,17 +53,17 @@ function defaultConfigHandsonTable() {
function
mostrarVistaPrevia
()
{
ajaxWebService
.
get
(
URI_ROL_POLICIA
).
then
((
response
)
=>
{
debugger
if
(
response
.
data
.
status
)
{
if
(
response
.
status
)
{
handsonTable
.
destroy
();
let
container
=
document
.
getElementById
(
"tblProyectado"
);
let
filas
=
[];
debugger
response
.
data
.
data
.
forEach
(
d
=>
{
response
.
data
.
forEach
(
d
=>
{
d
.
detalles_rol
.
forEach
(
dr
=>
{
dr
.
horario
=
`
${
dr
.
fecha_entrada
.
split
(
" "
)[
1
]}
-
${
dr
.
fecha_salida
.
split
(
" "
)[
1
]}
`
;
dr
.
fecha_entrada
=
dr
.
fecha_entrada
.
split
(
" "
)[
0
];
dr
.
fecha_salida
=
dr
.
fecha_salida
.
split
(
" "
)[
0
];
debugger
let
objFila
=
{
policia_dni
:
d
.
policia_dni
,
policia_nombres
:
d
.
policia_nombres
,
...
...
@@ -71,7 +71,8 @@ function mostrarVistaPrevia() {
fecha_salida
:
dr
.
fecha_salida
,
sede_id
:
d
.
sede_id
,
sede_descripcion
:
d
.
sede_descripcion
,
horario
:
dr
.
horario
,
tiporol_descripcion
:
d
.
tiporol_descripcion
};
filas
.
push
(
objFila
);
});
...
...
@@ -110,7 +111,7 @@ function mostrarVistaPrevia() {
readOnly
:
true
},
{
"data"
:
"tipo
_horario
"
,
"data"
:
"tipo
rol_descripcion
"
,
"className"
:
"text-center"
,
readOnly
:
true
},
...
...
src/main/webapp/vistas/proyectarAsistenciaPolicias.jsp
View file @
c206fa00
...
...
@@ -52,7 +52,7 @@
</div>
<div
class=
"panel-footer"
>
<div
class=
"text-center"
>
<button
class=
"btn btn-primary"
id=
"btnVistaPrevia"
><i
class=
"icon-eye4"
></i>
V
ista previa
</button>
<button
class=
"btn btn-primary"
id=
"btnVistaPrevia"
><i
class=
"icon-eye4"
></i>
V
er
</button>
<!--<button class="btn btn-warning" id="btnLimpiar"><i class="fa fa-eraser"></i> Limpiar</button>-->
</div>
</div>
...
...
@@ -64,6 +64,9 @@
<div
class=
"panel panel-primary card-3"
>
<div
class=
"panel-heading"
>
<h6
class=
"panel-title"
style=
"font-size: 15px; font-family: inherit"
><i
class=
"icon icon-search4"
></i>
ASISTENCIAS PROYECTADAS
</h6>
<div
class=
"heading-elements"
>
<button
type=
"button"
id=
"btnGuardarCambios"
class=
"btn bg-slate border-slate-600 btn-xs"
><i
class=
"glyphicon glyphicon-plus"
></i>
Guardar cambios
</button>
</div>
</div>
<div
id=
"tblProyectado"
>
<!-- <table class="table table-responsive dataTable table-striped table-sm table-bordered" id="tblAsistenciaPolicias">
...
...
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