Botones de Actualizar y elimiar Propuesta normativa
git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C187
This commit is contained in:
parent
6759cdb393
commit
dd6526e86d
1 changed files with 118 additions and 0 deletions
|
|
@ -75,6 +75,17 @@ jQuery(document).ready(function () {
|
|||
this.getDataModel = function () {
|
||||
|
||||
|
||||
$("#btnModificar").unbind("click");
|
||||
$("#btnModificar").click(function () {
|
||||
ActualizarItem(true);
|
||||
});
|
||||
|
||||
$("#btnEliminar").unbind("click");
|
||||
$("#btnEliminar").click(function () {
|
||||
ActualizarItem(false);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#btnBuscarUsuario").unbind("click");
|
||||
$("#btnBuscarUsuario").click(function () {
|
||||
|
|
@ -153,6 +164,33 @@ this.getDataModel = function () {
|
|||
CargarUsuarios();
|
||||
}
|
||||
|
||||
|
||||
this.ActualizarItem = function (accion) {
|
||||
|
||||
//if (!$("#formDetallePropuesta").valid()) {
|
||||
// toastr.warning("Ingresar todos los campos que son requeridos.");
|
||||
// return false;
|
||||
//}
|
||||
|
||||
if (!confirm((accion == true) ? "Se guardarán los cambios.\n ¿Desea continuar?" : "Desea eliminar el registro.\n ¿Desea continuar?"))
|
||||
{ return; }
|
||||
|
||||
model.ProyectoNormativo.IdEstado = (accion == true) ? model.ProyectoNormativo.IdEstado : Estados.Eliminado.Codigo;
|
||||
model.ProyectoNormativo.Estado = (accion == true) ? model.ProyectoNormativo.Estado : Estados.Eliminado.Descripcion;
|
||||
|
||||
model.ProyectoNormativo.FechaFinConsulta = $('#txtFechaFinalizacion').DateFormatWCF();
|
||||
|
||||
var uri = SinortWCF + '/api/GuardarProyectoNormativo';
|
||||
AjaxPostData(uri, model, true, true, CompletarAccion, null, null);
|
||||
}
|
||||
|
||||
this.CompletarAccion = function () {
|
||||
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.CargarUsuarios = function (filtro) {
|
||||
|
||||
var uri = CatalogosWCF + '/api/ObtenerUsuario';
|
||||
|
|
@ -999,6 +1037,85 @@ $('#tableDocForo').on('click', 'button', function () {
|
|||
|
||||
});
|
||||
|
||||
// Documentos de Eventos Adjuntos
|
||||
|
||||
|
||||
this.CargarDocumentosEventos = function (id) {
|
||||
|
||||
var tableDocEvento = $('#tableDocEvento').DataTable();
|
||||
tableDocEvento.clear().draw();
|
||||
var uri = SinortWCF + '/api/ObtenerAdjuntos';
|
||||
|
||||
var modeldoc = {
|
||||
IdDocumentoAdjunto: id
|
||||
|
||||
};
|
||||
|
||||
AjaxPostData(uri, modeldoc, false, false, CargarTablaDocumentosEventos, null, null);
|
||||
|
||||
}
|
||||
|
||||
this.CargarTablaDocumentosEventos = function (data) {
|
||||
|
||||
var tableDocEvento = $('#tableDocEvento').DataTable();
|
||||
tableDocEvento.clear().draw();
|
||||
var lista = data;
|
||||
|
||||
$.each(lista, function (key, item) {
|
||||
|
||||
|
||||
var option = $("#ucAbrirDocumento").html();
|
||||
var ext = item.TipoArchivo.toLowerCase();
|
||||
switch (ext) {
|
||||
case 'pdf':
|
||||
option = replaceAll("[$icon]", "fa-file-pdf-o", option);
|
||||
break;
|
||||
case 'doc':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'docx':
|
||||
option = replaceAll("[$icon]", "fa-file-word-o", option);
|
||||
break;
|
||||
case 'png':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'jpg':
|
||||
option = replaceAll("[$icon]", "fa-file-image-o", option);
|
||||
break;
|
||||
case 'xls':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
case 'xlsx':
|
||||
option = replaceAll("[$icon]", "fa-file-excel-o", option);
|
||||
break;
|
||||
default:
|
||||
option = replaceAll("[$icon]", "fa-file-text", option);
|
||||
}
|
||||
|
||||
tableDocEvento.row.add([item.IdDocumentoAdjunto,
|
||||
option,
|
||||
item.Nombre,
|
||||
item.UsuarioCreacion,
|
||||
item.RutaDescarga]).draw();
|
||||
|
||||
});
|
||||
ENDREQUEST();
|
||||
}
|
||||
|
||||
$('#tableDocEvento').on('click', 'button', function () {
|
||||
|
||||
var data = $('#tableDocEvento').DataTable().row($(this).parents('tr')).data();
|
||||
|
||||
window.open(data[4]);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Documentos Matriz
|
||||
|
||||
this.CargarDocumentosMatriz = function (id) {
|
||||
|
|
@ -1385,6 +1502,7 @@ this.ModalEventoPopUp = function (evento) {
|
|||
$("#btnVerAdjuntosEvento").disable();
|
||||
$("#btnGuardarEvento").disable();
|
||||
|
||||
CargarDocumentosEventos(evento.id);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue