Commit 47b0b44a4aafd560084dc0b9c007fa65b123b98e
1 parent
8fd2c4e9bd
Exists in
master
boton ver productos en popup, fuera total
Showing
2 changed files
with
34 additions
and
10 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -5,7 +5,6 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
| 5 | 5 | focaModalService, focaBotoneraLateralService, $interval |
| 6 | 6 | ) { |
| 7 | 7 | $scope.actividad = 'Logistica'; |
| 8 | - | |
| 9 | 8 | //Datos Pantalla |
| 10 | 9 | $scope.titulo = 'Logistica de Pedidos'; |
| 11 | 10 | var transportista = { |
| ... | ... | @@ -52,7 +51,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
| 52 | 51 | }else { |
| 53 | 52 | idRemito = JSON.parse(punto).notaPedido.remito.id; |
| 54 | 53 | } |
| 55 | - var modalInstance = $uibModal.open( | |
| 54 | + $uibModal.open( | |
| 56 | 55 | { |
| 57 | 56 | ariaLabelledBy: 'Busqueda de Vehiculo', |
| 58 | 57 | templateUrl: 'foca-detalle-vehiculo.html', |
| ... | ... | @@ -65,9 +64,6 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo |
| 65 | 64 | } |
| 66 | 65 | } |
| 67 | 66 | ); |
| 68 | - modalInstance.result.then(function() { | |
| 69 | - }, function() { | |
| 70 | - }); | |
| 71 | 67 | }; |
| 72 | 68 | |
| 73 | 69 | $scope.quitarVehiculo = function(vehiculo) { |
src/js/osm-directive.js
| ... | ... | @@ -8,8 +8,28 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() |
| 8 | 8 | scope.map = L.map(contenedor).setView([attrs.latitud, attrs.longitud], attrs.zoom); |
| 9 | 9 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(scope.map); |
| 10 | 10 | }, |
| 11 | - controller: ['$scope', '$filter', function($scope, $filter) { | |
| 11 | + controller: ['$scope', '$filter', '$compile', 'focaModalService', | |
| 12 | + function($scope, $filter, $compile, focaModalService) { | |
| 12 | 13 | $scope.markers = []; |
| 14 | + $scope.verProductos = function(id) { | |
| 15 | + var parametrosModal = { | |
| 16 | + titulo: 'Productos', | |
| 17 | + query: '/articulos/remito/' + id, | |
| 18 | + soloMostrar: true, | |
| 19 | + size: 'md', | |
| 20 | + columnas: [ | |
| 21 | + { | |
| 22 | + nombre: 'Producto', | |
| 23 | + propiedad: 'descripcion' | |
| 24 | + }, | |
| 25 | + { | |
| 26 | + nombre: 'Cantidad', | |
| 27 | + propiedad: 'cantidad' | |
| 28 | + } | |
| 29 | + ] | |
| 30 | + }; | |
| 31 | + focaModalService.modal(parametrosModal).then(); | |
| 32 | + }; | |
| 13 | 33 | $scope.$watch('marcadores', function() { |
| 14 | 34 | for(var i in $scope.markers) { |
| 15 | 35 | $scope.map.removeLayer($scope.markers[i]); |
| ... | ... | @@ -32,11 +52,9 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() |
| 32 | 52 | marcador.notaPedido.remito.numeroRemito |
| 33 | 53 | ]) + '<br/>'; |
| 34 | 54 | observacion += 'Cliente: ' + |
| 35 | - marcador.notaPedido.cliente.NOM + '<br/>'; | |
| 55 | + marcador.notaPedido.cliente.NOM; | |
| 36 | 56 | |
| 37 | 57 | // if($scope.parametros.individual) { |
| 38 | - observacion += | |
| 39 | - 'Total: ' + $filter('currency')(marcador.notaPedido.remito.total, '$'); | |
| 40 | 58 | observacion = 'Orden: ' + marcador.orden + '<br/>' + observacion; |
| 41 | 59 | |
| 42 | 60 | if(marcador.distancia) { |
| ... | ... | @@ -71,6 +89,11 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() |
| 71 | 89 | observacion += '<i class="fa fa-map-marker fa-3x" aria-hidden="true"'+ |
| 72 | 90 | 'class="form-control" ondragend="dropEnd()" ondragstart=\'drag(event, '+ |
| 73 | 91 | JSON.stringify(marcador)+')\' draggable="true"></i>(Arrastrar icono)'; |
| 92 | + observacion += '<button title="Ver productos" class="btn btn-secondary' + | |
| 93 | + 'float-right mt-2"'+ | |
| 94 | + 'ng-click="verProductos('+marcador.notaPedido.remito.id+')">' + | |
| 95 | + '<i class="fa fa-info" aria-hidden="true"></i>' + | |
| 96 | + '</button>'; | |
| 74 | 97 | |
| 75 | 98 | //Sin asignar VERDE |
| 76 | 99 | icon = new L.Icon({ |
| ... | ... | @@ -82,11 +105,16 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() |
| 82 | 105 | shadowSize: [41, 41] |
| 83 | 106 | }); |
| 84 | 107 | } |
| 108 | + | |
| 109 | + //COMPILO HTML PARA QUE FUNCIONE BOTON EN POPUP | |
| 110 | + observacion = '<div>' + observacion + '</div>'; | |
| 111 | + var compiledHtml = $compile(angular.element(observacion))($scope); | |
| 112 | + | |
| 85 | 113 | $scope.markers.push( |
| 86 | 114 | L.marker( |
| 87 | 115 | [marcador.latitud, marcador.longitud], {icon: icon}) |
| 88 | 116 | .addTo($scope.map) |
| 89 | - .bindPopup(observacion) | |
| 117 | + .bindPopup(compiledHtml[0]) | |
| 90 | 118 | .bindTooltip('Haga click para seleccionar') |
| 91 | 119 | ); |
| 92 | 120 | //abre marcador del primer punto |