Commit 887652239f2b8e1cdc4be9fc356f128aecd3ce4c
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
agrego dateTime See merge request modulos-npm/foca-admin-seguimiento!4
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.general = true; | 16 | $scope.general = true; |
| 15 | 17 | ||
| 16 | console.info($scope.actividad); | 18 | console.info($scope.actividad); |
| 17 | $scope.marcadores = []; | 19 | $scope.marcadores = []; |
| 18 | 20 | ||
| 19 | focaAdminSeguimientoService.obtenerActividad().then(function(datos) { | 21 | focaAdminSeguimientoService.obtenerActividad().then(function(datos) { |
| 20 | $scope.marcadores = datos.data; | 22 | $scope.marcadores = datos.data; |
| 21 | }); | 23 | }); |
| 22 | 24 | ||
| 23 | $scope.general = function() { | 25 | $scope.general = function() { |
| 24 | $scope.general = true; | 26 | $scope.general = true; |
| 25 | }; | 27 | }; |
| 26 | 28 | ||
| 27 | $scope.individual = function() { | 29 | $scope.individual = function() { |
| 28 | $scope.general = false; | 30 | $scope.general = false; |
| 29 | 31 | ||
| 30 | }; | 32 | }; |
| 31 | 33 | ||
| 32 | $scope.salir = function() { | 34 | $scope.salir = function() { |
| 33 | $location.path('/'); | 35 | $location.path('/'); |
| 34 | }; | 36 | }; |
| 35 | } | 37 | } |
| 36 | ]); | 38 | ]); |
| 37 | 39 |
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': general}" | 21 | ng-class="{'active': general}" |
| 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': !general}" | 27 | ng-class="{'active': !general}" |
| 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 | <button | 31 | <button |
| 25 | type="button" | 32 | type="button" |
| 26 | class="btn col-12 my-1 boton-salir" | 33 | class="btn col-12 my-1 boton-salir" |
| 27 | ng-click="salir()" | 34 | ng-click="salir()" |
| 28 | > | 35 | > |
| 29 | Salir | 36 | Salir |
| 30 | </button> | 37 | </button> |
| 31 | </div> | 38 | </div> |
| 32 | </div> | 39 | </div> |
| 33 | </div> | 40 | </div> |
| 34 | 41 |