Commit e299523808c8d83ecbce7653f5d2987d179d711e
Exists in
master
Merge branch 'master' into 'master'
Master See merge request !11
Showing
3 changed files
Show diff stats
src/js/controller.js
1 | angular.module('focaModalDetalleHojaRuta') | 1 | angular.module('focaModalDetalleHojaRuta') |
2 | .controller('focaModalDetalleHojaRutaController', | 2 | .controller('focaModalDetalleHojaRutaController', |
3 | [ | 3 | [ |
4 | '$filter', | 4 | '$filter', |
5 | '$scope', | 5 | '$scope', |
6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
7 | 'idRemito', | 7 | 'idRemito', |
8 | 'focaModalDetalleHojaRutaService', | 8 | 'focaModalDetalleHojaRutaService', |
9 | 'focaModalService', | 9 | 'focaModalService', |
10 | 'focaSeguimientoService', | 10 | 'focaSeguimientoService', |
11 | '$uibModal', | 11 | '$uibModal', |
12 | function($filter, $scope, $uibModalInstance, idRemito, focaModalDetalleHojaRutaService, | 12 | function($filter, $scope, $uibModalInstance, idRemito, focaModalDetalleHojaRutaService, |
13 | focaModalService, focaSeguimientoService, $uibModal) | 13 | focaModalService, focaSeguimientoService, $uibModal) |
14 | { | 14 | { |
15 | //Seteo variables | 15 | //Seteo variables |
16 | $scope.remito = {}; | 16 | $scope.remito = {}; |
17 | $scope.cisternas = []; | 17 | $scope.cisternas = []; |
18 | $scope.articuloSeleccionado = {}; | 18 | $scope.articuloSeleccionado = {}; |
19 | $scope.aDescargar = []; | 19 | $scope.aDescargar = []; |
20 | $scope.cargando = true; | 20 | $scope.cargando = true; |
21 | 21 | ||
22 | //Datos | 22 | //Datos |
23 | var promesaRemito = focaModalDetalleHojaRutaService | 23 | var promesaRemito = focaModalDetalleHojaRutaService |
24 | .getRemitoById(idRemito); | 24 | .getRemitoById(idRemito); |
25 | var promesaCisternas = focaModalDetalleHojaRutaService | 25 | var promesaCisternas = focaModalDetalleHojaRutaService |
26 | .getCisternasByIdRemito(idRemito); | 26 | .getCisternasByIdRemito(idRemito); |
27 | 27 | ||
28 | Promise.all([promesaRemito, promesaCisternas]).then(function(res) { | 28 | Promise.all([promesaRemito, promesaCisternas]).then(function(res) { |
29 | $scope.cargando = false; | 29 | $scope.cargando = false; |
30 | $scope.remito = res[0].data; | 30 | $scope.remito = res[0].data; |
31 | $scope.cisternas = res[1].data; | 31 | $scope.cisternas = res[1].data; |
32 | var articuloAChequear = $scope.remito.articulosRemito.filter( | 32 | var articuloAChequear = $scope.remito.articulosRemito.filter( |
33 | function(articulo) { | 33 | function(articulo) { |
34 | return !articulo.descargado; | 34 | return !articulo.descargado; |
35 | }); | 35 | }); |
36 | if(!articuloAChequear.length || $scope.remito.rechazado) { | 36 | if(!articuloAChequear.length || $scope.remito.rechazado) { |
37 | $scope.readonly = true; | 37 | $scope.readonly = true; |
38 | $scope.cambio($scope.remito.articulosRemito[0]); | 38 | $scope.cambio($scope.remito.articulosRemito[0]); |
39 | }else { | 39 | }else { |
40 | $scope.cambio(articuloAChequear[0]); | 40 | $scope.cambio(articuloAChequear[0]); |
41 | } | 41 | } |
42 | $scope.$digest(); | 42 | $scope.$digest(); |
43 | }, function() { | 43 | }, function() { |
44 | focaModalService.alert('El servicio no responde intente más tarde'); | 44 | focaModalService.alert('El servicio no responde intente más tarde'); |
45 | $uibModalInstance.dismiss(); | 45 | $uibModalInstance.dismiss(); |
46 | }); | 46 | }); |
47 | $scope.cambio = function(articulo) { | 47 | $scope.cambio = function(articulo) { |
48 | if(!$scope.articuloSeleccionado.descargado) { | 48 | if(!$scope.articuloSeleccionado.descargado) { |
49 | $scope.articuloSeleccionado.cantidadDescargada = 0; | 49 | $scope.articuloSeleccionado.cantidadDescargada = 0; |
50 | } | 50 | } |
51 | $scope.aDescargar = []; | 51 | $scope.aDescargar = []; |
52 | $scope.articuloSeleccionado = articulo; | 52 | $scope.articuloSeleccionado = articulo; |
53 | }; | 53 | }; |
54 | $scope.descargar = function(key) { | 54 | $scope.descargar = function(key) { |
55 | if(key === 13) { | 55 | if(key === 13) { |
56 | $scope.cargando = true; | 56 | $scope.cargando = true; |
57 | var hojaRutaMovimientos = []; | 57 | var hojaRutaMovimientos = []; |
58 | var cisternaMovimientos = []; | 58 | var cisternaMovimientos = []; |
59 | var cisternaCargas = []; | 59 | var cisternaCargas = []; |
60 | var totalADescargar = 0; | 60 | var totalADescargar = 0; |
61 | for(var i = 0; i < $scope.aDescargar.length; i++) { | 61 | for(var i = 0; i < $scope.aDescargar.length; i++) { |
62 | totalADescargar += $scope.aDescargar[i] || 0; | 62 | totalADescargar += $scope.aDescargar[i] || 0; |
63 | } | 63 | } |
64 | focaModalService | 64 | focaModalService |
65 | .confirm('¿Desea descargar ' + totalADescargar + ' litros de ' + | 65 | .confirm('¿Desea descargar ' + totalADescargar + ' litros de ' + |
66 | $scope.articuloSeleccionado.descripcion + '?') | 66 | $scope.articuloSeleccionado.descripcion + '?') |
67 | .then(descargar, function() { | 67 | .then(descargar, function() { |
68 | $scope.cargando = false; | 68 | $scope.cargando = false; |
69 | }); | 69 | }); |
70 | } | 70 | } |
71 | function descargar() { | 71 | function descargar() { |
72 | for(var i = 0; i < $scope.cisternas.length; i++) { | 72 | for(var i = 0; i < $scope.cisternas.length; i++) { |
73 | var descarga = $scope.aDescargar[i]; | 73 | var descarga = $scope.aDescargar[i]; |
74 | var cisternaCarga = $scope.cisternas[i].cisternaCarga; | 74 | var cisternaCarga = $scope.cisternas[i].cisternaCarga; |
75 | if(!descarga) continue; | 75 | if(!descarga) continue; |
76 | if(descarga > cisternaCarga.cantidad) { | 76 | if(descarga > cisternaCarga.cantidad) { |
77 | focaModalService.alert('La cantidad a descargar no debe ser ' + | 77 | focaModalService.alert('La cantidad a descargar no debe ser ' + |
78 | 'mayor a la cantidad de la cisterna'); | 78 | 'mayor a la cantidad de la cisterna'); |
79 | $scope.cargando = false; | 79 | $scope.cargando = false; |
80 | return; | 80 | return; |
81 | } | 81 | } |
82 | cisternaCarga.cantidad -= descarga; | 82 | cisternaCarga.cantidad -= descarga; |
83 | 83 | ||
84 | //Guardar | 84 | //Guardar |
85 | var now = new Date(); | 85 | var now = new Date(); |
86 | var cisternaMovimiento = { | 86 | var cisternaMovimiento = { |
87 | fecha: now.toISOString().slice(0, 19).replace('T', ' '), | 87 | fecha: now.toISOString().slice(0, 19).replace('T', ' '), |
88 | cantidad: descarga, | 88 | cantidad: descarga, |
89 | metodo: 'descarga', | 89 | metodo: 'descarga', |
90 | idCisternaCarga: cisternaCarga.id, | 90 | idCisternaCarga: cisternaCarga.id, |
91 | idRemito: $scope.remito.id | 91 | idRemito: $scope.remito.id |
92 | }; | 92 | }; |
93 | var hojaRutaMovimiento = { | 93 | var hojaRutaMovimiento = { |
94 | reciboDescarga: $scope.numeroRecibo, | 94 | reciboDescarga: $scope.numeroRecibo, |
95 | idRemito: $scope.remito.id | 95 | idRemito: $scope.remito.id |
96 | }; | 96 | }; |
97 | delete cisternaCarga.articulo; | 97 | delete cisternaCarga.articulo; |
98 | cisternaCargas.push(cisternaCarga); | 98 | cisternaCargas.push(cisternaCarga); |
99 | cisternaMovimientos.push(cisternaMovimiento); | 99 | cisternaMovimientos.push(cisternaMovimiento); |
100 | hojaRutaMovimientos.push(hojaRutaMovimiento); | 100 | hojaRutaMovimientos.push(hojaRutaMovimiento); |
101 | } | 101 | } |
102 | var save = { | 102 | var save = { |
103 | cisternaCargas: cisternaCargas, | 103 | cisternaCargas: cisternaCargas, |
104 | cisternaMovimientos: cisternaMovimientos, | 104 | cisternaMovimientos: cisternaMovimientos, |
105 | hojaRutaMovimientos: hojaRutaMovimientos, | 105 | hojaRutaMovimientos: hojaRutaMovimientos, |
106 | articulo: $scope.articuloSeleccionado | 106 | articulo: $scope.articuloSeleccionado |
107 | }; | 107 | }; |
108 | focaModalDetalleHojaRutaService | 108 | focaModalDetalleHojaRutaService |
109 | .postMovimientoHojaRuta(save) | 109 | .postMovimientoHojaRuta(save) |
110 | .then(guardarSeguimiento) | 110 | .then(guardarSeguimiento) |
111 | .catch(error); | 111 | .catch(error); |
112 | function guardarSeguimiento(res) { | 112 | function guardarSeguimiento(res) { |
113 | focaSeguimientoService | 113 | focaSeguimientoService |
114 | .guardarPosicion( | 114 | .guardarPosicion( |
115 | 'Entrega de producto', | 115 | 'Entrega de producto', |
116 | res.data[0].id, | 116 | res.data[0].id, |
117 | $scope.remito.observaciones); | 117 | $scope.remito.observaciones); |
118 | $scope.aDescargar = []; | 118 | $scope.aDescargar = []; |
119 | $scope.remito.observaciones = ''; | 119 | $scope.remito.observaciones = ''; |
120 | $scope.articuloSeleccionado.descargado = true; | 120 | $scope.articuloSeleccionado.descargado = true; |
121 | var siguienteArticulo = $scope.remito.articulosRemito.filter( | 121 | var siguienteArticulo = $scope.remito.articulosRemito.filter( |
122 | function(articulo) { | 122 | function(articulo) { |
123 | return articulo.id != $scope.articuloSeleccionado.id; | 123 | return articulo.id != $scope.articuloSeleccionado.id; |
124 | } | 124 | } |
125 | ); | 125 | ); |
126 | if(siguienteArticulo.length) { | 126 | if(siguienteArticulo.length) { |
127 | $scope.cambio(siguienteArticulo[0]); | 127 | $scope.cambio(siguienteArticulo[0]); |
128 | } | 128 | } |
129 | $scope.actualizarPuntoDescarga(); | 129 | $scope.actualizarPuntoDescarga(); |
130 | } | 130 | } |
131 | } | 131 | } |
132 | }; | 132 | }; |
133 | 133 | ||
134 | $scope.cancel = function() { | 134 | $scope.cancel = function() { |
135 | $uibModalInstance.dismiss('cancel'); | 135 | $uibModalInstance.dismiss('cancel'); |
136 | }; | 136 | }; |
137 | 137 | ||
138 | $scope.distribucionDisponible = function() { | 138 | $scope.distribucionDisponible = function() { |
139 | return $scope.articuloSeleccionado.cantidadDescargada && | 139 | return $scope.articuloSeleccionado.cantidadDescargada && |
140 | $scope.articuloSeleccionado.cantidadDescargada <= | 140 | $scope.articuloSeleccionado.cantidadDescargada <= |
141 | $scope.articuloSeleccionado.cantidad; | 141 | $scope.articuloSeleccionado.cantidad; |
142 | }; | 142 | }; |
143 | 143 | ||
144 | $scope.actualizarArticulo = function() { | 144 | $scope.actualizarArticulo = function() { |
145 | $scope.articuloSeleccionado.cantidadDescargada = 0; | 145 | $scope.articuloSeleccionado.cantidadDescargada = 0; |
146 | for(var i = 0; i < $scope.aDescargar.length; i++) { | 146 | for(var i = 0; i < $scope.aDescargar.length; i++) { |
147 | $scope.articuloSeleccionado.cantidadDescargada += | 147 | $scope.articuloSeleccionado.cantidadDescargada += |
148 | parseFloat($scope.aDescargar[i]) || 0; | 148 | parseFloat($scope.aDescargar[i]) || 0; |
149 | } | 149 | } |
150 | }; | 150 | }; |
151 | 151 | ||
152 | $scope.actualizarPuntoDescarga = function() { | 152 | $scope.actualizarPuntoDescarga = function() { |
153 | var modalInstance = $uibModal.open( | 153 | var modalInstance = $uibModal.open( |
154 | { | 154 | { |
155 | ariaLabelledBy: 'Actualizar punto de descarga', | 155 | ariaLabelledBy: 'Actualizar punto de descarga', |
156 | templateUrl: 'modal-actualizar-punto-descarga.html', | 156 | templateUrl: 'modal-actualizar-punto-descarga.html', |
157 | controller: 'focaModalActualizarPuntoDescargaController', | 157 | controller: 'focaModalActualizarPuntoDescargaController', |
158 | resolve: { | 158 | resolve: { |
159 | puntosDescarga: function() { | 159 | notaPedido: function() { |
160 | return $scope.remito.notaPedido.notaPedidoPuntoDescarga; | 160 | return $scope.remito.notaPedido; |
161 | } | 161 | } |
162 | }, | 162 | }, |
163 | size: 'lg' | 163 | size: 'lg' |
164 | } | 164 | } |
165 | ); | 165 | ); |
166 | modalInstance.result.then(function() { | 166 | modalInstance.result.then(function() { |
167 | success(); | 167 | success(); |
168 | }, function() { | 168 | }, function() { |
169 | success(); | 169 | success(); |
170 | }); | 170 | }); |
171 | }; | 171 | }; |
172 | 172 | ||
173 | $scope.rechazar = function() { | 173 | $scope.rechazar = function() { |
174 | focaModalService | 174 | focaModalService |
175 | .prompt('Aclare el motivo de rechazo') | 175 | .prompt('Aclare el motivo de rechazo') |
176 | .then(function(motivo) { | 176 | .then(function(motivo) { |
177 | $scope.cargando = true; | 177 | $scope.cargando = true; |
178 | var remitoRechazado = $.extend(true, {}, $scope.remito); | 178 | var remitoRechazado = $.extend(true, {}, $scope.remito); |
179 | delete remitoRechazado.articulosRemito; | 179 | delete remitoRechazado.articulosRemito; |
180 | delete remitoRechazado.notaPedido; | 180 | delete remitoRechazado.notaPedido; |
181 | remitoRechazado.rechazado = true; | 181 | remitoRechazado.rechazado = true; |
182 | remitoRechazado.motivoRechazo = motivo; | 182 | remitoRechazado.motivoRechazo = motivo; |
183 | remitoRechazado.fechaRemito = | 183 | remitoRechazado.fechaRemito = |
184 | remitoRechazado.fechaRemito.slice(0, 19).replace('T', ' '); | 184 | remitoRechazado.fechaRemito.slice(0, 19).replace('T', ' '); |
185 | focaModalDetalleHojaRutaService.rechazarRemito(remitoRechazado) | 185 | focaModalDetalleHojaRutaService.rechazarRemito(remitoRechazado) |
186 | .then(function(res) { | 186 | .then(function(res) { |
187 | focaSeguimientoService.guardarPosicion( | 187 | focaSeguimientoService.guardarPosicion( |
188 | 'Entrega de producto', | 188 | 'Entrega de producto', |
189 | res.data[1].id, | 189 | res.data[1].id, |
190 | motivo); | 190 | motivo); |
191 | success(); | 191 | success(); |
192 | }) | 192 | }) |
193 | .catch(error); | 193 | .catch(error); |
194 | $scope.readonly = true; | 194 | $scope.readonly = true; |
195 | }); | 195 | }); |
196 | }; | 196 | }; |
197 | 197 | ||
198 | //funciones | 198 | //funciones |
199 | function error(error) { | 199 | function error(error) { |
200 | focaModalService.alert('Hubo un error ' + error); | 200 | focaModalService.alert('Hubo un error ' + error); |
201 | } | 201 | } |
202 | function success() { | 202 | function success() { |
203 | focaModalService.alert('Operación realizada con éxito'); | 203 | focaModalService.alert('Operación realizada con éxito'); |
204 | $scope.cargando = false; | 204 | $scope.cargando = false; |
205 | } | 205 | } |
206 | } | 206 | } |
207 | ] | 207 | ] |
208 | ) | 208 | ) |
209 | .controller('focaModalActualizarPuntoDescargaController', | 209 | .controller('focaModalActualizarPuntoDescargaController', |
210 | [ | 210 | [ |
211 | '$scope', | 211 | '$scope', |
212 | '$uibModalInstance', | 212 | '$uibModalInstance', |
213 | 'focaSeguimientoService', | 213 | 'focaSeguimientoService', |
214 | 'focaModalService', | 214 | 'focaModalService', |
215 | 'puntosDescarga', | 215 | 'notaPedido', |
216 | 'focaModalDetalleHojaRutaService', | ||
216 | 'focaModalDetalleHojaRutaService', | 217 | function($scope, $uibModalInstance, focaSeguimientoService, |
217 | function($scope, $uibModalInstance, focaSeguimientoService, | 218 | focaModalService, notaPedido, focaModalDetalleHojaRutaService) |
218 | focaModalService, puntosDescarga, focaModalDetalleHojaRutaService) | 219 | { |
219 | { | 220 | $scope.notaPedido = notaPedido; |
220 | $scope.puntosDescarga = puntosDescarga; | 221 | $scope.descripcion = ''; |
221 | focaSeguimientoService.obtenerPosicion(function(res) { | 222 | focaSeguimientoService.obtenerPosicion(function(res) { |
223 | $scope.posicion = res.coords; | ||
224 | }); | ||
225 | |||
226 | $scope.cancel = function() { | ||
222 | $scope.posicion = res.coords; | 227 | if ($scope.ingreso) { |
223 | }); | 228 | $scope.ingreso = false; |
224 | 229 | } else { | |
225 | $scope.cancel = function() { | 230 | $uibModalInstance.dismiss(); |
226 | $uibModalInstance.dismiss(); | 231 | } |
227 | }; | 232 | }; |
228 | 233 | ||
229 | $scope.select = function(puntoDescarga) { | 234 | $scope.select = function(puntoDescarga) { |
230 | if(!$scope.posicion){ | 235 | if (!$scope.posicion) { |
231 | focaModalService.alert('No se pudo obtener la ubicacion'); | 236 | focaModalService.alert('No se pudo obtener la ubicación'); |
232 | return; | 237 | return; |
238 | } | ||
239 | puntoDescarga.latitud = $scope.posicion.latitude; | ||
240 | puntoDescarga.longitud = $scope.posicion.longitude; | ||
241 | focaModalDetalleHojaRutaService | ||
242 | .guardarPuntoDescarga(puntoDescarga) | ||
243 | .then(function(res) { | ||
244 | $uibModalInstance.close(res.data); | ||
245 | }); | ||
246 | }; | ||
247 | |||
248 | $scope.guardar = function() { | ||
249 | if (!$scope.posicion) { | ||
250 | focaModalService.alert('No se pudo obtener la ubicación'); | ||
251 | return; | ||
252 | } | ||
253 | focaModalDetalleHojaRutaService | ||
254 | .guardarPuntoDescarga({ | ||
255 | id: 0, | ||
256 | id_cliente: $scope.notaPedido.idCliente, | ||
233 | } | 257 | id_da_config_0: $scope.notaPedido.idDomicilio, |
234 | puntoDescarga.latitud = $scope.posicion.latitude; | 258 | descripcion: $scope.descripcion, |
235 | puntoDescarga.longitud = $scope.posicion.longitude; | 259 | latitud: $scope.posicion.latitude, |
260 | longitud: $scope.posicion.longitude | ||
236 | focaModalDetalleHojaRutaService | 261 | }) |
262 | .then(function(res) { | ||
237 | .updatePuntoDescarga(puntoDescarga) | 263 | $uibModalInstance.close(res.data); |
238 | .then(function(res) { | 264 | }); |
239 | $uibModalInstance.close(res.data); | 265 | |
240 | }); | 266 | }; |
241 | }; | 267 | |
242 | } | 268 | } |
243 | ] | 269 | ] |
244 | ); | 270 | ); |
245 | 271 |
src/js/service.js
1 | angular.module('focaModalDetalleHojaRuta') | 1 | angular.module('focaModalDetalleHojaRuta') |
2 | .service('focaModalDetalleHojaRutaService', [ | 2 | .service('focaModalDetalleHojaRutaService', [ |
3 | '$http', | 3 | '$http', |
4 | 'API_ENDPOINT', | 4 | 'API_ENDPOINT', |
5 | function($http, API_ENDPOINT) { | 5 | function($http, API_ENDPOINT) { |
6 | return { | 6 | return { |
7 | getDetallesHojaRuta: function() { | 7 | getDetallesHojaRuta: function() { |
8 | return $http.get(API_ENDPOINT.URL + '/transportista'); | 8 | return $http.get(API_ENDPOINT.URL + '/transportista'); |
9 | }, | 9 | }, |
10 | getCisternasByIdRemito: function(idRemito) { | 10 | getCisternasByIdRemito: function(idRemito) { |
11 | return $http.get(API_ENDPOINT.URL + '/cisternas/obtener/remito/' + idRemito); | 11 | return $http.get(API_ENDPOINT.URL + '/cisternas/obtener/remito/' + idRemito); |
12 | }, | 12 | }, |
13 | getRemitoById: function(idRemito) { | 13 | getRemitoById: function(idRemito) { |
14 | return $http.get(API_ENDPOINT.URL + '/remito/obtener/' + idRemito + '/punto'); | 14 | return $http.get(API_ENDPOINT.URL + '/remito/obtener/' + idRemito + '/punto'); |
15 | }, | 15 | }, |
16 | postMovimientoHojaRuta: function(datos) { | 16 | postMovimientoHojaRuta: function(datos) { |
17 | return $http.post(API_ENDPOINT.URL + '/hoja-ruta/movimiento', datos); | 17 | return $http.post(API_ENDPOINT.URL + '/hoja-ruta/movimiento', datos); |
18 | }, | 18 | }, |
19 | rechazarRemito: function(remito) { | 19 | rechazarRemito: function(remito) { |
20 | return $http.post(API_ENDPOINT.URL + '/remito/rechazar', {remito: remito}); | 20 | return $http.post(API_ENDPOINT.URL + '/remito/rechazar', {remito: remito}); |
21 | }, | 21 | }, |
22 | updatePuntoDescarga: function(puntoDescarga) { | 22 | guardarPuntoDescarga: function(puntoDescarga) { |
23 | return $http.post(API_ENDPOINT.URL + '/punto-descarga', | 23 | return $http.post(API_ENDPOINT.URL + '/punto-descarga', |
24 | {puntoDescarga: puntoDescarga}); | 24 | {puntoDescarga: puntoDescarga}); |
25 | } | 25 | } |
26 | }; | 26 | }; |
27 | } | 27 | } |
28 | ]); | 28 | ]); |
29 | 29 |
src/views/modal-actualizar-punto-descarga.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1 d-flex"> |
2 | <h5 class="modal-title">Actualizar posición punto de descarga</h5> | 2 | <h5 class="modal-title" ng-hide="ingreso">Actualizar posición punto de descarga</h5> |
3 | <h5 class="modal-title" ng-show="ingreso">Crear nuevo punto de descarga</h5> | ||
4 | <button | ||
5 | class="btn btn-primary" | ||
6 | title="Nuevo" | ||
7 | ng-click="ingreso = true" | ||
8 | ng-hide="ingreso"> | ||
9 | <i class="fa fa-plus" aria-hidden="true"></i> | ||
10 | </button> | ||
3 | </div> | 11 | </div> |
4 | <div class="modal-body" id="modal-body"> | 12 | <div class="modal-body" id="modal-body"> |
5 | <table | 13 | <table |
6 | class="table table-striped table-sm col-12" | 14 | class="table table-striped table-sm col-12" |
7 | ng-hide="ingreso || cargaArticulos"> | 15 | ng-hide="ingreso"> |
8 | <thead> | 16 | <thead> |
9 | <tr> | 17 | <tr> |
10 | <th>Código</th> | 18 | <th>Código</th> |
11 | <th>Descripción</th> | 19 | <th>Descripción</th> |
12 | <th>Latitud</th> | 20 | <th>Latitud</th> |
13 | <th>Longitud</th> | 21 | <th>Longitud</th> |
14 | <th></th> | 22 | <th></th> |
15 | </tr> | 23 | </tr> |
16 | </thead> | 24 | </thead> |
17 | <tbody> | 25 | <tbody> |
18 | <tr ng-show="!puntosDescarga.length"> | 26 | <tr ng-show="!puntosDescarga.length"> |
19 | <td colspan="5"> | 27 | <td colspan="5"> |
20 | No se encontraron resultados. | 28 | No se encontraron resultados. |
21 | </td> | 29 | </td> |
22 | </tr> | 30 | </tr> |
23 | <tr class="selected" | 31 | <tr class="selected" |
24 | ng-repeat="(key, puntoDescarga) in puntosDescarga | filter: filters" | 32 | ng-repeat="(key, puntoDescarga) in puntosDescarga | filter: filters" |
25 | > | 33 | > |
26 | <td | 34 | <td |
27 | ng-bind="puntoDescarga.puntoDescarga.id | rellenarDigitos: 3: 0" | 35 | ng-bind="puntoDescarga.puntoDescarga.id | rellenarDigitos: 3: 0" |
28 | ng-click="seleccionarPunto(key)"></td> | 36 | ng-click="seleccionarPunto(key)"></td> |
29 | <td | 37 | <td |
30 | ng-bind="puntoDescarga.puntoDescarga.descripcion" | 38 | ng-bind="puntoDescarga.puntoDescarga.descripcion" |
31 | ng-click="seleccionarPunto(key)"></td> | 39 | ng-click="seleccionarPunto(key)"></td> |
32 | <td | 40 | <td |
33 | ng-bind="puntoDescarga.puntoDescarga.latitud" | 41 | ng-bind="puntoDescarga.puntoDescarga.latitud" |
34 | ng-click="seleccionarPunto(key)"></td> | 42 | ng-click="seleccionarPunto(key)"></td> |
35 | <td | 43 | <td |
36 | ng-bind="puntoDescarga.puntoDescarga.longitud" | 44 | ng-bind="puntoDescarga.puntoDescarga.longitud" |
37 | ng-click="seleccionarPunto(key)"></td> | 45 | ng-click="seleccionarPunto(key)"></td> |
38 | <td> | 46 | <td> |
39 | <button | 47 | <button |
40 | type="button" | 48 | type="button" |
41 | class="btn btn-xs btn-primary p-1 float-right mr-5" | 49 | class="btn btn-xs btn-primary p-1 float-right mr-5" |
42 | ng-click="select(puntoDescarga.puntoDescarga)" | 50 | ng-click="select(puntoDescarga.puntoDescarga)" |
43 | title="Actualizar"> | 51 | title="Actualizar"> |
44 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 52 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
45 | </button> | 53 | </button> |
46 | </td> | 54 | </td> |
47 | </tr> | 55 | </tr> |
48 | </tbody> | 56 | </tbody> |
49 | </table> | 57 | </table> |
58 | <div ng-show="ingreso"> | ||
59 | <form> | ||
60 | <label>Descripción</label> | ||
61 | <input | ||
62 | ng-model="descripcion" | ||
63 | type="text" | ||
64 | class="form-control"> | ||
65 | </form> | ||
66 | </div> | ||
50 | </div> | 67 | </div> |
51 | <div class="modal-footer py-2"> | 68 | <div class="modal-footer py-2"> |
52 | <button | 69 | <button |
53 | class="btn btn-secondary btn-sm" | 70 | class="btn btn-secondary btn-sm" |
54 | type="button" | 71 | type="button" |
72 | ng-click="guardar()" | ||
73 | >Guardar</button> | ||
74 | <button | ||
75 | class="btn btn-secondary btn-sm" | ||
76 | type="button" | ||
55 | ng-click="cancel()" | 77 | ng-click="cancel()" |
56 | >Cancelar</button> | 78 | >Cancelar</button> |
57 | </div> | 79 | </div> |
58 | 80 |