diff --git a/src/js/controller.js b/src/js/controller.js index 6c34364..14ba00b 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -5,7 +5,6 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo focaModalService, focaBotoneraLateralService, $interval ) { $scope.actividad = 'Logistica'; - //Datos Pantalla $scope.titulo = 'Logistica de Pedidos'; var transportista = { @@ -52,7 +51,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo }else { idRemito = JSON.parse(punto).notaPedido.remito.id; } - var modalInstance = $uibModal.open( + $uibModal.open( { ariaLabelledBy: 'Busqueda de Vehiculo', templateUrl: 'foca-detalle-vehiculo.html', @@ -65,9 +64,6 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo } } ); - modalInstance.result.then(function() { - }, function() { - }); }; $scope.quitarVehiculo = function(vehiculo) { diff --git a/src/js/osm-directive.js b/src/js/osm-directive.js index 5a5dd80..0d5a192 100644 --- a/src/js/osm-directive.js +++ b/src/js/osm-directive.js @@ -8,8 +8,28 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() scope.map = L.map(contenedor).setView([attrs.latitud, attrs.longitud], attrs.zoom); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(scope.map); }, - controller: ['$scope', '$filter', function($scope, $filter) { + controller: ['$scope', '$filter', '$compile', 'focaModalService', + function($scope, $filter, $compile, focaModalService) { $scope.markers = []; + $scope.verProductos = function(id) { + var parametrosModal = { + titulo: 'Productos', + query: '/articulos/remito/' + id, + soloMostrar: true, + size: 'md', + columnas: [ + { + nombre: 'Producto', + propiedad: 'descripcion' + }, + { + nombre: 'Cantidad', + propiedad: 'cantidad' + } + ] + }; + focaModalService.modal(parametrosModal).then(); + }; $scope.$watch('marcadores', function() { for(var i in $scope.markers) { $scope.map.removeLayer($scope.markers[i]); @@ -32,11 +52,9 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() marcador.notaPedido.remito.numeroRemito ]) + '
'; observacion += 'Cliente: ' + - marcador.notaPedido.cliente.NOM + '
'; + marcador.notaPedido.cliente.NOM; // if($scope.parametros.individual) { - observacion += - 'Total: ' + $filter('currency')(marcador.notaPedido.remito.total, '$'); observacion = 'Orden: ' + marcador.orden + '
' + observacion; if(marcador.distancia) { @@ -71,6 +89,11 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() observacion += '(Arrastrar icono)'; + observacion += ''; //Sin asignar VERDE icon = new L.Icon({ @@ -82,11 +105,16 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() shadowSize: [41, 41] }); } + + //COMPILO HTML PARA QUE FUNCIONE BOTON EN POPUP + observacion = '
' + observacion + '
'; + var compiledHtml = $compile(angular.element(observacion))($scope); + $scope.markers.push( L.marker( [marcador.latitud, marcador.longitud], {icon: icon}) .addTo($scope.map) - .bindPopup(observacion) + .bindPopup(compiledHtml[0]) .bindTooltip('Haga click para seleccionar') ); //abre marcador del primer punto