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
982d50c6
Commit
982d50c6
authored
Aug 27, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usando map en proyeccion de asistencias
parent
c206fa00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
53 deletions
+24
-53
proyectar_asistencia_policias.js
src/main/webapp/js/pages/proyectar_asistencia_policias.js
+23
-33
proyectarAsistenciaPolicias.jsp
src/main/webapp/vistas/proyectarAsistenciaPolicias.jsp
+1
-20
No files found.
src/main/webapp/js/pages/proyectar_asistencia_policias.js
View file @
982d50c6
let
data
=
[];
let
listaSedes
=
[];
let
handsonTable
;
function
initializeData
()
{
data
.
push
({
"dni"
:
"12345678"
,
"nombres"
:
"DELGADO CHOZO JUAN FRANCISCO"
,
"sede"
:
"CANTA CALLAO 2"
,
"horario"
:
"07:00 - 17:00"
,
"tipo_horario"
:
"REGULAR"
,
"fecha_entrada"
:
"15/06/2018"
,
"marcacion_entrada"
:
"06:59"
,
"marcacion_salida"
:
"00:00"
,
"fecha_salida"
:
"15/06/2018"
});
data
.
push
({
"dni"
:
"12345678"
,
"nombres"
:
"DELGADO CHOZO JUAN FRANCISCO"
,
"sede"
:
"CANTA CALLAO 2"
,
"horario"
:
"07:00 - 17:00"
,
"tipo_horario"
:
"REGULAR"
,
"fecha_entrada"
:
"16/06/2018"
,
"marcacion_entrada"
:
"06:59"
,
"marcacion_salida"
:
"00:00"
,
"fecha_salida"
:
"16/06/2018"
});
data
.
push
({
"dni"
:
"12345678"
,
"nombres"
:
"DELGADO CHOZO JUAN FRANCISCO"
,
"sede"
:
"CANTA CALLAO 2"
,
"horario"
:
"07:00 - 07:00"
,
"tipo_horario"
:
"AMANECIDA 24h"
,
"fecha_entrada"
:
"17/06/2018"
,
"marcacion_entrada"
:
"06:59"
,
"marcacion_salida"
:
"00:00"
,
"fecha_salida"
:
"18/06/2018"
});
}
function
listarSedes
(
selectorName
)
{
...
...
@@ -57,31 +46,34 @@ function mostrarVistaPrevia() {
handsonTable
.
destroy
();
let
container
=
document
.
getElementById
(
"tblProyectado"
);
let
filas
=
[];
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
,
fecha_entrada
:
dr
.
fecha_entrada
,
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
);
});
let
data
=
[];
response
.
data
.
forEach
(
rol
=>
{
rol
.
detalles_rol
.
map
(
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
];
return
dr
;
})
.
forEach
(
dr
=>
{
let
obj
=
{
policia_dni
:
rol
.
policia_dni
,
policia_nombres
:
rol
.
policia_nombres
,
fecha_entrada
:
dr
.
fecha_entrada
,
fecha_salida
:
dr
.
fecha_salida
,
sede_id
:
rol
.
sede_id
,
sede_descripcion
:
rol
.
sede_descripcion
,
horario
:
dr
.
horario
,
tiporol_descripcion
:
rol
.
tiporol_descripcion
};
data
.
push
(
obj
);
});
});
handsonTable
=
new
Handsontable
(
container
,
{
data
:
filas
,
data
:
data
,
stretchH
:
'all'
,
rowHeaders
:
true
,
colHeaders
:
[
'DNI'
,
'Apellidos y Nombres'
,
'Sede'
,
'Horario'
,
'Rol'
,
'Fecha Entrada'
,
'Hora entrada'
,
'Hora Salida'
,
'Fecha Salida'
],
...
...
@@ -249,6 +241,5 @@ $().ready(function () {
$
(
"#dpFechaFin"
).
datepicker
(
'setDate'
,
'now'
);
// defaultConfigDataTable();
defaultConfigHandsonTable
();
initializeData
();
$
(
"#btnVistaPrevia"
).
click
(
mostrarVistaPrevia
);
});
\ No newline at end of file
src/main/webapp/vistas/proyectarAsistenciaPolicias.jsp
View file @
982d50c6
...
...
@@ -68,26 +68,7 @@
<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">
<thead>
<tr>
<th class="text-center">N°</th>
<th class="text-center">Apellidos y Nombres</th>
<th class="text-center">Sede</th>
<th class="text-center">Horario</th>
<th class="text-center">Tipo de horario</th>
<th class="text-center">Fecha de Entrada</th>
<th class="text-center">Marcación de entrada</th>
<th class="text-center">Marcación de salida</th>
<th class="text-center">Fecha de salida</th>
</tr>
</thead>
<tbody>
</tbody>
</table>-->
</div>
<div
id=
"tblProyectado"
></div>
</div>
</div>
...
...
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