Commit ffa8f9cf0be7d610575eee3901175891749ea3ee

Authored by Eric Fernandez
1 parent a44016dcef
Exists in master

avances

Showing 1 changed file with 24 additions and 12 deletions   Show diff stats
src/js/controller.js
... ... @@ -54,18 +54,30 @@ angular.module('focaHojaRuta')
54 54 size: 'lg'
55 55 }
56 56 );
57   - modalInstance.result.then(function(remito) {
58   - // Al guardar los datos del producto entregado logueamos la
59   - // actividad para su seguimiento.
60   - console.log(remito);
61   - focaSeguimientoService.guardarPosicion(
62   - 'Entrega de producto',
63   - remito.id,
64   - remito.observaciones
65   - );
66   - //hojaRutaService.postMovimientoHojaRuta(remito).then(function(movimiento){
67   - // focaModalService.alert('descarga realizada con éxito');
68   - // });
  57 + modalInstance.result.then(function(detalle) {
  58 + console.log(detalle);
  59 + /*Al guardar los datos del producto entregado logueamos la
  60 + actividad para su seguimiento.
  61 +
  62 + hojaRutaService.postMovimientoHojaRuta(detalle).then(function(movimiento) {
  63 + console.log(detalle) ;
  64 + });
  65 + var promesaSeguimiento = focaSeguimientoService.posicionCallBack(success);
  66 + function success(posicion) {
  67 + var nuevaPosicion = {
  68 + posicion: {
  69 + latitud: posicion.coords.latitude,
  70 + longitud: posicion.coords.longitude,
  71 + idComprobante: detalle.idRemito,
  72 + actividad: 'Entrega de producto',
  73 + observaciones: detalle.observaciones
  74 + }
  75 + };
  76 + focaSeguimientoService.nuevaPosicion(nuevaPosicion).then(successMark);
  77 + }
  78 + function successMark(seguimiento) {
  79 + console.log(seguimiento);
  80 + }*/
69 81 });
70 82 };
71 83