Commit 478f232555f8bcaa45566949ce71015b9257e46f
1 parent
6e2db590a8
Exists in
master
and in
1 other branch
vista no disponible
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
src/js/controller.js
| 1 | angular.module('focaAutorizarHojaRuta') | 1 | angular.module('focaAutorizarHojaRuta') |
| 2 | .controller('focaAutorizarHojaRutaCtrl', [ | 2 | .controller('focaAutorizarHojaRutaCtrl', [ |
| 3 | '$scope', | 3 | '$scope', |
| 4 | 'focaAutorizarHojaRutaService', | 4 | 'focaAutorizarHojaRutaService', |
| 5 | 'focaBotoneraLateralService', | 5 | 'focaBotoneraLateralService', |
| 6 | '$filter', | 6 | '$filter', |
| 7 | 'focaModalService', | 7 | 'focaModalService', |
| 8 | function($scope, focaAutorizarHojaRutaService, focaBotoneraLateralService, $filter, focaModalService) { | 8 | function($scope, focaAutorizarHojaRutaService, focaBotoneraLateralService, $filter, focaModalService) { |
| 9 | 9 | ||
| 10 | $scope.now = Date.now(); | 10 | $scope.now = Date.now(); |
| 11 | $scope.notasPedido = [] | 11 | $scope.notasPedido = [] |
| 12 | 12 | ||
| 13 | $scope.fechaDesde = new Date(); | 13 | $scope.fechaDesde = new Date(); |
| 14 | $scope.fechaHasta = new Date(); | 14 | $scope.fechaHasta = new Date(); |
| 15 | 15 | ||
| 16 | focaBotoneraLateralService.showSalir(true); | 16 | focaBotoneraLateralService.showSalir(true); |
| 17 | 17 | ||
| 18 | var month = $scope.fechaDesde.getMonth() - 1 < 0 ? 12 : $scope.fechaDesde.getMonth() - 1; | 18 | var month = $scope.fechaDesde.getMonth() - 1 < 0 ? 12 : $scope.fechaDesde.getMonth() - 1; |
| 19 | $scope.fechaDesde.setMonth(month); | 19 | $scope.fechaDesde.setMonth(month); |
| 20 | 20 | ||
| 21 | focaAutorizarHojaRutaService.getNotasPedido($scope.fechaDesde.toISOString().split('.')[0], | 21 | focaAutorizarHojaRutaService.getNotasPedido($scope.fechaDesde.toISOString().split('.')[0], |
| 22 | $scope.fechaHasta.toISOString().split('.')[0]).then(function(res) { | 22 | $scope.fechaHasta.toISOString().split('.')[0]).then(function(res) { |
| 23 | $scope.notasPedido = res.data.slice(0, 4); | 23 | $scope.notasPedido = res.data.slice(0, 4); |
| 24 | }); | 24 | }); |
| 25 | 25 | ||
| 26 | $scope.getSeleccionados = function() { | 26 | $scope.getSeleccionados = function() { |
| 27 | var seleccionados = $filter('filter')($scope.notasPedido, { checked: true }); | 27 | var seleccionados = $filter('filter')($scope.notasPedido, { checked: true }); |
| 28 | 28 | ||
| 29 | return seleccionados.length; | 29 | return seleccionados.length; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | $scope.seleccionarTodo = function() { | 32 | $scope.seleccionarTodo = function() { |
| 33 | $scope.notasPedido.forEach(function (notaPedido) { | 33 | $scope.notasPedido.forEach(function (notaPedido) { |
| 34 | notaPedido.checked = !$scope.checkedAll; | 34 | notaPedido.checked = !$scope.checkedAll; |
| 35 | }); | 35 | }); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | $scope.verNotaPedido = function(notaPedido) { | 38 | $scope.verNotaPedido = function(notaPedido) { |
| 39 | focaModalService.alert('En desarrollo'); | 39 | focaModalService.alert('Vista no disponible'); |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | $scope.autorizar = function() { | 42 | $scope.autorizar = function() { |
| 43 | focaModalService.alert('En Desarrollo'); | 43 | focaModalService.alert('Vista no disponible'); |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | }]); | 46 | }]); |
| 47 | 47 |