53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
|
|
$("#formResultadoCotizacion").EnableValidationToolTip();
|
|||
|
|
var tableItemsPlanPago;
|
|||
|
|
|
|||
|
|
//#region READY
|
|||
|
|
|
|||
|
|
jQuery(document).ready(function () {
|
|||
|
|
|
|||
|
|
tableItemsCondicionesTasa = $('#tableItemsPlanPago').DataTable();
|
|||
|
|
|
|||
|
|
|
|||
|
|
if (jQuery.isEmptyObject(JsonCotizacionResponse))
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
$("#btnImprimir").click(function () {
|
|||
|
|
var id = $("#txtCotizacion").val();
|
|||
|
|
var colaborador = $("#ddlColaborador").val();
|
|||
|
|
var tipoVehiculo = $("#ddlTipoVehiculo").val();
|
|||
|
|
|
|||
|
|
var uri = format("api/DocumentosAPI/ImprimirCotizacion?id={0}&colaborador={1}&tipoVehiculo={2}", id, colaborador, tipoVehiculo);
|
|||
|
|
$.getJSON(server + uri).done(function (data) {
|
|||
|
|
if (data != null) {
|
|||
|
|
window.open(data.url);
|
|||
|
|
}
|
|||
|
|
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) {
|
|||
|
|
if (typeof getDataModel !== 'undefined' && $.isFunction(getDataModel)) {
|
|||
|
|
if (DataModel == true) {
|
|||
|
|
getDataModel();
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
ENDREQUEST();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
ENDREQUEST();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//#endregion
|