diff --git a/src/js/controller.js b/src/js/controller.js index 368d50b..41f6f2f 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -10,7 +10,7 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo $scope.titulo = 'Logistica de Pedidos'; $scope.botonera = ['Transportista']; var cabecera = ''; - + $scope.now = new Date(); $scope.idVendedor = 0; $scope.marcadores = []; $scope.vehiculos = []; @@ -112,16 +112,8 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo $location.path('/'); }; - $scope.search = function(key) { - if (key === 13) { - $scope.idVendedor = $scope.idVendedorInput; - getSeguimiento(); - $scope.$broadcast('removeCabecera', 'General'); - $scope.$broadcast('addCabecera', { - label: cabecera, - valor: $scope.idVendedorInput - }); - } + $scope.search = function() { + getSeguimiento(); }; $scope.fecha = function() { @@ -174,17 +166,24 @@ angular.module('focaLogisticaPedidoRuta') .controller('focaLogisticaPedidoRutaCo function getSeguimiento() { var desde = new Date('1900/01/01'); var hasta = new Date('2099/01/01'); - if ($scope.now) { - var now = $scope.now; - desde = new Date(new Date(now.setHours(0)).setMinutes(0)); - desde = desde.setDate(desde.getDate() - 1); + if($scope.fechaDesde) { + var fechaDesde = $scope.fechaDesde; + desde = new Date(new Date(fechaDesde.setHours(0)).setMinutes(0)); desde = new Date(desde); } + if($scope.fechaHasta) { + var fechaHasta = $scope.fechaHasta; + hasta = new Date(new Date(fechaHasta.setHours(0)).setMinutes(0)); + hasta = hasta.setDate(hasta.getDate() + 1); + hasta = new Date(hasta); + } var datos = { actividad: $scope.actividad, idUsuario: $scope.idVendedor, fechaDesde: desde, - fechaHasta: hasta + fechaHasta: hasta, + asignacion: $scope.filtroEstado ? true : ($scope.filtroEstado !== undefined ? + false : undefined) }; $scope.datosBuscados = { diff --git a/src/js/controllerDetalleVehiculo.js b/src/js/controllerDetalleVehiculo.js index 1c30144..9d0feaa 100644 --- a/src/js/controllerDetalleVehiculo.js +++ b/src/js/controllerDetalleVehiculo.js @@ -27,7 +27,7 @@ angular.module('focaLogisticaPedidoRuta') function(res) { $scope.remito = res.data; if($scope.remito.idUsuarioProceso) { - focaModalService.alert('El remito esta siendo cargado por otro usario'); + focaModalService.alert('Remito ya asignado'); $uibModalInstance.close(); } $scope.articulos = res.data.articulosRemito; diff --git a/src/js/osm-directive.js b/src/js/osm-directive.js index 3d1c3b8..cb28362 100644 --- a/src/js/osm-directive.js +++ b/src/js/osm-directive.js @@ -3,6 +3,7 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() restrict: 'E', link: function(scope, el, attrs) { var contenedor = document.createElement('div'); + contenedor.className = 'border border-light rounded'; el.append(contenedor); 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); @@ -48,9 +49,9 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() JSON.stringify(marcador)+')\' draggable="true">(Arrastrar icono)'; var icon; if(marcador.notaPedido.remito.idUsuarioProceso) { - //Asignado AZUL + //Asignado ROJO icon = new L.Icon({ - iconUrl: 'img/marker-icon-2x-blue.png', + iconUrl: 'img/marker-icon-2x-red.png', shadowUrl: 'img/marker-shadow.png', iconSize: [25, 41], iconAnchor: [12, 41], @@ -58,9 +59,9 @@ angular.module('focaLogisticaPedidoRuta').directive('focaLogistica', function() shadowSize: [41, 41] }); }else { - //Sin asignar ROJO + //Sin asignar VERDE icon = new L.Icon({ - iconUrl: 'img/marker-icon-2x-red.png', + iconUrl: 'img/marker-icon-2x-green.png', shadowUrl: 'img/marker-shadow.png', iconSize: [25, 41], iconAnchor: [12, 41], diff --git a/src/views/foca-detalle-vehiculo.html b/src/views/foca-detalle-vehiculo.html index 2bd758b..4d51184 100644 --- a/src/views/foca-detalle-vehiculo.html +++ b/src/views/foca-detalle-vehiculo.html @@ -83,7 +83,7 @@ -