1204 lines
51 KiB
JavaScript
1204 lines
51 KiB
JavaScript
|
|
//#region GLOBALES
|
|||
|
|
var infoGarantia = {};
|
|||
|
|
var infoCotizacion = {};
|
|||
|
|
var infoSolicitante = {};
|
|||
|
|
|
|||
|
|
var _rubroAuto = null;
|
|||
|
|
var _rubroVida = null;
|
|||
|
|
var _rubroDesempleo = null;
|
|||
|
|
var IsReadOnlyForm = false;
|
|||
|
|
var IsLoadedCotizacion = true;
|
|||
|
|
var ModeCotizacion = []; //0=Normal 1=SegurosAutoManual 2=SeguroVidaManual 3=SeguroDesempleoManual
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#formSeguros").EnableValidationToolTip();
|
|||
|
|
//#endregion
|
|||
|
|
|
|||
|
|
//#region READY
|
|||
|
|
jQuery(document).ready(function () {
|
|||
|
|
try {
|
|||
|
|
|
|||
|
|
$("#btnCotizar").attr("disabled", true);
|
|||
|
|
|
|||
|
|
$("#txtSeguroAuto").change(function () {
|
|||
|
|
var _montoSegAuto = $("#txtSeguroAuto").autoNumeric('get');
|
|||
|
|
|
|||
|
|
$("#hiddenFlagEsSeguroAutoManual").val(true);
|
|||
|
|
LlenarSeguros(null, null, _montoSegAuto > 0);
|
|||
|
|
CheckAdicionales();
|
|||
|
|
|
|||
|
|
|
|||
|
|
//Indica que las condiciones de la cotizacion estan siendo elegidas/modificadas por el usuario
|
|||
|
|
$("#btnCotizar").attr("disabled", false);
|
|||
|
|
IsLoadedCotizacion = false;
|
|||
|
|
|
|||
|
|
ModeCotizacion.push(1);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#txtSeguroVida").change(function () {
|
|||
|
|
var _montoSegVida = $("#txtSeguroVida").autoNumeric('get');
|
|||
|
|
|
|||
|
|
$("#hiddenFlagEsSeguroVidaManual").val(true);
|
|||
|
|
LlenarSeguros(_montoSegVida > 0, null, null);
|
|||
|
|
CheckAdicionales();
|
|||
|
|
|
|||
|
|
//Indica que las condiciones de la cotizacion estan siendo elegidas/modificadas por el usuario
|
|||
|
|
$("#btnCotizar").attr("disabled", false);
|
|||
|
|
IsLoadedCotizacion = false;
|
|||
|
|
|
|||
|
|
ModeCotizacion.push(2);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#txtSeguroDesempleo").change(function () {
|
|||
|
|
var _montoSegDesempleo = $("#txtSeguroDesempleo").autoNumeric('get');
|
|||
|
|
|
|||
|
|
$("#hiddenFlagEsSeguroDesempleoManual").val(true);
|
|||
|
|
LlenarSeguros(null, _montoSegDesempleo > 0, null);
|
|||
|
|
CheckAdicionales();
|
|||
|
|
|
|||
|
|
//Indica que las condiciones de la cotizacion estan siendo elegidas/modificadas por el usuario
|
|||
|
|
$("#btnCotizar").attr("disabled", false);
|
|||
|
|
IsLoadedCotizacion = false;
|
|||
|
|
|
|||
|
|
ModeCotizacion.push(3);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
GetControlsSettings("Seguros", "Seguros", "formSeguros", true);
|
|||
|
|
|
|||
|
|
$("#radioAseguradoDeudor").attr("disabled", true);
|
|||
|
|
$("#radioAseguradoCodeudor").attr("disabled", true);
|
|||
|
|
$("#radioAseguradoTercero").attr("disabled", true);
|
|||
|
|
|
|||
|
|
//Conductor Habitual: Se visualiza si el seguro de Auto es brindado por INS
|
|||
|
|
if ($("#hiddenIdAseguradoraAuto").val() == "1") {
|
|||
|
|
$('#tabConductorHabitual').show();
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$('#tabConductorHabitual').hide();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//Beneficiaros: Se visualizan si el seguro de vida es brindado por INS o DS
|
|||
|
|
if ($("#hiddenIdAseguradoraVida").val() == "1" || $("#hiddenIdAseguradoraVida").val() == "4") {
|
|||
|
|
$('#tabBeneficiariosPoliza').show();
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$('#tabBeneficiariosPoliza').hide();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado al inicializar el formulario de seguros. Vuelva a intentarlo mas tarde", Message_Error);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
//#endregion
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#btnCotizar").click(function () {
|
|||
|
|
Cotizar();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#TabsClienteCentrico li a").click(function (event) {
|
|||
|
|
try {
|
|||
|
|
//Si etapa está activa
|
|||
|
|
if ($("#hiddenTaskStatus").val() == 1 && IsReadOnlyForm == false) {
|
|||
|
|
|
|||
|
|
event.preventDefault();
|
|||
|
|
var thisHREF = this.attributes["href"].nodeValue;
|
|||
|
|
|
|||
|
|
//Si es la primera vez que quiere salir o no ha guardado antes de quere salir.
|
|||
|
|
if ($("#hiddenFlagSalir").val() != "true" || $("#hiddenFlagGuardarDatos").val() != "true") {
|
|||
|
|
|
|||
|
|
//Activa el flag de salir
|
|||
|
|
$("#hiddenFlagSalir").val("true");
|
|||
|
|
|
|||
|
|
//Indica al usuario que debe guardar
|
|||
|
|
toastr.warning("Estimado usuario, debe guardar los datos antes de salir del formulario.", Message_Warning);
|
|||
|
|
ENDREQUEST();
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
document.location.href = thisHREF;
|
|||
|
|
}
|
|||
|
|
} catch (e) {
|
|||
|
|
ENDREQUEST();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#btnMotivosDevolucion").click(function () {
|
|||
|
|
initializeFormMotivos(3, false, "SOURCE");
|
|||
|
|
$('#modalMotivos').modal('show');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#btnGuardar").click(function () {
|
|||
|
|
guardar(false);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#btnEnviar").click(function () {
|
|||
|
|
if ($("#hiddenEnviarA").val() != "") {
|
|||
|
|
if (!confirm("¿Enviar?"))
|
|||
|
|
return;
|
|||
|
|
actualizarMotivo(3);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
toastr.warning("Debe especificar a donde enviar la solicitud.");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
this.getDataModel = function () {
|
|||
|
|
|
|||
|
|
$('#btnEnviarA').unbind('click');
|
|||
|
|
$('#btnEnviarA').click(function () {
|
|||
|
|
CargarDataCatalogoDecision();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#btnBuscar').unbind('click');
|
|||
|
|
$('#btnBuscar').click(function () {
|
|||
|
|
CargarDataCatalogoDecision();
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
CargarDefaultPolizasAdicionales();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.CargarDefaultPolizasAdicionales = function () {
|
|||
|
|
LoadMessage();
|
|||
|
|
var uri = 'api/CotizacionAPI/CargarDefaultPolizasAdicionales';
|
|||
|
|
$.getJSON(server + uri).done(function (data) {
|
|||
|
|
if (data != null) {
|
|||
|
|
$("#hiddenRequeridoSeguroVida").val(data.SeguroVida);
|
|||
|
|
$("#hiddenRequeridoSeguroDesempleo").val(data.SeguroDesempleo);
|
|||
|
|
$("#hiddenRequeridoSeguroAuto").val(data.SeguroAuto);
|
|||
|
|
$.each(data.SegurosCotizacion, function (key, item) {
|
|||
|
|
switch (item.RubroSeguro.TipoRubroSeguro.Descripcion.trim()) {
|
|||
|
|
case "AUTO":
|
|||
|
|
$("#hiddenDefaultSeguroAutoId").val(item.RubroSeguro.IdRubroSeguro);
|
|||
|
|
$("#hiddenDefaultSeguroAutoDesc").val(item.RubroSeguro.Descripcion);
|
|||
|
|
break;
|
|||
|
|
case "VIDA":
|
|||
|
|
$("#hiddenDefaultSeguroVidaId").val(item.RubroSeguro.IdRubroSeguro);
|
|||
|
|
$("#hiddenDefaultSeguroVidaDesc").val(item.RubroSeguro.Descripcion);
|
|||
|
|
break;
|
|||
|
|
case "DESEMPLEO":
|
|||
|
|
$("#hiddenDefaultSeguroDesempleoId").val(item.RubroSeguro.IdRubroSeguro);
|
|||
|
|
$("#hiddenDefaultSeguroDesempleoDesc").val(item.RubroSeguro.Descripcion);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
CargarCotizacion();
|
|||
|
|
}
|
|||
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde");
|
|||
|
|
}).then(function (value) {
|
|||
|
|
ENDREQUEST();
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.CargarCotizacion = function ()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
var uri = 'api/SegurosAPI/getDataModel?_IdSolicitud=' + $("#hiddensol_co_solicitud").val() + '&etapa=' + $("#hiddenStep").val();
|
|||
|
|
|
|||
|
|
$.getJSON(server + uri).done(function (data) {
|
|||
|
|
|
|||
|
|
infoSolicitante = data.Solicitante;
|
|||
|
|
infoGarantia = data.Solicitud.Garantia[0];
|
|||
|
|
infoCotizacion = data.DatosCotizacion[0];
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (data.HistorialDecision != null) {
|
|||
|
|
HistorialDecision = data.HistorialDecision;
|
|||
|
|
$("#hiddenEnviarA").val(HistorialDecision.Decision.IdDecision);
|
|||
|
|
$("#txtEnviarA").val(HistorialDecision.Decision.Descripcion);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//Condiciones de Financiamiento
|
|||
|
|
$("#txtTipoVehiculo").val(infoCotizacion.DescripcionTipoVehiculo);
|
|||
|
|
$("#txtPlanInversion").val("Compra de Vehículo");
|
|||
|
|
$("#hiddenMoneda").val(infoCotizacion.IdMoneda);
|
|||
|
|
$("#txtMoneda").val(infoCotizacion.DescripcionMoneda);
|
|||
|
|
$("#txtPorcComision").autoNumeric('set', infoCotizacion.PorcComision);
|
|||
|
|
$("#txtPlazoMeses").val(infoCotizacion.PeriodoMesesCredito);
|
|||
|
|
$("#hiddenPlazoMeses").val(infoCotizacion.PeriodoMesesCredito);
|
|||
|
|
$("#txtMontoPrima").autoNumeric('set', infoCotizacion.MontoPrima);
|
|||
|
|
$("#txtPorcentajePrima").autoNumeric('set', infoCotizacion.PorcPrima);
|
|||
|
|
$("#txtTasaInteres").val(infoCotizacion.EnunciadoCondiciones);
|
|||
|
|
$("#txtMonto").autoNumeric('set', infoCotizacion.MontoPrestamo);
|
|||
|
|
$("#txtMontoCreditoSinSeguros").autoNumeric('set', infoCotizacion.MontoPrestamoSinSeguros);
|
|||
|
|
|
|||
|
|
$("#hiddenIngresoMinReqCol").val(ToMoney(infoCotizacion.IngresoMinReqCol));
|
|||
|
|
$("#hiddenIngresoMInReqDol").val(ToMoney(infoCotizacion.IngresoMInReqDol));
|
|||
|
|
$("#hiddenMontoComision").val(ToMoney(infoCotizacion.MontoComision));
|
|||
|
|
$("#hiddenMontoConstitucionPrenda").val(ToMoney(infoCotizacion.MontoConstitucionPrenda));
|
|||
|
|
$("#hiddenMontoDesembolso").val(ToMoney(infoCotizacion.MontoDesembolso));
|
|||
|
|
$("#hiddenMontoTraspaso").val(ToMoney(infoCotizacion.MontoTraspaso));
|
|||
|
|
$("#hiddenTipoCambio").val(infoCotizacion.TipoCambio);
|
|||
|
|
|
|||
|
|
|
|||
|
|
//PolizaVehiculoGratis
|
|||
|
|
$("#chk" + "PolizaVehiculoGratis").attr("checked", infoCotizacion.AplicaPolizaVehiculoGratis != true ? false : true);
|
|||
|
|
|
|||
|
|
//PlazoMesesPolizaVehiculoGratis
|
|||
|
|
$("#hidden" + "PlazoMesesPolizaVehiculoGratis").val(infoCotizacion.PeriodoMesesGracia == 0 ? '' : infoCotizacion.PeriodoMesesGracia);
|
|||
|
|
$("#txt" + "PlazoMesesPolizaVehiculoGratis").val(infoCotizacion.PeriodoMesesGracia == 0 ? '' : infoCotizacion.PeriodoMesesGracia);
|
|||
|
|
|
|||
|
|
|
|||
|
|
//PolizasAdicionales
|
|||
|
|
$("#chk" + "PolizasAdicionales").attr("checked", false);
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("disabled", true);
|
|||
|
|
$("#chk" + "SeguroVida").attr("disabled", true);
|
|||
|
|
$("#chk" + "SeguroAuto").attr("disabled", true);
|
|||
|
|
if (infoCotizacion.SegurosCotizacion != null && infoCotizacion.SegurosCotizacion.length > 0) {
|
|||
|
|
$.each(infoCotizacion.SegurosCotizacion, function (key, item) {
|
|||
|
|
switch (item.RubroSeguro.TipoRubroSeguro.Descripcion.trim()) {
|
|||
|
|
case "AUTO":
|
|||
|
|
_rubroAuto = item;
|
|||
|
|
$("#txtSeguroAuto").autoNumeric('set', item.Monto);
|
|||
|
|
$("#txtSeguroAutoAnterior").val(ToMoney(item.MontoAnterior)); // Steven Rojas
|
|||
|
|
$("#chk" + "SeguroAuto").attr("checked", true);
|
|||
|
|
$("#btn" + "RubroSeguroAuto").attr("disabled", false);
|
|||
|
|
$("#hidden" + "RubroSeguroAuto").val(item.RubroSeguro.IdRubroSeguro);
|
|||
|
|
$("#txt" + "RubroSeguroAuto").val(item.RubroSeguro.Descripcion);
|
|||
|
|
if ($("#hiddenRequeridoSeguroAuto").val() == "false")
|
|||
|
|
$("#chk" + "PolizasAdicionales").attr("checked", true);
|
|||
|
|
break;
|
|||
|
|
case "VIDA":
|
|||
|
|
_rubroVida = item;
|
|||
|
|
$("#txtSeguroVida").autoNumeric('set', item.Monto);
|
|||
|
|
$("#chk" + "SeguroVida").attr("checked", true);
|
|||
|
|
$("#btn" + "RubroSeguroVida").attr("disabled", false);
|
|||
|
|
$("#hidden" + "RubroSeguroVida").val(item.RubroSeguro.IdRubroSeguro);
|
|||
|
|
$("#txt" + "RubroSeguroVida").val(item.RubroSeguro.Descripcion);
|
|||
|
|
if ($("#hiddenRequeridoSeguroVida").val() == "false")
|
|||
|
|
$("#chk" + "PolizasAdicionales").attr("checked", true);
|
|||
|
|
break;
|
|||
|
|
case "DESEMPLEO":
|
|||
|
|
_rubroDesempleo = item;
|
|||
|
|
$("#txtSeguroDesempleo").autoNumeric('set', item.Monto);
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("checked", true);
|
|||
|
|
$("#btn" + "RubroSeguroDesempleo").attr("disabled", false);
|
|||
|
|
$("#hidden" + "RubroSeguroDesempleo").val(item.RubroSeguro.IdRubroSeguro);
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").val(item.RubroSeguro.Descripcion);
|
|||
|
|
if ($("#hiddenRequeridoSeguroDesempleo").val() == "false")
|
|||
|
|
$("#chk" + "PolizasAdicionales").attr("checked", true);
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
if (item.IdAgenteSeguro != null && item.IdAgenteSeguro != "") {
|
|||
|
|
$("#hiddenAgenteSeguros").val(item.AgenteSeguro.IdAgenteSeguro);
|
|||
|
|
$("#txtAgenteSeguros").val(item.AgenteSeguro.NombreCompleto + " - Licencia:" + item.AgenteSeguro.NumLicencia);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
if ($("#chk" + "PolizasAdicionales").prop("checked")) {
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("disabled", $("#hiddenRequeridoSeguroDesempleo").val() == "true");
|
|||
|
|
$("#chk" + "SeguroVida").attr("disabled", $("#hiddenRequeridoSeguroVida").val() == "true");
|
|||
|
|
$("#chk" + "SeguroAuto").attr("disabled", $("#hiddenRequeridoSeguroAuto").val() == "true");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//Datos de Vehiculo
|
|||
|
|
$("#hiddenAgencia").val(infoCotizacion.IdAgenciaVehiculo);
|
|||
|
|
$("#txtAgencia").val(infoCotizacion.DescripcionAgenciaVehiculo);
|
|||
|
|
|
|||
|
|
$("#hiddenSubAgencia").val(infoCotizacion.IdSubAgenciaVehiculo);
|
|||
|
|
$("#txtSubAgencia").val(infoCotizacion.DescripcionSubAgenciaVehiculo);
|
|||
|
|
|
|||
|
|
$("#hiddenMarca").val(infoCotizacion.IdMarcaVehiculo);
|
|||
|
|
$("#txtMarca").val(infoCotizacion.DescripcionMarcaVehiculo);
|
|||
|
|
|
|||
|
|
$("#hiddenEstilo").val(infoCotizacion.IdEstiloVehiculo);
|
|||
|
|
$("#txtEstilo").val(infoCotizacion.DescripcionEstiloVehiculo);
|
|||
|
|
|
|||
|
|
$("#hiddenAnnoAuto").val(infoCotizacion.IdAnnoVehiculo);
|
|||
|
|
$("#txtAnnoAuto").val(infoCotizacion.DescripcionAnnoVehiculo);
|
|||
|
|
|
|||
|
|
$("#hiddenUsoVehiculo").val(infoCotizacion.IdUsoVehiculo);
|
|||
|
|
$("#txtUsoVehiculo").val(infoCotizacion.DescripcionUsoVehiculo);
|
|||
|
|
|
|||
|
|
//Caracteristicas Adicionales del Vehiculo
|
|||
|
|
if (infoGarantia != null) {
|
|||
|
|
$("#txtChasis").val(infoGarantia.Chasis);
|
|||
|
|
|
|||
|
|
$("#txtMotor").val(infoGarantia.Motor);
|
|||
|
|
|
|||
|
|
$("#txtPlaca").val(infoGarantia.Placa);
|
|||
|
|
|
|||
|
|
$("#txtColor").val(infoGarantia.Color);
|
|||
|
|
|
|||
|
|
$("#hiddenTipoTraccion").val(infoGarantia.IdTipoTraccion);
|
|||
|
|
$("#txtTipoTraccion").val(infoGarantia.TipoTraccion.Descripcion);
|
|||
|
|
|
|||
|
|
$("#txtPesoNeto").val(infoGarantia.PesoNeto);
|
|||
|
|
|
|||
|
|
$("#hiddenTipoTransmision").val(infoGarantia.IdTipoTransmision);
|
|||
|
|
$("#txtTipoTransmision").val(infoGarantia.TipoTransmision.Descripcion);
|
|||
|
|
|
|||
|
|
$("#txtCilindrada").val(infoGarantia.Cilindrada);
|
|||
|
|
|
|||
|
|
$("#txtNumCilindros").val(infoGarantia.NumCilindros);
|
|||
|
|
|
|||
|
|
$("#hiddenTipoCombustible").val(infoGarantia.IdTipoCombustible);
|
|||
|
|
$("#txtTipoCombustible").val(infoGarantia.TipoCombustible.Descripcion);
|
|||
|
|
|
|||
|
|
$("#txtCapacidad").val(infoGarantia.Capacidad);
|
|||
|
|
|
|||
|
|
$("#txtInscritoANombre").val(infoGarantia.InscritoANombre);
|
|||
|
|
|
|||
|
|
$("#hiddenCategoriaVehiculo").val(infoGarantia.IdCategoriaVehiculo);
|
|||
|
|
$("#txtCategoriaVehiculo").val(infoGarantia.CategoriaVehiculo.Descripcion);
|
|||
|
|
|
|||
|
|
$("#hiddenCarroceriaVehiculo").val(infoGarantia.IdCarroceriaVehiculo);
|
|||
|
|
$("#txtCarroceriaVehiculo").val(infoGarantia.CarroceriaVehiculo.Descripcion);
|
|||
|
|
|
|||
|
|
|
|||
|
|
impostar_tipo_identificacion("IdentificacionConductorHabitual", infoGarantia.ConductorHabitual_IdTipoIdentificacion);
|
|||
|
|
impostar_identificacion("IdentificacionConductorHabitual", infoGarantia.ConductorHabitual_Identificacion);
|
|||
|
|
$("#txtNombreConductorHabitual").val(infoGarantia.ConductorHabitual_Nombre);
|
|||
|
|
|
|||
|
|
//BMU 01-09-2016
|
|||
|
|
$("#txtFechaVehiculoSaleAgencia").val(infoGarantia.FechaVehiculoSaleAgencia == null ? "" : moment(infoGarantia.FechaVehiculoSaleAgencia).format("DD/MM/YYYY"));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//Tipo de Asegurado
|
|||
|
|
if (infoSolicitante != null &&
|
|||
|
|
infoSolicitante.length > 0) {
|
|||
|
|
|
|||
|
|
$.each(infoSolicitante, function (key, item) {
|
|||
|
|
|
|||
|
|
var tipoSolicitante = item.TipoSolicitante.Descripcion.split("-")[0];
|
|||
|
|
switch (tipoSolicitante.trim().toUpperCase()) {
|
|||
|
|
case "DEUDOR":
|
|||
|
|
$("#lblAseguradoDeudorIdentificacion").text(item.Cliente.Identificacion);
|
|||
|
|
$("#lblAseguradoDeudorNombre").text(item.Cliente.PrimerNombre + " " + item.Cliente.SegundoNombre + " " + item.Cliente.PrimerApellido + " " + item.Cliente.SegundoApellido);
|
|||
|
|
$("#txtCategoriaRiesgo").val(item.Cliente.IdCategoriaRiesgo);
|
|||
|
|
break;
|
|||
|
|
|
|||
|
|
case "CODEUDOR":
|
|||
|
|
$("#lblAseguradoCodeudorIdentificacion").text(item.Cliente.Identificacion);
|
|||
|
|
$("#lblAseguradoCodeudorNombre").text(item.Cliente.PrimerNombre + " " + item.Cliente.SegundoNombre + " " + item.Cliente.PrimerApellido + " " + item.Cliente.SegundoApellido);
|
|||
|
|
break;
|
|||
|
|
|
|||
|
|
case "ASEGURADO":
|
|||
|
|
var subTipoSolicitante = item.TipoSolicitante.Descripcion.split("-")[1];
|
|||
|
|
switch (subTipoSolicitante.trim().toUpperCase()) {
|
|||
|
|
case "DEUDOR":
|
|||
|
|
$("#radioAseguradoDeudor").attr("checked", true);
|
|||
|
|
$("#radioAseguradoCodeudor").attr("checked", false);
|
|||
|
|
$("#radioAseguradoTercero").attr("checked", false);
|
|||
|
|
$("#lblAdjuntarKYCSegurado").attr("style", "display:none;");
|
|||
|
|
break;
|
|||
|
|
case "CODEUDOR":
|
|||
|
|
|
|||
|
|
$("#radioAseguradoDeudor").attr("checked", false);
|
|||
|
|
$("#radioAseguradoCodeudor").attr("checked", true);
|
|||
|
|
$("#radioAseguradoTercero").attr("checked", false);
|
|||
|
|
$("#lblAdjuntarKYCSegurado").attr("style", "display:none;");
|
|||
|
|
break;
|
|||
|
|
case "OTRO":
|
|||
|
|
|
|||
|
|
$("#radioAseguradoDeudor").attr("checked", false);
|
|||
|
|
$("#radioAseguradoCodeudor").attr("checked", false);
|
|||
|
|
$("#radioAseguradoTercero").attr("checked", true);
|
|||
|
|
|
|||
|
|
$("#lblAdjuntarKYCSegurado").attr("style", "display:block;");
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CargarInfoAsegurado(item.Cliente);
|
|||
|
|
|
|||
|
|
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
//Beneficiarios Seguro de Autos
|
|||
|
|
initializeFormBeneficiarios(true, "formSeguros", null);
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#formSeguros").valid();
|
|||
|
|
|
|||
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde");
|
|||
|
|
}).then(function (value) {
|
|||
|
|
SoloLectura();
|
|||
|
|
ENDREQUEST();
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.CargarInfoAsegurado = function (infoCliente) {
|
|||
|
|
try {
|
|||
|
|
|
|||
|
|
$('#divDatosTipoAsegurado').attr("disabled", true);
|
|||
|
|
|
|||
|
|
if (infoCliente != null && !(jQuery.isEmptyObject(infoCliente))) {
|
|||
|
|
//TipoIdentificacion
|
|||
|
|
impostar_tipo_identificacion('AsegTerceroIdentificacion', infoCliente.IdTipoIdentificacion);
|
|||
|
|
//Identificacion
|
|||
|
|
impostar_identificacion('AsegTerceroIdentificacion', infoCliente.Identificacion);
|
|||
|
|
$("#txtAsegTerceroPrimerApellido").val(infoCliente.PrimerApellido);
|
|||
|
|
$("#txtAsegTerceroSegundoApellido").val(infoCliente.SegundoApellido);
|
|||
|
|
$("#txtAsegTerceroNombreCompleto").val(infoCliente.PrimerNombre);
|
|||
|
|
$("#txtAsegTerceroFecNacimiento").val(infoCliente.FeNacimiento);
|
|||
|
|
if (infoCliente.Nacionalidad != null) {
|
|||
|
|
$("#hiddenPaisNacimiento").val(infoCliente.Nacionalidad.idnIdNacionalidad);
|
|||
|
|
$("#txtPaisNacimiento").val(infoCliente.Nacionalidad.Pais);
|
|||
|
|
}
|
|||
|
|
if (infoCliente.Genero != null) {
|
|||
|
|
$("#hiddenAsegTerceroGenero").val(infoCliente.IdGenero);
|
|||
|
|
$("#txtAsegTerceroGenero").val(infoCliente.Genero.Descripcion);
|
|||
|
|
}
|
|||
|
|
if (infoCliente.Profesion != null) {
|
|||
|
|
$("#hiddenProfesion").val(infoCliente.Profesion.IdProfesion);
|
|||
|
|
$("#txtProfesion").val(infoCliente.Profesion.Descripcion);
|
|||
|
|
}
|
|||
|
|
if (infoCliente.DireccionCliente != null) {
|
|||
|
|
|
|||
|
|
if (infoCliente.DireccionCliente[0].Provincia != null)
|
|||
|
|
{
|
|||
|
|
$("#hiddenProvincia").val(infoCliente.DireccionCliente[0].Provincia.IdProvincia);
|
|||
|
|
$("#txtProvincia").val(infoCliente.DireccionCliente[0].Provincia.Descripcion);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (infoCliente.DireccionCliente[0].Distrito != null)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
$("#hiddenDistrito").val(infoCliente.DireccionCliente[0].Distrito.IdDistrito);
|
|||
|
|
$("#txtDistrito").val(infoCliente.DireccionCliente[0].Distrito.Descripcion);
|
|||
|
|
|
|||
|
|
if (infoCliente.DireccionCliente[0].Distrito.Canton != null)
|
|||
|
|
{
|
|||
|
|
$("#hiddenCanton").val(infoCliente.DireccionCliente[0].Distrito.Canton.IdCanton);
|
|||
|
|
$("#txtCanton").val(infoCliente.DireccionCliente[0].Distrito.Canton.Descripcion);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#txtAsegTerceroOtrasSenas").val(infoCliente.DireccionCliente[0].DirExacta);
|
|||
|
|
}
|
|||
|
|
$("#txtAsegTerceroTelefono").val(infoCliente.TelefonoCliente[0].Telefono);
|
|||
|
|
$("#txtEmail").val(infoCliente.EmailCliente[0].Email);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado al cargar la información del asegurado. Vuelva a intentarlo.");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.CargarDataCatalogoDecision = function () {
|
|||
|
|
var proceso = $("#hiddenProcess").val();
|
|||
|
|
var etapa = $("#hiddenStep").val();
|
|||
|
|
var usuario = $("#hiddenUserID").val();
|
|||
|
|
var sol_co_cotizacion = $("#hiddensol_co_cotizacion").val();
|
|||
|
|
var DireccionAPI = $('#btnEnviarA').attr("Direccion_API");
|
|||
|
|
DireccionAPICatalogo = DireccionAPI;
|
|||
|
|
SelectedCatalog = "EnviarA";
|
|||
|
|
CargarDataCatalogo(DireccionAPI, $("#txtDescripcion").val(), proceso, etapa, usuario, sol_co_cotizacion);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.actualizarMotivo = function (_Estado) {
|
|||
|
|
try {
|
|||
|
|
var _model = {
|
|||
|
|
IdMotivoSolicitud: IdMotivoSolicitud,
|
|||
|
|
Comentario: $("#txtComentarioMotivo").val(),
|
|||
|
|
Estado: _Estado
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var uri = 'api/MotivosAPI/ActualizarMotivoSolicitud/';
|
|||
|
|
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 == "EXITOSO") {
|
|||
|
|
toastr.info('Motivos actualizados con exito', 'Completado');
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado al actualizar los motivos. Vuelva a intentarlo.");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo.");
|
|||
|
|
ENDREQUEST();
|
|||
|
|
}).then(function (value) {
|
|||
|
|
guardar(true);
|
|||
|
|
});
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado al intentar actualizar los motivos. Vuelva a intentarlo.");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.Enviar = function () {
|
|||
|
|
var Incident = "0";
|
|||
|
|
if ($("#hiddenIncident").val() != "")
|
|||
|
|
Incident = $("#hiddenIncident").val();
|
|||
|
|
var JsonEnviarCotizacion =
|
|||
|
|
{
|
|||
|
|
IdCotizacion: $('#hiddensol_co_cotizacion').val(),
|
|||
|
|
UserId: $("#hiddenUserID").val(),
|
|||
|
|
TaskId: $("#hiddenTaskId").val(),
|
|||
|
|
Process: $("#hiddenProcess").val(),
|
|||
|
|
Step: $("#hiddenStep").val(),
|
|||
|
|
Incident: Incident,
|
|||
|
|
IdDecision: $("#hiddenEnviarA").val()
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var uri = 'api/GlobalAPI/Enviar/';
|
|||
|
|
var DTO = JSON.stringify(JsonEnviarCotizacion);
|
|||
|
|
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'POST',
|
|||
|
|
url: server + uri,
|
|||
|
|
cache: false,
|
|||
|
|
data: DTO,
|
|||
|
|
contentType: 'application/json; charset=utf-8',
|
|||
|
|
dataType: 'json',
|
|||
|
|
success: function (data) {
|
|||
|
|
if (data.CodigoRespuesta == "EXITOSO") {
|
|||
|
|
alert("Incidente enviado");
|
|||
|
|
window.open('', '_self', ''); window.close();
|
|||
|
|
}
|
|||
|
|
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);
|
|||
|
|
toastr.warning(data.DescripcionRespuesta, Message_Warning);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo.");
|
|||
|
|
ENDREQUEST();
|
|||
|
|
}).then(function (value) {
|
|||
|
|
ENDREQUEST();
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.guardar = function (enviar) {
|
|||
|
|
try {
|
|||
|
|
if (!$("#formSeguros").valid()) {
|
|||
|
|
ENDREQUEST();
|
|||
|
|
toastr.warning("Ingresar todos los campos que son requeridos.");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (IsLoadedCotizacion == false) {
|
|||
|
|
toastr.warning(" Estimado usuario, se ha detectado que las condiciones de la última cotización han cambiado.<br>Por favor realice nuevamente el cálculo de la cotización.");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
var SegurosCotizacion = []
|
|||
|
|
|
|||
|
|
if ($("#chk" + "SeguroVida").prop('checked'))
|
|||
|
|
{
|
|||
|
|
if ($("#txtSeguroVida").autoNumeric('get') != null && $("#txtSeguroVida").autoNumeric('get') != "") {
|
|||
|
|
SegurosCotizacion.push({
|
|||
|
|
IdCotizacion: $('#hiddensol_co_cotizacion').val(),
|
|||
|
|
IdRubroSeguro: $("#hidden" + "RubroSeguroVida").val(),
|
|||
|
|
Monto: $("#txtSeguroVida").autoNumeric('get'),
|
|||
|
|
IdAgenteSeguro: $("#hiddenAgenteSeguros").val()
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($("#chk" + "SeguroDesempleo").prop('checked'))
|
|||
|
|
{
|
|||
|
|
if ($("#txtSeguroDesempleo").autoNumeric('get') != null && $("#txtSeguroDesempleo").autoNumeric('get') != "") {
|
|||
|
|
SegurosCotizacion.push({
|
|||
|
|
IdCotizacion: $('#hiddensol_co_cotizacion').val(),
|
|||
|
|
IdRubroSeguro: $("#hidden" + "RubroSeguroDesempleo").val(),
|
|||
|
|
Monto: $("#txtSeguroDesempleo").autoNumeric('get'),
|
|||
|
|
IdAgenteSeguro: $("#hiddenAgenteSeguros").val()
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
if ($("#chk" + "SeguroAuto").prop('checked'))
|
|||
|
|
{
|
|||
|
|
if ($("#txtSeguroAuto").autoNumeric('get') != null && $("#txtSeguroAuto").autoNumeric('get') != "") {
|
|||
|
|
SegurosCotizacion.push({
|
|||
|
|
IdCotizacion: $('#hiddensol_co_cotizacion').val(),
|
|||
|
|
IdRubroSeguro: $("#hidden" + "RubroSeguroAuto").val(),
|
|||
|
|
Monto: $("#txtSeguroAuto").autoNumeric('get'),
|
|||
|
|
IdAgenteSeguro: $("#hiddenAgenteSeguros").val()
|
|||
|
|
|
|||
|
|
})
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
var _model = {
|
|||
|
|
IdCotizacion: $('#hiddensol_co_cotizacion').val(),
|
|||
|
|
Solicitud: {
|
|||
|
|
IdSolicitud: $("#hiddensol_co_solicitud").val(),
|
|||
|
|
Garantia: [{
|
|||
|
|
IdGarantia: null,
|
|||
|
|
IdSolicitud: $("#hiddensol_co_solicitud").val(),
|
|||
|
|
Chasis: $("#txtChasis").val(),
|
|||
|
|
Motor: $("#txtMotor").val(),
|
|||
|
|
Placa: $("#txtPlaca").val(),
|
|||
|
|
Color: $("#txtColor").val(),
|
|||
|
|
IdTipoTraccion: $("#hiddenTipoTraccion").val(),
|
|||
|
|
PesoNeto: $("#txtPesoNeto").autoNumeric('get'),
|
|||
|
|
IdTipoTransmision: $("#hiddenTipoTransmision").val(),
|
|||
|
|
Cilindrada: $("#txtCilindrada").autoNumeric('get'),
|
|||
|
|
NumCilindros: $("#txtNumCilindros").val(),
|
|||
|
|
IdTipoCombustible: $("#hiddenTipoCombustible").val(),
|
|||
|
|
Capacidad: $("#txtCapacidad").autoNumeric('get'),
|
|||
|
|
InscritoANombre: $("#txtInscritoANombre").val(),
|
|||
|
|
IdCategoriaVehiculo: $("#hiddenCategoriaVehiculo").val(),
|
|||
|
|
IdCarroceriaVehiculo: $("#hiddenCarroceriaVehiculo").val(),
|
|||
|
|
ConductorHabitual_IdTipoIdentificacion: obtener_tipo_identificacion("IdentificacionConductorHabitual"),
|
|||
|
|
ConductorHabitual_Identificacion: obtener_identificacion("IdentificacionConductorHabitual"),
|
|||
|
|
ConductorHabitual_Nombre: $("#txtNombreConductorHabitual").val(),
|
|||
|
|
//BMU 01-09-2016
|
|||
|
|
FechaVehiculoSaleAgencia: $('#txtFechaVehiculoSaleAgencia').val() == "" ? null : moment($('#txtFechaVehiculoSaleAgencia').val(), "DD/MM/YYYY").toJSON()
|
|||
|
|
}],
|
|||
|
|
Cotizacion: {
|
|||
|
|
IngresoMinReqCol: $("#hiddenIngresoMinReqCol").val(),
|
|||
|
|
IngresoMInReqDol: $("#hiddenIngresoMInReqDol").val(),
|
|||
|
|
MontoComision: $("#hiddenMontoComision").val(),
|
|||
|
|
MontoConstitucionPrenda: $("#hiddenMontoConstitucionPrenda").val(),
|
|||
|
|
MontoPrestamo: $("#txtMonto").autoNumeric('get'),
|
|||
|
|
MontoPrestamoSinSeguros: $("#txtMontoCreditoSinSeguros").autoNumeric('get'),
|
|||
|
|
MontoDesembolso: $("#hiddenMontoDesembolso").val(),
|
|||
|
|
MontoTraspaso: $("#hiddenMontoTraspaso").val(),
|
|||
|
|
TipoCambio: $("#hiddenTipoCambio").val(),
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
SegurosCotizacion: SegurosCotizacion
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var uri = 'api/SegurosAPI/GuardarDatos/';
|
|||
|
|
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.CodigoRespuesta == "EXITOSO") {
|
|||
|
|
toastr.info('Información guardada con exito', 'Completado');
|
|||
|
|
if ($("#hiddenFlagSalir").val() == "true") { $("#hiddenFlagGuardarDatos").val("true"); }
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado al guardar el formulario. Vuelva a intentarlo.");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}).fail(function (jqxhr, textStatus, error) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo.");
|
|||
|
|
ENDREQUEST();
|
|||
|
|
}).then(function (value) {
|
|||
|
|
if (enviar)
|
|||
|
|
Enviar();
|
|||
|
|
else
|
|||
|
|
ENDREQUEST();
|
|||
|
|
});
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado a intentar invocar el metodo de guardado del formulario. Vuelva a intentarlo mas tarde", Message_Error);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.SoloLectura = function () {
|
|||
|
|
|
|||
|
|
try {
|
|||
|
|
|
|||
|
|
if ($("#hiddenTaskStatus").val() == 1) {
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
FormReadOnly();
|
|||
|
|
|
|||
|
|
$("button[direccion_api]").remove();
|
|||
|
|
$("#btnGuardar").remove();
|
|||
|
|
$("#btnCotizar").remove();
|
|||
|
|
$("#btnEnviar").remove();
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#btnGuardarBitacoraComentario").remove();
|
|||
|
|
|
|||
|
|
IsReadOnlyForm = true;
|
|||
|
|
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un problema al cargar el formulario. Vuela a intentarlo mas tarde", Message_Error);
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
this.Cotizar = function (modoCalculo) {
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
if (!$("#formSeguros").valid()) {
|
|||
|
|
toastr.warning("Ingresar todos los campos que son requeridos.");
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//#region Arma el objeto de seguros a enviar a cotizar
|
|||
|
|
var listaRubros = [];
|
|||
|
|
|
|||
|
|
if ($("#chk" + "SeguroAuto").prop('checked')) {
|
|||
|
|
var oTipoRubroSeguro = {
|
|||
|
|
IdTipoRubroSeguro: 3,
|
|||
|
|
IdRubroSeguro: $("#hidden" + "RubroSeguroAuto").val(),
|
|||
|
|
Descripcion: "AUTO",
|
|||
|
|
RubroSeguro: [{
|
|||
|
|
SegurosCotizacion: [{
|
|||
|
|
Monto: parseFloat($("#txtSeguroAuto").autoNumeric('get'))
|
|||
|
|
}]
|
|||
|
|
}]
|
|||
|
|
};
|
|||
|
|
listaRubros.push(oTipoRubroSeguro);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($("#chk" + "SeguroDesempleo").prop('checked')) {
|
|||
|
|
oTipoRubroSeguro = {
|
|||
|
|
IdTipoRubroSeguro: 2,
|
|||
|
|
IdRubroSeguro: $("#hidden" + "RubroSeguroDesempleo").val(),
|
|||
|
|
Descripcion: "DESEMPLEO",
|
|||
|
|
RubroSeguro: [{
|
|||
|
|
SegurosCotizacion: [{
|
|||
|
|
Monto: parseFloat($("#txtSeguroDesempleo").autoNumeric('get'))
|
|||
|
|
}]
|
|||
|
|
}]
|
|||
|
|
};
|
|||
|
|
listaRubros.push(oTipoRubroSeguro);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if ($("#chk" + "SeguroVida").prop('checked')) {
|
|||
|
|
oTipoRubroSeguro = {
|
|||
|
|
IdTipoRubroSeguro: 1,
|
|||
|
|
IdRubroSeguro: $("#hidden" + "RubroSeguroVida").val(),
|
|||
|
|
Descripcion: "VIDA",
|
|||
|
|
RubroSeguro: [{
|
|||
|
|
SegurosCotizacion: [{
|
|||
|
|
Monto: parseFloat($("#txtSeguroVida").autoNumeric('get'))
|
|||
|
|
}]
|
|||
|
|
}]
|
|||
|
|
};
|
|||
|
|
listaRubros.push(oTipoRubroSeguro);
|
|||
|
|
}
|
|||
|
|
//#endregion
|
|||
|
|
|
|||
|
|
var _esSeguroAutoManual = false;
|
|||
|
|
var _esSeguroVidaManual = false;
|
|||
|
|
var _esSeguroDesempleoManual = false;
|
|||
|
|
|
|||
|
|
_esSeguroAutoManual = $("#hiddenFlagEsSeguroAutoManual").val();
|
|||
|
|
_esSeguroVidaManual = $("#hiddenFlagEsSeguroVidaManual").val();
|
|||
|
|
_esSeguroDesempleoManual = $("#hiddenFlagEsSeguroDesempleoManual").val();
|
|||
|
|
|
|||
|
|
|
|||
|
|
for (var i = 0; i < ModeCotizacion.length; i++) {
|
|||
|
|
switch (ModeCotizacion[i]) {
|
|||
|
|
case 1:
|
|||
|
|
_esSeguroAutoManual = true;
|
|||
|
|
break;
|
|||
|
|
case 2:
|
|||
|
|
_esSeguroVidaManual = true;
|
|||
|
|
break;
|
|||
|
|
case 3:
|
|||
|
|
_esSeguroDesempleoManual = true;
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (_esSeguroAutoManual === undefined || _esSeguroAutoManual === null || _esSeguroAutoManual === "") { _esSeguroAutoManual = false; }
|
|||
|
|
if (_esSeguroVidaManual === undefined || _esSeguroVidaManual === null || _esSeguroVidaManual === "") { _esSeguroVidaManual = false; }
|
|||
|
|
if (_esSeguroDesempleoManual === undefined || _esSeguroDesempleoManual === null || _esSeguroDesempleoManual === "") { _esSeguroDesempleoManual = false; }
|
|||
|
|
|
|||
|
|
|
|||
|
|
//#region JsonCotizacionRequest
|
|||
|
|
JsonCotizacionRequest = {
|
|||
|
|
IdCotizacion: $("#hiddensol_co_cotizacion").val(),
|
|||
|
|
Rubros: listaRubros,
|
|||
|
|
EsSeguroAutoManual: _esSeguroAutoManual,
|
|||
|
|
EsSeguroVidaManual: _esSeguroVidaManual,
|
|||
|
|
EsSeguroDesempleoManual: _esSeguroDesempleoManual
|
|||
|
|
};
|
|||
|
|
//#endregion
|
|||
|
|
|
|||
|
|
var uri = 'api/CotizacionAPI/ObtenerCotizacionCambiandoMontosSeguros/';
|
|||
|
|
var DTO = JSON.stringify(JsonCotizacionRequest);
|
|||
|
|
|
|||
|
|
$("button[type=button]").attr("disabled", true);
|
|||
|
|
$.ajax({
|
|||
|
|
type: 'POST',
|
|||
|
|
url: server + uri,
|
|||
|
|
cache: false,
|
|||
|
|
data: DTO,
|
|||
|
|
contentType: 'application/json; charset=utf-8',
|
|||
|
|
dataType: 'json',
|
|||
|
|
success: function (data) {
|
|||
|
|
if (data.CodigoRespuesta == "EXITOSO") {
|
|||
|
|
JsonCotizacionResponse = data;
|
|||
|
|
|
|||
|
|
$("#hiddenIngresoMinReqCol").val(ToMoney(JsonCotizacionResponse.IngresogReqCol));
|
|||
|
|
$("#hiddenIngresoMInReqDol").val(ToMoney(JsonCotizacionResponse.IngresogReqDol));
|
|||
|
|
$("#hiddenMontoComision").val(ToMoney(JsonCotizacionResponse.MontoComision));
|
|||
|
|
$("#hiddenMontoConstitucionPrenda").val(ToMoney(JsonCotizacionResponse.MontoConstitucionPrenda));
|
|||
|
|
$("#txtMonto").val(ToMoney(JsonCotizacionResponse.MontoCredito));
|
|||
|
|
$("#txtMontoCreditoSinSeguros").val(ToMoney(JsonCotizacionResponse.MontoCreditoSinSeguros));
|
|||
|
|
|
|||
|
|
$("#hiddenMontoDesembolso").val(ToMoney(JsonCotizacionResponse.MontoDesembolso));
|
|||
|
|
$("#hiddenMontoTraspaso").val(ToMoney(JsonCotizacionResponse.MontoTraspaso));
|
|||
|
|
$("#hiddenTipoCambio").val(JsonCotizacionResponse.TipoCambio);
|
|||
|
|
$("#txtTasaInteres").val(JsonCotizacionResponse.EnunciadoCondiciones);
|
|||
|
|
|
|||
|
|
$.each(JsonCotizacionResponse.SegurosEnCotizacion, function (key, item) {
|
|||
|
|
|
|||
|
|
switch (item.RubroSeguro.TipoRubroSeguro.Descripcion.toUpperCase()) {
|
|||
|
|
case "AUTO":
|
|||
|
|
$("#txtSeguroAuto").val(ToMoney(item.Monto));
|
|||
|
|
break;
|
|||
|
|
case "DESEMPLEO":
|
|||
|
|
$("#txtSeguroDesempleo").val(ToMoney(item.Monto));
|
|||
|
|
break;
|
|||
|
|
case "VIDA":
|
|||
|
|
$("#txtSeguroVida").val(ToMoney(item.Monto));
|
|||
|
|
default:
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#btnCotizar").attr("disabled", true);
|
|||
|
|
IsLoadedCotizacion = true;
|
|||
|
|
ModeCotizacion = [];
|
|||
|
|
|
|||
|
|
guardar();
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
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) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
|||
|
|
}).then(function (value) {
|
|||
|
|
ENDREQUEST();
|
|||
|
|
$("button[type=button]").attr("disabled", false);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado al intentar invocar el metodo de cotizacion. Vuelva a intentarlo mas tarde", Message_Error);
|
|||
|
|
ENDREQUEST();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#chkPolizasAdicionales").change(function () {
|
|||
|
|
var requeridoVida = $("#hiddenRequeridoSeguroVida").val();
|
|||
|
|
if (requeridoVida == "false") {
|
|||
|
|
if (!$('#chkSeguroVida').checked && $("#txtSeguroVida").autoNumeric('get') != 0) {
|
|||
|
|
toastr.warning("No se puede deshabilitar el seguro de vida si no es 0", Message_Warning);
|
|||
|
|
this.checked = true;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
var requeridoDesempleo = $("#hiddenRequeridoSeguroDesempleo").val();
|
|||
|
|
if (requeridoDesempleo == "false") {
|
|||
|
|
if (!$('#chkSeguroDesempleo').checked && $("#txtSeguroDesempleo").autoNumeric('get') != 0) {
|
|||
|
|
toastr.warning("No se puede deshabilitar el seguro de desempleo si no es 0", Message_Warning);
|
|||
|
|
this.checked = true;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
var requeridoAuto = $("#hiddenRequeridoSeguroAuto").val();
|
|||
|
|
if (requeridoAuto == "false") {
|
|||
|
|
if (!$('#chkSeguroAuto').checked && $("#txtSeguroAuto").autoNumeric('get') != 0) {
|
|||
|
|
toastr.warning("No se puede deshabilitar el seguro de auto si no es 0", Message_Warning);
|
|||
|
|
this.checked = true;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
LlenarSeguros(false, false, false);
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#chkSeguroVida').change(function () {
|
|||
|
|
try {
|
|||
|
|
if (!this.checked && $("#txtSeguroVida").autoNumeric('get') != 0) {
|
|||
|
|
toastr.warning("No se puede deshabilitar el seguro de vida si no es 0", Message_Warning);
|
|||
|
|
this.checked = true;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
var SeguroVida = this.checked;
|
|||
|
|
LlenarSeguros(SeguroVida, null, null);
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#chkSeguroDesempleo').change(function () {
|
|||
|
|
try {
|
|||
|
|
if (!this.checked && $("#txtSeguroDesempleo").autoNumeric('get') != 0) {
|
|||
|
|
toastr.warning("No se puede deshabilitar el seguro de desempleo si no es 0", Message_Warning);
|
|||
|
|
this.checked = true;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
var SeguroDesempleo = this.checked;
|
|||
|
|
LlenarSeguros(null, SeguroDesempleo, null);
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#chkSeguroAuto').change(function () {
|
|||
|
|
try {
|
|||
|
|
if (!this.checked && $("#txtSeguroAuto").autoNumeric('get') != 0) {
|
|||
|
|
toastr.warning("No se puede deshabilitar el seguro de auto si no es 0", Message_Warning);
|
|||
|
|
this.checked = true;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
var SeguroAuto = this.checked;
|
|||
|
|
LlenarSeguros(null, null, SeguroAuto);
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado. Vuelva a intentarlo mas tarde", Message_Error);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
this.CheckAdicionales = function () {
|
|||
|
|
var totAdicionales = 0;
|
|||
|
|
var totAdicionalesNoChecked = 0;
|
|||
|
|
if ($("#hiddenRequeridoSeguroVida").val() == "false") {
|
|||
|
|
totAdicionales += 1;
|
|||
|
|
if ($("#chk" + "SeguroVida").prop("checked") == false) {
|
|||
|
|
totAdicionalesNoChecked += 1;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if ($("#hiddenRequeridoSeguroDesempleo").val() == "false") {
|
|||
|
|
totAdicionales += 1;
|
|||
|
|
if ($("#chk" + "SeguroDesempleo").prop("checked") == false) {
|
|||
|
|
totAdicionalesNoChecked += 1;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if ($("#hiddenRequeridoSeguroAuto").val() == "false") {
|
|||
|
|
totAdicionales += 1;
|
|||
|
|
if ($("#chk" + "SeguroAuto").prop("checked") == false) {
|
|||
|
|
totAdicionalesNoChecked += 1;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if (totAdicionales == totAdicionalesNoChecked && $("#chk" + "PolizasAdicionales").prop("checked") == true) {
|
|||
|
|
$("#chk" + "PolizasAdicionales").attr('checked', false);
|
|||
|
|
if ($("#hiddenRequeridoSeguroVida").val() == "false")
|
|||
|
|
$("#chk" + "SeguroVida").attr("disabled", true);
|
|||
|
|
if ($("#hiddenRequeridoSeguroDesempleo").val() == "false")
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("disabled", true);
|
|||
|
|
if ($("#hiddenRequeridoSeguroAuto").val() == "false")
|
|||
|
|
$("#chk" + "SeguroAuto").attr("disabled", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
this.LlenarSeguros = function (SeguroVida, SeguroDesempleo, SeguroAuto) {
|
|||
|
|
var PolizasAdicionales = $("#chk" + "PolizasAdicionales").prop('checked');
|
|||
|
|
|
|||
|
|
//#region SeguroVida
|
|||
|
|
if (SeguroVida != null) {
|
|||
|
|
var requerido = $("#hiddenRequeridoSeguroVida").val();
|
|||
|
|
if (requerido == "true") {
|
|||
|
|
if ($("#hidden" + "RubroSeguroVida").val() == "") {
|
|||
|
|
$("#chk" + "SeguroVida").attr("disabled", true);
|
|||
|
|
$("#chk" + "SeguroVida").attr("checked", true);
|
|||
|
|
$("#btn" + "RubroSeguroVida").attr("disabled", false);
|
|||
|
|
|
|||
|
|
if (idMoneda == DefaultLimiteCreditoIdMoneda && montoCredito >= DefaultLimiteCredito) {
|
|||
|
|
$("#hidden" + "RubroSeguroVida").val($('#hiddenDefaultLimiteCreditoIdRubroVida').val());
|
|||
|
|
$("#txt" + "RubroSeguroVida").val($('#hiddenDefaultLimiteCreditoDescRubroVida').val());
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#hidden" + "RubroSeguroVida").val($("#hiddenDefaultSeguroVidaId").val());
|
|||
|
|
$("#txt" + "RubroSeguroVida").val($("#hiddenDefaultSeguroVidaDesc").val());
|
|||
|
|
}
|
|||
|
|
$("#txt" + "RubroSeguroVida").attr("required", true);
|
|||
|
|
$("#txtSeguroVida").attr("disabled", false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
if (PolizasAdicionales) {
|
|||
|
|
$("#chk" + "SeguroVida").attr("disabled", false);
|
|||
|
|
$("#chk" + "SeguroVida").attr("checked", SeguroVida);
|
|||
|
|
$("#btn" + "RubroSeguroVida").attr("disabled", !SeguroVida);
|
|||
|
|
if (SeguroVida) {
|
|||
|
|
if (idMoneda == DefaultLimiteCreditoIdMoneda && montoCredito >= DefaultLimiteCredito) {
|
|||
|
|
$("#hidden" + "RubroSeguroVida").val($('#hiddenDefaultLimiteCreditoIdRubroVida').val());
|
|||
|
|
$("#txt" + "RubroSeguroVida").val($('#hiddenDefaultLimiteCreditoDescRubroVida').val());
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#hidden" + "RubroSeguroVida").val($("#hiddenDefaultSeguroVidaId").val());
|
|||
|
|
$("#txt" + "RubroSeguroVida").val($("#hiddenDefaultSeguroVidaDesc").val());
|
|||
|
|
}
|
|||
|
|
$("#txt" + "RubroSeguroVida").attr("required", true);
|
|||
|
|
$("#txtSeguroVida").attr("disabled", false);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#hidden" + "RubroSeguroVida").val("");
|
|||
|
|
$("#txt" + "RubroSeguroVida").val("");
|
|||
|
|
$("#txt" + "RubroSeguroVida").attr("required", false);
|
|||
|
|
//$("#txtSeguroVida").autoNumeric('set', 0);
|
|||
|
|
$("#txtSeguroVida").attr("disabled", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#chk" + "SeguroVida").attr("disabled", true);
|
|||
|
|
$("#chk" + "SeguroVida").attr("checked", false);
|
|||
|
|
$("#btn" + "RubroSeguroVida").attr("disabled", true);
|
|||
|
|
$("#hidden" + "RubroSeguroVida").val("");
|
|||
|
|
$("#txt" + "RubroSeguroVida").val("");
|
|||
|
|
$("#txt" + "RubroSeguroVida").attr("required", false);
|
|||
|
|
//$("#txtSeguroVida").autoNumeric('set', 0);
|
|||
|
|
$("#txtSeguroVida").attr("disabled", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//#endregion
|
|||
|
|
|
|||
|
|
//#region SeguroDesempleo
|
|||
|
|
if (SeguroDesempleo != null) {
|
|||
|
|
var requerido = $("#hiddenRequeridoSeguroDesempleo").val();
|
|||
|
|
if (requerido == "true") {
|
|||
|
|
if ($("#hidden" + "RubroSeguroDesempleo").val() == "") {
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("disabled", true);
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("checked", true);
|
|||
|
|
$("#btn" + "RubroSeguroDesempleo").attr("disabled", false);
|
|||
|
|
if (idMoneda == DefaultLimiteCreditoIdMoneda && montoCredito >= DefaultLimiteCredito) {
|
|||
|
|
$("#hidden" + "RubroSeguroDesempleo").val($('#hiddenDefaultLimiteCreditoIdRubroDesempleo').val());
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").val($('#hiddenDefaultLimiteCreditoDescRubroDesempleo').val());
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#hidden" + "RubroSeguroDesempleo").val($("#hiddenDefaultSeguroDesempleoId").val());
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").val($("#hiddenDefaultSeguroDesempleoDesc").val());
|
|||
|
|
}
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").attr("required", true);
|
|||
|
|
$("#txtSeguroDesempleo").attr("disabled", false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
if (PolizasAdicionales) {
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("disabled", false);
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("checked", SeguroDesempleo);
|
|||
|
|
$("#btn" + "RubroSeguroDesempleo").attr("disabled", !SeguroDesempleo);
|
|||
|
|
if (SeguroDesempleo) {
|
|||
|
|
if (idMoneda == DefaultLimiteCreditoIdMoneda && montoCredito >= DefaultLimiteCredito) {
|
|||
|
|
$("#hidden" + "RubroSeguroDesempleo").val($('#hiddenDefaultLimiteCreditoIdRubroDesempleo').val());
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").val($('#hiddenDefaultLimiteCreditoDescRubroDesempleo').val());
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#hidden" + "RubroSeguroDesempleo").val($("#hiddenDefaultSeguroDesempleoId").val());
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").val($("#hiddenDefaultSeguroDesempleoDesc").val());
|
|||
|
|
}
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").attr("required", true);
|
|||
|
|
$("#txtSeguroDesempleo").attr("disabled", false);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#hidden" + "RubroSeguroDesempleo").val("");
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").val("");
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").attr("required", false);
|
|||
|
|
//$("#txtSeguroDesempleo").autoNumeric('set', 0);
|
|||
|
|
$("#txtSeguroDesempleo").attr("disabled", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("disabled", true);
|
|||
|
|
$("#chk" + "SeguroDesempleo").attr("checked", false);
|
|||
|
|
$("#btn" + "RubroSeguroDesempleo").attr("disabled", true);
|
|||
|
|
$("#hidden" + "RubroSeguroDesempleo").val("");
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").val("");
|
|||
|
|
$("#txt" + "RubroSeguroDesempleo").attr("required", false);
|
|||
|
|
//$("#txtSeguroDesempleo").autoNumeric('set', 0);
|
|||
|
|
$("#txtSeguroDesempleo").attr("disabled", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//#endregion
|
|||
|
|
|
|||
|
|
//#region SeguroAuto
|
|||
|
|
if (SeguroAuto != null) {
|
|||
|
|
var requerido = $("#hiddenRequeridoSeguroAuto").val();
|
|||
|
|
if (requerido == "true") {
|
|||
|
|
if ($("#hidden" + "RubroSeguroAuto").val() == "") {
|
|||
|
|
$("#chk" + "SeguroAuto").attr("disabled", true);
|
|||
|
|
$("#chk" + "SeguroAuto").attr("checked", true);
|
|||
|
|
$("#btn" + "RubroSeguroAuto").attr("disabled", false);
|
|||
|
|
$("#hidden" + "RubroSeguroAuto").val($("#hiddenDefaultSeguroAutoId").val());
|
|||
|
|
$("#txt" + "RubroSeguroAuto").val($("#hiddenDefaultSeguroAutoDesc").val());
|
|||
|
|
$("#txt" + "RubroSeguroAuto").attr("required", true);
|
|||
|
|
$("#txtSeguroAuto").attr("disabled", false);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
if (PolizasAdicionales) {
|
|||
|
|
$("#chk" + "SeguroAuto").attr("disabled", false);
|
|||
|
|
$("#chk" + "SeguroAuto").attr("checked", SeguroAuto);
|
|||
|
|
$("#btn" + "RubroSeguroAuto").attr("disabled", !SeguroAuto);
|
|||
|
|
if (SeguroAuto) {
|
|||
|
|
$("#hidden" + "RubroSeguroAuto").val($("#hiddenDefaultSeguroAutoId").val());
|
|||
|
|
$("#txt" + "RubroSeguroAuto").val($("#hiddenDefaultSeguroAutoDesc").val());
|
|||
|
|
$("#txt" + "RubroSeguroAuto").attr("required", true);
|
|||
|
|
$("#txtSeguroAuto").attr("disabled", false);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#hidden" + "RubroSeguroAuto").val("");
|
|||
|
|
$("#txt" + "RubroSeguroAuto").val("");
|
|||
|
|
$("#txt" + "RubroSeguroAuto").attr("required", false);
|
|||
|
|
//$("#txtSeguroAuto").autoNumeric('set', 0);
|
|||
|
|
$("#txtSeguroAuto").attr("disabled", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$("#chk" + "SeguroAuto").attr("disabled", true);
|
|||
|
|
$("#chk" + "SeguroAuto").attr("checked", false);
|
|||
|
|
$("#btn" + "RubroSeguroAuto").attr("disabled", true);
|
|||
|
|
$("#hidden" + "RubroSeguroAuto").val("");
|
|||
|
|
$("#txt" + "RubroSeguroAuto").val("");
|
|||
|
|
$("#txt" + "RubroSeguroAuto").attr("required", false);
|
|||
|
|
//$("#txtSeguroAuto").autoNumeric('set', 0);
|
|||
|
|
$("#txtSeguroAuto").attr("disabled", true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
//#endregion
|
|||
|
|
|
|||
|
|
$("#formSeguros").valid();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
this.CargarDataCatalogoAdicional = function (control) {
|
|||
|
|
var uri = "";
|
|||
|
|
|
|||
|
|
try {
|
|||
|
|
|
|||
|
|
var controlsCalculo = ["RubroSeguroVida", "RubroSeguroDesempleo", "RubroSeguroAuto", "CarroceriaVehiculo", "PlazoMeses"];
|
|||
|
|
|
|||
|
|
if (jQuery.inArray(control, controlsCalculo) !== -1) {
|
|||
|
|
|
|||
|
|
//Indica que las condiciones de la cotizacion estan siendo elegidas/modificadas por el usuario
|
|||
|
|
$("#btnCotizar").attr("disabled", false);
|
|||
|
|
IsLoadedCotizacion = false;
|
|||
|
|
}
|
|||
|
|
} catch (e) {
|
|||
|
|
toastr.error("Ha ocurrido un error inesperado al intentar cotizar el prestamo. Vuelva a intentarlo mas tarde", Message_Error);
|
|||
|
|
}
|
|||
|
|
}
|