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
4a79f622
Commit
4a79f622
authored
Aug 16, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avance rolpolicia
parent
ad9fa28f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
4 deletions
+46
-4
crearRolPolicia.js
src/main/webapp/js/pages/crearRolPolicia.js
+44
-3
crearRolPolicia.jsp
src/main/webapp/vistas/crearRolPolicia.jsp
+2
-1
No files found.
src/main/webapp/js/pages/crearRolPolicia.js
View file @
4a79f622
...
...
@@ -27,6 +27,7 @@ function listarFrecuenciaRol() {
function
listarSedes
()
{
axios
.
get
(
URI_LISTAR_SEDES
).
then
((
result
)
=>
{
let
sedes
=
result
.
data
;
sedes
=
_
.
orderBy
(
sedes
,
s
=>
s
.
descripcion
);
let
html
=
"<option>[SELECCIONE]</option>"
;
sedes
.
forEach
(
sede
=>
html
+=
`<option value="
${
sede
.
codigo
}
">
${
sede
.
descripcion
}
</option>`
);
$
(
"#cboSedes"
).
html
(
html
);
...
...
@@ -36,6 +37,7 @@ function listarSedes() {
function
listarPolicias
()
{
axios
.
get
(
URI_LISTAR_POLICIAS
).
then
((
result
)
=>
{
let
policias
=
result
.
data
;
policias
=
_
.
orderBy
(
policias
,
p
=>
p
.
nombres
);
let
html
=
"<option>[SELECCIONE]</option>"
;
policias
.
forEach
(
p
=>
html
+=
`<option value="
${
p
.
id
}
">
${
p
.
nombres
}
</option>`
);
$
(
"#cboPolicias"
).
html
(
html
);
...
...
@@ -55,9 +57,47 @@ function modificarServicio() {
animar
();
// e.preventDefault();
}
function
registrarRolPolicia
()
{
[
{
id
:
""
,
nombres
:
""
,
sede
:
{
id
:
""
,
nombre
:
""
},
rol
:
{
nombre
:
""
,
id
:
""
}
}
]
[
{
id
:
""
,
nombres
:
""
,
sede_id
:
""
,
sede_nombre
:
""
,
rol_nombre
:
""
,
rol_id
:
""
}
]
debugger
;
axios
.
post
(
'/policias'
,
{
nombre
:
'billy'
,
rol
:
'regular'
,
frecuencia
:
''
})
.
then
(
function
(
response
)
{
console
.
log
(
response
);
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
});
}
function
cancelar
()
{
...
...
@@ -135,5 +175,5 @@ $().ready(function () {
$
(
'#servicio13'
).
click
(
modificarServicio
);
$
(
"#btnCancelar"
).
click
(
cancelar
);
$
(
"#btnGuardarCambios"
).
click
(
guardarCambios
);
$
(
"#btnRegistrar"
).
click
(
registrarRolPolicia
);
});
\ No newline at end of file
src/main/webapp/vistas/crearRolPolicia.jsp
View file @
4a79f622
...
...
@@ -62,7 +62,7 @@
</div>
<div
class=
"panel-footer"
>
<div
class=
"text-center"
>
<button
class=
"btn btn-primary"
id=
"btn
Busc
ar"
><i
class=
"fa fa-search"
></i>
Registrar
</button>
<button
class=
"btn btn-primary"
id=
"btn
Registr
ar"
><i
class=
"fa fa-search"
></i>
Registrar
</button>
<button
class=
"btn btn-warning"
id=
"btnLimpiar"
><i
class=
"fa fa-eraser"
></i>
Limpiar
</button>
</div>
</div>
...
...
@@ -892,6 +892,7 @@
<script
src=
"../plantilla/assets/js/plugins/pickers/daterangepicker.js"
></script>
<script
src=
"../js/lib/jquery-ui.multidatespicker.js"
></script>
<script
src=
"../plantilla/assets/js/plugins/extensions/contextmenu.js"
></script>
<script
src=
"../js/lib/lodash.js"
type=
"text/javascript"
></script>
<script
src=
"../js/lib/axios.min.js"
type=
"text/javascript"
></script>
<script
src=
"../js/pages/crearRolPolicia.js"
></script>
...
...
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