162 lines
No EOL
6 KiB
JavaScript
162 lines
No EOL
6 KiB
JavaScript
jQuery(document).ready(function () {
|
|
try {
|
|
//**********************************
|
|
//CREDITO
|
|
//**********************************
|
|
$('#btnGenDocCaratulaCredito').click(function () {
|
|
GenerarDocumento("CaratulaCredito");
|
|
});
|
|
|
|
|
|
//Aprobacion
|
|
if ($('#btnGenDocCartaAprobacion') != null) {
|
|
$('#btnGenDocCartaAprobacion').click(function () {
|
|
GenerarDocumento("CartaAprobacion");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocCartaAprobacionCompraTasa') != null) {
|
|
$('#btnGenDocCartaAprobacionCompraTasa').click(function () {
|
|
GenerarDocumento("CartaAprobacionCompraTasa");
|
|
});
|
|
}
|
|
|
|
|
|
//PreAprobacion
|
|
if ($('#btnGenDocCartaPreAprobacion') != null) {
|
|
$('#btnGenDocCartaPreAprobacion').click(function () {
|
|
GenerarDocumento("CartaPreAprobacion");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocCartaPreAprobacionCompraTasa') != null) {
|
|
$('#btnGenDocCartaPreAprobacionCompraTasa').click(function () {
|
|
GenerarDocumento("CartaPreAprobacionCompraTasa");
|
|
});
|
|
}
|
|
|
|
|
|
if ($('#btnTipoAprobacionCasoUndefined') != null) {
|
|
$('#btnTipoAprobacionCasoUndefined').click(function () {
|
|
toastr.warning("Estimado usuario, no fue posible determinar cuál es el tipo de documento a generar según el dato del parámetro de tipo de aprobación para el trámite actual.<br>Por favor comuniquese con el Administrador del Sistema.", Message_Warning);
|
|
return;
|
|
});
|
|
}
|
|
|
|
|
|
//**********************************
|
|
//INS
|
|
//**********************************
|
|
if ($('#btnGenDocSolicitudSeguroINS') != null) {
|
|
$('#btnGenDocSolicitudSeguroINS').click(function () {
|
|
GenerarDocumento("SolicitudINS");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocCartaExclusionFlotillaINS') != null) {
|
|
$('#btnGenDocCartaExclusionFlotillaINS').click(function () {
|
|
GenerarDocumento("AutorizacionExclusionFlotillaINS");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocComprobanteEntregaDocumentosINS') != null) {
|
|
$('#btnGenDocComprobanteEntregaDocumentosINS').click(function () {
|
|
GenerarDocumento("ComprobanteEntregaDocumentosINS");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocDeberInformacionINS') != null) {
|
|
$('#btnGenDocDeberInformacionINS').click(function () {
|
|
GenerarDocumento("DeberInformacionINS");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocCartaDescriptivaPolizaINS') != null) {
|
|
$('#btnGenDocCartaDescriptivaPolizaINS').click(function () {
|
|
GenerarDocumento("CartaDescriptivaPolizaINS");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocSolicitudInclusionVidaINS') != null) {
|
|
$('#btnGenDocSolicitudInclusionVidaINS').click(function () {
|
|
GenerarDocumento("SolicitudInclusionVidaINS");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocAutorizacionConsultaExpedienteINS') != null) {
|
|
$('#btnGenDocAutorizacionConsultaExpedienteINS').click(function () {
|
|
GenerarDocumento("AutorizacionConsultaExpedienteINS");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocSolicitudInclusionDesempleoINS') != null) {
|
|
$('#btnGenDocSolicitudInclusionDesempleoINS').click(function () {
|
|
GenerarDocumento("SolicitudInclusionDesempleoINS");
|
|
});
|
|
}
|
|
|
|
|
|
//**********************************
|
|
//MAPFRE
|
|
//**********************************
|
|
if ($('#btnGenDocSolicitudSeguroMAPFRE') != null) {
|
|
$('#btnGenDocSolicitudSeguroMAPFRE').click(function () {
|
|
GenerarDocumento("SolicitudMAPFRE");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocCartaExclusionFlotillaMAPFRE') != null) {
|
|
$('#btnGenDocCartaExclusionFlotillaMAPFRE').click(function () {
|
|
GenerarDocumento("CartaExclusionFlotillaMAPFRE");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocCartaDescriptivaPolizaMAPFRE') != null) {
|
|
$('#btnGenDocCartaDescriptivaPolizaMAPFRE').click(function () {
|
|
GenerarDocumento("CartaDescriptivaPolizaMAPFRE");
|
|
});
|
|
}
|
|
|
|
if ($('#btnGenDocSolicitudSeguroDS') != null) {
|
|
$('#btnGenDocSolicitudSeguroDS').click(function () {
|
|
GenerarDocumento("SolicitudDS");
|
|
});
|
|
}
|
|
|
|
//**********************************
|
|
//LEGAL
|
|
//**********************************
|
|
$('#btnGenDocPrenda').click(function () {
|
|
GenerarDocumento("Prenda");
|
|
});
|
|
|
|
} catch (e) {
|
|
toastr.error("Ha ocurrido un error inesperado al inicializar el formulario de informa. Vuelva a intentarlo mas tarde", Message_Error);
|
|
}
|
|
});
|
|
|
|
this.GenerarDocumento = function (tipoDocumento) {
|
|
|
|
var Mode = 0;
|
|
if (parseFloat($("#hiddenVersionMap").val()) >= 1) Mode = 1;
|
|
|
|
var uri = "api/DocumentosAPI/Adjuntar" + tipoDocumento + "?IdSolicitud=" + $('#hiddensol_co_solicitud').val() + "&IdCotizacion=" + $('#hiddensol_co_cotizacion').val() + "&process=" + $('#hiddenProcess').val() + "&TipoCambio=" + $("#hiddenTasaTipoCambio").val() + "&Mode=" + Mode;
|
|
$.getJSON(server + uri).done(function (data) {
|
|
if (data != null) {
|
|
if (data.CodigoRespuesta == "EXITOSO") {
|
|
window.open(data.url);
|
|
}
|
|
else if (data.CodigoRespuesta == "ADVERTENCIA") {
|
|
toastr.warning(data.DescripcionRespuesta, Message_Warning);
|
|
}
|
|
else {
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
|
}
|
|
}
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|
ENDREQUEST();
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
|
}).then(function (value) {
|
|
ENDREQUEST();
|
|
});
|
|
}; |