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
810455af
Commit
810455af
authored
Sep 04, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listando tolerancias individuales
parent
da1aff03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
4 deletions
+129
-4
tolerancia_individual.js
src/main/webapp/js/pages/tolerancia_individual.js
+129
-4
No files found.
src/main/webapp/js/pages/tolerancia_individual.js
View file @
810455af
function
getColumns
()
{
let
columns
=
[
{
title
:
`N°`
,
data
:
`id`
,
className
:
'text-center'
},
{
title
:
`APELLIDOS Y NOMBRES`
,
data
:
null
,
className
:
`text-center`
,
render
:
(
data
)
=>
{
let
nombresCompletos
;
let
nombres
=
data
.
trabajador_nombres
;
let
apellidos
=
data
.
trabajador_apellidos
;
nombresCompletos
=
`
${
apellidos
}
${
nombres
}
`
;
return
nombresCompletos
;
}
},
{
title
:
"FECHA INICIO"
,
data
:
"fechaInicio"
,
className
:
"text-center"
},
{
title
:
`FECHA FIN`
,
data
:
`fechaFin`
,
className
:
'text-center'
},
{
title
:
`ESTADO`
,
data
:
`estado`
,
className
:
'text-center'
,
render
:
(
data
)
=>
{
let
label
=
""
;
let
text
=
""
;
switch
(
data
)
{
case
1
:
label
=
"label label-success"
;
text
=
"ACTIVO"
;
break
;
case
2
:
label
=
"label label-warning"
;
text
=
"ANULADO"
;
break
;
case
3
:
label
=
"label label-info"
;
text
=
"TERMINADO"
;
break
;
case
4
:
label
=
"label label-danger"
;
text
=
"INACTIVO"
;
break
;
}
return
`<span class="
${
label
}
">
${
text
}
</span>`
;
}
},
{
title
:
`ACCIONES`
,
data
:
null
,
className
:
'text-center'
,
render
:
(
data
)
=>
{
return
null
;
}
},
];
return
columns
;
}
const
listarPersonal
=
(
selectorName
)
=>
{
initSelect2
(
selectorName
,
baseURLRest
+
URI_TRABAJADORES
,
{
title
:
"nombresapellidos"
,
subtitle
:
"documentoidentidad"
});
...
...
@@ -30,7 +104,7 @@ const inicializarInputsModalNuevaTolerancia = () => {
}
});
$
(
"#txtToleranciaSabado"
).
bind
(
'input'
,
function
(
e
)
{
if
(
!
$
(
this
).
data
(
"previousValue"
)
||
$
(
this
).
data
(
"previousValue"
)
!=
$
(
this
).
val
())
{
console
.
log
(
"changed "
+
$
(
this
).
val
());
...
...
@@ -42,7 +116,7 @@ const inicializarInputsModalNuevaTolerancia = () => {
}
});
initDatePicker
(
"#dpFechaInicio"
,
"#dpFechaFin"
);
};
...
...
@@ -150,6 +224,30 @@ const mostrarModalNuevaTolerancia = () => {
});
};
const
aplicarFiltro
=
()
=>
{
debugger
let
jsonPersonal
=
$
(
'#cboPersonalFiltro'
).
select2
(
'data'
)[
0
];
let
trabajador_id
=
""
;
if
(
jsonPersonal
)
{
trabajador_id
=
jsonPersonal
.
id
;
}
// let sede_id = "";
let
fecha_inicio
=
$
(
"#dpFechaInicioFiltro"
).
val
();
let
fecha_fin
=
$
(
"#dpFechaFinFiltro"
).
val
();
let
rango_fechas
=
generarFechas
(
fecha_inicio
,
fecha_fin
);
let
params
=
cleanQueryParams
({
trabajador_id
,
fecha_inicio
:
rango_fechas
});
debugger
listarToleranciasIndividuales
({
params
});
}
function
addMinutes
(
time
,
minsToAdd
)
{
function
D
(
J
)
{
return
(
J
<
10
?
'0'
:
''
)
+
J
;
...
...
@@ -161,11 +259,37 @@ function addMinutes(time, minsToAdd) {
return
D
(
mins
%
(
24
*
60
)
/
60
|
0
)
+
':'
+
D
(
mins
%
60
);
}
function
listarToleranciasIndividuales
(
objParams
=
{}){
ajaxWebService
.
get
(
URI_ADMINISTRATIVOS_TOLERANCIA_INDIVIDUAL
,
objParams
).
then
((
response
)
=>
{
let
columns
=
getColumns
();
let
wrapsNameDatatable
=
`divDatatable`
;
let
classNameForDatatable
=
`display table table-bordered`
;
makeDatatable
(
wrapsNameDatatable
,
{
data
:
response
.
data
,
columns
,
},
classNameForDatatable
,
).
then
((
nodes
)
=>
{
nodes
.
container
.
off
()
.
on
(
"click"
,
".registrar"
,
function
()
{
let
data
=
nodes
.
datatable
.
DataTable
().
row
(
$
(
this
).
parents
(
"tr"
)).
data
();
// mostrarModalRegistro(data);
});
});
});
}
$
(()
=>
{
initDatePicker
(
"#dpFechaInicioFiltro"
,
"#dpFechaFinFiltro"
);
listarPersonal
(
"#cboPersonalFiltro"
);
listarSedes
(
"#cboSedesFiltro"
);
// $("#btnMostrarTodo").click(listarAsistencia
);
//
$("#btnAplicarFiltro").click(aplicarFiltro);
$
(
"#btnMostrarTodo"
).
click
(
listarToleranciasIndividuales
);
$
(
"#btnAplicarFiltro"
).
click
(
aplicarFiltro
);
$
(
"#btnNuevaTolerancia"
).
click
(
mostrarModalNuevaTolerancia
);
});
\ 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