Commit 6e2db590a82d89a4c1e06606bb8b7c634550132b
1 parent
efdfb0b11e
Exists in
master
and in
1 other branch
alert foca
Showing
1 changed file
with
4 additions
and
3 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 | function($scope, focaAutorizarHojaRutaService, focaBotoneraLateralService, $filter) { | 7 | 'focaModalService', |
8 | function($scope, focaAutorizarHojaRutaService, focaBotoneraLateralService, $filter, focaModalService) { | ||
8 | 9 | ||
9 | $scope.now = Date.now(); | 10 | $scope.now = Date.now(); |
10 | $scope.notasPedido = [] | 11 | $scope.notasPedido = [] |
11 | 12 | ||
12 | $scope.fechaDesde = new Date(); | 13 | $scope.fechaDesde = new Date(); |
13 | $scope.fechaHasta = new Date(); | 14 | $scope.fechaHasta = new Date(); |
14 | 15 | ||
15 | focaBotoneraLateralService.showSalir(true); | 16 | focaBotoneraLateralService.showSalir(true); |
16 | 17 | ||
17 | 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; |
18 | $scope.fechaDesde.setMonth(month); | 19 | $scope.fechaDesde.setMonth(month); |
19 | 20 | ||
20 | focaAutorizarHojaRutaService.getNotasPedido($scope.fechaDesde.toISOString().split('.')[0], | 21 | focaAutorizarHojaRutaService.getNotasPedido($scope.fechaDesde.toISOString().split('.')[0], |
21 | $scope.fechaHasta.toISOString().split('.')[0]).then(function(res) { | 22 | $scope.fechaHasta.toISOString().split('.')[0]).then(function(res) { |
22 | $scope.notasPedido = res.data.slice(0, 4); | 23 | $scope.notasPedido = res.data.slice(0, 4); |
23 | }); | 24 | }); |
24 | 25 | ||
25 | $scope.getSeleccionados = function() { | 26 | $scope.getSeleccionados = function() { |
26 | var seleccionados = $filter('filter')($scope.notasPedido, { checked: true }); | 27 | var seleccionados = $filter('filter')($scope.notasPedido, { checked: true }); |
27 | 28 | ||
28 | return seleccionados.length; | 29 | return seleccionados.length; |
29 | } | 30 | } |
30 | 31 | ||
31 | $scope.seleccionarTodo = function() { | 32 | $scope.seleccionarTodo = function() { |
32 | $scope.notasPedido.forEach(function (notaPedido) { | 33 | $scope.notasPedido.forEach(function (notaPedido) { |
33 | notaPedido.checked = !$scope.checkedAll; | 34 | notaPedido.checked = !$scope.checkedAll; |
34 | }); | 35 | }); |
35 | } | 36 | } |
36 | 37 | ||
37 | $scope.verNotaPedido = function(notaPedido) { | 38 | $scope.verNotaPedido = function(notaPedido) { |
38 | alert('En desarrollo'); | 39 | focaModalService.alert('En desarrollo'); |
39 | }; | 40 | }; |
40 | 41 | ||
41 | $scope.autorizar = function() { | 42 | $scope.autorizar = function() { |
42 | alert('En Desarrollo'); | 43 | focaModalService.alert('En Desarrollo'); |
43 | }; | 44 | }; |
44 | 45 | ||
45 | }]); | 46 | }]); |
46 | 47 |