Guest User

Untitled

a guest
Nov 20th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. function realizarAsignacionTraslado(NumeroDocumento, Monto, Tipo_Prestamo, NumeroPrestamo, Cod_Fiador){
  2. return new Promise((res, rej) => {
  3. axios({
  4. method: 'POST',
  5. url: `https://URL/metodo?NumeroDocumento=${NumeroDocumento}&Monto=${Monto}&Tipo_Prestamo=${Tipo_Prestamo}&NumeroPrestamo=${NumeroPrestamo}&Cod_Fiador=${Cod_Fiador}`,
  6. headers: {
  7. Authorization: token_type + " " + access_token
  8. }
  9. })
  10. .then(function (response) {
  11. console.log(response);
  12. myApp.hideIndicator();
  13. }).catch(function (error) {
  14. console.log(error);
  15. myApp.hideIndicator();
  16. });
  17. })
  18. }
  19.  
  20. $('#btn-realizar-pago').on('click', function(e){
  21. console.log("REALIZANDO EL PAGO");
  22. if (JSON.stringify(prestamo_seleccionado)=='{}') {
  23. console.log('vacio');
  24. $.each(asignacion_credito, function(index, value){
  25. console.log(value);
  26. if (value.NumeroPrestamo === ""){
  27. realizarAsignacionTraslado(value.NumeroDocumento, parseFloat(value.Monto), value.Tipo_Prestamo,"",value.Cod_fiador);
  28. }
  29. });
  30. }
  31. else{
  32. console.log("Existe prestamo selecionado: ");
  33. console.log(prestamo_seleccionado);
  34. }
  35. $('.cantidad').val("");
  36. asignacion_credito = [];
  37. e.preventDefault();
  38. });
Add Comment
Please, Sign In to add comment