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
d93f000d
Commit
d93f000d
authored
Sep 27, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EDIT registro periodo de cierre, modificando el estado de cierre de una sede especifica]
parent
c4d2ef89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
46 deletions
+125
-46
general.js
src/main/webapp/js/general.js
+2
-1
registro_periodo_cierre.js
src/main/webapp/js/pages/registro_periodo_cierre.js
+123
-45
No files found.
src/main/webapp/js/general.js
View file @
d93f000d
...
...
@@ -55,6 +55,7 @@ const URI_ESTADOJUSTIFICACION = "estadoJustificaciones"
const
URI_TIPOPERSONAL
=
"tipoPersonales"
const
URI_MESESCIERRE
=
"mesesCierre"
const
URI_PERIODOCIERRE
=
"periodoCierreAsistencia"
const
URI_PERIODOCIERRE_SEDES
=
"periodoSedes"
const
URI_JUSTIFICACION_ASISTENCIAS
=
"asistenciaJustificacion"
//</editor-fold>
...
...
@@ -614,7 +615,7 @@ const listarSedes = (nodeIdentifier, todos = true) => {
});
};
const
getDataRow
=
(
datatable
,
e
)
=>
datatable
.
DataTable
().
row
(
$
(
e
.
currentTarget
).
parents
(
"tr"
)
.
data
()
)
const
getDataRow
=
(
datatable
,
e
)
=>
datatable
.
DataTable
().
row
(
$
(
e
.
currentTarget
).
parents
(
"tr"
)
).
data
(
)
/*ELIMINAR CUANDO PASE A PROD*/
//$("body").addClass("sidebar-xs")
...
...
src/main/webapp/js/pages/registro_periodo_cierre.js
View file @
d93f000d
...
...
@@ -190,6 +190,7 @@ function listarPeriodosCierre(objParams = {}){
}
const
mostrarModalVerDetalle
=
(
data
)
=>
{
ajaxModal
.
get
(
"periodoscierre/detalleperiodo.jspf"
).
then
((
response
)
=>
{
swalWithBootstrapButtons
({
title
:
'<strong>Detalle</strong>'
,
...
...
@@ -200,50 +201,78 @@ const mostrarModalVerDetalle = (data) => {
width
:
'30%'
,
customClass
:
'swal2-overflow'
,
onOpen
:
()
=>
{
let
columns
=
[
{
title
:
'N°'
,
data
:
'id'
,
className
:
'text-center'
},
{
title
:
'Sede'
,
data
:
'sede_descripcion'
,
className
:
'text-center'
},
{
title
:
'ESTADO'
,
data
:
'estado'
,
className
:
'text-center'
},
{
title
:
'ACCIONES'
,
data
:
null
,
className
:
'text-center'
,
render
:
(
data
)
=>
{
return
``
let
params
=
{
periodocierreasistencia_id
:
data
.
id
}
ajaxWebService
.
get
(
URI_PERIODOCIERRE_SEDES
,
{
params
}).
then
((
response2
)
=>
{
let
columns
=
[
{
title
:
'N°'
,
data
:
'id'
,
className
:
'text-center'
},
{
title
:
'Sede'
,
data
:
'sede_descripcion'
},
{
title
:
'ESTADO'
,
data
:
'estado'
,
className
:
'text-center'
,
render
:
(
data
)
=>
{
let
label
=
""
,
contenido
=
""
if
(
data
===
1
)
{
label
=
"label label-success"
contenido
=
"ABIERTO"
}
else
if
(
data
===
0
)
{
label
=
"label label-danger"
contenido
=
"CERRADO"
}
return
`<span class="
${
label
}
">
${
contenido
}
</span>`
}
},
{
title
:
'ACCIONES'
,
data
:
null
,
className
:
'text-center'
,
render
:
(
data
)
=>
{
let
abrirPeriodo
=
""
,
cerrarPeriodo
let
acciones
if
(
data
.
estado
===
1
)
{
cerrarPeriodo
=
`<span style="cursor: pointer"><i class="cierre-periodo-sede icon-lock2 text-danger-700"></i> </span>`
;
}
else
if
(
data
.
estado
===
0
)
{
abrirPeriodo
=
`<span style="cursor: pointer"><i class="cierre-periodo-sede icon-unlocked2 text-success-700"></i> </span>`
;
}
acciones
=
abrirPeriodo
+
cerrarPeriodo
return
acciones
}
}
}
]
let
wrapsNameDatatable
=
`dtPeriodoSedes
`
;
let
classNameForDatatable
=
`display table table-bordered`
;
makeDatatable
(
wrapsNameDatatable
,
{
data
:
response
.
data
,
columns
,
}
,
classNameForDatatable
,
).
then
((
nodes
)
=>
{
nodes
.
container
.
off
()
// .on("click", ".editar", (e) => mostrarModalEditarPeriodoCierre(getDataRow(nodes.datatable, e)))
// .on("click", ".cierre-periodo", (e) => mostrarModalCierrePeriodo(getDataRow(nodes.datatable, e))
)
// .on("click", ".ver-detalle", (e) => mostrarModalVerDetalle(getDataRow(nodes.datatable, e)
))
})
;
]
let
wrapsNameDatatable
=
`dtPeriodoSedes`
;
let
classNameForDatatable
=
`display table table-bordered
`
;
let
dataOrdenada
=
_
.
orderBy
(
response2
.
data
,
s
=>
s
.
sede_descripcion
)
makeDatatable
(
wrapsNameDatatable
,
{
data
:
dataOrdenada
,
columns
,
pageLength
:
10
},
classNameForDatatable
,
).
then
((
nodes
)
=>
{
nodes
.
container
.
off
(
)
.
on
(
"click"
,
".cierre-periodo-sede"
,
(
e
)
=>
mostrarModalCierrePeriodoSede
(
getDataRow
(
nodes
.
datatable
,
e
),
data
))
});
})
}
}).
then
((
result
)
=>
{
...
...
@@ -254,6 +283,55 @@ const mostrarModalVerDetalle = (data) => {
});
}
const
mostrarModalCierrePeriodoSede
=
(
data
,
jsonPrimerDatatable
)
=>
{
debugger
let
{
id
,
estado
}
=
data
;
let
titulo
=
""
;
let
textoConfirmacion
=
""
let
tituloOperacion
=
""
;
if
(
estado
)
{
titulo
=
`Cerrar el periodo «
${
data
.
mescierre_descripcion
}
»?`
;
textoConfirmacion
=
'Sí!'
;
tituloOperacion
=
'¡Periodo cerrado exitosamente!'
;
estado
=
0
;
}
else
{
titulo
=
`Abrir el periodo «
${
data
.
mescierre_descripcion
}
»?`
;
textoConfirmacion
=
'Sí!'
;
tituloOperacion
=
'¡Periodo abierto exitosamente!'
;
estado
=
1
;
}
swal
({
title
:
titulo
,
text
:
""
,
type
:
'question'
,
showCancelButton
:
true
,
confirmButtonColor
:
'#3085d6'
,
cancelButtonColor
:
'#d33'
,
confirmButtonText
:
textoConfirmacion
}).
then
((
result
)
=>
{
if
(
result
.
value
)
{
ajaxWebService
.
patch
(
`
${
URI_PERIODOCIERRE_SEDES
}
/
${
id
}
`
,
{
estado
}).
then
((
response
)
=>
{
if
(
response
.
status
)
{
swal
({
type
:
'success'
,
title
:
tituloOperacion
,
showConfirmButton
:
false
,
timer
:
1500
});
// listarPeriodosCierre()
}
debugger
mostrarModalVerDetalle
(
jsonPrimerDatatable
)
});
}
else
{
mostrarModalVerDetalle
(
jsonPrimerDatatable
)
}
});
}
const
mostrarModalEditarPeriodoCierre
=
(
data
)
=>
{
ajaxModal
.
get
(
"cierreasistenciamensual/mantenimientoPeriodoCierre/registroperiodocierre.jspf"
).
then
((
response
)
=>
{
swalWithBootstrapButtons
({
...
...
@@ -368,14 +446,14 @@ const aplicarFiltro = () => {
const
formControls
=
{
init
()
{
debugger
this
.
initTipoCierres
()
this
.
initPeriodos
()
this
.
initEstados
()
this
.
initPickers
()
},
initTipoCierres
()
{
debugger
listarTipoPersonal
(
"#cboTipoPersonalFiltro"
,
1
)
},
initPeriodos
()
{
...
...
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