Commit 64d354f8cebd6e2652325f2a5aad4e63960c9c52
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'upstream/master'
Showing
2 changed files
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(); | ||
7 | |||
6 | if ($routeParams.parametro === 'nota-pedido') { | 8 | if ($routeParams.parametro === 'nota-pedido') { |
7 | $scope.actividad = 'Nota de pedido'; | 9 | $scope.actividad = 'Nota de pedido'; |
8 | } | 10 | } |
9 | 11 | ||
10 | if ($routeParams.parametro === 'hoja-ruta') { | 12 | if ($routeParams.parametro === 'hoja-ruta') { |
11 | $scope.actividad = 'Entrega de producto'; | 13 | $scope.actividad = 'Entrega de producto'; |
12 | } | 14 | } |
13 | 15 | ||
14 | $scope.idUsuario = 0; | 16 | $scope.idUsuario = 0; |
15 | $scope.marcadores = []; | 17 | $scope.marcadores = []; |
16 | getSeguimiento(); | 18 | getSeguimiento(); |
17 | 19 | ||
18 | $scope.general = function() { | 20 | $scope.general = function() { |
19 | $scope.idUsuario = 0; | 21 | $scope.idUsuario = 0; |
20 | getSeguimiento(); | 22 | getSeguimiento(); |
21 | }; | 23 | }; |
22 | 24 | ||
23 | $scope.individual = function() { | 25 | $scope.individual = function() { |
24 | $scope.idUsuario = -1; | 26 | $scope.idUsuario = -1; |
25 | }; | 27 | }; |
26 | 28 | ||
27 | $scope.salir = function() { | 29 | $scope.salir = function() { |
28 | $location.path('/'); | 30 | $location.path('/'); |
29 | }; | 31 | }; |
30 | 32 | ||
31 | $scope.search = function(key) { | 33 | $scope.search = function(key) { |
32 | if (key === 13) { | 34 | if (key === 13) { |
33 | $scope.idUsuario = $scope.idUsuarioInput; | 35 | $scope.idUsuario = $scope.idUsuarioInput; |
34 | getSeguimiento(); | 36 | getSeguimiento(); |
35 | } | 37 | } |
36 | }; | 38 | }; |
37 | 39 | ||
38 | function getSeguimiento () { | 40 | function getSeguimiento () { |
39 | var datos = { | 41 | var datos = { |
40 | actividad: $scope.actividad, | 42 | actividad: $scope.actividad, |
41 | idUsuario: $scope.idUsuario | 43 | idUsuario: $scope.idUsuario |
42 | }; | 44 | }; |
43 | 45 | ||
44 | focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) { | 46 | focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) { |
45 | $scope.marcadores = datos.data; | 47 | $scope.marcadores = datos.data; |
46 | }); | 48 | }); |
47 | } | 49 | } |
48 | } | 50 | } |
49 | ]); | 51 | ]); |
50 | 52 |
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 | ||
13 | type="date" | ||
14 | ng-model="now" | ||
15 | class="btn col-12 my-1" | ||
16 | foca-focus="true" | ||
17 | hasta-hoy | ||
18 | /> | ||
12 | <button | 19 | <button |
13 | type="button" | 20 | type="button" |
14 | ng-class="{'active': idUsuario == 0}" | 21 | ng-class="{'active': idUsuario == 0}" |
15 | class="btn col-12 my-1" | 22 | class="btn col-12 my-1" |
16 | ng-click="general()" | 23 | ng-click="general()" |
17 | >General</button> | 24 | >General</button> |
18 | <button | 25 | <button |
19 | type="button" | 26 | type="button" |
20 | ng-class="{'active': idUsuario != 0}" | 27 | ng-class="{'active': idUsuario != 0}" |
21 | class="btn col-12 my-1" | 28 | class="btn col-12 my-1" |
22 | ng-click="individual()" | 29 | ng-click="individual()" |
23 | >Individual</button> | 30 | >Individual</button> |
24 | <div class="form-group"> | 31 | <div class="form-group"> |
25 | <input | 32 | <input |
26 | type="text" | 33 | type="text" |
27 | placeholder="Vendedor" | 34 | placeholder="Vendedor" |
28 | class="form-control" | 35 | class="form-control" |
29 | ng-model="idUsuarioInput" | 36 | ng-model="idUsuarioInput" |
30 | ng-show="idUsuario == -1" | 37 | ng-show="idUsuario == -1" |
31 | ng-keypress="search($event.keyCode)" | 38 | ng-keypress="search($event.keyCode)" |
32 | foca-focus="idUsuario == -1" | 39 | foca-focus="idUsuario == -1" |
33 | > | 40 | > |
34 | </div> | 41 | </div> |
35 | <button | 42 | <button |
36 | type="button" | 43 | type="button" |
37 | class="btn col-12 my-1 boton-salir" | 44 | class="btn col-12 my-1 boton-salir" |
38 | ng-click="salir()" | 45 | ng-click="salir()" |
39 | > | 46 | > |
40 | Salir | 47 | Salir |
41 | </button> | 48 | </button> |
42 | </div> | 49 | </div> |
43 | </div> | 50 | </div> |
44 | </div> | 51 | </div> |
45 | 52 |