Commit 4c0293733ba3ac773b9543fdfe250fb51e3cf1b3
1 parent
599b49f2f7
Exists in
master
arreglos para demo
Showing
3 changed files
with
26 additions
and
25 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -25,15 +25,23 @@ angular.module('focaAbmVehiculo') |
| 25 | 25 | .controller('focaAbmVehiculoController', [ |
| 26 | 26 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', |
| 27 | 27 | function($scope, focaAbmVehiculoService, $routeParams, $location) { |
| 28 | + $scope.transportistas = []; | |
| 29 | + | |
| 28 | 30 | focaAbmVehiculoService.getVehiculo($routeParams.id).then(function(res) { |
| 29 | - if(!res.data[0].transportista.COD) { | |
| 30 | - res.data[0].transportista = ''; | |
| 31 | + if (res.data.length > 0) { | |
| 32 | + if(!res.data[0].transportista.COD) { | |
| 33 | + res.data[0].transportista = ''; | |
| 34 | + } | |
| 35 | + | |
| 36 | + $scope.vehiculo = res.data[0]; | |
| 31 | 37 | } |
| 32 | - $scope.vehiculo = res.data[0]; | |
| 38 | + | |
| 33 | 39 | }); |
| 40 | + | |
| 34 | 41 | focaAbmVehiculoService.getTransportistas().then(function(res) { |
| 35 | 42 | $scope.transportistas = res.data; |
| 36 | 43 | }); |
| 44 | + | |
| 37 | 45 | $scope.cancelar = function() { |
| 38 | 46 | $location.path('/vehiculo'); |
| 39 | 47 | }; |
src/views/foca-abm-vehiculos-item.html
| 1 | -<h4>Sectores</h4> | |
| 1 | +<h4>Vehiculo</h4> | |
| 2 | 2 | <form name="formVehiculo"> |
| 3 | 3 | <input type="hidden" name="id" ng-model="sector.id" /> |
| 4 | 4 | <div class="form-group row"> |
| 5 | 5 | <label class="offset-sm-1 col-sm-2 col-form-label">Transportista</label> |
| 6 | 6 | <div class="col-sm-4"> |
| 7 | - <input | |
| 8 | - class="form-control" | |
| 9 | - type="text" | |
| 10 | - teclado-virtual | |
| 11 | - ng-model="vehiculo.transportista" | |
| 12 | - ng-model-options="{allowInvalid: false}" | |
| 13 | - uib-typeahead="transportista as transportista.COD + ' ' + | |
| 14 | - transportista.NOM for transportista in transportistas | filter:$viewValue" | |
| 15 | - /> | |
| 16 | - </div> | |
| 17 | - </div> | |
| 18 | - <div class="form-group row"> | |
| 19 | - <label class="offset-sm-1 col-sm-2 col-form-label">Código</label> | |
| 20 | - <div class="col-sm-4"> | |
| 21 | - <input | |
| 22 | - class="form-control" | |
| 23 | - type="text" | |
| 24 | - teclado-virtual | |
| 25 | - ng-model="vehiculo.id" | |
| 26 | - readonly | |
| 27 | - /> | |
| 7 | + <select class="form-control" ng-model="vehiculo.transportista" | |
| 8 | + ng-options="transportista as transportista.NOM for transportista in transportistas" | |
| 9 | + > | |
| 10 | + </select> | |
| 28 | 11 | </div> |
| 29 | 12 | </div> |
| 30 | 13 | <div class="form-group row"> |
| ... | ... | @@ -86,3 +69,8 @@ |
| 86 | 69 | </div> |
| 87 | 70 | </div> |
| 88 | 71 | </form> |
| 72 | +<a href="#!/" title="Salir" | |
| 73 | + class="btn btn-secondary btn-block float-right col-md-2" | |
| 74 | +> | |
| 75 | + Salir | |
| 76 | +</a> | |
| 89 | 77 | \ No newline at end of file |