From d58440b74e986e2e2aa524157ba51aa12f033d23 Mon Sep 17 00:00:00 2001 From: jmoya Date: Tue, 31 Jul 2018 14:29:12 +0000 Subject: [PATCH] git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C360 --- .../Sinort-Scripts/TareasPendientes.js | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js index d2f48ed1a..efbada47d 100644 --- a/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js +++ b/AYA.SlnSynor/AYA.SlnSynor/Sinort-Scripts/TareasPendientes.js @@ -345,7 +345,7 @@ this.GuardarRespuestaSolicitud = function () { this.GuardarRespuestaSolicitudCompra = function () { - if ($("select#drpTipo").val() == "1") { + if (EstadoTipoUsuario == "1") { justificacion = $('#txtJustificacionCompra').val(); @@ -371,13 +371,15 @@ this.GuardarRespuestaSolicitudCompra = function () { AjaxPostData(uri, model, false, false, null, null, null); } else { - if ($('#txtUsuarios') == '') { + if ($('#txtUsuarios').val() == '') { toastr.warning("Debe seleccionar un usuario."); return false; } - if (!confirm("¿Está seguro que desea enviar la autorización de la solicitud de compra? .\n ¿Desea continuar?")) + if (!confirm("¿Está seguro que desea enviar la autorización de la solicitud de compra a "+$('#txtUsuarios').val()+"?")) { return; } - EnviarCorreoSuperUsuario(); + var uri = SinortWCF + '/api/InsertarActualizarTareasPendientes'; + LeerFormulario(); + AjaxPostData(uri, model, false, false, EnviarCorreoSolicitud, null, null); } ENDREQUEST(); location.reload(); @@ -503,7 +505,7 @@ this.EnviarCorreoProyectoNormativo = function () { this.EnviarCorreoSolicitud = function () { if (Solicitud.DescripcionTipoSolicitud == "Compra") { - if ($("select#drpTipo").val() == "1") { + if (EstadoTipoUsuario == "1") { if (EstadoConfirmacion) { var Plantilla = { @@ -602,7 +604,23 @@ this.LeerFormulario = function () { var ArrayTareasPendientes = []; - + if (EstadoTipoUsuario == "0") { + var TareaPendiente + = { + IdTareasPendientes: InfoIdTareasPendientes, + Descripcion: InfoIDescripcion, + ContenidoRelacionado: InfoIContenidoRelacionado, + Respuesta: 0, + FechaVencimiento: InfoIFechaVencimiento, + TipoTareaPendiente: InfoITipoTareaPendiente, + UsuarioAsignado: $('#txtUsuarios').val(), + IdProyectoNormativo: InfoIdProyectoNormativo, + NombreProyectoNormativo: InfoNombreProyectoNormativo, + PromotorProyectoNormativo: InfoPromotor + } + } + else { + var TareaPendiente = { IdTareasPendientes: InfoIdTareasPendientes, @@ -616,6 +634,7 @@ this.LeerFormulario = function () { NombreProyectoNormativo: InfoNombreProyectoNormativo, PromotorProyectoNormativo: InfoPromotor } + } ArrayTareasPendientes.push(TareaPendiente); model = {