Commit 9250964a4bbc66e953346c8377c43bcdff896ac2
1 parent
64d354f8ce
Exists in
master
and in
1 other branch
union con fecha
Showing
2 changed files
with
8 additions
and
1 deletions
Show diff stats
src/js/controller.js
1 | angular.module('focaAdminSeguimiento') .controller('focaAdminSeguimientoController', [ | 1 | angular.module('focaAdminSeguimiento') .controller('focaAdminSeguimientoController', [ |
2 | '$scope', 'focaAdminSeguimientoService', '$location', '$routeParams', | 2 | '$scope', 'focaAdminSeguimientoService', '$location', '$routeParams', |
3 | function($scope, focaAdminSeguimientoService, $location, $routeParams) { | 3 | function($scope, focaAdminSeguimientoService, $location, $routeParams) { |
4 | $scope.actividad = ''; | 4 | $scope.actividad = ''; |
5 | 5 | ||
6 | $scope.now = new Date(); | 6 | $scope.now = new Date(); |
7 | 7 | ||
8 | if ($routeParams.parametro === 'nota-pedido') { | 8 | if ($routeParams.parametro === 'nota-pedido') { |
9 | $scope.actividad = 'Nota de pedido'; | 9 | $scope.actividad = 'Nota de pedido'; |
10 | } | 10 | } |
11 | 11 | ||
12 | if ($routeParams.parametro === 'hoja-ruta') { | 12 | if ($routeParams.parametro === 'hoja-ruta') { |
13 | $scope.actividad = 'Entrega de producto'; | 13 | $scope.actividad = 'Entrega de producto'; |
14 | } | 14 | } |
15 | 15 | ||
16 | $scope.idUsuario = 0; | 16 | $scope.idUsuario = 0; |
17 | $scope.marcadores = []; | 17 | $scope.marcadores = []; |
18 | getSeguimiento(); | 18 | getSeguimiento(); |
19 | 19 | ||
20 | $scope.general = function() { | 20 | $scope.general = function() { |
21 | $scope.idUsuario = 0; | 21 | $scope.idUsuario = 0; |
22 | getSeguimiento(); | 22 | getSeguimiento(); |
23 | }; | 23 | }; |
24 | 24 | ||
25 | $scope.individual = function() { | 25 | $scope.individual = function() { |
26 | $scope.idUsuario = -1; | 26 | $scope.idUsuario = -1; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | $scope.salir = function() { | 29 | $scope.salir = function() { |
30 | $location.path('/'); | 30 | $location.path('/'); |
31 | }; | 31 | }; |
32 | 32 | ||
33 | $scope.search = function(key) { | 33 | $scope.search = function(key) { |
34 | if (key === 13) { | 34 | if (key === 13) { |
35 | $scope.idUsuario = $scope.idUsuarioInput; | 35 | $scope.idUsuario = $scope.idUsuarioInput; |
36 | getSeguimiento(); | 36 | getSeguimiento(); |
37 | } | 37 | } |
38 | }; | 38 | }; |
39 | |||
40 | $scope.fecha = function() { | ||
41 | getSeguimiento(); | ||
42 | }; | ||
39 | 43 | ||
40 | function getSeguimiento () { | 44 | function getSeguimiento () { |
41 | var datos = { | 45 | var datos = { |
42 | actividad: $scope.actividad, | 46 | actividad: $scope.actividad, |
43 | idUsuario: $scope.idUsuario | 47 | idUsuario: $scope.idUsuario, |
48 | fechaDesde: $scope.now, | ||
49 | fechaHasta: $scope.now | ||
44 | }; | 50 | }; |
45 | 51 | ||
46 | focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) { | 52 | focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) { |
47 | $scope.marcadores = datos.data; | 53 | $scope.marcadores = datos.data; |
48 | }); | 54 | }); |
49 | } | 55 | } |
50 | } | 56 | } |
51 | ]); | 57 | ]); |
52 | 58 |
src/views/foca-admin-seguimiento.html
1 | <div class="foca-admin-seguimiento"> | 1 | <div class="foca-admin-seguimiento"> |
2 | <div class="row"> | 2 | <div class="row"> |
3 | <div class="offset-1 col-9"> | 3 | <div class="offset-1 col-9"> |
4 | <osm | 4 | <osm |
5 | latitud="-32.89214159952345" | 5 | latitud="-32.89214159952345" |
6 | longitud="-68.84572999101856" | 6 | longitud="-68.84572999101856" |
7 | zoom="14" | 7 | zoom="14" |
8 | marcadores="marcadores" | 8 | marcadores="marcadores" |
9 | /> | 9 | /> |
10 | </div> | 10 | </div> |
11 | <div class="col-2 pl-0"> | 11 | <div class="col-2 pl-0"> |
12 | <input | 12 | <input |
13 | type="date" | 13 | type="date" |
14 | ng-model="now" | 14 | ng-model="now" |
15 | class="btn col-12 my-1" | 15 | class="btn col-12 my-1" |
16 | foca-focus="true" | 16 | foca-focus="true" |
17 | ng-blur="fecha()" | ||
17 | hasta-hoy | 18 | hasta-hoy |
18 | /> | 19 | /> |
19 | <button | 20 | <button |
20 | type="button" | 21 | type="button" |
21 | ng-class="{'active': idUsuario == 0}" | 22 | ng-class="{'active': idUsuario == 0}" |
22 | class="btn col-12 my-1" | 23 | class="btn col-12 my-1" |
23 | ng-click="general()" | 24 | ng-click="general()" |
24 | >General</button> | 25 | >General</button> |
25 | <button | 26 | <button |
26 | type="button" | 27 | type="button" |
27 | ng-class="{'active': idUsuario != 0}" | 28 | ng-class="{'active': idUsuario != 0}" |
28 | class="btn col-12 my-1" | 29 | class="btn col-12 my-1" |
29 | ng-click="individual()" | 30 | ng-click="individual()" |
30 | >Individual</button> | 31 | >Individual</button> |
31 | <div class="form-group"> | 32 | <div class="form-group"> |
32 | <input | 33 | <input |
33 | type="text" | 34 | type="text" |
34 | placeholder="Vendedor" | 35 | placeholder="Vendedor" |
35 | class="form-control" | 36 | class="form-control" |
36 | ng-model="idUsuarioInput" | 37 | ng-model="idUsuarioInput" |
37 | ng-show="idUsuario == -1" | 38 | ng-show="idUsuario == -1" |
38 | ng-keypress="search($event.keyCode)" | 39 | ng-keypress="search($event.keyCode)" |
39 | foca-focus="idUsuario == -1" | 40 | foca-focus="idUsuario == -1" |
40 | > | 41 | > |
41 | </div> | 42 | </div> |
42 | <button | 43 | <button |
43 | type="button" | 44 | type="button" |
44 | class="btn col-12 my-1 boton-salir" | 45 | class="btn col-12 my-1 boton-salir" |
45 | ng-click="salir()" | 46 | ng-click="salir()" |
46 | > | 47 | > |
47 | Salir | 48 | Salir |
48 | </button> | 49 | </button> |
49 | </div> | 50 | </div> |
50 | </div> | 51 | </div> |
51 | </div> | 52 | </div> |
52 | 53 |