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
9a0af8e0
Commit
9a0af8e0
authored
Aug 27, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proyectado de asistencia con array de promesas
parent
76bac4fb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
37 deletions
+30
-37
general.js
src/main/webapp/js/general.js
+2
-1
proyectar_asistencia_policias.js
src/main/webapp/js/pages/proyectar_asistencia_policias.js
+28
-36
No files found.
src/main/webapp/js/general.js
View file @
9a0af8e0
...
@@ -27,6 +27,7 @@ const URI_POLICIAS_ASISTENCIA = "asistenciaPolicias";
...
@@ -27,6 +27,7 @@ const URI_POLICIAS_ASISTENCIA = "asistenciaPolicias";
const
URI_POLICIA_MONTOS_AMANECIDAS
=
"montoAmanecidas"
;
const
URI_POLICIA_MONTOS_AMANECIDAS
=
"montoAmanecidas"
;
const
URI_POLICIA_CONCEPTOSEDES
=
"conceptoSedes"
;
const
URI_POLICIA_CONCEPTOSEDES
=
"conceptoSedes"
;
const
URI_POLICIA_REPORTE_MONTOS
=
"reporteMontosPolicias"
;
const
URI_POLICIA_REPORTE_MONTOS
=
"reporteMontosPolicias"
;
const
URI_POLICIA_PROYECCION
=
"proyeccion"
;
//</editor-fold>
//</editor-fold>
...
@@ -302,7 +303,7 @@ data: [],
...
@@ -302,7 +303,7 @@ data: [],
classNameForDatatable
:
``
,
classNameForDatatable
:
``
,
footerFilter
:
false
,
footerFilter
:
false
,
highlighting
:
true
highlighting
:
true
})
=>
{
})
=>
{
let
data
=
jsonForDatatable
.
data
;
let
data
=
jsonForDatatable
.
data
;
let
columns
=
jsonForDatatable
.
columns
;
let
columns
=
jsonForDatatable
.
columns
;
let
columnDefs
=
jsonForDatatable
.
columns
;
let
columnDefs
=
jsonForDatatable
.
columns
;
...
...
src/main/webapp/js/pages/proyectar_asistencia_policias.js
View file @
9a0af8e0
...
@@ -63,46 +63,14 @@ function defaultConfigHandsonTable() {
...
@@ -63,46 +63,14 @@ function defaultConfigHandsonTable() {
function
mostrarVistaPrevia
()
{
function
mostrarVistaPrevia
()
{
ajaxWebService
.
get
(
URI_ROL_POLICIA
).
then
((
response
)
=>
{
ajaxWebService
.
get
(
URI_POLICIA_PROYECCION
).
then
((
response
)
=>
{
debugger
debugger
if
(
response
.
status
)
{
if
(
response
.
status
)
{
handsonTable
.
destroy
();
handsonTable
.
destroy
();
let
container
=
document
.
getElementById
(
"tblProyectado"
);
let
container
=
document
.
getElementById
(
"tblProyectado"
);
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
];
dr
.
asistencia_entrada
=
dr
.
asistencia_entrada
===
null
?
""
:
dr
.
asistencia_entrada
.
split
(
" "
)[
1
];
dr
.
asistencia_salida
=
dr
.
asistencia_salida
===
null
?
""
:
dr
.
asistencia_salida
.
split
(
" "
)[
1
];
return
dr
;
})
.
forEach
(
dr
=>
{
let
obj
=
{
rol_id
:
rol
.
id
,
detallerol_id
:
dr
.
id
,
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
,
marcacion_entrada
:
dr
.
asistencia_entrada
,
marcacion_salida
:
dr
.
asistencia_salida
};
data
.
push
(
obj
);
});
});
handsonTable
=
new
Handsontable
(
container
,
{
handsonTable
=
new
Handsontable
(
container
,
{
data
:
data
,
data
:
response
.
data
,
stretchH
:
'all'
,
stretchH
:
'all'
,
rowHeaders
:
true
,
rowHeaders
:
true
,
colHeaders
:
[
'DNI'
,
'Apellidos y Nombres'
,
'Sede'
,
'Horario'
,
'Rol'
,
'Fecha Entrada'
,
'Hora entrada'
,
'Hora Salida'
,
'Fecha Salida'
],
colHeaders
:
[
'DNI'
,
'Apellidos y Nombres'
,
'Sede'
,
'Horario'
,
'Rol'
,
'Fecha Entrada'
,
'Hora entrada'
,
'Hora Salida'
,
'Fecha Salida'
],
...
@@ -145,7 +113,7 @@ function mostrarVistaPrevia() {
...
@@ -145,7 +113,7 @@ function mostrarVistaPrevia() {
},
},
{
{
data
:
"marcacion
_entrada"
,
data
:
"asistencia
_entrada"
,
className
:
'text-center'
,
className
:
'text-center'
,
editor
:
TA_EDITOR_HORA
,
editor
:
TA_EDITOR_HORA
,
type
:
'time'
,
type
:
'time'
,
...
@@ -154,7 +122,7 @@ function mostrarVistaPrevia() {
...
@@ -154,7 +122,7 @@ function mostrarVistaPrevia() {
allowInvalid
:
false
allowInvalid
:
false
},
},
{
{
data
:
"marcacion
_salida"
,
data
:
"asistencia
_salida"
,
className
:
'text-center'
,
className
:
'text-center'
,
timeFormat
:
'HH:mm'
,
timeFormat
:
'HH:mm'
,
editor
:
TA_EDITOR_HORA
,
editor
:
TA_EDITOR_HORA
,
...
@@ -216,6 +184,30 @@ function registrarEventoTab() {
...
@@ -216,6 +184,30 @@ function registrarEventoTab() {
function
guardarCambios
()
{
function
guardarCambios
()
{
let
data
=
handsonTable
.
getSourceData
();
let
data
=
handsonTable
.
getSourceData
();
let
dataRequest
=
data
.
map
(
d
=>
{
return
{
id
:
d
.
id
,
sede_descripcion
:
d
.
sede_descripcion
,
asistencia_entrada
:
d
.
asistencia_entrada
,
asistencia_salida
:
d
.
asistencia_salida
}
});
let
promises
=
[]
dataRequest
.
forEach
(
d
=>
{
promises
.
push
(
ajaxWebService
.
patch
(
`
${
URI_POLICIA_PROYECCION
}
/
${
d
.
id
}
`
,
d
))
});
axios
.
all
(
promises
)
.
then
(
axios
.
spread
(
function
(
acct
,
perms
)
{
debugger
}));
// ajaxWebService.patch(URI_POLICIA_PROYECCION, dataRequest).then((response) => {
//
// });
}
}
...
...
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