1255 lines
48 KiB
JavaScript
1255 lines
48 KiB
JavaScript
var Utilitario_ULA = new ULA_OBJECT();
|
|
var CambioPantalla = false;
|
|
|
|
|
|
function ULA_OBJECT() { }
|
|
|
|
|
|
|
|
ULA_OBJECT.prototype.copyEmpty = function (ref) {
|
|
|
|
var ret = $.extend(true, {}, ref);
|
|
Object.keys(ret).forEach(function (key) { ret[key] = null; });
|
|
return ret;
|
|
}
|
|
|
|
|
|
|
|
|
|
var ValidateModeBitacoraDocumentos = {
|
|
ObservacionSatisfacePoliticaCumplimiento: 1,
|
|
ObservacionExcepcion: 2
|
|
}
|
|
|
|
var EnumRolFuncional = {
|
|
Formalizador: 1,
|
|
Analista: 2
|
|
}
|
|
|
|
var ES = {
|
|
"sProcessing": "Procesando...",
|
|
"sLengthMenu": "Mostrar _MENU_ registros",
|
|
"sZeroRecords": "No se encontraron resultados",
|
|
"sEmptyTable": "Ningún dato disponible",
|
|
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
|
|
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
|
|
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
|
|
"sInfoPostFix": "",
|
|
"sSearch": "Buscar:",
|
|
"sUrl": "",
|
|
"sInfoThousands": ",",
|
|
"sLoadingRecords": "Cargando...",
|
|
"oPaginate": {
|
|
"sFirst": "Primero",
|
|
"sLast": "Último",
|
|
"sNext": "Siguiente",
|
|
"sPrevious": "Anterior"
|
|
},
|
|
"oAria": {
|
|
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
|
|
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
|
|
}
|
|
};
|
|
|
|
var EtapasCustom = {
|
|
RE_Reco_Dar_Segui: ($("#hiddenStep").val() == "RE_Reco_Dar_Segui" ? true : false),
|
|
AP_Corre_Caratula_Adjuntar_Doc: ($("#hiddenStep").val() == "AP_Corre_Caratula_Adjuntar_Doc" ? true : false),
|
|
DE_AP_Corre_Caratula_Adjuntar_Doc: ($("#hiddenStep").val() == "DE_AP_Corre_Caratula_Adjuntar_Doc" ? true : false),
|
|
}
|
|
|
|
|
|
jQuery(document).ready(function () {
|
|
ObtenerAlertasViewBag();
|
|
|
|
$("#btnCompletarTarea").click(function () {
|
|
if (!confirm("¿Desea completar la tarea?")) {
|
|
$('#btnCompletarTarea').enable();
|
|
ENDREQUEST();
|
|
return;
|
|
}
|
|
EnviarIncidente(false);
|
|
});
|
|
|
|
$("#btnFinalizarTarea").click(function () {
|
|
if (!confirm("¿Esta seguro de que desea abortar todo el trámite?")) {
|
|
ENDREQUEST();
|
|
return;
|
|
}
|
|
|
|
//******************************************************************
|
|
//nota: el abortar para la etapa AP_Corregircaratula solo va a funcionar en los flujos de versión 3 en adelante
|
|
//******************************************************************
|
|
//Inicializa y abre los comentarios de tipo finalizacion de trámite
|
|
//******************************************************************
|
|
InicializarBitacoraComentariosInternos($("#hiddenStep").val(), EnumTipoComentario.ComentarioFinalizacionTramite, false, BitacoraComentariosInternos_Show);
|
|
|
|
});
|
|
|
|
if (EtapasCustom.RE_Reco_Dar_Segui && $.inArray($("#hiddenIdTipoTramite").val(), ["2", "3", "5"]) != -1) {
|
|
$("#MenuBarTab1").hide();
|
|
}
|
|
|
|
//Si No es un Rol de Analisis entonces oculta la pestaña de 'Lista de Documentos'
|
|
if ((EtapasCustom.AP_Corre_Caratula_Adjuntar_Doc || EtapasCustom.DE_AP_Corre_Caratula_Adjuntar_Doc) && $.inArray($("#hiddenIdCorrigeCaratula").val(), ["35", "37", ""]) == -1) {
|
|
$("#MenuBarTab8").hide();
|
|
}
|
|
|
|
$('#btnImprimirCaratulaLayout').click(function () {
|
|
ImprimirCaratulaCredito();
|
|
});
|
|
|
|
$('#btnImprimirUltimaCaratulaFormalizadaLayout').click(function () {
|
|
ImprimirUltimaCaratulaFormalizada();
|
|
});
|
|
|
|
|
|
});
|
|
|
|
//#region IDENTIFICACION
|
|
function ShowDiv(id, code) {
|
|
|
|
|
|
$(format("#ddtipo_{0} option", id)).each(function () {
|
|
|
|
codeInt = $(this).val();
|
|
|
|
var div = $(format("#div_{0}_{1}", codeInt, id));
|
|
if (div != null) {
|
|
div.hide();
|
|
}
|
|
});
|
|
|
|
if (code === 'undefined' || code == null || code == '')
|
|
code = $(format("#ddtipo_{0}", id)).val();
|
|
|
|
//var code = $(format("#ddtipo_{0}", id)).val();
|
|
var div = $(format("#div_{0}_{1}", code, id));
|
|
if (div != null) {
|
|
div.show();
|
|
}
|
|
}
|
|
|
|
function format(fmtstr) {
|
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
return fmtstr.replace(/\{(\d+)\}/g, function (match, index) {
|
|
return args[index];
|
|
});
|
|
}
|
|
|
|
function valida_enteros(evento) {
|
|
var key = evento.keyCode;
|
|
if (key >= 48 && key <= 57)
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function alfanumerico(evento) {
|
|
var key = evento.keyCode;
|
|
if ((key >= 48 && key <= 57) || (key >= 65 && key <= 90) || (key >= 97 && key <= 122)) {
|
|
evento.keyCode = String.fromCharCode(key).toUpperCase().charCodeAt(0)
|
|
return true;
|
|
}
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function pad(str, max) {
|
|
str = str.toString();
|
|
return str.length < max ? pad("0" + str, max) : str;
|
|
}
|
|
|
|
function identificacion(obj) {
|
|
var val = $(obj).val();
|
|
var max = $(obj).attr("maxlength");
|
|
var valpad = pad(val, max);
|
|
$(obj).val(valpad);
|
|
}
|
|
|
|
function limpiar_identificacion(id_control) {
|
|
|
|
for (var i = 1; i <= 11; i++) {
|
|
|
|
switch (i.toString()) {
|
|
case "1":
|
|
impostar_identificacion(id_control, "00-0000-0000", i.toString());
|
|
break;
|
|
case "2":
|
|
impostar_identificacion(id_control, "", i.toString());
|
|
break;
|
|
case "3":
|
|
impostar_identificacion(id_control, "", i.toString());
|
|
break;
|
|
//case "4":
|
|
// impostar_identificacion(id_control, "000000000000", i.toString());
|
|
// break;
|
|
//case "5":
|
|
// impostar_identificacion(id_control, "00000000000000000", i.toString());
|
|
// break;
|
|
//case "6":
|
|
// impostar_identificacion(id_control, "00000", i.toString());
|
|
// break;
|
|
//case "7":
|
|
// impostar_identificacion(id_control, "000000000000000", i.toString());
|
|
// break;
|
|
case "8":
|
|
impostar_identificacion(id_control, "", i.toString());
|
|
break;
|
|
case "9":
|
|
impostar_identificacion(id_control, "0000000000", i.toString());
|
|
break;
|
|
case "10":
|
|
impostar_identificacion(id_control, "0000000000", i.toString());
|
|
break;
|
|
//case "11":
|
|
// impostar_identificacion(id_control, "", i.toString());
|
|
// break;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
function obtener_identificacion(id_control) {
|
|
var ret = "";
|
|
|
|
var code = $(format("#ddtipo_{0}", id_control)).val();
|
|
switch (code) {
|
|
case "1":
|
|
var parte1 = $(format("#txt_ced_nac1_{0}", id_control)).val();
|
|
var parte2 = $(format("#txt_ced_nac2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_nac3_{0}", id_control)).val();
|
|
if (parseInt(parte1) < 10)
|
|
parte1 = "0" + parte1;
|
|
ret = parte1 + "-" + parte2 + "-" + parte3;
|
|
break;
|
|
case "2":
|
|
//var parte1 = $(format("#txt_ced_resperm1_{0}", id_control)).val();
|
|
//var parte2 = $(format("#txt_ced_resperm2_{0}", id_control)).val();
|
|
//var parte3 = $(format("#txt_ced_resperm3_{0}", id_control)).val();
|
|
//ret = parseInt(parte1) + "-" + parte2 + parte3;
|
|
ret = $(format("#txt_ced_resperm_{0}", id_control)).val();
|
|
break;
|
|
case "3":
|
|
//var parte1 = $(format("#txt_ced_restemp1_{0}", id_control)).val();
|
|
//var parte2 = $(format("#txt_ced_restemp2_{0}", id_control)).val();
|
|
//var parte3 = $(format("#lbl_ced_restemp3_{0}", id_control)).val();
|
|
//var parte4 = $(format("#txt_ced_restemp4_{0}", id_control)).val();
|
|
//ret = parte1 + parte2 + parte3 + parte4;
|
|
ret = $(format("#txt_ced_restemp_{0}", id_control)).val();
|
|
break;
|
|
case "4":
|
|
var parte1 = $(format("#txt_ced_resapol1_{0}", id_control)).val();
|
|
var parte2 = $(format("#lbl_ced_resapol2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_resapol3_{0}", id_control)).val();
|
|
var parte4 = $(format("#txt_ced_resapol4_{0}", id_control)).val();
|
|
ret = parte1 + parte2 + parte3 + parte4;
|
|
break;
|
|
case "5":
|
|
var parte1 = $(format("#txt_ced_re1_{0}", id_control)).val();
|
|
var parte2 = $(format("#lbl_ced_re2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_re3_{0}", id_control)).val();
|
|
var parte4 = $(format("#txt_ced_re4_{0}", id_control)).val();
|
|
var parte5 = $(format("#txt_ced_re5_{0}", id_control)).val();
|
|
ret = parte1 + parte2 + parte3 + parte4 + parte5;
|
|
break;
|
|
case "6":
|
|
var parte1 = $(format("#txt_ced_ren1_{0}", id_control)).val();
|
|
var parte2 = $(format("#txt_ced_ren2_{0}", id_control)).val();
|
|
ret = parte1 + parte2;
|
|
break;
|
|
case "7":
|
|
var parte1 = $(format("#lbl_ced_ref1_{0}", id_control)).val();
|
|
var parte2 = $(format("#txt_ced_ref2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_ref3_{0}", id_control)).val();
|
|
var parte4 = $(format("#txt_ced_ref4_{0}", id_control)).val();
|
|
ret = parte1 + parte2 + parte3 + parte4;
|
|
break;
|
|
case "8":
|
|
ret = $(format("#txt_ced_pas_fisica_{0}", id_control)).val();
|
|
break;
|
|
case "9":
|
|
var parte1 = $(format("#txt_ced_jurnac1_{0}", id_control)).val();
|
|
var parte2 = $(format("#txt_ced_jurnac2_{0}", id_control)).val();
|
|
var parte3 = $(format("#txt_ced_jurnac3_{0}", id_control)).val();
|
|
ret = parte1 + parte2 + parte3;
|
|
break;
|
|
case "10":
|
|
ret = $(format("#txt_ced_pas_jur_{0}", id_control)).val();
|
|
break;
|
|
case "11":
|
|
ret = $(format("#txt_ced_unica_fisica_{0}", id_control)).val();
|
|
break;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
|
|
function obtener_tipo_identificacion(id_control) {
|
|
return $(format("#ddtipo_{0}", id_control)).val();
|
|
}
|
|
|
|
function impostar_tipo_identificacion(id_control, code) {
|
|
$(format("#ddtipo_{0}", id_control)).val(code);
|
|
}
|
|
|
|
function impostar_identificacion(id_control, identificacion, code, showddl) {
|
|
|
|
if (code === 'undefined' || code == null || code == '')
|
|
code = $(format("#ddtipo_{0}", id_control)).val();
|
|
|
|
|
|
ShowDiv(id_control, code);
|
|
|
|
switch (code) {
|
|
case "1":
|
|
if (identificacion.length == 12) {
|
|
var parte1 = identificacion.substring(1, 2);
|
|
var parte2 = identificacion.substring(3, 7);
|
|
var parte3 = identificacion.substring(8, 12);
|
|
$(format("#txt_ced_nac1_{0}", id_control)).val(parte1);
|
|
$(format("#txt_ced_nac2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_nac3_{0}", id_control)).val(parte3);
|
|
}
|
|
else
|
|
alert("Se esperaban 12 carácteres para el tipo de indentificación 1");
|
|
break;
|
|
case "2":
|
|
$(format("#txt_ced_resperm_{0}", id_control)).val(identificacion);
|
|
//if (identificacion.length == 18) {
|
|
// var parte1 = identificacion.substring(0, 3);
|
|
// var parte2 = identificacion.substring(4, 11);
|
|
// var parte3 = identificacion.substring(11, 18);
|
|
// $(format("#txt_ced_resperm1_{0}", id_control)).val(parte1);
|
|
// $(format("#txt_ced_resperm2_{0}", id_control)).val(parte2);
|
|
// $(format("#txt_ced_resperm3_{0}", id_control)).val(parte3);
|
|
//}
|
|
//else
|
|
// alert("Se esperaban 18 carácteres para el tipo de indentificación 2");
|
|
break;
|
|
case "3":
|
|
$(format("#txt_ced_restemp_{0}", id_control)).val(identificacion);
|
|
//if (identificacion.length == 19) {
|
|
// var parte1 = identificacion.substring(0, 7);
|
|
// var parte2 = identificacion.substring(7, 10);
|
|
// var parte3 = identificacion.substring(10, 12);
|
|
// var parte4 = identificacion.substring(12, 19);
|
|
// $(format("#txt_ced_restemp1_{0}", id_control)).val(parte1);
|
|
// $(format("#txt_ced_restemp2_{0}", id_control)).val(parte2);
|
|
// $(format("#lbl_ced_restemp3_{0}", id_control)).val(parte3);
|
|
// $(format("#txt_ced_restemp4_{0}", id_control)).val(parte4);
|
|
//}
|
|
//else
|
|
// alert("Se esperaban 19 carácteres para el tipo de indentificación 3");
|
|
break;
|
|
case "4":
|
|
if (identificacion.length == 12) {
|
|
var parte1 = identificacion.substring(0, 2);
|
|
var parte2 = identificacion.substring(2, 3);
|
|
var parte3 = identificacion.substring(3, 9);
|
|
var parte4 = identificacion.substring(9, 12);
|
|
$(format("#txt_ced_resapol1_{0}", id_control)).val(parte1);
|
|
$(format("#lbl_ced_resapol2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_resapol3_{0}", id_control)).val(parte3);
|
|
$(format("#txt_ced_resapol4_{0}", id_control)).val(parte4);
|
|
}
|
|
else
|
|
alert("Se esperaban 12 carácteres para el tipo de indentificación 4");
|
|
break;
|
|
case "5":
|
|
if (identificacion.length == 17) {
|
|
var parte1 = identificacion.substring(0, 3);
|
|
var parte2 = identificacion.substring(3, 5);
|
|
var parte3 = identificacion.substring(5, 11);
|
|
var parte4 = identificacion.substring(11, 13);
|
|
var parte5 = identificacion.substring(13, 17);
|
|
$(format("#txt_ced_re1_{0}", id_control)).val(parte1);
|
|
$(format("#lbl_ced_re2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_re3_{0}", id_control)).val(parte3);
|
|
$(format("#txt_ced_re4_{0}", id_control)).val(parte4);
|
|
$(format("#txt_ced_re5_{0}", id_control)).val(parte5);
|
|
}
|
|
else
|
|
alert("Se esperaban 17 carácteres para el tipo de indentificación 5");
|
|
break;
|
|
case "6":
|
|
if (identificacion.length == 5) {
|
|
var parte1 = identificacion.substring(0, 4);
|
|
var parte2 = identificacion.substring(4, 5);
|
|
$(format("#txt_ced_ren1_{0}", id_control)).val(parte1);
|
|
$(format("#txt_ced_ren2_{0}", id_control)).val(parte2);
|
|
}
|
|
else
|
|
alert("Se esperaban 5 carácteres para el tipo de indentificación 6");
|
|
break;
|
|
case "7":
|
|
if (identificacion.length == 15) {
|
|
var parte1 = identificacion.substring(0, 3);
|
|
var parte2 = identificacion.substring(3, 6);
|
|
var parte3 = identificacion.substring(6, 13);
|
|
var parte4 = identificacion.substring(13, 15);
|
|
$(format("#lbl_ced_ref1_{0}", id_control)).val(parte1);
|
|
$(format("#txt_ced_ref2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_ref3_{0}", id_control)).val(parte3);
|
|
$(format("#txt_ced_ref4_{0}", id_control)).val(parte4);
|
|
}
|
|
else
|
|
alert("Se esperaban 15 carácteres para el tipo de indentificación 7");
|
|
break;
|
|
case "8":
|
|
$(format("#txt_ced_pas_fisica_{0}", id_control)).val(identificacion);
|
|
break;
|
|
case "9":
|
|
if (identificacion.length == 10) {
|
|
var parte1 = identificacion.substring(0, 1);
|
|
var parte2 = identificacion.substring(1, 4);
|
|
var parte3 = identificacion.substring(4, 10);
|
|
$(format("#txt_ced_jurnac1_{0}", id_control)).val(parte1);
|
|
$(format("#txt_ced_jurnac2_{0}", id_control)).val(parte2);
|
|
$(format("#txt_ced_jurnac3_{0}", id_control)).val(parte3);
|
|
}
|
|
else
|
|
alert("Se esperaban 10 carácteres para el tipo de indentificación 10");
|
|
break;
|
|
case "10":
|
|
$(format("#txt_ced_pas_jur_{0}", id_control)).val(identificacion);
|
|
break;
|
|
case "11":
|
|
$(format("#txt_ced_unica_fisica_{0}", id_control)).val(identificacion);
|
|
break;
|
|
}
|
|
}
|
|
//#endregion
|
|
|
|
this.ToMoney = function (value) {
|
|
try {
|
|
return value.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
|
}
|
|
catch (ex) {
|
|
return "0.00";
|
|
}
|
|
};
|
|
|
|
this.StartSelectControlRequest = function (_selectId) {
|
|
$(_selectId).empty();
|
|
listItems = "<option value='-1' ><i class=\"fa fa-spinner fa-spin\"></i>Cargando catalogos, Por favor Espere...</option>";
|
|
$(_selectId).append(listItems);
|
|
};
|
|
|
|
this.CleanSelectControl = function (_selectId) {
|
|
$(_selectId).empty();
|
|
listItems = "<option value='' ></option>";
|
|
$(_selectId).append(listItems);
|
|
$(_selectId).val("");
|
|
};
|
|
|
|
this.AddSelectOption = function (_selectId, _optionId, _text) {
|
|
$(_selectId)
|
|
.append($("<option></option>")
|
|
.attr("value", _optionId)
|
|
.text(_text));
|
|
};
|
|
|
|
this.ConsultaTasaTipoCambio = function () {
|
|
|
|
try {
|
|
|
|
var _usuario = $("#hiddenUserID").val().split("/")[1];
|
|
var _proceso = $("#hiddenProcess").val();
|
|
|
|
|
|
var _model = { Usuario: _usuario, Procesos: _proceso };
|
|
|
|
var uri = 'api/GlobalAPI/ConsultarTasaCambio/';
|
|
var DTO = JSON.stringify(_model);
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: server + uri,
|
|
cache: false,
|
|
data: DTO,
|
|
contentType: 'application/json; charset=utf-8',
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
|
|
if (data != null && data.CodigoRespuesta == "EXITOSO") {
|
|
$("#hiddenTasaTipoCambio").val(data.TipoCambioVenta);
|
|
}
|
|
else {
|
|
toastr.error("Ha ocurrido un error inesperado al consultar la tasa de tipo de cambio.<br>" + data.DescripcionRespuesta);
|
|
}
|
|
}
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|
if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
return;
|
|
toastr.error("Ha ocurrido un error inesperado. Vuela a intentarlo mas tarde");
|
|
ENDREQUEST();
|
|
}).then(function (value) {
|
|
ENDREQUEST();
|
|
});
|
|
} catch (e) {
|
|
if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
return;
|
|
toastr.error("Ha ocurrido un error inesperado a intentar invocar el metodo de consulta de tasa de tipo de cambio. Vuelva a intentarlo mas tarde", Message_Error);
|
|
ENDREQUEST();
|
|
}
|
|
|
|
|
|
}
|
|
|
|
this.ObtenerAlertasViewBag = function () {
|
|
try {
|
|
var message = $("#hiddenErrorTasaTipoCambio").val();
|
|
var arrError = message.split('|');
|
|
|
|
$.each(arrError, function (key, item) {
|
|
if (item.trim() != "") {
|
|
toastr.warning(item, Message_Warning);
|
|
}
|
|
});
|
|
} catch (e) {
|
|
|
|
}
|
|
}
|
|
|
|
this.LeerControlesUltimus = function (modelo) {
|
|
//function para leer los controles ocultos de ultimus
|
|
//se lo asignan a la variable de entrada y luego la retorna
|
|
//esto es para centralizar la lectura de los mismos
|
|
|
|
modelo.UltimusTaskId = $("#hiddenTaskId").val();
|
|
modelo.UltimusUserID = $("#hiddenUserID").val();
|
|
|
|
modelo.UltimusTaskUser = $("#hiddenTaskUser").val();
|
|
modelo.UltimusAssignedToUser = $("#hiddenAssignedToUser").val();
|
|
|
|
|
|
modelo.UltimusProcess = $("#hiddenProcess").val();
|
|
modelo.UltimusStep = $("#hiddenStep").val();
|
|
modelo.UltimusIncident = $("#hiddenIncident").val();
|
|
modelo.UltimusIpAdress = $("#hiddenIpAdress").val();
|
|
modelo.UltimusMachineName = $("#hiddenMachineName").val();
|
|
modelo.UltimusActivityType = $("#hiddenActivityType").val();
|
|
modelo.UltimusJobFunction = $("#hiddenJobFunction").val();
|
|
modelo.UltimusUserFullName = $("#hiddenUserFullName").val();
|
|
modelo.UltimusUserEmail = $("#hiddenUserEmail").val();
|
|
modelo.UltimusSupervisor = $("#hiddenSupervisor").val();
|
|
modelo.UltimusSupervisorFullName = $("#hiddenSupervisorFullName").val();
|
|
modelo.Version = $("#hiddenVersion").val();
|
|
modelo.UltimusTaskStatus = $("#hiddenTaskStatus").val();
|
|
modelo.HostResponse = $("#hiddenHostResponse").val();
|
|
modelo.IdSolicitud = $("#hidden_co_solicitud").val();
|
|
|
|
return modelo;
|
|
}
|
|
|
|
//this.EnviarIncidente = function (FinalizarTarea, End, MensajeFin) {
|
|
|
|
// var model = {};
|
|
// model.FinalizarTarea = IsNullOrEmpty(FinalizarTarea) ? false : FinalizarTarea;
|
|
// model.Solicitud = {};
|
|
// model.Solicitud.IdSolicitud = $("#hidden_co_solicitud").val();
|
|
// model = LeerControlesUltimus(model);
|
|
|
|
// var ExistCallBack = (typeof CompleteTaskCallBack !== 'undefined' && $.isFunction(CompleteTaskCallBack)) ? true : false;
|
|
|
|
// $.ajax({
|
|
// type: 'POST',
|
|
// url: server + 'api/EnviarIncidenteAPI/EnviarIncidente',
|
|
// cache: false,
|
|
// data: JSON.stringify(model),
|
|
// contentType: 'application/json; charset=utf-8',
|
|
// dataType: 'json',
|
|
// async: End == true ? false : true,
|
|
// success: function (data) {
|
|
// if (data != null && data.CodigoRespuesta == "ERROR") {
|
|
// $('#btnCompletarTarea').enable();
|
|
// if ($("#hiddenStep").val() == "IN_Ing_Cliente")
|
|
// $('#btnGuardarDatos').enable();
|
|
// toastr.error("verifique los Logs del WebAPI", Message_Error);
|
|
// ENDREQUEST();
|
|
// } else if (data != null && data.CodigoRespuesta == "ADVERTENCIA") {
|
|
// if ($("#hiddenStep").val() == "IN_Ing_Cliente")
|
|
// $('#btnGuardarDatos').enable();
|
|
// toastr.warning(data.DescripcionRespuesta, Message_Warning);
|
|
// } else {
|
|
|
|
// if (($("#hiddenIncident").val() == "0" && !IsNullOrEmpty(data.UltimusIncident) && data.UltimusIncident != "0"))
|
|
// alert("Se ha generado el número de incidente " + data.UltimusIncident + ", para el proceso de " + $("#hiddenProcess").val());
|
|
|
|
// if (ExistCallBack)
|
|
// CompleteTaskCallBack(data);
|
|
// else {
|
|
// if (FinalizarTarea == false && MensajeFin != false)
|
|
// alert("La etapa " + $("#hiddenStep").val() + " se completó correctamente.");
|
|
// $('#btnCompletarTarea').attr('disabled', true)
|
|
|
|
// if (MensajeFin != false)
|
|
// window.close();
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
// }).fail(function (jqxhr, textStatus, error) {
|
|
// if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
// return;
|
|
// $('#btnCompletarTarea').enable();
|
|
// toastr.error("Ha ocurrido un error inesperado. Vuela a intentarlo mas tarde", Message_Error);
|
|
// }).then(function (value) {
|
|
// if (End == undefined || End == null || End == false) {
|
|
// ENDREQUEST();
|
|
// }
|
|
|
|
// });
|
|
//}
|
|
|
|
|
|
this.EnviarIncidente = function (FinalizarTarea, End, MensajeFin) {
|
|
|
|
var model = {};
|
|
model.FinalizarTarea = IsNullOrEmpty(FinalizarTarea) ? false : FinalizarTarea;
|
|
model.Solicitud = {};
|
|
model.Solicitud.IdSolicitud = $("#hidden_co_solicitud").val();
|
|
model = LeerControlesUltimus(model);
|
|
model.IdDecisionn = $("#hiddenIdDecisionn").val();
|
|
model.Analista = $("#hiddenAnalista").val();
|
|
|
|
var ExistCallBack = (typeof CompleteTaskCallBack !== 'undefined' && $.isFunction(CompleteTaskCallBack)) ? true : false;
|
|
|
|
|
|
Ultimus.AjaxPostData(Ultimus.server + 'api/EnviarIncidenteAPI/EnviarIncidente', model, End == true ? false : true, false, function (data) {
|
|
if (data != null && data.CodigoRespuesta == "ERROR") {
|
|
$('#btnCompletarTarea').enable();
|
|
if ($("#hiddenStep").val() == "IN_Ing_Cliente")
|
|
$('#btnGuardarDatos').enable();
|
|
toastr.error("verifique los Logs del WebAPI", Message_Error);
|
|
ENDREQUEST();
|
|
} else if (data != null && data.CodigoRespuesta == "ADVERTENCIA") {
|
|
if ($("#hiddenStep").val() == "IN_Ing_Cliente")
|
|
$('#btnGuardarDatos').enable();
|
|
toastr.warning(data.DescripcionRespuesta, Message_Warning);
|
|
} else {
|
|
|
|
if (($("#hiddenIncident").val() == "0" && !IsNullOrEmpty(data.UltimusIncident) && data.UltimusIncident != "0"))
|
|
alert("Se ha generado el número de incidente " + data.UltimusIncident + ", para el proceso de " + $("#hiddenProcess").val());
|
|
|
|
if (ExistCallBack)
|
|
CompleteTaskCallBack(data);
|
|
else {
|
|
if (FinalizarTarea == false && MensajeFin != false)
|
|
alert("La etapa " + $("#hiddenStep").val() + " se completó correctamente.");
|
|
$('#btnCompletarTarea').attr('disabled', true)
|
|
|
|
if (MensajeFin != false)
|
|
window.close();
|
|
}
|
|
if (End == undefined || End == null || End == false) {
|
|
ENDREQUEST();
|
|
}
|
|
|
|
}
|
|
}, "ERROR");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.MostrarEPower = function (RutaEpower) {
|
|
|
|
try {
|
|
|
|
if (RutaEpower != null && !IsNullOrEmpty(RutaEpower))
|
|
var ventanaEpower = window.open(RutaEpower, "_blank", "menubar=0,toolbar=0,scrollbars=1,resizable=1");
|
|
else
|
|
toastr.warning("La consulta en EPower para el documento seleccionado no se encuentra definida.");
|
|
|
|
|
|
//ventanaEpower.close();
|
|
|
|
} catch (e) {
|
|
toastr.error("Ha ocurrido un problema al intentar abrir la consulta del documento en EPower.");
|
|
}
|
|
|
|
|
|
}
|
|
|
|
this.ObtenerTipoCambioContable = function () {
|
|
|
|
var uri = "api/SAPServicioIntegracionAPI/ObtenerTipoCambioContable/"
|
|
var Item = {
|
|
NumeroCliente: null,
|
|
Identificacion: null,
|
|
NumeroLinea: null,
|
|
NumeroSolicitud: null
|
|
};
|
|
|
|
var DTO = JSON.stringify(Item);
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: server + uri,
|
|
cache: false,
|
|
async: false,
|
|
data: DTO,
|
|
contentType: 'application/json; charset=utf-8',
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
if (data != null) {
|
|
TasaCambios = isNaN(data.TipoCambio) || data.TipoCambio == null ? "0" : data.TipoCambio;
|
|
}
|
|
}
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|
if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
return;
|
|
toastr.error("Ha ocurrido un error inesperado. Vuela a intentarlo mas tarde");
|
|
|
|
ENDREQUEST();
|
|
}).then(function (value) {
|
|
ENDREQUEST();
|
|
});
|
|
}
|
|
|
|
this.ObtenerTasasBase = function () {
|
|
|
|
var uri = "api/SAPServicioIntegracionAPI/ObtenerTasasBase/"
|
|
var Item = {
|
|
NumeroCliente: null,
|
|
Identificacion: null,
|
|
NumeroLinea: null,
|
|
NumeroSolicitud: null
|
|
};
|
|
|
|
var DTO = JSON.stringify(Item);
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: server + uri,
|
|
cache: false,
|
|
async: false,
|
|
data: DTO,
|
|
contentType: 'application/json; charset=utf-8',
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
if (data != null) {
|
|
TasaBasePasiva = isNaN(data.TasaBasePasiva) || data.TasaBasePasiva == null ? 0 : data.TasaBasePasiva;
|
|
TasaBasePrime = isNaN(data.TasaBasePrime) || data.TasaBasePrime == null ? 0 : data.TasaBasePrime;
|
|
}
|
|
}
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|
if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
return;
|
|
toastr.error("Ha ocurrido un error inesperado. Vuela a intentarlo mas tarde");
|
|
|
|
ENDREQUEST();
|
|
}).then(function (value) {
|
|
ENDREQUEST();
|
|
});
|
|
}
|
|
|
|
this.CambioPantallaMenu = function (event, btnMenu) {
|
|
|
|
|
|
CambioPantalla = true;
|
|
|
|
var ExistCallBack = (typeof CambioPantallaMenuCallBack !== 'undefined' && $.isFunction(CambioPantallaMenuCallBack)) ? true : false;
|
|
|
|
if (ExistCallBack && !CambioPantallaMenuCallBack(btnMenu)) {
|
|
event.preventDefault();
|
|
return false;
|
|
}
|
|
|
|
LoadMessage();
|
|
|
|
|
|
return true;
|
|
}
|
|
|
|
this.toValidDate = function (datestring) {
|
|
var fechatiempo = datestring.split(" ");
|
|
var fecha = fechatiempo[0].split("-");
|
|
|
|
return new String(fecha[2] + '-' + fecha[0] + '-' + fecha[1] + ' ' + fechatiempo[1])
|
|
|
|
}
|
|
|
|
|
|
this.CargarConfiguracionContadorAnalisis = function (model) {
|
|
|
|
var sesion_temporazador = sessionStorage.temporizador_analisis;
|
|
|
|
|
|
sesion_temporazador = sesion_temporazador != null ? JSON.parse(sesion_temporazador) : sesion_temporazador;
|
|
|
|
// var Fecha_InicioAnalisisIteraccion = model !=null ? model.DatosGeneralesAnalisis.Fecha_InicioAnalisisIteraccion : sesion_temporazador.InicioOficial ;
|
|
|
|
var temporizador = {
|
|
IdSolicitud: $("#hidden_co_solicitud").val(),
|
|
Etapa: $("#hiddenStep").val(),
|
|
FormatoFecha: "YYYY-MM-DD HH:mm:ss",
|
|
UnidadMedida: "seconds",
|
|
InicioOficial: null,
|
|
ConteoIniciado: false,
|
|
TiempoTotalOficial: 0,
|
|
Start: function (model) {
|
|
temporizador.TiempoTotalOficial = 0;
|
|
temporizador.ConteoIniciado = true;
|
|
temporizador.InicioOficial = moment(model.DatosGeneralesAnalisis.Fecha_InicioAnalisisIteraccion, temporizador.FormatoFecha).format(temporizador.FormatoFecha); //: moment().format(temporizador.FormatoFecha);
|
|
sessionStorage.temporizador_analisis = JSON.stringify(temporizador);
|
|
|
|
|
|
},
|
|
Stop: function () {
|
|
temporizador.TiempoTotalOficial = temporizador.ConteoIniciado == true ? moment(moment().format(temporizador.FormatoFecha)).diff(moment(temporizador.InicioOficial, temporizador.FormatoFecha).format(temporizador.FormatoFecha), temporizador.UnidadMedida) : 0;
|
|
temporizador.ConteoIniciado = false;
|
|
temporizador.InicioOficial = null;
|
|
sessionStorage.temporizador_analisis = JSON.stringify(temporizador);
|
|
}
|
|
}
|
|
|
|
if (sesion_temporazador != null && temporizador.IdSolicitud == sesion_temporazador.IdSolicitud && sesion_temporazador.Etapa == temporizador.Etapa) {
|
|
|
|
temporizador.ConteoIniciado = sesion_temporazador.ConteoIniciado;
|
|
temporizador.InicioOficial = sesion_temporazador.InicioOficial;
|
|
temporizador.inicioReal = sesion_temporazador.inicioReal;
|
|
//temporizador.TiempoTotalOficial = sesion_temporazador.TiempoTotalOficial;
|
|
}
|
|
else
|
|
sessionStorage.temporizador_analisis = JSON.stringify(temporizador);
|
|
|
|
return temporizador;
|
|
}
|
|
|
|
this.GuardarFormularioAnalisis = function (enviar, esControlAprobacion, End) {
|
|
|
|
var Etapas = {
|
|
AN_Rev_Doc_Clasificar: ($("#hiddenStep").val() == "AN_Rev_Doc_Clasificar" ? true : false),
|
|
AN_Preanalisis: ($("#hiddenStep").val() == "AN_Preanalisis" ? true : false),
|
|
AN_Informe_Analisis: ($("#hiddenStep").val() == "AN_Informe_Analisis" ? true : false),
|
|
AN_Visita_Seguimiento: ($("#hiddenStep").val() == "AN_Visita_Seguimiento" ? true : false)
|
|
};
|
|
|
|
Ultimus.LoadMessage();
|
|
|
|
//Se incluye para que Guarde=True los datos en el Archivo de Excel
|
|
model.GuardarAceptacion = true;//IsNullOrEmpty(enviar) ? false : enviar ;
|
|
|
|
var DatosGeneralesAnalisis = model.DatosGeneralesAnalisis == null ? {} : model.DatosGeneralesAnalisis;
|
|
var PermitirEditarCaratula = sessionStorage.Analisis_EditarCaratula == "0" ? true : false;
|
|
|
|
|
|
if (End == true) {
|
|
temporizador_analisis.Start(model);
|
|
temporizador_analisis.Stop();
|
|
DatosGeneralesAnalisis.Iniciado_PreAnalisis = 0;
|
|
DatosGeneralesAnalisis.Fecha_InicioAnalisisIteraccion = null;
|
|
|
|
}
|
|
|
|
var ContadorTiempoTramite = temporizador_analisis.ConteoIniciado;
|
|
|
|
|
|
DatosGeneralesAnalisis.IdSolicitud = $("#hidden_co_solicitud").val();
|
|
|
|
|
|
if (Etapas.AN_Preanalisis) {
|
|
if (esControlAprobacion == true) {
|
|
DatosGeneralesAnalisis.Completado_PreAnalisis = true;
|
|
DatosGeneralesAnalisis.TiempoTotal_PreAnalisis = DatosGeneralesAnalisis.TiempoTotal_PreAnalisis + temporizador_analisis.TiempoTotalOficial;
|
|
DatosGeneralesAnalisis.PermitirEditarCaratula_InformeAnalisis = PermitirEditarCaratula;
|
|
DatosGeneralesAnalisis.TiempoTotal_InformeAnalisis = temporizador_analisis.TiempoTotalOficial;
|
|
DatosGeneralesAnalisis.IdDecision_InformeAnalisis = IsNullOrEmpty($("#ddlAccionRechazo option:selected").val()) ? null : $("#ddlAccionRechazo option:selected").val();
|
|
}
|
|
else {
|
|
|
|
DatosGeneralesAnalisis.TiempoTotal_PreAnalisis = DatosGeneralesAnalisis.TiempoTotal_PreAnalisis + temporizador_analisis.TiempoTotalOficial;
|
|
DatosGeneralesAnalisis.TiempoTotal_InformeAnalisis = temporizador_analisis.TiempoTotalOficial;
|
|
|
|
DatosGeneralesAnalisis.PermitirEditarCaratula_PreAnalisis = PermitirEditarCaratula;
|
|
|
|
DatosGeneralesAnalisis.SolicitarDocumentos_Seguimiento = IsNullOrEmpty($("#btnsSolicitarDocumentacion").val()) ? null : ($("#btnsSolicitarDocumentacion").val() == "0" ? true : false);
|
|
|
|
DatosGeneralesAnalisis.Fecha_VisitaSeguimiento = IsNullOrEmpty($("#txtFechaEntrevistaCliente").val()) ? null : moment($("#txtFechaEntrevistaCliente").val(), $("#txtFechaEntrevistaCliente").attr("dateformat")).format("MM-DD-YYYY");
|
|
|
|
DatosGeneralesAnalisis.Comentarios_Seguimiento = $("#txtComentariosSeguimiento").val();
|
|
|
|
DatosGeneralesAnalisis.IdTipoSeguimiento = $("#ddlTipoSeguimiento option:selected").val();
|
|
|
|
if (model.ListaDocumentosSeguimiento != null)
|
|
$.each(model.ListaDocumentosSeguimiento, function (id, item) {
|
|
|
|
var idDoc = item.IdTipoDocumento;
|
|
|
|
item.SolicitarCliente = ($("#SolicitarCliente_" + idDoc).prop("checked") ? true : false)
|
|
item.ClienteEntrego = ($("#ClienteEntrego_" + idDoc).prop("checked") ? true : false);
|
|
model.ListaDocumentosSeguimiento[id] = item;
|
|
});
|
|
}
|
|
}
|
|
|
|
model.DatosGeneralesAnalisis = DatosGeneralesAnalisis;
|
|
model = LeerControlesUltimus(model);
|
|
|
|
var EsAsincrono = (Etapas.AN_Informe_Analisis || Etapas.AN_Preanalisis ? false : true);
|
|
var MuestraMensaje = ((Etapas.AN_Informe_Analisis && enviar == true) || (Etapas.AN_Preanalisis && (enviar == true || esControlAprobacion == true)) ? false : true);
|
|
|
|
|
|
|
|
//Ultimus.AjaxPostData(server + "api/AnalisisAPI/GuardarAnalisis", model, EsAsincrono, MuestraMensaje, function (data) {
|
|
// ENDREQUEST();
|
|
// if (enviar == true)
|
|
// EnviarIncidente(null);
|
|
//});
|
|
|
|
|
|
var DTO = JSON.stringify(model);
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: server + "api/AnalisisAPI/GuardarAnalisis",
|
|
cache: false,
|
|
data: DTO,
|
|
contentType: 'application/json; charset=utf-8',
|
|
dataType: 'json',
|
|
async: EsAsincrono,
|
|
success: function (data) {
|
|
|
|
if (data != null) {
|
|
|
|
if (MuestraMensaje) {
|
|
switch (data.CodigoRespuesta) {
|
|
case "EXITOSO":
|
|
toastr.info('Información guardada con exito', 'Completado');
|
|
break;
|
|
case "ERROR":
|
|
toastr.error("Ha ocurrido un error.");
|
|
break;
|
|
default:
|
|
toastr.warning(data.DescripcionRespuesta);
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (enviar == true)
|
|
EnviarIncidente(false, true);
|
|
else if (End == undefined || End == null || End == false)
|
|
ENDREQUEST();
|
|
|
|
}
|
|
}
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|
if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
return;
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde");
|
|
|
|
ENDREQUEST();
|
|
}).then(function (value) {
|
|
if (End == undefined || End == null || End == false)
|
|
ENDREQUEST();
|
|
});
|
|
|
|
|
|
var DTO = JSON.stringify(model);
|
|
|
|
|
|
|
|
if (ContadorTiempoTramite)
|
|
temporizador_analisis.Start(model);
|
|
}
|
|
|
|
this.pad = function (str, max) {
|
|
str = str.toString();
|
|
return str.length < max ? pad("0" + str, max) : str;
|
|
}
|
|
|
|
this.GenerarDocumento = function (IdDocumento) {
|
|
|
|
var _IdSolicitud = $("#hidden_co_solicitud").val();
|
|
|
|
|
|
|
|
if ($("#hiddenProcess").val() == 'Desembolso'
|
|
&& $("#hidden_AplicaCaratulaAprobacionUnica").val() != '1'
|
|
&& ($("#hiddenStep").val() != "DE_AP_Enviar_AProbacion"
|
|
&& $("#hiddenStep").val() != "DE_AP_Analizar_Caso"
|
|
&& $("#hiddenStep").val() != "DE_AP_Vali_CondicionesConCliente"
|
|
&& $("#hiddenStep").val() != "DE_AP_Corre_Caratula_Adjuntar_Doc"
|
|
&& $("#hiddenStep").val() != "DE_AP_Incluir_Cliente_SAP")) {
|
|
_IdSolicitud = $("#hidden_IdSolicitudCredito").val();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var DatosEntrada = {
|
|
Solicitud: {
|
|
IdSolicitud: _IdSolicitud,
|
|
Step: $("#hiddenStep").val(),
|
|
IncidentStatus: $("#hiddenTaskStatus").val()
|
|
},
|
|
DetalleDocumento: {
|
|
IdTipoDocumento: IdDocumento
|
|
}
|
|
};
|
|
|
|
DatosEntrada = LeerControlesUltimus(DatosEntrada);
|
|
|
|
Ultimus.AjaxPostData(server + "api/DocumentosAPI/GenerarDocumento", DatosEntrada, true, false, function (data) {
|
|
|
|
if (data != null && !IsNullOrEmpty(data.RutaVirtual))
|
|
window.open(data.RutaVirtual);
|
|
else if (!IsNullOrEmpty(data.Error))
|
|
toastr.warning(data.Error, Ultimus.Message_Warning);
|
|
else
|
|
toastr.error(Ultimus.MessageFull_Error, Ultimus.Message_Error);
|
|
|
|
ENDREQUEST();
|
|
|
|
}, "ERROR");
|
|
}
|
|
|
|
this.AjaxFailEvent = function () {
|
|
|
|
if (CambioPantalla == true)
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
// Since confModal is essentially a nested modal it's enforceFocus method
|
|
// must be no-op'd or the following error results
|
|
// "Uncaught RangeError: Maximum call stack size exceeded"
|
|
// But then when the nested modal is hidden we reset modal.enforceFocus
|
|
var enforceModalFocusFn = $.fn.modal.Constructor.prototype.enforceFocus;
|
|
|
|
$.fn.modal.Constructor.prototype.enforceFocus = function () { };
|
|
|
|
this.ImprimirCaratulaCredito = function () {
|
|
GenerarDocumento(1);
|
|
}
|
|
|
|
function round(value, exp) {
|
|
if (typeof exp === 'undefined' || +exp === 0)
|
|
return Math.round(value);
|
|
|
|
value = +value;
|
|
exp = +exp;
|
|
|
|
if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0))
|
|
return NaN;
|
|
|
|
// Shift
|
|
value = value.toString().split('e');
|
|
value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)));
|
|
|
|
// Shift back
|
|
value = value.toString().split('e');
|
|
return +(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp));
|
|
}
|
|
|
|
this.LimpiarCatalogo = function () {
|
|
|
|
if (typeof $('#tableCatalogo') !== 'undefined' && $('#tableCatalogo') != null) {
|
|
var _tableCatalogo = $('#tableCatalogo').DataTable();
|
|
_tableCatalogo.clear().draw();
|
|
}
|
|
}
|
|
|
|
this.ValidateCaratulaCreditoRegistrada = function () {
|
|
|
|
var resp = false;
|
|
|
|
try {
|
|
|
|
var uri = "api/CaratulaCreditoAPI/ConsultarDatosSolicitusCaratula/"
|
|
var Item = {
|
|
IdSolicitud: $("#hidden_co_solicitud").val()
|
|
};
|
|
|
|
var DTO = JSON.stringify(Item);
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: server + uri,
|
|
cache: false,
|
|
data: DTO,
|
|
contentType: 'application/json; charset=utf-8',
|
|
async: false,
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
|
|
if (data != null) {
|
|
|
|
if (data.CodigoRespuesta == "EXITOSO") {
|
|
if (data.Solicitud == null || data.Solicitud.CaratulaCredito == null || data.Solicitud.CaratulaCredito.IdSolicitud == 0 || data.Solicitud.CaratulaCredito.IdTipoCaratula == null || data.Solicitud.CaratulaCredito.IdTipoCaratula == 0) {
|
|
resp = false;
|
|
toastr.warning("Estimado usuario debe de registrar la información de la carátula de crédito antes intentar enviar el trámite.");
|
|
}
|
|
else {
|
|
resp = true;
|
|
}
|
|
}
|
|
else if (data.CodigoRespuesta == "ADVERTENCIA") {
|
|
toastr.warning(data.DescripcionRespuesta);
|
|
}
|
|
else if (data.CodigoRespuesta == "ERROR") {
|
|
toastr.error("Ha ocurrido un error inesperado al cargar el formulario de datos adicionales de la carátula de crédito");
|
|
}
|
|
}
|
|
ENDREQUEST();
|
|
}
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|
|
|
if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
return;
|
|
|
|
toastr.error("Ha ocurrido un error inesperado. Vuela a intentarlo mas tarde");
|
|
|
|
ENDREQUEST();
|
|
}).then(function (value) {
|
|
ENDREQUEST();
|
|
});
|
|
|
|
} catch (e) {
|
|
resp = false;
|
|
}
|
|
|
|
return resp;
|
|
|
|
}
|
|
|
|
this.LockDevTools = function () {
|
|
//impide el click derecho y redireciona al abrir la consola
|
|
$("body").attr("oncontextmenu", "return false;");
|
|
|
|
$("body").mousedown(function () {
|
|
RedirecOnDevTools();
|
|
});
|
|
|
|
document.onkeydown = function (e) {
|
|
|
|
if (e.keyCode == 123) {
|
|
return false;
|
|
}
|
|
if (e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
|
|
return false;
|
|
}
|
|
if (e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
|
|
return false;
|
|
}
|
|
if (e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
|
|
return false;
|
|
}
|
|
|
|
RedirecOnDevTools();
|
|
|
|
}//fin keydown
|
|
|
|
}
|
|
|
|
this.RedirecOnDevTools = function () {
|
|
//redirecciona si la consola esta visible
|
|
var element = new Image;
|
|
|
|
|
|
Object.defineProperty(element, 'id', {
|
|
get: function () {
|
|
|
|
var url = window.location.href;
|
|
url = url + "&Advr=1"
|
|
|
|
RedirectToAction("HOME", "ERROR", url);
|
|
return null;
|
|
}
|
|
});
|
|
|
|
try {
|
|
var _0x25ee = ["\x63\x6C\x65\x61\x72", "", "\x6C\x6F\x67", "\x20\x20\x20\x20\x20\x20\x20\x64\x62\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x20\x20\x2C\x61\x64\x38\x38\x38\x38\x62\x61\x2C\x20\x20\x20\x20\x38\x38\x20\x20", "\x20\x20\x20\x20\x20\x20\x64\x38\x38\x62\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x64\x38\x27\x27\x20\x20\x20\x20\x60\x27\x38\x62\x20\x20\x20\x38\x38\x20\x20", "\x20\x20\x20\x20\x20\x64\x38\x27\x60\x38\x62\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x64\x38\x27\x20\x20\x20\x20\x20\x20\x20\x20\x60\x38\x62\x20\x20\x38\x38\x20\x20", "\x20\x20\x20\x20\x64\x38\x27\x20\x20\x60\x38\x62\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x38\x38\x20\x20", "\x20\x20\x20\x64\x38\x59\x61\x61\x61\x61\x59\x38\x62\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x38\x38\x20\x20", "\x20\x20\x64\x38\x27\x27\x27\x27\x27\x27\x27\x27\x38\x62\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x59\x38\x2C\x20\x20\x20\x20\x20\x20\x20\x20\x2C\x38\x50\x20\x20\x27\x27\x20\x20", "\x20\x64\x38\x27\x20\x20\x20\x20\x20\x20\x20\x20\x60\x38\x62\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x59\x38\x61\x2E\x20\x20\x20\x20\x2E\x61\x38\x50\x20\x20\x20\x61\x61\x20\x20", "\x64\x38\x27\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x60\x38\x62\x20\x20\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x38\x20\x20\x38\x38\x20\x20\x20\x20\x20\x20\x20\x60\x27\x59\x38\x38\x38\x38\x59\x27\x27\x20\x20\x20\x20\x38\x38\x20\x20", "\x45\x73\x74\x61\x20\x66\x75\x6E\x63\x69\xF3\x6E\x20\x64\x65\x6C\x20\x6E\x61\x76\x65\x67\x61\x64\x6F\x72\x20\x65\x73\x74\xE1\x20\x70\x65\x6E\x73\x61\x64\x61\x20\x70\x61\x72\x61\x20\x64\x65\x73\x61\x72\x72\x6F\x6C\x6C\x61\x64\x6F\x72\x65\x73\x2E", "\x53\x69\x20\x61\x6C\x67\x75\x69\x65\x6E\x20\x74\x65\x20\x68\x61\x20\x69\x6E\x64\x69\x63\x61\x64\x6F\x20\x71\x75\x65\x20\x63\x6F\x70\x69\x61\x72\x61\x73\x20\x79\x20\x70\x65\x67\x61\x72\x61\x73\x20\x61\x6C\x67\x6F\x20\x61\x71\x75\xED\x20\x70\x61\x72\x61", "\x68\x61\x62\x69\x6C\x69\x74\x61\x72\x20\x75\x6E\x61\x20\x66\x75\x6E\x63\x69\xF3\x6E\x20\x64\x65\x6C\x20\x70\x72\x6F\x63\x65\x73\x6F\x20\x6F\x20\x70\x61\x72\x61\x20\x61\x6C\x74\x65\x72\x61\x72\x20\x6C\x61\x20\x69\x6E\x66\x6F\x72\x6D\x61\x63\x69\xF3\x6E\x2C", "\x73\x65\x20\x74\x72\x61\x74\x61\x20\x64\x65\x20\x75\x6E\x20\x66\x72\x61\x75\x64\x65\x2E\x20\x53\x69\x20\x6C\x6F\x20\x68\x61\x63\x65\x73\x20\x65\x73\x74\x61\x73\x20\x76\x69\x6F\x6C\x61\x6E\x64\x6F\x20\x6C\x61\x20\x6C\x65\x79\x2E", "\x56\x65\x72\x20\x68\x74\x74\x70\x3A\x2F\x2F\x75\x6C\x74\x69\x6D\x75\x73\x2E\x63\x6F\x6D\x20\x70\x61\x72\x61\x20\x6D\xE1\x73\x20\x69\x6E\x66\x6F\x72\x6D\x61\x63\x69\xF3\x6E\x2E"]; console[_0x25ee[0]](); console[_0x25ee[2]](_0x25ee[1]); console[_0x25ee[2]](_0x25ee[3]); console[_0x25ee[2]](_0x25ee[4]); console[_0x25ee[2]](_0x25ee[5]); console[_0x25ee[2]](_0x25ee[6]); console[_0x25ee[2]](_0x25ee[7]); console[_0x25ee[2]](_0x25ee[8]); console[_0x25ee[2]](_0x25ee[9]); console[_0x25ee[2]](_0x25ee[10]); console[_0x25ee[2]](_0x25ee[1]); console[_0x25ee[2]](_0x25ee[11]); console[_0x25ee[2]](_0x25ee[12]); console[_0x25ee[2]](_0x25ee[13]); console[_0x25ee[2]](_0x25ee[14]); console[_0x25ee[2]](_0x25ee[1]); console[_0x25ee[2]](_0x25ee[15]); console[_0x25ee[2]](_0x25ee[1]); console[_0x25ee[2]](_0x25ee[1])
|
|
|
|
console.log(element);
|
|
}
|
|
catch (e) {
|
|
|
|
}
|
|
}
|
|
|
|
this.Encrypt = function (value) {
|
|
var uri = "api/GlobalAPI/Encriptar?Cadena=" + value
|
|
var SolicitudEncrypt = "";
|
|
$.ajax({
|
|
type: 'GET',
|
|
url: server + uri,
|
|
cache: false,
|
|
contentType: 'application/json; charset=utf-8',
|
|
dataType: 'json',
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
SolicitudEncrypt = data;
|
|
|
|
}
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|
if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
return;
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
|
ENDREQUEST();
|
|
|
|
}).then(function (value) {
|
|
ENDREQUEST();
|
|
|
|
});
|
|
return SolicitudEncrypt;
|
|
}
|
|
|
|
this.ImprimirUltimaCaratulaFormalizada = function () {
|
|
var _IdSolicitud = $("#hidden_co_solicitud").val();
|
|
|
|
if (_IdSolicitud != "0") {
|
|
var uri = "api/CaratulaCreditoAPI/ObtenerRutaUltimaCaratulaFormalizada?IdSolicitud=" + _IdSolicitud
|
|
$.ajax({
|
|
type: 'GET',
|
|
url: server + uri,
|
|
cache: false,
|
|
contentType: 'application/json; charset=utf-8',
|
|
dataType: 'json',
|
|
async: false,
|
|
success: function (data) {
|
|
|
|
if (data == null)
|
|
{
|
|
toastr.warning("No se encontró una caratula permanente formalizada para este cliente.", Ultimus.Message_Warning);
|
|
return;
|
|
}
|
|
|
|
if (data != "") {
|
|
var rutavirtual = Ultimus.replaceAll("ULA.Cathay.Credito", "UltimusAttachment", server);
|
|
window.open(rutavirtual + data)
|
|
} else {
|
|
toastr.warning("No se encontró una caratula permanente formalizada para este cliente.", Ultimus.Message_Warning);
|
|
}
|
|
|
|
}
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|
if (typeof AjaxFailEvent !== 'undefined' && $.isFunction(AjaxFailEvent) && !AjaxFailEvent(jqxhr, textStatus, error))
|
|
return;
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
|
ENDREQUEST();
|
|
|
|
}).then(function (value) {
|
|
ENDREQUEST();
|
|
|
|
});
|
|
} else {
|
|
toastr.warning("Es requerido un número de solicitud.", Ultimus.Message_Warning);
|
|
}
|
|
|
|
}
|
|
|