Commit 8d4258a5 by Billy Larru

[EDIT periodo de cierre, inicializando filtros]

parent 6b2d5aa5
......@@ -137,11 +137,11 @@ const registrarNuevoPeriodo = () => {
}
const listarTipoPersonal = (nodeIdentifier) => {
const listarTipoPersonal = (nodeIdentifier, todos = 0) => {
return ajaxWebService.get(URI_TIPOPERSONAL).then((response) => {
if (response.status) {
let data = response.data
let html = ""
let html = `<option value="">${todos ? "[TODOS]" : "[SELECCIONE]"}</option>`
html += data.map(tipoPersonal => `<option value="${tipoPersonal.id}">${tipoPersonal.descripcion}</option>`)
$(nodeIdentifier).html(html)
}
......@@ -149,11 +149,11 @@ const listarTipoPersonal = (nodeIdentifier) => {
})
}
const listarMesesCierre = (nodeIdentifier) => {
const listarMesesCierre = (nodeIdentifier, todos = 0) => {
return ajaxWebService.get(URI_MESESCIERRE).then((response) => {
if (response.status) {
let data = response.data
let html = ""
let html = `<option value="">${todos ? "[TODOS]" : "[SELECCIONE]"}</option>`
html += data.map(mesCierre => `<option value="${mesCierre.id}">${mesCierre.descripcion}</option>`)
$(nodeIdentifier).html(html)
}
......@@ -303,7 +303,32 @@ const aplicarFiltro = () => {
}
const formControls = {
init() {
debugger
this.initTipoCierres()
this.initPeriodos()
this.initEstados()
this.initPickers()
},
initTipoCierres() {
debugger
listarTipoPersonal("#cboTipoPersonalFiltro", 1)
},
initPeriodos() {
listarMesesCierre("#cboPeriodoFiltro", 1)
},
initEstados() {
},
initPickers() {
initDatePicker("#dpFechaInicioFiltro", "#dpFechaFinFiltro")
}
}
$(document).ready(function () {
formControls.init()
$("#btnNuevoPeriodo").click(mostrarModalNuevoPeriodo);
$("#btnMostrarTodo").click(listarPeriodosCierre)
$("#btnAplicarFiltro").click(aplicarFiltro)
......
......@@ -20,14 +20,14 @@
<div class="panel-body">
<div class="row">
<div class="col-md-8 form-group">
<label>Personal</label>
<select class="select-search form-control" id="cboPersonalFiltro" >
<div class="col-md-6 form-group">
<label>Tipo de Cierre</label>
<select class="select-search form-control" id="cboTipoPersonalFiltro" >
</select>
</div>
<div class="col-md-4 form-group">
<label>Sede</label>
<select class="form-control" id="cboSedesFiltro">
<div class="col-md-6 form-group">
<label>Periodo</label>
<select class="form-control" id="cboPeriodoFiltro">
</select>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment