Commit 5594ced8aa1d6b0ba305f43619e1012d6c1fcada
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master See merge request !7
Showing
2 changed files
 
Show diff stats
src/js/controller.js
| 1 | angular.module('focaInformes') | 1 | angular.module('focaInformes') | 
| 2 | .controller('focaInformesController', | 2 | .controller('focaInformesController', | 
| 3 | [ | 3 | [ | 
| 4 | '$scope', | 4 | '$scope', | 
| 5 | 'focaInformesService', | 5 | 'focaInformesService', | 
| 6 | 'focaBotoneraLateralService', | 6 | 'focaBotoneraLateralService', | 
| 7 | '$uibModal', | 7 | '$uibModal', | 
| 8 | function($scope, focaInformesService, focaBotoneraLateralService, $uibModal) | 8 | function($scope, focaInformesService, focaBotoneraLateralService, $uibModal) | 
| 9 | { | 9 | { | 
| 10 | $scope.now = new Date(); | 10 | $scope.now = new Date(); | 
| 11 | $scope.botonera = focaInformesService.getBotonera(); | 11 | $scope.botonera = focaInformesService.getBotonera(); | 
| 12 | 12 | ||
| 13 | //SETEO BOTONERA LATERAL | 13 | //SETEO BOTONERA LATERAL | 
| 14 | focaBotoneraLateralService.showSalir(true); | 14 | focaBotoneraLateralService.showSalir(true); | 
| 15 | focaBotoneraLateralService.showPausar(false); | 15 | focaBotoneraLateralService.showPausar(false); | 
| 16 | focaBotoneraLateralService.showGuardar(false); | 16 | focaBotoneraLateralService.showGuardar(false); | 
| 17 | 17 | ||
| 18 | $scope.seleccionarHojasDeRuta = function() { | 18 | $scope.seleccionarHojasDeRuta = function() { | 
| 19 | focaBotoneraLateralService.showTeclado(false); | 19 | focaBotoneraLateralService.showTeclado(false); | 
| 20 | $uibModal.open( | 20 | $uibModal.open( | 
| 21 | { | 21 | { | 
| 22 | ariaLabelledBy: 'Informes de hojas de ruta', | 22 | ariaLabelledBy: 'Informes de hojas de ruta', | 
| 23 | templateUrl: 'informe-hoja-ruta.html', | 23 | templateUrl: 'informe-hoja-ruta.html', | 
| 24 | controller: 'focaModalInformeHojaRutaController', | 24 | controller: 'focaModalInformeHojaRutaController', | 
| 25 | size: 'xl' | 25 | size: 'xl' | 
| 26 | } | 26 | } | 
| 27 | ) | 27 | ) | 
| 28 | .result.then(function(){ | 28 | .result.then(function() { | 
| 29 | focaBotoneraLateralService.showTeclado(true); | 29 | focaBotoneraLateralService.showTeclado(true); | 
| 30 | }, function(){ | 30 | }, function() { | 
| 31 | focaBotoneraLateralService.showTeclado(true); | 31 | focaBotoneraLateralService.showTeclado(true); | 
| 32 | }); | 32 | }); | 
| 33 | }; | 33 | }; | 
| 34 | $scope.seleccionarChoferes = function() { | 34 | $scope.seleccionarChoferes = function() { | 
| 35 | focaBotoneraLateralService.showTeclado(false); | 35 | focaBotoneraLateralService.showTeclado(false); | 
| 36 | $uibModal.open( | 36 | $uibModal.open( | 
| 37 | { | 37 | { | 
| 38 | ariaLabelledBy: 'Informes de choferes', | 38 | ariaLabelledBy: 'Informes de choferes', | 
| 39 | templateUrl: 'informe-chofer.html', | 39 | templateUrl: 'informe-chofer.html', | 
| 40 | controller: 'focaModalInformeChoferController', | 40 | controller: 'focaModalInformeChoferController', | 
| 41 | size: 'xl' | 41 | size: 'xl' | 
| 42 | } | 42 | } | 
| 43 | ) | 43 | ) | 
| 44 | .result.then(function(){ | 44 | .result.then(function() { | 
| 45 | focaBotoneraLateralService.showTeclado(true); | 45 | focaBotoneraLateralService.showTeclado(true); | 
| 46 | }, function(){ | 46 | }, function() { | 
| 47 | focaBotoneraLateralService.showTeclado(true); | 47 | focaBotoneraLateralService.showTeclado(true); | 
| 48 | }); | 48 | }); | 
| 49 | }; | 49 | }; | 
| 50 | $scope.seleccionarLitrosPorKmRecorridosPorUnidadDeReparto = function() { | 50 | $scope.seleccionarLitrosPorKmRecorridosPorUnidadDeReparto = function() { | 
| 51 | focaBotoneraLateralService.showTeclado(false); | 51 | focaBotoneraLateralService.showTeclado(false); | 
| 52 | $uibModal.open( | 52 | $uibModal.open( | 
| 53 | { | 53 | { | 
| 54 | ariaLabelledBy: 'Informes de litros por km recorridos por unidad de reparto', | 54 | ariaLabelledBy: 'Informes de litros por km recorridos por unidad de reparto', | 
| 55 | templateUrl: 'informe-litros-km-unidad.html', | 55 | templateUrl: 'informe-litros-km-unidad.html', | 
| 56 | controller: 'focaModalInformeLitrosKmUnidadController', | 56 | controller: 'focaModalInformeLitrosKmUnidadController', | 
| 57 | size: 'xl' | 57 | size: 'xl' | 
| 58 | } | 58 | } | 
| 59 | ) | 59 | ) | 
| 60 | .result.then(function(){ | 60 | .result.then(function() { | 
| 61 | focaBotoneraLateralService.showTeclado(true); | 61 | focaBotoneraLateralService.showTeclado(true); | 
| 62 | }, function(){ | 62 | }, function() { | 
| 63 | focaBotoneraLateralService.showTeclado(true); | 63 | focaBotoneraLateralService.showTeclado(true); | 
| 64 | }); | 64 | }); | 
| 65 | }; | 65 | }; | 
| 66 | $scope.seleccionarInformeGeneralPorUnidadDeReparto = function() { | 66 | $scope.seleccionarInformeGeneralPorUnidadDeReparto = function() { | 
| 67 | focaBotoneraLateralService.showTeclado(false); | 67 | focaBotoneraLateralService.showTeclado(false); | 
| 68 | $uibModal.open( | 68 | $uibModal.open( | 
| 69 | { | 69 | { | 
| 70 | ariaLabelledBy: 'Informe general por unidad de reparto', | 70 | ariaLabelledBy: 'Informe general por unidad de reparto', | 
| 71 | templateUrl: 'informe-general-unidad.html', | 71 | templateUrl: 'informe-general-unidad.html', | 
| 72 | controller: 'focaModalInformeGeneralUnidadController', | 72 | controller: 'focaModalInformeGeneralUnidadController', | 
| 73 | size: 'xl' | 73 | size: 'xl' | 
| 74 | } | 74 | } | 
| 75 | ) | 75 | ) | 
| 76 | .result.then(function(){ | 76 | .result.then(function() { | 
| 77 | focaBotoneraLateralService.showTeclado(true); | 77 | focaBotoneraLateralService.showTeclado(true); | 
| 78 | }, function(){ | 78 | }, function() { | 
| 79 | focaBotoneraLateralService.showTeclado(true); | 79 | focaBotoneraLateralService.showTeclado(true); | 
| 80 | }); | 80 | }); | 
| 81 | }; | 81 | }; | 
| 82 | $scope.seleccionarInformeDeRepartoÓptimoDetallado = function() { | 82 | $scope.seleccionarInformeDeRepartoÓptimoDetallado = function() { | 
| 83 | focaBotoneraLateralService.showTeclado(false); | 83 | focaBotoneraLateralService.showTeclado(false); | 
| 84 | $uibModal.open( | 84 | $uibModal.open( | 
| 85 | { | 85 | { | 
| 86 | ariaLabelledBy: 'Informe de reparto óptimo detallado', | 86 | ariaLabelledBy: 'Informe de reparto óptimo detallado', | 
| 87 | templateUrl: 'informe-reparto-optimo.html', | 87 | templateUrl: 'informe-reparto-optimo.html', | 
| 88 | controller: 'focaModalInformeRepartoOptimoController', | 88 | controller: 'focaModalInformeRepartoOptimoController', | 
| 89 | size: 'xl' | 89 | size: 'xl' | 
| 90 | } | 90 | } | 
| 91 | ) | 91 | ) | 
| 92 | .result.then(function(){ | 92 | .result.then(function() { | 
| 93 | focaBotoneraLateralService.showTeclado(true); | 93 | focaBotoneraLateralService.showTeclado(true); | 
| 94 | }, function(){ | 94 | }, function() { | 
| 95 | focaBotoneraLateralService.showTeclado(true); | ||
| 96 | }); | ||
| 97 | }; | ||
| 98 | $scope.seleccionarInformeDeProductividad = function() { | ||
| 99 | focaBotoneraLateralService.showTeclado(false); | ||
| 100 | $uibModal.open( | ||
| 101 | { | ||
| 102 | ariaLabelledBy: | ||
| 103 | 'Informe de productividad de Vendedores / Cobradores / Transportistas', | ||
| 104 | templateUrl: 'informe-productividad.html', | ||
| 105 | controller: 'focaModalInformeProductividadController', | ||
| 106 | size: 'xl' | ||
| 107 | } | ||
| 108 | ) | ||
| 109 | .result.then(function() { | ||
| 110 | focaBotoneraLateralService.showTeclado(true); | ||
| 111 | }, function() { | ||
| 95 | focaBotoneraLateralService.showTeclado(true); | 112 | focaBotoneraLateralService.showTeclado(true); | 
| 96 | }); | 113 | }); | 
| 97 | }; | 114 | }; | 
| 98 | } | 115 | } | 
| 99 | ]); | 116 | ]); | 
| 100 | 117 | 
src/js/service.js
| 1 | angular.module('focaInformes') | 1 | angular.module('focaInformes') | 
| 2 | .factory('focaInformesService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .factory('focaInformesService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 
| 3 | return { | 3 | return { | 
| 4 | getBotonera: function() { | 4 | getBotonera: function() { | 
| 5 | var result = [ | 5 | var result = [ | 
| 6 | { | 6 | { | 
| 7 | label: 'Hojas de ruta', | 7 | label: 'Hojas de ruta', | 
| 8 | image: 'cliente.png' | 8 | image: 'cliente.png' | 
| 9 | }, | 9 | }, | 
| 10 | { | 10 | { | 
| 11 | label: 'Choferes', | 11 | label: 'Choferes', | 
| 12 | image: 'chofer.png' | 12 | image: 'chofer.png' | 
| 13 | }, | 13 | }, | 
| 14 | { | 14 | { | 
| 15 | label: 'Litros por km recorridos por unidad de reparto', | 15 | label: 'Litros por km recorridos por unidad de reparto', | 
| 16 | image: 'productos.png' | 16 | image: 'productos.png' | 
| 17 | }, | 17 | }, | 
| 18 | { | 18 | { | 
| 19 | label: 'Informe general por unidad de reparto', | 19 | label: 'Informe general por unidad de reparto', | 
| 20 | image: 'flete.png' | 20 | image: 'flete.png' | 
| 21 | }, | 21 | }, | 
| 22 | { | 22 | { | 
| 23 | label: 'Informe de reparto óptimo detallado', | 23 | label: 'Informe de reparto óptimo detallado', | 
| 24 | image: 'flete.png' | 24 | image: 'flete.png' | 
| 25 | }, | ||
| 26 | { | ||
| 27 | label: 'Informe de productividad', | ||
| 28 | image: 'chofer.png' | ||
| 25 | } | 29 | } | 
| 26 | ]; | 30 | ]; | 
| 27 | return result; | 31 | return result; | 
| 28 | } | 32 | } | 
| 29 | }; | 33 | }; | 
| 30 | }]); | 34 | }]); | 
| 31 | 35 |