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
ec310974
Commit
ec310974
authored
Aug 21, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agregando filtros al proyectado de asistencia
parent
21e11678
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
79 deletions
+117
-79
proyectar_asistencia_policias.js
src/main/webapp/js/pages/proyectar_asistencia_policias.js
+108
-72
proyectarAsistenciaPolicias.jsp
src/main/webapp/vistas/proyectarAsistenciaPolicias.jsp
+9
-7
No files found.
src/main/webapp/js/pages/proyectar_asistencia_policias.js
View file @
ec310974
let
data
=
[];
let
s
edes
=
[];
let
listaS
edes
=
[];
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"
,
...
...
@@ -15,6 +15,30 @@ function initializeData() {
function
listarSedes
(
selectorName
)
{
axios
.
get
(
URI_SEDES
).
then
((
result
)
=>
{
let
sedes
=
result
.
data
;
sedes
=
_
.
orderBy
(
sedes
,
s
=>
s
.
descripcion
);
listaSedes
=
_
.
map
(
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
listarPolicias
(
selectorName
)
{
axios
.
get
(
URI_POLICIAS
).
then
((
result
)
=>
{
let
policias
=
result
.
data
;
policias
=
_
.
orderBy
(
policias
,
p
=>
p
.
nombres
);
let
html
=
`<option value="">[TODOS]</option>`
;
policias
.
forEach
(
p
=>
html
+=
`<option documento_identidad="
${
p
.
dni
}
" value="
${
p
.
id
}
">
${
p
.
nombres
}
</option>`
);
$
(
`
${
selectorName
}
`
).
html
(
html
);
$
(
'.select-search'
).
select2
();
});
}
function
defaultConfigHandsonTable
()
{
let
container
=
document
.
getElementById
(
"tblProyectado"
);
...
...
@@ -30,80 +54,90 @@ function defaultConfigHandsonTable() {
function
mostrarVistaPrevia
()
{
handsonTable
.
destroy
();
let
container
=
document
.
getElementById
(
"tblProyectado"
);
handsonTable
=
new
Handsontable
(
container
,
{
data
:
data
,
stretchH
:
'all'
,
rowHeaders
:
true
,
colHeaders
:
[
'DNI'
,
'Apellidos y Nombres'
,
'Sede'
,
'Horario'
,
'Rol'
,
'Fecha Entrada'
,
'Hora entrada'
,
'Hora Salida'
,
'Fecha Salida'
],
columns
:
[
{
data
:
"dni"
,
className
:
'text-center'
,
readOnly
:
true
},
{
"data"
:
"nombres"
,
readOnly
:
true
},
{
"data"
:
"sede"
,
"className"
:
"text-center"
,
axios
.
get
(
URI_ROL_POLICIA
).
then
((
response
)
=>
{
response
.
data
=
formatResponse
(
response
);
if
(
response
.
data
.
status
)
{
handsonTable
.
destroy
();
let
container
=
document
.
getElementById
(
"tblProyectado"
);
handsonTable
=
new
Handsontable
(
container
,
{
data
:
response
.
data
.
data
,
stretchH
:
'all'
,
rowHeaders
:
true
,
colHeaders
:
[
'DNI'
,
'Apellidos y Nombres'
,
'Sede'
,
'Horario'
,
'Rol'
,
'Fecha Entrada'
,
'Hora entrada'
,
'Hora Salida'
,
'Fecha Salida'
],
columns
:
[
{
data
:
"policia_dni"
,
className
:
'text-center'
,
readOnly
:
true
},
{
"data"
:
"policia_nombres"
,
readOnly
:
true
},
{
"data"
:
"sede_descripcion"
,
"className"
:
"text-center"
,
// editor: 'select',
// selectOptions: sedes,
source
:
sedes
,
strict
:
true
,
type
:
'autocomplete'
,
allowInvalid
:
false
},
{
"data"
:
"horario"
,
"className"
:
"text-center"
,
readOnly
:
true
},
{
"data"
:
"tipo_horario"
,
"className"
:
"text-center"
,
readOnly
:
true
},
{
"data"
:
"fecha_entrada"
,
"className"
:
'text-center'
,
type
:
'date'
,
dateFormat
:
'DD/MM/YYYY'
,
readOnly
:
true
},
{
data
:
"marcacion_entrada"
,
className
:
'text-center'
,
editor
:
TA_EDITOR_HORA
,
type
:
'time'
,
timeFormat
:
'HH:mm'
,
correctFormat
:
true
,
allowInvalid
:
false
},
{
data
:
"marcacion_salida"
,
className
:
'text-center'
,
timeFormat
:
'HH:mm'
,
editor
:
TA_EDITOR_HORA
,
type
:
'time'
,
correctFormat
:
true
,
allowInvalid
:
false
,
},
{
data
:
"fecha_salida"
,
className
:
'text-center'
,
type
:
'date'
,
dateFormat
:
'DD/MM/YYYY'
,
readOnly
:
true
}
]
source
:
listaSedes
,
strict
:
true
,
type
:
'autocomplete'
,
allowInvalid
:
false
},
{
"data"
:
"horario"
,
"className"
:
"text-center"
,
readOnly
:
true
},
{
"data"
:
"tipo_horario"
,
"className"
:
"text-center"
,
readOnly
:
true
},
{
"data"
:
"fecha_entrada"
,
"className"
:
'text-center'
,
type
:
'date'
,
dateFormat
:
'DD/MM/YYYY'
,
readOnly
:
true
},
{
data
:
"marcacion_entrada"
,
className
:
'text-center'
,
editor
:
TA_EDITOR_HORA
,
type
:
'time'
,
timeFormat
:
'HH:mm'
,
correctFormat
:
true
,
allowInvalid
:
false
},
{
data
:
"marcacion_salida"
,
className
:
'text-center'
,
timeFormat
:
'HH:mm'
,
editor
:
TA_EDITOR_HORA
,
type
:
'time'
,
correctFormat
:
true
,
allowInvalid
:
false
,
},
{
data
:
"fecha_salida"
,
className
:
'text-center'
,
type
:
'date'
,
dateFormat
:
'DD/MM/YYYY'
,
readOnly
:
true
}
]
});
registrarEventoTab
();
}
});
registrarEventoTab
();
}
function
registrarEventoTab
()
{
...
...
@@ -166,7 +200,9 @@ TA_EDITOR_HORA.prototype.createElements = function () {
$
(
function
()
{
$
().
ready
(
function
()
{
listarPolicias
(
"#cboPoliciasFiltro"
);
listarSedes
(
"#cboSedesFiltro"
);
$
(
"#dpFechaInicio"
).
datepicker
({
minDate
:
new
Date
(
2000
,
1
-
1
,
1
),
maxDate
:
new
Date
(),
dateFormat
:
'dd/mm/yy'
,
...
...
src/main/webapp/vistas/proyectarAsistenciaPolicias.jsp
View file @
ec310974
...
...
@@ -21,16 +21,15 @@
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-6 form-group"
>
<label>
Busqueda Por
</label>
<select
id=
"cboCriterio"
class=
"form-control"
>
<option
value=
""
>
[SELECCIONE]
</option>
<option
value=
""
>
DNI
</option>
<option
value=
""
>
APELLIDOS
</option>
<label>
Policia
</label>
<select
class=
"select-search form-control"
id=
"cboPoliciasFiltro"
>
</select>
</div>
<div
class=
"col-md-6 form-group"
>
<label>
Criterio
</label>
<input
type=
"text"
class=
"form-control"
></input>
<label>
Sede
</label>
<select
id=
"cboSedesFiltro"
class=
"select-search form-control"
>
</select>
</div>
</div>
...
...
@@ -105,6 +104,9 @@
<script
src=
"../js/lib/dataTables.rowsGroup.js"
type=
"text/javascript"
></script>
<script
type=
"text/javascript"
src=
"../plantilla/assets/js/plugins/tables/handsontable/handsontable.min.js"
></script>
<script
src=
"../js/lib/jquery.inputmask.bundle.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=
"../plantilla/assets/js/plugins/forms/selects/select2.min.js"
></script>
<script
src=
"../js/pages/proyectar_asistencia_policias.js"
type=
"text/javascript"
></script>
<!--js-->
...
...
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