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
da1aff03
Commit
da1aff03
authored
6 years ago
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
registrando tolerancia individual
parent
a8ff9c83
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
12 deletions
+118
-12
general.js
src/main/webapp/js/general.js
+2
-0
tolerancia_individual.js
src/main/webapp/js/pages/tolerancia_individual.js
+104
-0
registroTolerancia.jsp
...inistrativos/tolerancia/individual/registroTolerancia.jsp
+12
-12
No files found.
src/main/webapp/js/general.js
View file @
da1aff03
...
...
@@ -33,6 +33,8 @@ const URI_POLICIA_PROYECCION = "proyeccion";
const
URI_POLICIA_PROYECTADO_COMPARATIVO
=
"proyectadoComparativo"
;
const
URI_ADMINISTRATIVO_ASISTENCIA
=
"asistenciaAdministrativa"
;
const
URI_TRABAJADORES
=
"trabajadores"
;
const
URI_ADMINISTRATIVOS_TOLERANCIA_INDIVIDUAL
=
"toleranciasIndividuales"
;
const
URI_ADMINISTRATIVOS_ESTADO_TOLERANCIA_INDIVIDUAL
=
"estadoTolerancias"
;
//</editor-fold>
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/js/pages/tolerancia_individual.js
View file @
da1aff03
...
...
@@ -18,16 +18,110 @@ const listarSedes = (selectorName) => {
const
inicializarInputsModalNuevaTolerancia
=
()
=>
{
listarPersonal
(
"#cboPersonal"
);
$
(
"#cboPersonal"
).
change
(
cargarHorarios
);
$
(
"#txtToleranciaLV"
).
bind
(
'input'
,
function
(
e
)
{
if
(
!
$
(
this
).
data
(
"previousValue"
)
||
$
(
this
).
data
(
"previousValue"
)
!=
$
(
this
).
val
())
{
console
.
log
(
"changed "
+
$
(
this
).
val
());
$
(
this
).
data
(
"previousValue"
,
$
(
this
).
val
());
let
tolerancia
=
$
(
this
).
val
();
let
horarioLV
=
$
(
"#txtHorarioLV"
).
val
();
let
nuevoHorarioLV
=
addMinutes
(
horarioLV
,
tolerancia
);
$
(
"#txtNuevoHorarioLV"
).
val
(
nuevoHorarioLV
);
}
});
$
(
"#txtToleranciaSabado"
).
bind
(
'input'
,
function
(
e
)
{
if
(
!
$
(
this
).
data
(
"previousValue"
)
||
$
(
this
).
data
(
"previousValue"
)
!=
$
(
this
).
val
())
{
console
.
log
(
"changed "
+
$
(
this
).
val
());
$
(
this
).
data
(
"previousValue"
,
$
(
this
).
val
());
let
tolerancia
=
$
(
this
).
val
();
let
horarioSabado
=
$
(
"#txtHorarioSabado"
).
val
();
let
nuevoHorarioSabado
=
addMinutes
(
horarioSabado
,
tolerancia
);
$
(
"#txtNuevoHorarioSabado"
).
val
(
nuevoHorarioSabado
);
}
});
initDatePicker
(
"#dpFechaInicio"
,
"#dpFechaFin"
);
};
const
cargarHorarios
=
()
=>
{
let
jsonPersonal
=
$
(
'#cboPersonal'
).
select2
(
'data'
)[
0
];
let
horarioLV
=
jsonPersonal
.
horarioLV
;
let
horarioSabado
=
jsonPersonal
.
horarioSabado
;
$
(
"#txtHorarioLV"
).
val
(
horarioLV
);
$
(
"#txtNuevoHorarioLV"
).
val
(
horarioLV
).
attr
(
'min'
,
horarioLV
);
$
(
"#txtHorarioSabado"
).
val
(
horarioSabado
).
attr
(
'min'
,
horarioSabado
);
$
(
"#txtNuevoHorarioSabado"
).
val
(
horarioSabado
);
}
const
registrarNuevaTolerancia
=
()
=>
{
let
jsonPersonal
=
$
(
'#cboPersonal'
).
select2
(
'data'
)[
0
];
let
{
id
:
trabajador_id
,
nombres
:
trabajador_nombres
,
apellidos
:
trabajador_apellidos
,
documento_identidad
:
trabajador_documentoidentidad
,
horarioLV
,
horarioSabado
}
=
jsonPersonal
;
let
toleranciaLV
=
$
(
"#txtToleranciaLV"
).
val
();
let
toleranciaSabado
=
$
(
"#txtToleranciaSabado"
).
val
();
let
nuevoHorarioLV
=
$
(
"#txtNuevoHorarioLV"
).
val
();
let
nuevoHorarioSabado
=
$
(
"#txtNuevoHorarioSabado"
).
val
();
let
fechaInicio
=
$
(
"#dpFechaInicio"
).
val
();
let
fechaFin
=
$
(
"#dpFechaFin"
).
val
();
let
observacion
=
$
(
"#txtObservacion"
).
val
();
let
params
=
{
trabajador_id
,
trabajador_documentoidentidad
,
trabajador_nombres
,
trabajador_apellidos
,
horarioLV
,
toleranciaLV
,
nuevoHorarioLV
,
horarioSabado
,
toleranciaSabado
,
nuevoHorarioSabado
,
fechaRegistro
:
""
,
fechaInicio
,
fechaFin
,
observacion
,
estado
:
1
};
ajaxWebService
.
post
(
URI_ADMINISTRATIVOS_TOLERANCIA_INDIVIDUAL
,
params
)
.
then
((
response
)
=>
{
debugger
;
if
(
response
.
status
)
{
swal
({
type
:
'success'
,
title
:
'¡Tolerancia registrada exitosamente!'
,
showConfirmButton
:
false
,
timer
:
1500
})
listarRolesPolicias
();
// console.log(response.data);
}
else
{
swal
({
type
:
'success'
,
title
:
'¡No ha sido posible registrar la tolerancia!'
,
showConfirmButton
:
false
,
timer
:
1500
})
}
})
.
catch
((
error
)
=>
{
console
.
log
(
error
);
});
};
const
mostrarModalNuevaTolerancia
=
()
=>
{
...
...
@@ -56,6 +150,16 @@ const mostrarModalNuevaTolerancia = () => {
});
};
function
addMinutes
(
time
,
minsToAdd
)
{
function
D
(
J
)
{
return
(
J
<
10
?
'0'
:
''
)
+
J
;
}
;
var
piece
=
time
.
split
(
':'
);
var
mins
=
piece
[
0
]
*
60
+
+
piece
[
1
]
+
+
minsToAdd
;
return
D
(
mins
%
(
24
*
60
)
/
60
|
0
)
+
':'
+
D
(
mins
%
60
);
}
$
(()
=>
{
initDatePicker
(
"#dpFechaInicioFiltro"
,
"#dpFechaFinFiltro"
);
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/vistas/modals/administrativos/tolerancia/individual/registroTolerancia.jsp
View file @
da1aff03
...
...
@@ -9,30 +9,30 @@
</div>
<div class="row">
<div class="form-group col-md-4">
<label>Horario LV
:
</label>
<input type="time" class="form-control" id="txtHorarioLV" disabled>
<label>Horario LV</label>
<input type="time" class="form-control
text-center
" id="txtHorarioLV" disabled>
</div>
<div class="form-group col-md-4">
<label>Tolerancia(min)
:
</label>
<input type="number" min="0" value="0" class="form-control" id="txtToleranciaLV">
<label>Tolerancia(min)</label>
<input type="number" min="0" value="0" class="form-control
text-center
" id="txtToleranciaLV">
</div>
<div class="form-group col-md-4">
<label>Nuevo Horario LV
:
</label>
<input type="time"
class="form-control
" id="txtNuevoHorarioLV">
<label>Nuevo Horario LV</label>
<input type="time"
min="00:00" max="23:59" class="form-control text-center
" id="txtNuevoHorarioLV">
</div>
</div>
<div class="row">
<div class="form-group col-md-4">
<label>Horario Sabado
:
</label>
<input type="time" class="form-control" id="txtHorarioSabado" disabled>
<label>Horario Sabado</label>
<input type="time" class="form-control
text-center
" id="txtHorarioSabado" disabled>
</div>
<div class="form-group col-md-4">
<label>Tolerancia(min)
:
</label>
<input type="number" min="0" value="0" class="form-control" id="txtToleranciaSabado">
<label>Tolerancia(min)</label>
<input type="number" min="0" value="0" class="form-control
text-center
" id="txtToleranciaSabado">
</div>
<div class="form-group col-md-4">
<label>Nuevo Horario
LV:
</label>
<input type="time"
class="form-control
" id="txtNuevoHorarioSabado">
<label>Nuevo Horario
Sabado
</label>
<input type="time"
min="00:00" max="23:59" class="form-control text-center
" id="txtNuevoHorarioSabado">
</div>
</div>
<div class="row">
...
...
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