Commit a0addacb471056026c9cc68c910cf8d676ffb405

Authored by Eric Fernandez
1 parent f390a93465
Exists in master and in 2 other branches develop, lab

muestro remitos pendientes

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 $scope.dateOptions = { 12 $scope.dateOptions = {
13 maxDate: new Date() 13 maxDate: new Date()
14 }; 14 };
15 15
16 switch($routeParams.parametro){ 16 switch($routeParams.parametro){
17 case 'nota-pedido': 17 case 'nota-pedido':
18 $scope.actividad = 'Nota de pedido'; 18 $scope.actividad = 'Nota de pedido';
19 $scope.titulo = 'Seguimiento de nota de pedido'; 19 $scope.titulo = 'Seguimiento de nota de pedido';
20 cabecera = 'Vendedor:'; 20 cabecera = 'Vendedor:';
21 break; 21 break;
22 case 'hoja-ruta': 22 case 'hoja-ruta':
23 $scope.actividad = 'Entrega de producto'; 23 $scope.actividad = 'Entrega de producto';
24 $scope.titulo = 'Seguimiento de hoja de ruta'; 24 $scope.titulo = 'Seguimiento de hoja de ruta';
25 cabecera = 'Vehiculo:'; 25 cabecera = 'Vehiculo:';
26 break; 26 break;
27 case 'cobranza': 27 case 'cobranza':
28 $scope.actividad = 'Cobranza'; 28 $scope.actividad = 'Cobranza';
29 $scope.titulo = 'Seguimiento de cobranza'; 29 $scope.titulo = 'Seguimiento de cobranza';
30 cabecera = 'Cobrador:'; 30 cabecera = 'Cobrador:';
31 break; 31 break;
32 } 32 }
33 33
34 $scope.idUsuario = 0; 34 $scope.idUsuario = 0;
35 $scope.marcadores = []; 35 $scope.marcadores = [];
36 getSeguimiento(); 36 getSeguimiento();
37 37
38 $timeout(function() { 38 $timeout(function() {
39 $scope.$broadcast('addCabecera',{ 39 $scope.$broadcast('addCabecera',{
40 label: 'General', 40 label: 'General',
41 valor: '' 41 valor: ''
42 }); 42 });
43 }); 43 });
44 44
45 //SETEO BOTONERA LATERAL 45 //SETEO BOTONERA LATERAL
46 focaBotoneraLateralService.showSalir(true); 46 focaBotoneraLateralService.showSalir(true);
47 focaBotoneraLateralService.showPausar(false); 47 focaBotoneraLateralService.showPausar(false);
48 focaBotoneraLateralService.showGuardar(false); 48 focaBotoneraLateralService.showGuardar(false);
49 49
50 $scope.general = function() { 50 $scope.general = function() {
51 $scope.idUsuario = 0; 51 $scope.idUsuario = 0;
52 getSeguimiento(); 52 getSeguimiento();
53 $scope.$broadcast('removeCabecera', cabecera); 53 $scope.$broadcast('removeCabecera', cabecera);
54 $scope.$broadcast('removeCabecera', 'Individual'); 54 $scope.$broadcast('removeCabecera', 'Individual');
55 $scope.$broadcast('addCabecera',{ 55 $scope.$broadcast('addCabecera',{
56 label: 'General', 56 label: 'General',
57 valor: '' 57 valor: ''
58 }); 58 });
59 }; 59 };
60 60
61 $scope.individual = function() { 61 $scope.individual = function() {
62 $scope.idUsuario = -1; 62 $scope.idUsuario = -1;
63 }; 63 };
64 64
65 $scope.salir = function() { 65 $scope.salir = function() {
66 $location.path('/'); 66 $location.path('/');
67 }; 67 };
68 68
69 $scope.search = function(key) { 69 $scope.search = function(key) {
70 if (key === 13) { 70 if (key === 13) {
71 $scope.idUsuario = $scope.idUsuarioInput; 71 $scope.idUsuario = $scope.idUsuarioInput;
72 $scope.$broadcast('removeCabecera', 'General'); 72 $scope.$broadcast('removeCabecera', 'General');
73 $scope.$broadcast('addCabecera', { 73 $scope.$broadcast('addCabecera', {
74 label: 'Individual', 74 label: 'Individual',
75 valor: '' 75 valor: ''
76 }); 76 });
77 getSeguimiento(); 77 getSeguimiento();
78 if ($scope.actividad === 'Entrega de producto' && $scope.idUsuario != 0) {
79 focaAdminSeguimientoService.obtenerRemitosVehiculo($scope.idUsuario)
80 .then(function(res) {
81 var remitos = [];
82 for (var i = 0; i < res.data.length; i++) {
83 remitos = remitos.concat(res.data[i].remitos);
84 }
85 $scope.remitosVehiculo = remitos;
86 });
87 }
78 } 88 }
79 }; 89 };
80 90
81 $scope.fecha = function() { 91 $scope.fecha = function() {
82 getSeguimiento(); 92 getSeguimiento();
83 }; 93 };
84 94
85 function getSeguimiento() { 95 function getSeguimiento() {
86 var now = $scope.now; 96 var now = $scope.now;
87 var desde = new Date(new Date(now.setHours(0)).setMinutes(0)); 97 var desde = new Date(new Date(now.setHours(0)).setMinutes(0));
88 desde = desde.setDate(desde.getDate() - 1); 98 desde = desde.setDate(desde.getDate() - 1);
89 desde = new Date(desde); 99 desde = new Date(desde);
90 var datos = { 100 var datos = {
91 actividad: $scope.actividad, 101 actividad: $scope.actividad,
92 idUsuario: $scope.idUsuario, 102 idUsuario: $scope.idUsuario,
93 fechaDesde: desde, 103 fechaDesde: desde,
94 fechaHasta: new Date(new Date(now.setHours(23)).setMinutes(59)) 104 fechaHasta: new Date(new Date(now.setHours(23)).setMinutes(59)),
105 entregado: $scope.filtroEstado ? true : ($scope.filtroEstado !== undefined ?
106 false : undefined)
95 }; 107 };
96 108
97 $scope.datosBuscados = { 109 $scope.datosBuscados = {
98 actividad: $scope.actividad, 110 actividad: $scope.actividad,
99 individual: $scope.idUsuario !== 0 ? true : false 111 individual: $scope.idUsuario !== 0 ? true : false
100 }; 112 };
101 113
102 focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) { 114 focaAdminSeguimientoService.obtenerActividad(datos).then(function(datos) {
103 if($scope.idUsuario !== 0){ 115 if($scope.idUsuario !== 0){
104 switch($routeParams.parametro){ 116 switch($routeParams.parametro){
105 case 'nota-pedido': 117 case 'nota-pedido':
106 $scope.$broadcast('addCabecera', { 118 $scope.$broadcast('addCabecera', {
107 label: cabecera, 119 label: cabecera,
108 valor: (datos.data.length) ? $scope.idUsuario + ' - ' + 120 valor: (datos.data.length) ? $scope.idUsuario + ' - ' +
109 datos.data[0].notaPedido.vendedor.NomVen 121 datos.data[0].notaPedido.vendedor.NomVen
110 : $scope.idUsuario 122 : $scope.idUsuario
111 }); 123 });
112 break; 124 break;
113 case 'hoja-ruta': 125 case 'hoja-ruta':
114 $scope.$broadcast('addCabecera', { 126 $scope.$broadcast('addCabecera', {
115 label: cabecera, 127 label: cabecera,
116 valor: (datos.data.length) ? $scope.idUsuario + ' - ' + 128 valor: (datos.data.length) ? $scope.idUsuario + ' - ' +
117 datos.data[0].hojaRutaMovimiento.remito.hojaRuta.vehiculo.tractor 129 datos.data[0].hojaRutaMovimiento.remito.hojaRuta.vehiculo.tractor
118 : $scope.idUsuario 130 : $scope.idUsuario
119 }); 131 });
120 break; 132 break;
121 case 'cobranza': 133 case 'cobranza':
122 break; 134 break;
123 } 135 }
124 } 136 }
125 $scope.marcadores = datos.data; 137 $scope.marcadores = datos.data;
126 }); 138 });
127 } 139 }
128 } 140 }
129 ]); 141 ]);
130 142
src/js/osm-directive.js
1 angular.module('focaAdminSeguimiento').directive('osm', function() { 1 angular.module('focaAdminSeguimiento').directive('osm', function() {
2 return { 2 return {
3 restrict: 'E', 3 restrict: 'E',
4 link: function(scope, el, attrs) { 4 link: function(scope, el, attrs) {
5 var contenedor = document.createElement('div'); 5 var contenedor = document.createElement('div');
6 el.append(contenedor); 6 el.append(contenedor);
7 scope.map = L.map(contenedor).setView([attrs.latitud, attrs.longitud], attrs.zoom); 7 scope.map = L.map(contenedor).setView([attrs.latitud, attrs.longitud], attrs.zoom);
8 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(scope.map); 8 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(scope.map);
9 }, 9 },
10 controller: ['$scope', '$filter', function($scope, $filter) { 10 controller: ['$scope', '$filter', function($scope, $filter) {
11 $scope.markers = []; 11 $scope.markers = [];
12 $scope.$watch('marcadores', function() { 12 $scope.$watch('marcadores', function() {
13 for(var i in $scope.markers) { 13 for(var i in $scope.markers) {
14 $scope.map.removeLayer($scope.markers[i]); 14 $scope.map.removeLayer($scope.markers[i]);
15 } 15 }
16 16
17 $scope.markers = []; 17 $scope.markers = [];
18 var observacion = ''; 18 var observacion = '';
19 19
20 angular.forEach($scope.marcadores, function(marcador) { 20 angular.forEach($scope.marcadores, function(marcador) {
21 var icon = new L.Icon({
22 iconUrl: 'img/marker-icon-2x-blue.png',
23 shadowUrl: 'img/marker-shadow.png',
24 iconSize: [25, 41],
25 iconAnchor: [12, 41],
26 popupAnchor: [1, -34],
27 shadowSize: [41, 41]
28 });
21 if ($scope.parametros.actividad === 'Nota de pedido') { 29 if ($scope.parametros.actividad === 'Nota de pedido') {
22 observacion = generarObservacion(getNotaPedido(marcador)); 30 observacion = generarObservacion(getNotaPedido(marcador));
23 } 31 }
24 32
25 if ($scope.parametros.actividad === 'Cobranza') { 33 if ($scope.parametros.actividad === 'Cobranza') {
26 observacion = getCobranza(marcador); 34 observacion = getCobranza(marcador);
27 } 35 }
28 36
29 if ($scope.parametros.actividad === 'Entrega de producto') { 37 if ($scope.parametros.actividad === 'Entrega de producto') {
30 observacion = getEntrega(marcador); 38 observacion = getEntrega(marcador);
39 if (marcador.hojaRutaMovimiento.remito.rechazado) {
40 icon = new L.Icon({
41 iconUrl: 'img/marker-icon-2x-yellow.png',
42 shadowUrl: 'img/marker-shadow.png',
43 iconSize: [25, 41],
44 iconAnchor: [12, 41],
45 popupAnchor: [1, -34],
46 shadowSize: [41, 41]
47 });
48 } else {
49 icon = new L.Icon({
50 iconUrl: 'img/marker-icon-2x-green.png',
51 shadowUrl: 'img/marker-shadow.png',
52 iconSize: [25, 41],
53 iconAnchor: [12, 41],
54 popupAnchor: [1, -34],
55 shadowSize: [41, 41]
56 });
57 }
31 } 58 }
32 59
33 if (observacion) { 60 if (observacion) {
34 $scope.markers.push( 61 $scope.markers.push(
35 L.marker([marcador.latitud, marcador.longitud]).addTo($scope.map) 62 L.marker(
63 [marcador.latitud, marcador.longitud],
64 {icon: icon}).addTo($scope.map)
36 .bindPopup(observacion) 65 .bindPopup(observacion)
37 ); 66 );
38 67
39 $scope.markers[0].openPopup(); 68 $scope.markers[0].openPopup();
40 } 69 }
41 }); 70 });
42 71
43 function getNotaPedido(marcador) { 72 function getNotaPedido(marcador) {
44 var observacion = []; 73 var observacion = [];
45 74
46 if (!marcador.notaPedido.id) { 75 if (!marcador.notaPedido.id) {
47 return false; 76 return false;
48 } 77 }
49 78
50 var notaPedido = marcador.notaPedido; 79 var notaPedido = marcador.notaPedido;
51 var textVendedor = notaPedido.idVendedor + ' - '; 80 var textVendedor = notaPedido.idVendedor + ' - ';
52 81
53 if (notaPedido.vendedor) { 82 if (notaPedido.vendedor) {
54 textVendedor += notaPedido.vendedor.NomVen; 83 textVendedor += notaPedido.vendedor.NomVen;
55 } 84 }
56 85
57 observacion.push(['Vendedor', textVendedor]); 86 observacion.push(['Vendedor', textVendedor]);
58 87
59 if (!$scope.parametros.individual) { 88 if (!$scope.parametros.individual) {
60 observacion.push(['Ultima Nota de Pedido', '']); 89 observacion.push(['Ultima Nota de Pedido', '']);
61 } 90 }
62 91
63 var textFecha = $filter('date')(marcador.fecha.slice(0,10), 'dd/MM/yyyy') + 92 var textFecha = $filter('date')(marcador.fecha.slice(0,10), 'dd/MM/yyyy') +
64 ' ' + marcador.fecha.slice(11,19); 93 ' ' + marcador.fecha.slice(11,19);
65 observacion.push(['Fecha', textFecha]); 94 observacion.push(['Fecha', textFecha]);
66 95
67 observacion.push(['Nº', 96 observacion.push(['Nº',
68 $filter('comprobante')([notaPedido.sucursal, notaPedido.numeroNotaPedido ]) 97 $filter('comprobante')([notaPedido.sucursal, notaPedido.numeroNotaPedido ])
69 ]); 98 ]);
70 99
71 if (notaPedido.cliente) { 100 if (notaPedido.cliente) {
72 observacion.push(['Cliente', notaPedido.cliente.NOM]); 101 observacion.push(['Cliente', notaPedido.cliente.NOM]);
73 } 102 }
74 103
75 if ($scope.parametros.individual) { 104 if ($scope.parametros.individual) {
76 observacion.push(['Total', $filter('currency')(notaPedido.total, '$')]); 105 observacion.push(['Total', $filter('currency')(notaPedido.total, '$')]);
77 observacion.unshift(['Orden', marcador.orden]); 106 observacion.unshift(['Orden', marcador.orden]);
78 107
79 if (marcador.distancia) { 108 if (marcador.distancia) {
80 observacion.push(['Distancia a casa central', 109 observacion.push(['Distancia a casa central',
81 marcador.distancia + 'km' 110 marcador.distancia + 'km'
82 ]); 111 ]);
83 } 112 }
84 } else { 113 } else {
85 observacion.push(['Cantidad de nota de pedido', 114 observacion.push(['Cantidad de nota de pedido',
86 marcador.cantidad 115 marcador.cantidad
87 ]); 116 ]);
88 117
89 observacion.push(['Total Vendido', 118 observacion.push(['Total Vendido',
90 $filter('currency')(marcador.total, '$') 119 $filter('currency')(marcador.total, '$')
91 ]); 120 ]);
92 } 121 }
93 122
94 console.info(marcador, observacion); 123 console.info(marcador, observacion);
95 return observacion; 124 return observacion;
96 } 125 }
97 126
98 function getCobranza(marcador) { 127 function getCobranza(marcador) {
99 observacion = ''; 128 observacion = '';
100 observacion += 'Cobrador: ' + marcador.recibo.cobrador.CodVen + ' - ' + 129 observacion += 'Cobrador: ' + marcador.recibo.cobrador.CodVen + ' - ' +
101 marcador.recibo.CFE + '<br/>'; 130 marcador.recibo.CFE + '<br/>';
102 131
103 if (!$scope.parametros.individual) { 132 if (!$scope.parametros.individual) {
104 observacion += '<b>Ultima Cobranza</b><br/>'; 133 observacion += '<b>Ultima Cobranza</b><br/>';
105 } 134 }
106 135
107 observacion += 'Fecha: ' + 136 observacion += 'Fecha: ' +
108 $filter('date')(marcador.fecha.slice(0,10), 'dd/MM/yyyy') + ' ' + 137 $filter('date')(marcador.fecha.slice(0,10), 'dd/MM/yyyy') + ' ' +
109 marcador.fecha.slice(11,19) + '<br/>'; 138 marcador.fecha.slice(11,19) + '<br/>';
110 observacion += 'Nº: ' + $filter('comprobante')([ 139 observacion += 'Nº: ' + $filter('comprobante')([
111 marcador.recibo.PVE, marcador.recibo.NCO]) + '<br/>'; 140 marcador.recibo.PVE, marcador.recibo.NCO]) + '<br/>';
112 observacion += 'Cliente: ' + marcador.recibo.cliente.NOM + '<br/>'; 141 observacion += 'Cliente: ' + marcador.recibo.cliente.NOM + '<br/>';
113 var totalCobrado = 0; 142 var totalCobrado = 0;
114 for (var i = 0; i < marcador.recibo.facturas.length; i++) { 143 for (var i = 0; i < marcador.recibo.cuerpos.length; i++) {
115 if (marcador.recibo.facturas[i].LOP === 'P') { 144 if (marcador.recibo.cuerpos[i].LOP === 'P') {
116 totalCobrado += marcador.recibo.facturas[i].IMP; 145 totalCobrado += marcador.recibo.cuerpos[i].IMP;
117 } 146 }
118 } 147 }
119 148
120 if ($scope.parametros.individual) { 149 if ($scope.parametros.individual) {
121 if (marcador.distancia) { 150 if (marcador.distancia) {
122 observacion += 'Distancia a casa central: ' + 151 observacion += 'Distancia a casa central: ' +
123 marcador.distancia + 'km' + '<br/>'; 152 marcador.distancia + 'km' + '<br/>';
124 observacion += 'Total Cobrado: ' + 153 observacion += 'Total Cobrado: ' +
125 $filter('currency')(totalCobrado, '$'); 154 $filter('currency')(totalCobrado, '$');
126 } 155 }
127 } else { 156 } else {
128 observacion += 'Cantidad de cobranzas: ' + 157 observacion += 'Cantidad de cobranzas: ' +
129 marcador.cantidad + '<br/>'; 158 marcador.cantidad + '<br/>';
130 observacion += 'Total Cobrado: ' + 159 observacion += 'Total Cobrado: ' +
131 $filter('currency')(totalCobrado, '$'); 160 $filter('currency')(totalCobrado, '$');
132 } 161 }
133 return observacion; 162 return observacion;
134 } 163 }
135 164
136 function getEntrega(marcador) { 165 function getEntrega(marcador) {
137 var observacion = ''; 166 var observacion = '';
138 var remito = marcador.hojaRutaMovimiento.remito; 167 var remito = marcador.hojaRutaMovimiento.remito;
139 observacion += 'Vehiculo: ' + 168 observacion += 'Vehiculo: ' +
140 remito.hojaRuta.idVehiculo + ' - ' + 169 remito.hojaRuta.idVehiculo + ' - ' +
141 remito.hojaRuta.vehiculo.tractor + '<br/>'; 170 remito.hojaRuta.vehiculo.tractor + '<br/>';
142 observacion += 'Transportista: ' + 171 observacion += 'Transportista: ' +
143 remito.hojaRuta.transportista.NOM + '<br/>'; 172 remito.hojaRuta.transportista.NOM + '<br/>';
144 observacion += 'Chofer: ' + 173 observacion += 'Chofer: ' +
145 remito.hojaRuta.chofer.nombre + '<br/>'; 174 remito.hojaRuta.chofer.nombre + '<br/>';
146 observacion += 'Hoja de ruta: ' + $filter('comprobante')([ 175 observacion += 'Hoja de ruta: ' + $filter('comprobante')([
147 remito.hojaRuta.sucursal, 176 remito.hojaRuta.sucursal,
148 remito.hojaRuta.numeroHojaRuta 177 remito.hojaRuta.numeroHojaRuta
149 ]) + '<br/>'; 178 ]) + '<br/>';
150 179
151 if (!$scope.parametros.individual) { 180 if (!$scope.parametros.individual) {
152 observacion += '<b>Ultimo Remito</b><br/>'; 181 observacion += '<b>Ultimo Remito</b><br/>';
153 } 182 }
154 183
155 observacion += 'Fecha: ' + 184 observacion += 'Fecha: ' +
156 $filter('date')(marcador.fecha.slice(0,10), 'dd/MM/yyyy') + ' ' + 185 $filter('date')(marcador.fecha.slice(0,10), 'dd/MM/yyyy') + ' ' +
157 marcador.fecha.slice(11,19) + '<br/>'; 186 marcador.fecha.slice(11,19) + '<br/>';
158 187
159 observacion += 'Nº: ' + $filter('comprobante')([ 188 observacion += 'Nº: ' + $filter('comprobante')([
160 remito.sucursal, 189 remito.sucursal,
161 remito.numeroRemito 190 remito.numeroRemito
162 ]) + '<br/>'; 191 ]) + '<br/>';
163 observacion += 'Cliente: ' + 192 observacion += 'Cliente: ' +
164 remito.cliente.NOM + '<br/>'; 193 remito.cliente.NOM + '<br/>';
165 194
166 if ($scope.parametros.individual) { 195 if ($scope.parametros.individual) {
167 observacion += 'Producto: ' + 196 // observacion += 'Producto: ' +
168 remito.articulosRemito[0].descripcion + '<br/>'; 197 // remito.articulosRemito[0].descripcion + '<br/>';
169 observacion += 'Cantidad entregada: ' + 198 // observacion += 'Cantidad entregada: ' +
170 remito.carga + '<br/>'; 199 // remito.carga + '<br/>';
171 200
172 if (marcador.distancia) { 201 if (marcador.distancia) {
173 observacion += 'Distancia a casa central: ' + marcador.distancia + 202 observacion += 'Distancia a casa central: ' + marcador.distancia +
174 'km <br/>'; 203 'km <br/>';
175 } 204 }
176 205
177 if (marcador.observaciones) {
178 observacion += 'Observaciones: ' + marcador.observaciones;
179 }
180 observacion = 'Orden: ' + marcador.orden + '<br/>' + observacion; 206 observacion = 'Orden: ' + marcador.orden + '<br/>' + observacion;
181 } else { 207 } else {
182 observacion += 'Cantidad de entregas: ' + marcador.cantidad; 208 observacion += 'Cantidad de entregas: ' + marcador.cantidad;
183 } 209 }
210 observacion += '<br/>';
211 if (remito.rechazado) {
212 observacion += '<strong>Motivo del rechazo: ' + remito.motivoRechazo;
213 }
184 214
185 return observacion; 215 return observacion;
186 } 216 }
187 217
188 function generarObservacion(array) { 218 function generarObservacion(array) {
189 var resultado = ''; 219 var resultado = '';
190 220
191 for (var i = 0; i < array.length; i++) { 221 for (var i = 0; i < array.length; i++) {
192 resultado += '<b>' + array[i][0] + ': </b>'; 222 resultado += '<b>' + array[i][0] + ': </b>';
193 resultado += array[i][1]; 223 resultado += array[i][1];
194 224
195 if (i < (array.length - 1)) { 225 if (i < (array.length - 1)) {
196 resultado += '<br/>'; 226 resultado += '<br/>';
197 } 227 }
198 } 228 }
199 229
200 return resultado; 230 return resultado;
201 } 231 }
202 }); 232 });
203 }], 233 }],
204 scope: { 234 scope: {
205 latitud: '=', 235 latitud: '=',
206 longitud: '=', 236 longitud: '=',
207 zoom: '=', 237 zoom: '=',
208 marcadores: '=', 238 marcadores: '=',
209 parametros: '=' 239 parametros: '='
210 } 240 }
1 angular.module('focaAdminSeguimiento') 1 angular.module('focaAdminSeguimiento')
2 .service( 2 .service(
3 'focaAdminSeguimientoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT 3 'focaAdminSeguimientoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT
4 ) { 4 ) {
5 return { 5 return {
6 obtenerActividad: function(parametros) { 6 obtenerActividad: function(parametros) {
7 return $http.post(API_ENDPOINT.URL + '/seguimiento/filtros', parametros); 7 return $http.post(API_ENDPOINT.URL + '/seguimiento/filtros', parametros);
8 },
9 obtenerRemitosVehiculo: function(idVehiculo) {
10 return $http.get(API_ENDPOINT.URL + '/hoja-ruta/abierta/' + idVehiculo);
8 } 11 }
9 }; 12 };
10 }]); 13 }]);
11 14
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="-34.7152975" 12 latitud="-34.7152975"
13 longitud="-65.9053867" 13 longitud="-65.9053867"
14 zoom="6" 14 zoom="6"
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="text" 21 type="text"
22 ng-model="now" 22 ng-model="now"
23 class="btn col-12 my-1" 23 class="btn col-12 my-1"
24 ng-blur="fecha()" 24 ng-blur="fecha()"
25 uib-datepicker-popup="dd/MM/yyyy" 25 uib-datepicker-popup="dd/MM/yyyy"
26 show-button-bar="false" 26 show-button-bar="false"
27 is-open="datepickerOpen" 27 is-open="datepickerOpen"
28 on-open-focus="false" 28 on-open-focus="false"
29 ng-focus="datepickerOpen = true" 29 ng-focus="datepickerOpen = true"
30 datepicker-options="dateOptions" 30 datepicker-options="dateOptions"
31 /> 31 />
32 <button 32 <button
33 type="button" 33 type="button"
34 ng-class="{'active': idUsuario == 0}" 34 ng-class="{'active': idUsuario == 0}"
35 class="btn col-12 my-1" 35 class="btn col-12 my-1"
36 ng-click="general()" 36 ng-click="general()"
37 >General</button> 37 >General</button>
38 <button 38 <button
39 type="button" 39 type="button"
40 ng-class="{'active': idUsuario != 0}" 40 ng-class="{'active': idUsuario != 0}"
41 class="btn col-12 my-1" 41 class="btn col-12 my-1"
42 ng-click="individual()" 42 ng-click="individual()"
43 >Individual</button> 43 >Individual</button>
44 <div class="form-group" ng-show="idUsuario == -1"> 44 <div class="form-group" ng-show="idUsuario != 0">
45 <input 45 <input
46 type="text" 46 type="text"
47 placeholder="Vendedor" 47 placeholder="Vendedor"
48 class="form-control" 48 class="form-control"
49 ng-model="idUsuarioInput" 49 ng-model="idUsuarioInput"
50 ng-keypress="search($event.keyCode)" 50 ng-keypress="search($event.keyCode)"
51 foca-focus="idUsuario == -1" 51 foca-focus="idUsuario == -1"
52 ng-show="actividad == 'Nota de pedido'" 52 ng-show="actividad == 'Nota de pedido'"
53 > 53 >
54 <input 54 <input
55 type="text" 55 type="text"
56 placeholder="Vehiculo" 56 placeholder="Vehiculo"
57 class="form-control" 57 class="form-control"
58 ng-model="idUsuarioInput" 58 ng-model="idUsuarioInput"
59 ng-keypress="search($event.keyCode)" 59 ng-keypress="search($event.keyCode)"
60 foca-focus="idUsuario == -1" 60 foca-focus="idUsuario == -1"
61 ng-show="actividad == 'Entrega de producto'" 61 ng-show="actividad == 'Entrega de producto'"
62 > 62 >
63 <input 63 <input
64 type="text" 64 type="text"
65 placeholder="Cobrador" 65 placeholder="Cobrador"
66 class="form-control" 66 class="form-control"
67 ng-model="idUsuarioInput" 67 ng-model="idUsuarioInput"
68 ng-keypress="search($event.keyCode)" 68 ng-keypress="search($event.keyCode)"
69 foca-focus="idUsuario == -1" 69 foca-focus="idUsuario == -1"
70 ng-show="actividad == 'Cobranza'" 70 ng-show="actividad == 'Cobranza'"
71 > 71 >
72 </div> 72 </div>
73 <div ng-show="actividad === 'Entrega de producto'"> 73 <div ng-show="actividad === 'Entrega de producto' && idUsuario != 0">
74 <div class="custom-control custom-radio"> 74 <div class="custom-control custom-radio">
75 <input 75 <input
76 type="radio" 76 type="radio"
77 class="custom-control-input" 77 class="custom-control-input"
78 id="idTodos" 78 id="idTodos"
79 name="filtro" 79 name="filtro"
80 ng-model="filtroEstado" 80 ng-model="filtroEstado"
81 ng-change="search()" 81 ng-change="search(13)"
82 checked> 82 checked>
83 <label class="custom-control-label pb-3" for="idTodos"></label> 83 <label class="custom-control-label pb-3" for="idTodos"></label>
84 <img src="img/marker-icon-grey.png"> 84 <img src="img/marker-icon-grey.png">
85 <strong>Todos</strong> 85 <strong>Todos</strong>
86 </div> 86 </div>
87 <div class="custom-control custom-radio"> 87 <div class="custom-control custom-radio">
88 <input 88 <input
89 type="radio" 89 type="radio"
90 class="custom-control-input" 90 class="custom-control-input"
91 id="entregado" 91 id="entregado"
92 name="filtro" 92 name="filtro"
93 ng-model="filtroEstado" 93 ng-model="filtroEstado"
94 ng-change="search()" 94 ng-change="search(13)"
95 ng-value="false"> 95 ng-value="true">
96 <label class="custom-control-label pb-3" for="entregado"></label> 96 <label class="custom-control-label pb-3" for="entregado"></label>
97 <img src="img/marker-icon-green.png"> 97 <img src="img/marker-icon-green.png">
98 <strong>Entregado</strong> 98 <strong>Entregado</strong>
99 </div> 99 </div>
100 <div class="custom-control custom-radio"> 100 <div class="custom-control custom-radio">
101 <input 101 <input
102 type="radio" 102 type="radio"
103 class="custom-control-input" 103 class="custom-control-input"
104 id="noEntregado" 104 id="noEntregado"
105 name="filtro" 105 name="filtro"
106 ng-model="filtroEstado" 106 ng-model="filtroEstado"
107 ng-change="search()" 107 ng-change="search(13)"
108 ng-value="true"> 108 ng-value="false">
109 <label class="custom-control-label pb-3" for="noEntregado"></label> 109 <label class="custom-control-label pb-3" for="noEntregado"></label>
110 <img src="img/marker-icon-yellow.png"> 110 <img src="img/marker-icon-yellow.png">
111 <strong>No entregado</strong> 111 <strong>No entregado</strong>
112 </div> 112 </div>
113 </div> 113 </div>
114 </div> 114 </div>
115 </div> 115 </div>
116 <div ng-show="actividad === 'Entrega de producto'"> 116 <div ng-show="actividad === 'Entrega de producto' && idUsuario != 0">
117 <strong>Remitos pendientes de entrega</strong> 117 <strong>Remitos pendientes de entrega</strong>
118 <table class="table"> 118 <table class="table">
119 <thead> 119 <thead>
120 <tr> 120 <tr>
121 <th>Remito Nº</th> 121 <th>Remito Nº</th>
122 <th>Cliente</th> 122 <th>Cliente</th>
123 <th>Dirección</th> 123 <th>Dirección</th>
124 </tr> 124 </tr>
125 </thead> 125 </thead>
126 <tbody> 126 <tbody>
127 <tr> 127 <tr ng-repeat="remito in remitosVehiculo">
128 <td>ejemplo</td> 128 <td ng-bind="[remito.sucursal, remito.numeroRemito] | comprobante"></td>
129 <td>ejemplo</td> 129 <td ng-bind="remito.nombreCliente"></td>
130 <td>ejemplo</td> 130 <td ng-bind="remito.domicilioStamp"></td>
131 </tr> 131 </tr>
132 </tbody> 132 </tbody>
133 </table> 133 </table>
134 </div> 134 </div>
135 </div> 135 </div>
136 136