Commit fd7984733c81f7e632bd42ef8e0847f0e0492690
Exists in
master
and in
1 other branch
Merge branch 'master' of http://git.focasoftware.com/npm/foca-abm-vehiculo
# Conflicts: # src/js/controller.js # src/views/foca-abm-vehiculos-item.html
Showing
3 changed files
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 |
src/views/foca-abm-vehiculos-listado.html
| ... | ... | @@ -15,7 +15,9 @@ |
| 15 | 15 | <th>Código</th> |
| 16 | 16 | <th>Transportista</th> |
| 17 | 17 | <th>Tractor</th> |
| 18 | + <th>Semi</th> | |
| 18 | 19 | <th>Capacidad</th> |
| 20 | + <th>Cisternado</th> | |
| 19 | 21 | <th class="text-center"> |
| 20 | 22 | <button class="btn btn-default boton-accion" ng-click="editar(0)"> |
| 21 | 23 | <i class="fa fa-plus"></i> |
| ... | ... | @@ -28,7 +30,9 @@ |
| 28 | 30 | <td ng-bind="vehiculo.id"></td> |
| 29 | 31 | <td ng-bind="vehiculo.transportista.NOM || 'No tiene'"></td> |
| 30 | 32 | <td ng-bind="vehiculo.tractor"></td> |
| 33 | + <td ng-bind="vehiculo.semi"></td> | |
| 31 | 34 | <td ng-bind="vehiculo.capacidad"></td> |
| 35 | + <td ng-bind="vehiculo.cisternado"></td> | |
| 32 | 36 | <td class="text-center"> |
| 33 | 37 | <button |
| 34 | 38 | class="btn btn-default boton-accion" |
| ... | ... | @@ -46,4 +50,9 @@ |
| 46 | 50 | </tr> |
| 47 | 51 | </body> |
| 48 | 52 | </table> |
| 53 | + <a href="#!/" title="Salir" | |
| 54 | + class="btn btn-secondary btn-block float-right col-md-2" | |
| 55 | + > | |
| 56 | + Salir | |
| 57 | + </a> | |
| 49 | 58 | </div> |