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
6159a3be
Commit
6159a3be
authored
Aug 24, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modal registro en mantenimiento de sede
parent
29b2cb7c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
12 deletions
+99
-12
mantenimiento_sede.js
src/main/webapp/js/pages/mantenimiento_sede.js
+79
-11
editarConceptoSede.jsp
...modals/policias/mantenimientoSedes/editarConceptoSede.jsp
+0
-1
registrarConceptoSede.jsp
...als/policias/mantenimientoSedes/registrarConceptoSede.jsp
+20
-0
No files found.
src/main/webapp/js/pages/mantenimiento_sede.js
View file @
6159a3be
let
htmlConceptos
=
""
;
let
htmlSedes
=
""
;
function
getColumns
()
{
let
columns
=
[
{
...
...
@@ -80,7 +82,7 @@ function getColumnDefs() {
return
columnDefs
;
}
function
inicializarInputsModal
(
data
=
{}){
function
inicializarInputsModal
Editar
(
data
=
{}){
debugger
$
(
"#spanSede"
).
html
(
data
.
sede_descripcion
);
$
(
"#cboEditarConceptos"
).
html
(
htmlConceptos
);
...
...
@@ -90,8 +92,15 @@ function inicializarInputsModal(data = {}){
// debugger
}
function
mostrarMensajeResultadoModal
(
result
=
{}){
function
inicializarInputsModalRegistrar
(
data
=
{}){
$
(
"#spanRegistrarSede"
).
html
(
data
.
sede_descripcion
);
$
(
"#cboRegistrarConceptos"
).
html
(
htmlConceptos
);
$
(
".select-search"
).
select2
();
}
function
mostrarMensajeResultadoModalEditar
(
result
=
{}){
if
(
result
.
value
)
{
// registrar();
swal
({
type
:
'success'
,
title
:
'¡Se realizó la actualización correctamente!'
,
...
...
@@ -101,6 +110,17 @@ function mostrarMensajeResultadoModal(result = {}){
}
}
function
mostrarMensajeResultadoModalRegistrar
(
result
=
{}){
if
(
result
.
value
)
{
swal
({
type
:
'success'
,
title
:
'¡Se asigno correctamente!'
,
showConfirmButton
:
false
,
timer
:
1500
});
}
}
function
mostrarModalEdicion
(
data
=
{})
{
axios
.
get
(
"modals/policias/mantenimientoSedes/editarConceptoSede.jsp"
).
then
((
response
)
=>
{
swal
({
...
...
@@ -115,10 +135,10 @@ function mostrarModalEdicion(data = {}) {
cancelButtonAriaLabel
:
'Thumbs down'
,
width
:
'15%'
,
onOpen
:
()
=>
{
inicializarInputsModal
(
data
);
inicializarInputsModal
Editar
(
data
);
}
}).
then
((
result
)
=>
{
mostrarMensajeResultadoModal
(
result
);
mostrarMensajeResultadoModal
Editar
(
result
);
});
});
}
...
...
@@ -132,7 +152,27 @@ function mostrarModalEliminacion(data) {
});
}
function
mostrarModalRegistrar
(
data
=
{})
{
axios
.
get
(
"modals/policias/mantenimientoSedes/registrarConceptoSede.jsp"
).
then
((
response
)
=>
{
swal
({
title
:
'<strong>Asignar concepto a sede</strong>'
,
html
:
response
.
data
,
showCloseButton
:
true
,
showCancelButton
:
true
,
focusConfirm
:
false
,
confirmButtonText
:
'<i class="fa fa-thumbs-up"></i> Registrar'
,
confirmButtonAriaLabel
:
'Thumbs up, great!'
,
cancelButtonText
:
'Cancelar'
,
cancelButtonAriaLabel
:
'Thumbs down'
,
width
:
'15%'
,
onOpen
:
()
=>
{
inicializarInputsModalRegistrar
(
data
);
}
}).
then
((
result
)
=>
{
mostrarMensajeResultadoModalEditar
(
result
);
});
});
}
function
listarAsignacionesConceptosSede
(
objParams
=
{})
{
axios
.
get
(
URI_POLICIA_CONCEPTOSEDES
,
objParams
).
then
((
response
)
=>
{
...
...
@@ -154,6 +194,12 @@ function listarAsignacionesConceptosSede(objParams = {}) {
footer
}
).
then
((
datatable
)
=>
{
$
(
datatable
).
on
(
"click"
,
".registrar"
,
function
()
{
let
data
=
$
(
datatable
).
DataTable
().
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
mostrarModalRegistrar
(
data
);
});
$
(
datatable
).
on
(
"click"
,
".editar"
,
function
()
{
let
data
=
$
(
datatable
).
DataTable
().
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
mostrarModalEdicion
(
data
);
...
...
@@ -171,7 +217,8 @@ function listarSedes(selectorName) {
let
sedes
=
result
.
data
;
sedes
=
_
.
orderBy
(
sedes
,
s
=>
s
.
descripcion
);
let
html
=
`<option value="">[TODOS]</option>`
;
sedes
.
forEach
(
sede
=>
html
+=
`<option value="
${
sede
.
codigo
}
">
${
sede
.
descripcion
}
</option>`
);
sedes
.
forEach
(
sede
=>
htmlSedes
+=
`<option value="
${
sede
.
codigo
}
">
${
sede
.
descripcion
}
</option>`
);
html
+=
htmlSedes
;
$
(
selectorName
).
html
(
html
);
$
(
'.select-search'
).
select2
();
});
...
...
@@ -182,7 +229,8 @@ function listarConceptos(selectorName) {
let
data
=
response
.
data
;
data
=
_
.
orderBy
(
data
,
d
=>
d
.
descripcion
);
let
html
=
`<option value="">[TODOS]</option>`
;
data
.
forEach
(
amanecida
=>
htmlConceptos
=
html
+=
`<option value="
${
amanecida
.
id
}
">
${
amanecida
.
descripcion
}
</option>`
);
data
.
forEach
(
amanecida
=>
htmlConceptos
+=
`<option value="
${
amanecida
.
id
}
">
${
amanecida
.
descripcion
}
</option>`
);
html
+=
htmlConceptos
;
$
(
selectorName
).
html
(
html
);
$
(
'.select-search'
).
select2
();
});
...
...
@@ -203,7 +251,28 @@ function buscar() {
function
registrar
()
{
let
let
sede_id
=
$
(
"#cboRegistrarSedes"
).
val
();
let
sede_descripcion
=
$
(
"#cboRegistrarSedes option:selected"
).
text
();
let
montoamanecida_id
=
$
(
"#cboRegistrarConceptos"
).
val
();
let
montoamanecida_descripcion
=
$
(
"#cboRegistrarConceptos option:selected"
).
text
();
let
estado
=
1
;
let
params
=
{
sede_descripcion
,
sede_id
,
montoamanecida_id
,
montoamanecida_descripcion
,
estado
};
debugger
axios
.
post
(
URI_POLICIA_CONCEPTOSEDES
,
params
)
.
then
((
response
)
=>
{
listarAsignacionesConceptosSede
();
});
}
...
...
@@ -214,5 +283,4 @@ $().ready(function () {
$
(
"#btnVerTodos"
).
click
(
listarAsignacionesConceptosSede
);
$
(
"#btnFiltro"
).
click
(
buscar
);
$
(
"#btnNuevo"
).
click
(
registrar
);
}
);
\ No newline at end of file
});
\ No newline at end of file
src/main/webapp/vistas/modals/policias/mantenimientoSedes/editarConceptoSede.jsp
View file @
6159a3be
...
...
@@ -4,7 +4,6 @@
<div class="col-md-12 form-group">
<label>Sede</label>
<span class="label label-left border-left-primary label-striped form-control" id="spanSede"></span>
</select>
</div>
</div>
...
...
src/main/webapp/vistas/modals/policias/mantenimientoSedes/registrarConceptoSede.jsp
0 → 100644
View file @
6159a3be
<form id="frmAsistenciaDocentes" onsubmit="return false;" autocomplete="off">
<div class="panel-body">
<div class="row">
<div class="col-md-12 form-group">
<label>Sede</label>
<span class="label label-left border-left-primary label-striped form-control" id="spanRegistrarSede"></span>
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
<label>Concepto</label>
<select class="select-search form-control" id="cboRegistrarConceptos">
</select>
</div>
</div>
</div>
</form>
\ No newline at end of file
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