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
1d1369b1
Commit
1d1369b1
authored
Aug 17, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
registrando rol de policia
parent
6e376188
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
39 deletions
+44
-39
crearRolPolicia.js
src/main/webapp/js/pages/crearRolPolicia.js
+42
-37
crearRolPolicia.jsp
src/main/webapp/vistas/crearRolPolicia.jsp
+2
-2
No files found.
src/main/webapp/js/pages/crearRolPolicia.js
View file @
1d1369b1
...
...
@@ -11,7 +11,8 @@ function listarRolesPolicias() {
let
columns
=
[
{
title
:
`N°`
,
data
:
`numeroFila`
// data: `numeroFila`
data
:
`id`
},
{
title
:
`APELLIDOS Y NOMBRES`
,
...
...
@@ -42,7 +43,7 @@ function listarRolesPolicias() {
data
:
`estado`
},
];
let
columnDefs
=
[
{
orderable
:
false
,
width
:
'5%'
,
targets
:
0
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'5%'
,
targets
:
1
},
...
...
@@ -53,7 +54,7 @@ function listarRolesPolicias() {
{
orderable
:
false
,
width
:
'8%'
,
targets
:
6
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'8%'
,
targets
:
7
,
className
:
"text-center"
}
];
let
wrapsNameDatatable
=
`divRoles`
;
let
classNameForDatatable
=
`display table table-bordered`
;
let
footer
=
false
...
...
@@ -75,7 +76,7 @@ function listarTipoRoles() {
let
roles
=
result
.
data
;
let
html
=
"<option>[SELECCIONE]</option>"
;
roles
.
forEach
(
rol
=>
html
+=
`<option value="
${
rol
.
codigo
}
">
${
rol
.
descripcion
}
</option>`
);
$
(
"#cboRol"
).
html
(
html
);
$
(
"#cbo
Tipo
Rol"
).
html
(
html
);
});
}
...
...
@@ -125,42 +126,45 @@ function modificarServicio() {
}
function
registrarRolPolicia
()
{
[
{
id
:
""
,
nombres
:
""
,
sede
:
{
id
:
""
,
nombre
:
""
},
rol
:
{
nombre
:
""
,
id
:
""
}
}
]
[
{
id
:
""
,
nombres
:
""
,
sede_id
:
""
,
sede_nombre
:
""
,
rol_nombre
:
""
,
rol_id
:
""
}
]
let
policia_nombres
=
$
(
"#cboPolicias option:selected"
).
text
();
let
policia_id
=
$
(
"#cboPolicias"
).
val
();
let
tiporol_id
=
$
(
"#cboTipoRol"
).
val
();
let
tiporol_descripcion
=
$
(
"#cboTipoRol option:selected"
).
text
();
;
let
rango_fechas
=
$
(
"#dpRangoFechas"
).
val
();
let
split_fechas
=
rango_fechas
.
split
(
"-"
).
map
(
f
=>
f
.
trim
());
let
fecha_inicio
=
split_fechas
[
0
];
let
fecha_fin
=
split_fechas
[
1
];
let
frecuencia_id
=
$
(
"#cboFrecuenciaRol"
).
val
();
let
frecuencia_descripcion
=
$
(
"#cboFrecuenciaRol option:selected"
).
text
();
let
sede_id
=
$
(
"#cboSedes"
).
val
();
let
sede_descripcion
=
$
(
"#cboSedes option:selected"
).
text
();
let
estado
=
1
;
let
params
=
{
policia_id
,
policia_nombres
,
sede_id
,
sede_descripcion
,
fecha_inicio
,
fecha_fin
,
tiporol_id
,
tiporol_descripcion
,
frecuencia_id
,
frecuencia_descripcion
,
estado
};
debugger
;
axios
.
post
(
'/policias'
,
{
nombre
:
'billy'
,
rol
:
'regular'
,
frecuencia
:
''
})
.
then
(
function
(
response
)
{
console
.
log
(
res
ponse
);
axios
.
post
(
URI_LISTAR_ROL_POLICIA
,
params
)
.
then
(
(
result
)
=>
{
debugger
listarRolesPolicias
();
console
.
log
(
res
ult
.
data
);
})
.
catch
(
function
(
error
)
{
.
catch
(
error
=>
{
console
.
log
(
error
);
});
}
...
...
@@ -194,6 +198,7 @@ function guardarCambios() {
$
().
ready
(
function
()
{
init
();
defaultConfigDataTable
();
$
(
'.selectpicker'
).
selectpicker
({
style
:
'btn-info'
,
size
:
4
...
...
src/main/webapp/vistas/crearRolPolicia.jsp
View file @
1d1369b1
...
...
@@ -31,7 +31,7 @@
<div
class=
"row"
>
<div
class=
"col-md-6 form-group"
>
<label>
Tipo de rol
</label>
<select
class=
"form-control"
id=
"cboRol"
>
<select
class=
"form-control"
id=
"cbo
Tipo
Rol"
>
</select>
</div>
...
...
@@ -39,7 +39,7 @@
<label>
Rango de fechas:
</label>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"icon-calendar22"
></i></span>
<input
type=
"text"
class=
"form-control daterange-basic"
value=
"01/06/2018 - 30/06/2018"
>
<input
type=
"text"
class=
"form-control daterange-basic"
value=
"01/06/2018 - 30/06/2018"
id=
"dpRangoFechas"
>
</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