Commit 33743d5fedf8defdaab9944afb708c13a007d9ea

Authored by Jose Pinto
1 parent 6d6faf043e
Exists in master and in 1 other branch develop

lat y lng no editables

src/js/controller.js
... ... @@ -14,6 +14,7 @@ angular.module('focaModalPuntoDescarga')
14 14 $scope.articuloSeleccionado = 0;
15 15 $scope.ivas = [];
16 16 $scope.puntosSeleccionados = [];
  17 + $scope.editando = false;
17 18 $scope.puntoDescarga = {
18 19 id: 0,
19 20 id_cliente: filters.idCliente,
... ... @@ -31,6 +32,14 @@ angular.module('focaModalPuntoDescarga')
31 32 $scope.cancel = function() {
32 33 if($scope.ingreso) {
33 34 $scope.ingreso = false;
  35 + $scope.puntoDescarga = {
  36 + id: 0,
  37 + id_cliente: filters.idCliente,
  38 + id_da_config_0: filters.idDomicilio,
  39 + latitud: -32.89214159952345,
  40 + longitud: -68.84572999101856
  41 + };
  42 + $scope.editando = false;
34 43 }else {
35 44 $uibModalInstance.dismiss('cancel');
36 45 }
... ... @@ -57,6 +66,7 @@ angular.module('focaModalPuntoDescarga')
57 66 latitud: -32.89214159952345,
58 67 longitud: -68.84572999101856
59 68 };
  69 + $scope.editando = false;
60 70 });
61 71 };
62 72  
... ... @@ -64,6 +74,7 @@ angular.module('focaModalPuntoDescarga')
64 74 focaModalPuntoDescargaService.getPuntoDescargaById(id).then(function(res) {
65 75 $scope.puntoDescarga = res.data;
66 76 $scope.ingreso = true;
  77 + $scope.editando = true;
67 78 });
68 79 };
69 80  
src/js/osm-directive.js
... ... @@ -20,7 +20,7 @@ angular.module('focaModalPuntoDescarga').directive('osmPuntoDescarga', function(
20 20 $scope.map.removeLayer($scope.markers[i]);
21 21 }
22 22 $scope.markers.push(
23   - L.marker([$scope.latitud, $scope.longitud], {draggable:'true'})
  23 + L.marker([$scope.latitud, $scope.longitud], {draggable: $scope.draggable})
24 24 .addTo($scope.map)
25 25 .on('dragend', function() {
26 26 $scope.latitud = this.getLatLng().lat;
... ... @@ -33,7 +33,8 @@ angular.module('focaModalPuntoDescarga').directive('osmPuntoDescarga', function(
33 33 scope: {
34 34 latitud: '=',
35 35 longitud: '=',
36   - zoom: '='
  36 + zoom: '=',
  37 + draggable: '<'
37 38 }
38 39 };
39 40 });
src/views/modal-punto-descarga.html
... ... @@ -25,7 +25,7 @@
25 25 </thead>
26 26 <tbody>
27 27 <tr ng-show="!puntosDescarga.length">
28   - <td colspan="3">
  28 + <td colspan="5">
29 29 No se encontraron resultados.
30 30 </td>
31 31 </tr>
... ... @@ -193,6 +193,7 @@
193 193 class="form-control form-control-sm"
194 194 ng-model="puntoDescarga.latitud"
195 195 ng-required="true"
  196 + ng-readonly="editando"
196 197 />
197 198 </div>
198 199 <div class="col-6">
... ... @@ -202,6 +203,7 @@
202 203 class="form-control form-control-sm"
203 204 ng-model="puntoDescarga.longitud"
204 205 ng-required="true"
  206 + ng-readonly="editando"
205 207 />
206 208 </div>
207 209 </div>
... ... @@ -209,7 +211,8 @@
209 211 latitud="puntoDescarga.latitud"
210 212 longitud="puntoDescarga.longitud"
211 213 zoom="14"
212   - ng-if="ingreso"
  214 + ng-if="ingreso",
  215 + draggable="!editando"
213 216 />
214 217 </form>
215 218 </div>