Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function realizarAsignacionTraslado(NumeroDocumento, Monto, Tipo_Prestamo, NumeroPrestamo, Cod_Fiador){
- return new Promise((res, rej) => {
- axios({
- method: 'POST',
- url: `https://URL/metodo?NumeroDocumento=${NumeroDocumento}&Monto=${Monto}&Tipo_Prestamo=${Tipo_Prestamo}&NumeroPrestamo=${NumeroPrestamo}&Cod_Fiador=${Cod_Fiador}`,
- headers: {
- Authorization: token_type + " " + access_token
- }
- })
- .then(function (response) {
- console.log(response);
- myApp.hideIndicator();
- }).catch(function (error) {
- console.log(error);
- myApp.hideIndicator();
- });
- })
- }
- $('#btn-realizar-pago').on('click', function(e){
- console.log("REALIZANDO EL PAGO");
- if (JSON.stringify(prestamo_seleccionado)=='{}') {
- console.log('vacio');
- $.each(asignacion_credito, function(index, value){
- console.log(value);
- if (value.NumeroPrestamo === ""){
- realizarAsignacionTraslado(value.NumeroDocumento, parseFloat(value.Monto), value.Tipo_Prestamo,"",value.Cod_fiador);
- }
- });
- }
- else{
- console.log("Existe prestamo selecionado: ");
- console.log(prestamo_seleccionado);
- }
- $('.cantidad').val("");
- asignacion_credito = [];
- e.preventDefault();
- });
Add Comment
Please, Sign In to add comment