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
6 years ago
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() {
...
@@ -11,7 +11,8 @@ function listarRolesPolicias() {
let
columns
=
[
let
columns
=
[
{
{
title
:
`N°`
,
title
:
`N°`
,
data
:
`numeroFila`
// data: `numeroFila`
data
:
`id`
},
},
{
{
title
:
`APELLIDOS Y NOMBRES`
,
title
:
`APELLIDOS Y NOMBRES`
,
...
@@ -42,7 +43,7 @@ function listarRolesPolicias() {
...
@@ -42,7 +43,7 @@ function listarRolesPolicias() {
data
:
`estado`
data
:
`estado`
},
},
];
];
let
columnDefs
=
[
let
columnDefs
=
[
{
orderable
:
false
,
width
:
'5%'
,
targets
:
0
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'5%'
,
targets
:
0
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'5%'
,
targets
:
1
},
{
orderable
:
false
,
width
:
'5%'
,
targets
:
1
},
...
@@ -53,7 +54,7 @@ function listarRolesPolicias() {
...
@@ -53,7 +54,7 @@ function listarRolesPolicias() {
{
orderable
:
false
,
width
:
'8%'
,
targets
:
6
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'8%'
,
targets
:
6
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'8%'
,
targets
:
7
,
className
:
"text-center"
}
{
orderable
:
false
,
width
:
'8%'
,
targets
:
7
,
className
:
"text-center"
}
];
];
let
wrapsNameDatatable
=
`divRoles`
;
let
wrapsNameDatatable
=
`divRoles`
;
let
classNameForDatatable
=
`display table table-bordered`
;
let
classNameForDatatable
=
`display table table-bordered`
;
let
footer
=
false
let
footer
=
false
...
@@ -75,7 +76,7 @@ function listarTipoRoles() {
...
@@ -75,7 +76,7 @@ function listarTipoRoles() {
let
roles
=
result
.
data
;
let
roles
=
result
.
data
;
let
html
=
"<option>[SELECCIONE]</option>"
;
let
html
=
"<option>[SELECCIONE]</option>"
;
roles
.
forEach
(
rol
=>
html
+=
`<option value="
${
rol
.
codigo
}
">
${
rol
.
descripcion
}
</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() {
...
@@ -125,42 +126,45 @@ function modificarServicio() {
}
}
function
registrarRolPolicia
()
{
function
registrarRolPolicia
()
{
[
let
policia_nombres
=
$
(
"#cboPolicias option:selected"
).
text
();
{
let
policia_id
=
$
(
"#cboPolicias"
).
val
();
id
:
""
,
let
tiporol_id
=
$
(
"#cboTipoRol"
).
val
();
nombres
:
""
,
let
tiporol_descripcion
=
$
(
"#cboTipoRol option:selected"
).
text
();
sede
:
{
;
id
:
""
,
let
rango_fechas
=
$
(
"#dpRangoFechas"
).
val
();
nombre
:
""
let
split_fechas
=
rango_fechas
.
split
(
"-"
).
map
(
f
=>
f
.
trim
());
},
let
fecha_inicio
=
split_fechas
[
0
];
rol
:
{
let
fecha_fin
=
split_fechas
[
1
];
nombre
:
""
,
let
frecuencia_id
=
$
(
"#cboFrecuenciaRol"
).
val
();
id
:
""
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
,
id
:
""
,
policia_nombres
,
nombres
:
""
,
sede_id
,
sede_id
:
""
,
sede_descripcion
,
sede_nombre
:
""
,
fecha_inicio
,
rol_nombre
:
""
,
fecha_fin
,
rol_id
:
""
tiporol_id
,
}
tiporol_descripcion
,
]
frecuencia_id
,
frecuencia_descripcion
,
estado
};
debugger
;
debugger
;
axios
.
post
(
'/policias'
,
{
nombre
:
'billy'
,
axios
.
post
(
URI_LISTAR_ROL_POLICIA
,
params
)
rol
:
'regular'
,
.
then
(
(
result
)
=>
{
frecuencia
:
''
debugger
})
.
then
(
function
(
response
)
{
listarRolesPolicias
();
console
.
log
(
res
ponse
);
console
.
log
(
res
ult
.
data
);
})
})
.
catch
(
function
(
error
)
{
.
catch
(
error
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
});
});
}
}
...
@@ -194,6 +198,7 @@ function guardarCambios() {
...
@@ -194,6 +198,7 @@ function guardarCambios() {
$
().
ready
(
function
()
{
$
().
ready
(
function
()
{
init
();
init
();
defaultConfigDataTable
();
$
(
'.selectpicker'
).
selectpicker
({
$
(
'.selectpicker'
).
selectpicker
({
style
:
'btn-info'
,
style
:
'btn-info'
,
size
:
4
size
:
4
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/vistas/crearRolPolicia.jsp
View file @
1d1369b1
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-6 form-group"
>
<div
class=
"col-md-6 form-group"
>
<label>
Tipo de rol
</label>
<label>
Tipo de rol
</label>
<select
class=
"form-control"
id=
"cboRol"
>
<select
class=
"form-control"
id=
"cbo
Tipo
Rol"
>
</select>
</select>
</div>
</div>
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<label>
Rango de fechas:
</label>
<label>
Rango de fechas:
</label>
<div
class=
"input-group"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"icon-calendar22"
></i></span>
<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>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
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