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
75aff2ae
Commit
75aff2ae
authored
Aug 23, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listado de asignacion de montos por amanecidas
parent
cec395e8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
10 deletions
+98
-10
asignar_monto_amanecida.js
src/main/webapp/js/pages/asignar_monto_amanecida.js
+97
-9
asignarMontoAmanecida.jsp
src/main/webapp/vistas/asignarMontoAmanecida.jsp
+1
-1
No files found.
src/main/webapp/js/pages/asignar_monto_amanecida.js
View file @
75aff2ae
function
getColumns
()
{
let
columns
=
[
{
title
:
`N°`
,
data
:
`id`
,
className
:
'text-center'
},
{
title
:
`CONCEPTO`
,
data
:
`descripcion`
,
className
:
`text-center`
,
},
{
title
:
`MONTO AMANECIDA 12h`
,
data
:
`monto12h`
,
className
:
'text-center'
},
{
title
:
`MONTO AMANECIDA 24h`
,
data
:
`monto24h`
,
className
:
'text-center'
},
{
title
:
'ESTADO'
,
data
:
`estado`
,
className
:
"text-center"
,
render
:
(
data
)
=>
{
let
label
=
""
;
let
contenido
=
""
;
if
(
data
===
1
)
{
label
=
`label label-success`
;
contenido
=
"ACTIVO"
;
}
else
if
(
data
===
0
)
{
label
=
`label label-danger`
;
contenido
=
"PASIVO"
;
}
return
`<span class="
${
label
}
">
${
contenido
}
</span>`
;
}
},
{
title
:
`ACCIONES`
,
data
:
null
,
className
:
'text-center'
,
render
:
(
data
)
=>
{
let
acciones
=
`<span data-placement="left" title="Editar" style="cursor: pointer"> <i class="editar icon-pencil text-slate-800"></i> </span>
<span data-placement="left" title="Eliminar" style="cursor: pointer"> <i class="eliminar icon-cancel-circle2 text-danger-700"></i> </span>`
;
return
acciones
;
}
}
];
return
columns
;
}
function
getColumnDefs
()
{
let
columnDefs
=
[
{
orderable
:
false
,
width
:
'3%'
,
targets
:
0
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'10%'
,
targets
:
1
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'30%'
,
targets
:
2
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
3
,
className
:
"text-center"
},
{
orderable
:
false
,
width
:
'7%'
,
targets
:
4
,
className
:
"text-center"
},
];
return
columnDefs
;
}
function
cambiarFormatoDecimal
(
selectorName
)
{
function
cambiarFormatoDecimal
(
selectorName
)
{
$
(
selectorName
).
formatter
({
$
(
selectorName
).
formatter
({
...
@@ -9,14 +77,14 @@ function registrar() {
...
@@ -9,14 +77,14 @@ function registrar() {
let
descripcion
=
$
(
"#txtDescripcion"
).
val
();
let
descripcion
=
$
(
"#txtDescripcion"
).
val
();
let
monto24h
=
parseFloat
(
$
(
"#txtMonto12h"
).
val
());
let
monto24h
=
parseFloat
(
$
(
"#txtMonto12h"
).
val
());
let
monto12h
=
parseFloat
(
$
(
"#txtMonto24h"
).
val
());
let
monto12h
=
parseFloat
(
$
(
"#txtMonto24h"
).
val
());
let
estado
_registro
=
1
;
let
estado
=
1
;
let
params
=
{
let
params
=
{
descripcion
,
descripcion
,
monto12h
,
monto12h
,
monto24h
,
monto24h
,
estado
_registro
estado
}
}
;
axios
.
post
(
URI_POLICIA_MONTOS_AMANECIDAS
,
params
).
then
((
response
)
=>
{
axios
.
post
(
URI_POLICIA_MONTOS_AMANECIDAS
,
params
).
then
((
response
)
=>
{
response
.
data
=
formatResponse
(
response
);
response
.
data
=
formatResponse
(
response
);
...
@@ -27,21 +95,39 @@ function registrar() {
...
@@ -27,21 +95,39 @@ function registrar() {
title
:
'¡Se registró correctamente!'
,
title
:
'¡Se registró correctamente!'
,
showConfirmButton
:
false
,
showConfirmButton
:
false
,
timer
:
1500
timer
:
1500
})
})
;
}
}
});
});
}
}
function
listarMontos
()
{
function
listarMontos
(
objParams
=
{})
{
axios
.
get
(
URI_POLICIA_MONTOS_AMANECIDAS
).
then
((
response
)
=>
{
response
.
data
=
formatResponse
(
response
.
data
);
if
(
response
.
data
.
status
)
{
axios
.
get
(
URI_POLICIA_MONTOS_AMANECIDAS
,
objParams
).
then
((
response
)
=>
{
response
.
data
=
formatResponse
(
response
);
let
columns
=
getColumns
();
let
columnDefs
=
getColumnDefs
();
}
let
wrapsNameDatatable
=
`divDatatable`
;
let
classNameForDatatable
=
`display table table-bordered`
;
let
footer
=
false
;
makeDatatable
(
{
data
:
response
.
data
.
data
,
columns
,
columnDefs
,
wrapsNameDatatable
,
classNameForDatatable
,
footer
}
).
then
((
datatable
)
=>
{
// $(datatable).on("click", ".registrar", function () {
// let data = $(datatable).DataTable().row($(this).parents("tr")).data();
// mostrarModalRegistroAsistencia(data);
// });
});
});
});
}
}
...
@@ -49,6 +135,7 @@ function listarMontos() {
...
@@ -49,6 +135,7 @@ function listarMontos() {
$
().
ready
(
function
()
{
$
().
ready
(
function
()
{
// cambiarFormatoDecimal("#txtMonto12h");
// cambiarFormatoDecimal("#txtMonto12h");
// cambiarFormatoDecimal("#txtMonto24h");
// cambiarFormatoDecimal("#txtMonto24h");
defaultConfigDataTable
();
listarMontos
();
listarMontos
();
$
(
"#btnRegistrar"
).
click
(
registrar
);
$
(
"#btnRegistrar"
).
click
(
registrar
);
});
});
\ No newline at end of file
src/main/webapp/vistas/asignarMontoAmanecida.jsp
View file @
75aff2ae
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12 form-group"
>
<div
class=
"col-md-12 form-group"
>
<label>
Descripcion
</label>
<label>
Concepto
</label>
<input
type=
"text"
class=
"form-control"
id=
"txtDescripcion"
>
<input
type=
"text"
class=
"form-control"
id=
"txtDescripcion"
>
</div>
</div>
</div>
</div>
...
...
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