Commit b5b91ae35ca023c137d6250ef4564c2a771ca0c9

Authored by Eric Fernandez
1 parent fd679a711e
Exists in master and in 1 other branch develop

avance seguimiento hoja de ruta

src/js/controller.js
1 angular.module('focaAdminSeguimiento') .controller('focaAdminSeguimientoController', [ 1 angular.module('focaAdminSeguimiento') .controller('focaAdminSeguimientoController', [
2 '$scope', '$timeout', 'focaAdminSeguimientoService', 2 '$scope', '$timeout', 'focaAdminSeguimientoService',
3 'focaBotoneraLateralService','$location', '$routeParams', 3 'focaBotoneraLateralService','$location', '$routeParams',
4 function($scope, $timeout, focaAdminSeguimientoService, 4 function($scope, $timeout, focaAdminSeguimientoService,
5 focaBotoneraLateralService, $location, $routeParams) { 5 focaBotoneraLateralService, $location, $routeParams) {
6 6
7 $scope.actividad = ''; 7 $scope.actividad = '';
8 $scope.titulo = ''; 8 $scope.titulo = '';
9 var cabecera = ''; 9 var cabecera = '';
10 10
11 $scope.now = new Date(); 11 $scope.now = new Date();
12 12
13 if ($routeParams.parametro === 'nota-pedido') { 13 if ($routeParams.parametro === 'nota-pedido') {
14 $scope.actividad = 'Nota de pedido'; 14 $scope.actividad = 'Nota de pedido';
15 $scope.titulo = 'Seguimiento de nota de pedido'; 15 $scope.titulo = 'Seguimiento de nota de pedido';
16 cabecera = 'Vendedor:'; 16 cabecera = 'Vendedor:';
17 } 17 }
18 18
19 if ($routeParams.parametro === 'hoja-ruta') { 19 if ($routeParams.parametro === 'hoja-ruta') {
20 $scope.actividad = 'Entrega de producto'; 20 $scope.actividad = 'Entrega de producto';
21 $scope.titulo = 'Seguimiento de hoja de ruta'; 21 $scope.titulo = 'Seguimiento de hoja de ruta';
22 cabecera = 'Vehiculo:'; 22 cabecera = 'Vehiculo:';
23 } 23 }
24 24
25 if ($routeParams.parametro === 'cobranza') { 25 if ($routeParams.parametro === 'cobranza') {
26 $scope.actividad = 'Cobranza'; 26 $scope.actividad = 'Cobranza';
27 $scope.titulo = 'Seguimiento de cobranza'; 27 $scope.titulo = 'Seguimiento de cobranza';
28 cabecera = 'Cobrador:'; 28 cabecera = 'Cobrador:';
29 } 29 }
30 30
31 $scope.idUsuario = 0; 31 $scope.idUsuario = 0;
32 $scope.marcadores = []; 32 $scope.marcadores = [];
33 getSeguimiento(); 33 getSeguimiento();
34 34
35 $timeout(function() { 35 $timeout(function() {
36 $scope.$broadcast('addCabecera',{ 36 $scope.$broadcast('addCabecera',{
37 label: 'General', 37 label: 'General',
38 valor: '' 38 valor: ''
39 }); 39 });
40 }) 40 });
41 41
42 //SETEO BOTONERA LATERAL 42 //SETEO BOTONERA LATERAL
43 focaBotoneraLateralService.showSalir(true); 43 focaBotoneraLateralService.showSalir(true);
44 focaBotoneraLateralService.showPausar(false); 44 focaBotoneraLateralService.showPausar(false);
45 focaBotoneraLateralService.showGuardar(false); 45 focaBotoneraLateralService.showGuardar(false);
46 46
47 $scope.general = function() { 47 $scope.general = function() {
48 $scope.idUsuario = 0; 48 $scope.idUsuario = 0;
49 getSeguimiento(); 49 getSeguimiento();
50 $scope.$broadcast('removeCabecera', cabecera); 50 $scope.$broadcast('removeCabecera', cabecera);
51 $scope.$broadcast('addCabecera',{ 51 $scope.$broadcast('addCabecera',{
52 label: 'General', 52 label: 'General',
53 valor: '' 53 valor: ''
54 }); 54 });
55 }; 55 };
56 56
57 $scope.individual = function() { 57 $scope.individual = function() {
58 $scope.idUsuario = -1; 58 $scope.idUsuario = -1;
59 }; 59 };
60 60
61 $scope.salir = function() { 61 $scope.salir = function() {
62 $location.path('/'); 62 $location.path('/');
63 }; 63 };
64 64
65 $scope.search = function(key) { 65 $scope.search = function(key) {
66 if (key === 13) { 66 if (key === 13) {
67 $scope.idUsuario = $scope.idUsuarioInput; 67 $scope.idUsuario = $scope.idUsuarioInput;
68 getSeguimiento(); 68 getSeguimiento();
69 $scope.$broadcast('removeCabecera', 'General'); 69 $scope.$broadcast('removeCabecera', 'General');
70 $scope.$broadcast('addCabecera', { 70 $scope.$broadcast('addCabecera', {
71 label: cabecera, 71 label: cabecera,
72 valor: $scope.idUsuarioInput 72 valor: $scope.idUsuarioInput
73 }); 73 });
74 } 74 }
75 }; 75 };
76 76
77 $scope.fecha = function() { 77 $scope.fecha = function() {
78 getSeguimiento(); 78 getSeguimiento();
79 }; 79 };
80 80
81 function getSeguimiento() { 81 function getSeguimiento() {
82 var now = $scope.now; 82 var now = $scope.now;
83 var desde = new Date(new Date(now.setHours(0)).setMinutes(0)); 83 var desde = new Date(new Date(now.setHours(0)).setMinutes(0));
84 desde = desde.setDate(desde.getDate() - 1); 84 desde = desde.setDate(desde.getDate() - 1);
85 desde = new Date(desde); 85 desde = new Date(desde);
86 var datos = { 86 var datos = {
87 actividad: $scope.actividad, 87 actividad: $scope.actividad,
88 idUsuario: $scope.idUsuario, 88 idUsuario: $scope.idUsuario,
89 fechaDesde: desde, 89 fechaDesde: desde,
90 fechaHasta: new Date(new Date(now.setHours(23)).setMinutes(59)) 90 fechaHasta: new Date(new Date(now.setHours(23)).setMinutes(59))
91 }; 91 };
92 92
93 $scope.datosBuscados = { 93 $scope.datosBuscados = {
94 actividad: $scope.actividad, 94 actividad: $scope.actividad,
95 individual: $scope.idUsuario !== 0 ? true : false 95 individual: $scope.idUsuario !== 0 ? true : false
96 }; 96 };
97 97
98 focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) { 98 focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) {
99 99
100 $scope.marcadores = datos.data; 100 $scope.marcadores = datos.data;
101 }); 101 });
102 } 102 }
103 } 103 }
104 ]); 104 ]);
105 105
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 <foca-cabecera-facturador 3 <foca-cabecera-facturador
4 titulo="titulo" 4 titulo="titulo"
5 fecha="now" 5 fecha="now"
6 class="mb-0 col-lg-12" 6 class="mb-0 col-lg-12"
7 ></foca-cabecera-facturador> 7 ></foca-cabecera-facturador>
8 </div> 8 </div>
9 <div class="row"> 9 <div class="row">
10 <div class="col-10"> 10 <div class="col-10">
11 <osm 11 <osm
12 latitud="-32.89214159952345" 12 latitud="-32.89214159952345"
13 longitud="-68.84572999101856" 13 longitud="-68.84572999101856"
14 zoom="14" 14 zoom="14"
15 marcadores="marcadores" 15 marcadores="marcadores"
16 parametros= "datosBuscados" 16 parametros= "datosBuscados"
17 /> 17 />
18 </div> 18 </div>
19 <div class="col-2 pl-0"> 19 <div class="col-2 pl-0">
20 <input 20 <input
21 type="date" 21 type="date"
22 ng-model="now" 22 ng-model="now"
23 class="btn col-12 my-1" 23 class="btn col-12 my-1"
24 foca-focus="true" 24 foca-focus="true"
25 ng-blur="fecha()" 25 ng-blur="fecha()"
26 hasta-hoy 26 hasta-hoy
27 /> 27 />
28 <button 28 <button
29 type="button" 29 type="button"
30 ng-class="{'active': idUsuario == 0}" 30 ng-class="{'active': idUsuario == 0}"
31 class="btn col-12 my-1" 31 class="btn col-12 my-1"
32 ng-click="general()" 32 ng-click="general()"
33 >General</button> 33 >General</button>
34 <button 34 <button
35 type="button" 35 type="button"
36 ng-class="{'active': idUsuario != 0}" 36 ng-class="{'active': idUsuario != 0}"
37 class="btn col-12 my-1" 37 class="btn col-12 my-1"
38 ng-click="individual()" 38 ng-click="individual()"
39 >Individual</button> 39 >Individual</button>
40 <div class="form-group" ng-show="idUsuario == -1"> 40 <div class="form-group" ng-show="idUsuario == -1">
41 <input 41 <input
42 type="text" 42 type="text"
43 placeholder="Vendedor" 43 placeholder="Vendedor"
44 class="form-control" 44 class="form-control"
45 ng-model="idUsuarioInput" 45 ng-model="idUsuarioInput"
46 ng-keypress="search($event.keyCode)" 46 ng-keypress="search($event.keyCode)"
47 foca-focus="idUsuario == -1" 47 foca-focus="idUsuario == -1"
48 ng-show="actividad == 'Nota de pedido'" 48 ng-show="actividad == 'Nota de pedido'"
49 > 49 >
50 <input 50 <input
51 type="text" 51 type="text"
52 placeholder="Vehiculo" 52 placeholder="Vehiculo"
53 class="form-control" 53 class="form-control"
54 ng-model="idUsuarioInput" 54 ng-model="idUsuarioInput"
55 ng-keypress="search($event.keyCode)" 55 ng-keypress="search($event.keyCode)"
56 foca-focus="idUsuario == -1" 56 foca-focus="idUsuario == -1"
57 ng-show="actividad == 'Entrega de producto'" 57 ng-show="actividad == 'Entrega de producto'"
58 > 58 >
59 <input 59 <input
60 type="text" 60 type="text"
61 placeholder="Cobrador" 61 placeholder="Cobrador"
62 class="form-control" 62 class="form-control"
63 ng-model="idUsuarioInput" 63 ng-model="idUsuarioInput"
64 ng-keypress="search($event.keyCode)" 64 ng-keypress="search($event.keyCode)"
65 foca-focus="idUsuario == -1" 65 foca-focus="idUsuario == -1"
66 ng-show="actividad == 'Cobranza'" 66 ng-show="actividad == 'Cobranza'"
67 > 67 >
68 </div> 68 </div>
69 <div ng-show="actividad === 'Entrega de producto'">
70 <div class="custom-control custom-radio">
71 <input
72 type="radio"
73 class="custom-control-input"
74 id="idTodos"
75 name="filtro"
76 ng-model="filtroEstado"
77 ng-change="search()"
78 checked>
79 <label class="custom-control-label pb-3" for="idTodos"></label>
80 <img src="img/marker-icon-grey.png">
81 <strong>Todos</strong>
82 </div>
83 <div class="custom-control custom-radio">
84 <input
85 type="radio"
86 class="custom-control-input"
87 id="entregado"
88 name="filtro"
89 ng-model="filtroEstado"
90 ng-change="search()"
91 ng-value="false">
92 <label class="custom-control-label pb-3" for="entregado"></label>
93 <img src="img/marker-icon-green.png">
94 <strong>Entregado</strong>
95 </div>
96 <div class="custom-control custom-radio">
97 <input
98 type="radio"
99 class="custom-control-input"
100 id="noEntregado"
101 name="filtro"
102 ng-model="filtroEstado"
103 ng-change="search()"
104 ng-value="true">
105 <label class="custom-control-label pb-3" for="noEntregado"></label>
106 <img src="img/marker-icon-yellow.png">
107 <strong>No entregado</strong>
108 </div>
109 </div>
69 </div> 110 </div>
70 </div> 111 </div>
112 <div ng-show="actividad === 'Entrega de producto'">
113 <strong>Remitos pendientes de entrega</strong>
114 <table class="table">
115 <thead>
116 <tr>
117 <th>Remito Nº</th>
118 <th>Cliente</th>
119 <th>Dirección</th>
120 </tr>
121 </thead>
122 <tbody>
123 <tr>
124 <td>ejemplo</td>
125 <td>ejemplo</td>
126 <td>ejemplo</td>
127 </tr>
128 </tbody>
129 </table>
130 </div>
71 </div> 131 </div>
72 132