Commit ad2f12a4 by Billy Larru

[EDIT registro justificacion, refactorizando codigo]

parent 1df71cf3
......@@ -625,4 +625,16 @@ const getDataRow = (datatable, e) => datatable.DataTable().row($(e.currentTarget
/*ELIMINAR CUANDO PASE A PROD*/
//$("body").addClass("sidebar-xs")
/**/
\ No newline at end of file
/**/
const llenarCombo = (nodeIdentifier, URI, todos = false, value = "id", texto = "descripcion") => {
return ajaxWebService.get(URI).then((response) => {
let data = response.data
let primeraOpcion = todos ? "[TODOS]" : "[SELECCIONE]"
let html = `<option>${primeraOpcion}</option>`
html += data.map((obj) => `<option value="${obj[value]}">${obj[texto]}</option>`).join("")
$(nodeIdentifier).html(html)
return $(nodeIdentifier)
})
}
\ No newline at end of file
......@@ -122,7 +122,7 @@ function getColumns() {
}
// return `<span class="${label}">${estado}</span>`;
return `<abbr title="${data.estadoasistencia_descripcion}" class="${label}">${estado}</abbr>`;
return `<span data-original-title="${data.estadoasistencia_descripcion}" tittle class="${label} estado-asistencia" data-popup="tooltip" data-placement="right">${estado}</span>`;
}
},
{
......@@ -252,7 +252,7 @@ function listarAsistencia(objParams = {}) {
let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
mostrarModalRegistro(data);
});
$('.estado-asistencia').tooltip()
});
});
}
......
......@@ -3,13 +3,10 @@ const listarPersonal = (selectorName) => {
};
const listarCausaJustificacion = (nodeIdentifier) => {
ajaxWebService.get(URI_JUSTIFICACION_CAUSA).then((response) => {
let data = response.data
let html = "<option>[SELECCIONE]</option>"
html += data.map((causaJustificacion) => `<option value="${causaJustificacion.id}">${causaJustificacion.descripcion}</option>`).join("")
$(nodeIdentifier).html(html)
$(nodeIdentifier).change(pintarHora)
})
llenarCombo(nodeIdentifier, URI_JUSTIFICACION_CAUSA)
.then((nodo) => {
nodo.change(pintarHora)
})
}
const pintarHora = () => {
......@@ -23,16 +20,6 @@ const pintarHora = () => {
}
}
const listarTipoJustificacion = (nodeIdentifier) => {
ajaxWebService.get(URI_JUSTIFICACION_TIPO).then((response) => {
let data = response.data
let html = "<option>[SELECCIONE]</option>"
html += data.map((tipoJustificacion) => `<option value="${tipoJustificacion.id}">${tipoJustificacion.descripcion}</option>`).join("")
$(nodeIdentifier).html(html)
})
}
const formControls = {
init() {
this.initializeRadioButton()
......@@ -40,7 +27,7 @@ const formControls = {
pickersNoConflict()
initDateRangePicker("#dpRangoFechas")
listarCausaJustificacion("#cboCausaJustificacion")
listarTipoJustificacion("#cboTipoJustificacion")
llenarCombo("#cboTipoJustificacion", URI_JUSTIFICACION_TIPO)
listarPersonal("#cboPersonal")
},
initializeRadioButton() {
......
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