Commit a41316a843d860568acccd787db517fc245eb314
1 parent
599b49f2f7
Exists in
master
prev commit
Showing
7 changed files
with
358 additions
and
47 deletions
Show diff stats
src/js/controller.js
1 | angular.module('focaAbmVehiculo') | 1 | angular.module('focaAbmVehiculo') |
2 | .controller('focaAbmVehiculosController', [ | 2 | .controller('focaAbmVehiculosController', [ |
3 | '$scope', 'focaAbmVehiculoService', '$location', 'focaModalService', | 3 | '$scope', 'focaAbmVehiculoService', '$location', 'focaModalService', '$uibModal', |
4 | function($scope, focaAbmVehiculoService, $location, focaModalService) { | 4 | function($scope, focaAbmVehiculoService, $location, focaModalService, $uibModal) { |
5 | focaAbmVehiculoService.getVehiculos().then(function(datos) { | 5 | $scope.buscar = function(idTransportista) { |
6 | $scope.vehiculos = datos.data; | 6 | focaAbmVehiculoService |
7 | $scope.vehiculosFiltrados = $scope.vehiculos; | 7 | .getVehiculosPorTransportista(idTransportista) |
8 | }); | 8 | .then(function(datos) { |
9 | $scope.vehiculos = datos.data; | ||
10 | }); | ||
11 | }; | ||
9 | $scope.editar = function(id) { | 12 | $scope.editar = function(id) { |
10 | $location.path('/vehiculo/' + id); | 13 | $location.path('/vehiculo/' + id); |
11 | }; | 14 | }; |
12 | $scope.solicitarConfirmacion = function(vehiculo) { | 15 | $scope.solicitarConfirmacion = function(vehiculo) { |
13 | focaModalService.confirm('¿Está seguro que desea borrar el vehiculo ' + | 16 | focaModalService.confirm('¿Está seguro que desea borrar el vehiculo ' + |
14 | vehiculo.id + ' ' + vehiculo.tractor + ' ?').then( | 17 | vehiculo.id + ' ' + vehiculo.tractor + ' ?').then( |
15 | function(data) { | 18 | function(data) { |
16 | if(data) { | 19 | if(data) { |
17 | focaAbmVehiculoService.deleteVehiculo(vehiculo.id); | 20 | focaAbmVehiculoService.deleteVehiculo(vehiculo.id); |
18 | $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); | 21 | $scope.vehiculos.splice($scope.vehiculos.indexOf(vehiculo), 1); |
19 | } | 22 | } |
20 | } | 23 | } |
21 | ); | 24 | ); |
22 | }; | 25 | }; |
26 | $scope.seleccionarTransportista = function() { | ||
27 | var modalInstance = $uibModal.open( | ||
28 | { | ||
29 | ariaLabelledBy: 'Busqueda de Transportista', | ||
30 | templateUrl: 'modal-proveedor.html', | ||
31 | controller: 'focaModalProveedorCtrl', | ||
32 | size: 'lg', | ||
33 | resolve: { | ||
34 | transportista: function() { | ||
35 | return true; | ||
36 | } | ||
37 | } | ||
38 | } | ||
39 | ); | ||
40 | modalInstance.result.then( | ||
41 | function(transprotista) { | ||
42 | $scope.buscar(transprotista.COD); | ||
43 | $scope.filtros = transprotista.NOM.trim(); | ||
44 | }, function() { | ||
45 | |||
46 | } | ||
47 | ); | ||
48 | }; | ||
23 | } | 49 | } |
24 | ]) | 50 | ]) |
25 | .controller('focaAbmVehiculoController', [ | 51 | .controller('focaAbmVehiculoController', [ |
26 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', | 52 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', |
27 | function($scope, focaAbmVehiculoService, $routeParams, $location) { | 53 | 'focaModalService', |
28 | focaAbmVehiculoService.getVehiculo($routeParams.id).then(function(res) { | 54 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, |
29 | if(!res.data[0].transportista.COD) { | 55 | focaModalService) { |
30 | res.data[0].transportista = ''; | 56 | $scope.nuevo = $routeParams.idVehiculo == 0 ? true : false; |
31 | } | 57 | $scope.vehiculo = {}; |
32 | $scope.vehiculo = res.data[0]; | 58 | focaAbmVehiculoService.getVehiculo($routeParams.idVehiculo).then(function(res) { |
59 | if(res.data) $scope.vehiculo = res.data; | ||
33 | }); | 60 | }); |
34 | focaAbmVehiculoService.getTransportistas().then(function(res) { | 61 | focaAbmVehiculoService.getCisternadoPorVehiculo($routeParams.idVehiculo) |
35 | $scope.transportistas = res.data; | 62 | .then(function(res) { |
63 | $scope.cisternas = res.data; | ||
36 | }); | 64 | }); |
37 | $scope.cancelar = function() { | 65 | $scope.cancelar = function() { |
38 | $location.path('/vehiculo'); | 66 | $location.path('/vehiculo'); |
39 | }; | 67 | }; |
68 | $scope.editar = function(id) { | ||
69 | $location.path('/vehiculo/' + $routeParams.idVehiculo + '/cisterna/' + id); | ||
70 | }; | ||
40 | $scope.guardar = function() { | 71 | $scope.guardar = function() { |
41 | $scope.vehiculo.idTransportista = $scope.vehiculo.transportista.COD; | 72 | if(!$scope.vehiculo.transportista){ |
73 | focaModalService.alert('Elija Transportista'); | ||
74 | return; | ||
75 | } | ||
42 | delete $scope.vehiculo.transportista; | 76 | delete $scope.vehiculo.transportista; |
43 | focaAbmVehiculoService.guerdarVehiculo($scope.vehiculo).then(function() { | 77 | focaAbmVehiculoService.guerdarVehiculo($scope.vehiculo).then(function(res) { |
44 | $location.path('/vehiculo'); | 78 | $location.path('/vehiculo/' + res.data.id); |
45 | }); | 79 | }); |
46 | }; | 80 | }; |
81 | $scope.solicitarConfirmacionCisterna = function(cisterna) { | ||
82 | focaModalService.confirm('¿Está seguro que desea borrar la cisterna ' + | ||
83 | cisterna.id + ' ' + cisterna.codigo + ' ?').then( | ||
84 | function(data) { | ||
85 | if(data) { | ||
86 | focaAbmVehiculoService.deleteCisterna(cisterna.id); | ||
87 | $scope.cisternas.splice($scope.cisternas.indexOf(cisterna), 1); | ||
88 | } | ||
89 | } | ||
90 | ); | ||
91 | }; | ||
92 | $scope.seleccionarTransportista = function() { | ||
93 | var modalInstance = $uibModal.open( | ||
94 | { | ||
95 | ariaLabelledBy: 'Busqueda de Transportista', | ||
96 | templateUrl: 'modal-proveedor.html', | ||
97 | controller: 'focaModalProveedorCtrl', | ||
98 | size: 'lg', | ||
99 | resolve: { | ||
100 | transportista: function() { | ||
101 | return true; | ||
102 | } | ||
103 | } | ||
104 | } | ||
105 | ); | ||
106 | modalInstance.result.then( | ||
107 | function(transprotista) { | ||
108 | $scope.vehiculo.idTransportista = transprotista.COD; | ||
109 | $scope.vehiculo.transportista = transprotista; | ||
110 | }, function() { | ||
111 | |||
112 | } | ||
113 | ); | ||
114 | }; | ||
47 | } | 115 | } |
48 | ]); | 116 | ]); |
49 | 117 |
src/js/controllerCisterna.js
File was created | 1 | angular.module('focaAbmVehiculo') | |
2 | .controller('focaAbmVehiculoCisternaController', [ | ||
3 | '$scope', 'focaAbmVehiculoService', '$routeParams', '$location', '$uibModal', | ||
4 | 'focaModalService', | ||
5 | function($scope, focaAbmVehiculoService, $routeParams, $location, $uibModal, | ||
6 | focaModalService) { | ||
7 | $scope.editar = false; | ||
8 | $scope.cisterna = { | ||
9 | cisternaCarga: { | ||
10 | articulo: {} | ||
11 | } | ||
12 | }; | ||
13 | |||
14 | focaAbmVehiculoService.getCisterna($routeParams.id).then(function(res) { | ||
15 | if(res.data) { | ||
16 | $scope.cisterna = res.data; | ||
17 | $scope.editar = true; | ||
18 | }else { | ||
19 | $scope.editar = false; | ||
20 | } | ||
21 | }); | ||
22 | $scope.cancelar = function() { | ||
23 | $location.path('/vehiculo/' + $routeParams.idVehiculo); | ||
24 | console.log($routeParams.id); | ||
25 | }; | ||
26 | $scope.guardar = function() { | ||
27 | if(!$scope.cisterna.unidadMedida) { | ||
28 | focaModalService.alert('Ingrese unidad de medida'); | ||
29 | return; | ||
30 | } | ||
31 | if(!$scope.cisterna.cisternaCarga.articulo) { | ||
32 | focaModalService.alert('Ingrese producto'); | ||
33 | return; | ||
34 | } | ||
35 | $scope.cisterna.idVehiculo = $routeParams.idVehiculo; | ||
36 | delete $scope.cisterna.unidadMedida; | ||
37 | delete $scope.cisterna.cisternaCarga.articulo; | ||
38 | focaAbmVehiculoService.guardarCisterna($scope.cisterna).then(function() { | ||
39 | $location.path('/vehiculo/' + $routeParams.idVehiculo); | ||
40 | }); | ||
41 | }; | ||
42 | |||
43 | // $scope.seleccionarArticulo = function() { | ||
44 | // var modalInstance = $uibModal.open( | ||
45 | // { | ||
46 | // ariaLabelledBy: 'Busqueda de Productos', | ||
47 | // templateUrl: 'modal-busqueda-productos.html', | ||
48 | // controller: 'modalBusquedaProductosCtrl', | ||
49 | // resolve: { | ||
50 | // parametroProducto: { | ||
51 | // idLista: -1, | ||
52 | // cotizacion: 1, | ||
53 | // simbolo: '$' | ||
54 | // } | ||
55 | // }, | ||
56 | // size: 'lg' | ||
57 | // } | ||
58 | // ); | ||
59 | // modalInstance.result.then( | ||
60 | // function(producto) { | ||
61 | // $scope.cisterna.cisternaCarga.idProducto = producto.id, | ||
62 | // $scope.cisterna.cisternaCarga.articulo.DetArt = producto.descripcion; | ||
63 | // }, function() { | ||
64 | // // funcion ejecutada cuando se cancela el modal | ||
65 | // } | ||
66 | // ); | ||
67 | // }; | ||
68 | |||
69 | $scope.seleccionarUnidadMedida = function() { | ||
70 | var modalInstance = $uibModal.open( | ||
71 | { | ||
72 | ariaLabelledBy: 'Busqueda de Unidades de medida', | ||
73 | templateUrl: 'modal-unidad-medida.html', | ||
74 | controller: 'focaModalUnidadMedidaCtrl', | ||
75 | size: 'lg' | ||
76 | } | ||
77 | ); | ||
78 | modalInstance.result.then(function(unidaMedida) { | ||
79 | $scope.cisterna.idUnidadMedida = unidaMedida.ID; | ||
80 | $scope.cisterna.unidadMedida = unidaMedida; | ||
81 | }); | ||
82 | } | ||
83 | } | ||
84 | ]); |
src/js/route.js
1 | angular.module('focaAbmVehiculo') | 1 | angular.module('focaAbmVehiculo') |
2 | .config([ | 2 | .config([ |
3 | '$routeProvider', | 3 | '$routeProvider', |
4 | function($routeProvider) { | 4 | function($routeProvider) { |
5 | $routeProvider.when('/vehiculo', { | 5 | $routeProvider.when('/vehiculo', { |
6 | controller: 'focaAbmVehiculosController', | 6 | controller: 'focaAbmVehiculosController', |
7 | templateUrl: 'src/views/foca-abm-vehiculos-listado.html' | 7 | templateUrl: 'src/views/foca-abm-vehiculos-listado.html' |
8 | }); | 8 | }); |
9 | } | 9 | } |
10 | ]) | 10 | ]) |
11 | .config([ | 11 | .config([ |
12 | '$routeProvider', | 12 | '$routeProvider', |
13 | function($routeProvider) { | 13 | function($routeProvider) { |
14 | $routeProvider.when('/vehiculo/:id', { | 14 | $routeProvider.when('/vehiculo/:idVehiculo', { |
15 | controller: 'focaAbmVehiculoController', | 15 | controller: 'focaAbmVehiculoController', |
16 | templateUrl: 'src/views/foca-abm-vehiculos-item.html' | 16 | templateUrl: 'src/views/foca-abm-vehiculos-item.html' |
17 | }); | 17 | }); |
18 | } | 18 | } |
19 | ]) | ||
20 | .config([ | ||
21 | '$routeProvider', | ||
22 | function($routeProvider) { | ||
23 | $routeProvider.when('/vehiculo/:idVehiculo/cisterna/:id', { | ||
24 | controller: 'focaAbmVehiculoCisternaController', | ||
25 | templateUrl: 'src/views/foca-abm-cisterna-item.html' | ||
26 | }); | ||
27 | } | ||
19 | ]); | 28 | ]); |
20 | 29 |
src/js/service.js
1 | angular.module('focaAbmVehiculo') | 1 | angular.module('focaAbmVehiculo') |
2 | .factory('focaAbmVehiculoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { | 2 | .factory('focaAbmVehiculoService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) { |
3 | return { | 3 | return { |
4 | getVehiculos: function() { | 4 | getVehiculos: function() { |
5 | return $http.get(API_ENDPOINT.URL + '/vehiculo'); | 5 | return $http.get(API_ENDPOINT.URL + '/vehiculo'); |
6 | }, | 6 | }, |
7 | getVehiculo: function(id) { | 7 | getVehiculo: function(id) { |
8 | return $http.get(API_ENDPOINT.URL + '/vehiculo/' + id); | 8 | return $http.get(API_ENDPOINT.URL + '/vehiculo/' + id); |
9 | }, | 9 | }, |
10 | getTransportistas: function() { | 10 | getTransportistas: function() { |
11 | return $http.get(API_ENDPOINT.URL + '/transportista'); | 11 | return $http.get(API_ENDPOINT.URL + '/transportista'); |
12 | }, | 12 | }, |
13 | guerdarVehiculo: function(vehiculo) { | 13 | guerdarVehiculo: function(vehiculo) { |
14 | return $http.post(API_ENDPOINT.URL + '/vehiculo', {vehiculo: vehiculo}); | 14 | return $http.post(API_ENDPOINT.URL + '/vehiculo', {vehiculo: vehiculo}); |
15 | }, | 15 | }, |
16 | deleteVehiculo: function(id) { | 16 | deleteVehiculo: function(id) { |
17 | return $http.delete(API_ENDPOINT.URL + '/vehiculo/' + id); | 17 | return $http.delete(API_ENDPOINT.URL + '/vehiculo/' + id); |
18 | }, | ||
19 | getCisternadoPorVehiculo: function(idVehiculo) { | ||
20 | return $http.get(API_ENDPOINT.URL + '/cisterna/listar/vehiculo/' + idVehiculo); | ||
21 | }, | ||
22 | getCisterna: function(id) { | ||
23 | return $http.get(API_ENDPOINT.URL + '/cisterna/' + id); | ||
24 | }, | ||
25 | guardarCisterna: function(cisterna) { | ||
26 | return $http.post(API_ENDPOINT.URL + '/cisterna/guardar', {cisterna: cisterna}); | ||
27 | }, | ||
28 | deleteCisterna: function(id) { | ||
29 | return $http.delete(API_ENDPOINT.URL + '/cisterna/borrar/' + id); | ||
30 | }, | ||
31 | getVehiculosPorTransportista: function(id) { | ||
32 | return $http.get(API_ENDPOINT.URL + '/vehiculo/transportista/' + id); | ||
18 | } | 33 | } |
19 | }; | 34 | }; |
20 | }]); | 35 | }]); |
21 | 36 |
src/views/foca-abm-cisterna-item.html
File was created | 1 | <h4>Cisterna</h4> | |
2 | <form name="formCisterna"> | ||
3 | <div class="form-group row"> | ||
4 | <label class="offset-sm-1 col-sm-2 col-form-label">Código</label> | ||
5 | <div class="col-sm-4"> | ||
6 | <input | ||
7 | class="form-control" | ||
8 | type="text" | ||
9 | teclado-virtual | ||
10 | ng-required="true" | ||
11 | ng-model="cisterna.codigo" | ||
12 | /> | ||
13 | </div> | ||
14 | </div> | ||
15 | <div class="form-group row"> | ||
16 | <label class="offset-sm-1 col-sm-2 col-form-label">Capacidad</label> | ||
17 | <div class="col-sm-4"> | ||
18 | <input | ||
19 | class="form-control" | ||
20 | type="text" | ||
21 | teclado-virtual | ||
22 | foca-tipo-input | ||
23 | ng-model="cisterna.capacidad" | ||
24 | ng-required="true" | ||
25 | /> | ||
26 | </div> | ||
27 | </div> | ||
28 | <div class="form-group row"> | ||
29 | <label class="offset-sm-1 col-sm-2 col-form-label">Unidad de medida</label> | ||
30 | <div class="col-sm-4 input-group"> | ||
31 | <input | ||
32 | ng-model="cisterna.unidadMedida.NOM" | ||
33 | class="form-control" | ||
34 | readonly | ||
35 | /> | ||
36 | <div class="input-group-append"> | ||
37 | <button | ||
38 | ladda="searchLoading" | ||
39 | class="btn btn-outline-secondary form-control" | ||
40 | type="button" | ||
41 | ng-click="seleccionarUnidadMedida()" | ||
42 | ng-disabled="editar" | ||
43 | > | ||
44 | <i class="fa fa-search" aria-hidden="true"></i> | ||
45 | </button> | ||
46 | </div> | ||
47 | </div> | ||
48 | </div> | ||
49 | <div class="form-group row"> | ||
50 | <label class="offset-sm-1 col-sm-2 col-form-label">Carga</label> | ||
51 | <div class="col-sm-4"> | ||
52 | <input | ||
53 | class="form-control" | ||
54 | foca-tipo-input | ||
55 | teclado-virtual | ||
56 | ng-model="cisterna.cisternaCarga.cantidad" | ||
57 | readonly | ||
58 | /> | ||
59 | </div> | ||
60 | </div> | ||
61 | <div class="form-group row"> | ||
62 | <label class="offset-sm-1 col-sm-2 col-form-label">Producto</label> | ||
63 | <div class="col-sm-4 input-group"> | ||
64 | <input | ||
65 | ng-model="cisterna.cisternaCarga.articulo.DetArt" | ||
66 | class="form-control" | ||
67 | readonly | ||
68 | /> | ||
69 | <!-- <div class="input-group-append"> | ||
70 | <button | ||
71 | ladda="searchLoading" | ||
72 | class="btn btn-outline-secondary form-control" | ||
73 | type="button" | ||
74 | ng-click="seleccionarArticulo(13)" | ||
75 | ng-disabled="editar" | ||
76 | > | ||
77 | <i class="fa fa-search" aria-hidden="true"></i> | ||
78 | </button> | ||
79 | </div> --> | ||
80 | </div> | ||
81 | </div> | ||
82 | <div class="form-group row"> | ||
83 | <div class="col-sm-7 text-right"> | ||
84 | <button | ||
85 | class="btn btn-primary" | ||
86 | ng-click="guardar()" | ||
87 | ng-disabled="!formCisterna.$valid" | ||
88 | >Guardar</button> | ||
89 | <button class="btn btn-default" ng-click="cancelar()">Cancelar</button> | ||
90 | </div> | ||
91 | </div> | ||
92 | </form> | ||
93 |
src/views/foca-abm-vehiculos-item.html
1 | <h4>Sectores</h4> | 1 | <h4>Vehiculo</h4> |
2 | <form name="formVehiculo"> | 2 | <form name="formVehiculo"> |
3 | <input type="hidden" name="id" ng-model="sector.id" /> | 3 | <input type="hidden" name="id" ng-model="sector.id" /> |
4 | <div class="form-group row"> | 4 | <div class="form-group row"> |
5 | <label class="offset-sm-1 col-sm-2 col-form-label">Transportista</label> | 5 | <label class="offset-sm-1 col-sm-2 col-form-label">Transportista</label> |
6 | <div class="col-sm-4"> | 6 | <div class="col-sm-4 input-group"> |
7 | <input | 7 | <input |
8 | class="form-control" | 8 | class="form-control" |
9 | type="text" | 9 | type="text" |
10 | teclado-virtual | 10 | ng-model="vehiculo.transportista.NOM" |
11 | ng-model="vehiculo.transportista" | 11 | readonly |
12 | ng-model-options="{allowInvalid: false}" | ||
13 | uib-typeahead="transportista as transportista.COD + ' ' + | ||
14 | transportista.NOM for transportista in transportistas | filter:$viewValue" | ||
15 | /> | 12 | /> |
13 | <div class="input-group-append"> | ||
14 | <button | ||
15 | class="btn btn-outline-secondary form-control" | ||
16 | type="button" | ||
17 | ng-click="seleccionarTransportista()"> | ||
18 | <i class="fa fa-search" aria-hidden="true"></i> | ||
19 | </button> | ||
20 | </div> | ||
16 | </div> | 21 | </div> |
17 | </div> | 22 | </div> |
18 | <div class="form-group row"> | 23 | <div class="form-group row"> |
19 | <label class="offset-sm-1 col-sm-2 col-form-label">Código</label> | 24 | <label class="offset-sm-1 col-sm-2 col-form-label">Código</label> |
20 | <div class="col-sm-4"> | 25 | <div class="col-sm-4"> |
21 | <input | 26 | <input |
22 | class="form-control" | 27 | class="form-control" |
23 | type="text" | 28 | type="text" |
24 | teclado-virtual | 29 | teclado-virtual |
25 | ng-model="vehiculo.id" | 30 | ng-model="vehiculo.codigo" |
26 | readonly | ||
27 | /> | 31 | /> |
28 | </div> | 32 | </div> |
29 | </div> | 33 | </div> |
30 | <div class="form-group row"> | 34 | <div class="form-group row"> |
31 | <label class="offset-sm-1 col-sm-2 col-form-label">Tractor</label> | 35 | <label class="offset-sm-1 col-sm-2 col-form-label">Tractor</label> |
32 | <div class="col-sm-4"> | 36 | <div class="col-sm-4"> |
33 | <input | 37 | <input |
34 | class="form-control" | 38 | class="form-control" |
35 | type="text" | 39 | type="text" |
36 | teclado-virtual | 40 | teclado-virtual |
37 | ng-model="vehiculo.tractor" | 41 | ng-model="vehiculo.tractor" |
38 | ng-required="true" | 42 | ng-required="true" |
39 | /> | 43 | /> |
40 | </div> | 44 | </div> |
41 | </div> | 45 | </div> |
42 | <div class="form-group row"> | 46 | <div class="form-group row"> |
43 | <label class="offset-sm-1 col-sm-2 col-form-label">Semi</label> | 47 | <label class="offset-sm-1 col-sm-2 col-form-label">Semi</label> |
44 | <div class="col-sm-4"> | 48 | <div class="col-sm-4"> |
45 | <input | 49 | <input |
46 | class="form-control" | 50 | class="form-control" |
47 | type="text" | 51 | type="text" |
48 | teclado-virtual | 52 | teclado-virtual |
49 | ng-model="vehiculo.semi" | 53 | ng-model="vehiculo.semi" |
50 | ng-required="true" | 54 | ng-required="true" |
51 | /> | 55 | /> |
52 | </div> | 56 | </div> |
53 | </div> | 57 | </div> |
54 | <div class="form-group row"> | 58 | <div class="form-group row"> |
55 | <label class="offset-sm-1 col-sm-2 col-form-label">Capacidad</label> | 59 | <label class="offset-sm-1 col-sm-2 col-form-label">Capacidad</label> |
56 | <div class="col-sm-4"> | 60 | <div class="col-sm-4"> |
57 | <input | 61 | <input |
58 | class="form-control" | 62 | class="form-control" |
59 | type="text" | 63 | type="text" |
60 | teclado-virtual | 64 | teclado-virtual |
61 | ng-model="vehiculo.capacidad" | 65 | ng-model="vehiculo.capacidad" |
62 | ng-required="true" | 66 | ng-required="true" |
63 | /> | 67 | /> |
64 | </div> | 68 | </div> |
65 | </div> | 69 | </div> |
66 | <div class="form-group row"> | 70 | <div class="form-group row"> |
67 | <label class="offset-sm-1 col-sm-2 col-form-label">Cisternado</label> | ||
68 | <div class="col-sm-4"> | ||
69 | <input | ||
70 | class="form-control" | ||
71 | type="text" | ||
72 | teclado-virtual | ||
73 | ng-model="vehiculo.cisternado" | ||
74 | ng-required="true" | ||
75 | /> | ||
76 | </div> | ||
77 | </div> | ||
78 | <div class="form-group row"> | ||
79 | <div class="col-sm-7 text-right"> | 71 | <div class="col-sm-7 text-right"> |
80 | <button | 72 | <button |
81 | class="btn btn-primary" | 73 | class="btn btn-primary" |
82 | ng-click="guardar()" | 74 | ng-click="guardar()" |
83 | ng-disabled="!formVehiculo.$valid" | 75 | ng-disabled="!formVehiculo.$valid" |
84 | >Guardar</button> | 76 | >Guardar</button> |
85 | <button class="btn btn-default" ng-click="cancelar()">Cancelar</button> | 77 | <button class="btn btn-default" ng-click="cancelar()">Cancelar</button> |
86 | </div> | 78 | </div> |
87 | </div> | 79 | </div> |
88 | </form> | 80 | </form> |
81 | <div class="col-12" ng-show="!nuevo"> | ||
82 | <h4>Cisternas</h4> | ||
83 | <table class="table table-sm table-striped table-dark"> | ||
84 | <thead> | ||
85 | <tr> | ||
86 | <th>Código</th> | ||
87 | <th>Unidad de Medida</th> | ||
88 | <th>Capacidad</th> | ||
89 | <th>Carga</th> | ||
90 | <th class="text-center"> | ||
91 | <button class="btn btn-default boton-accion" ng-click="editar(0)"> | ||
92 | <i class="fa fa-plus"></i> | ||
93 | </button> | ||
94 | </th> | ||
95 | </tr> | ||
96 | </thead> | ||
97 | <tbody> | ||
98 | <tr ng-repeat="cisterna in cisternas | filter:filtros"> | ||
99 | <td ng-bind="cisterna.id"></td> | ||
100 | <td ng-bind="cisterna.unidadMedida.NOM"></td> | ||
101 | <td ng-bind="cisterna.capacidad"></td> | ||
102 | <td ng-bind="cisterna.cisternaCarga.cantidad || 0"></td> | ||
103 | <td class="text-center"> | ||
104 | <button | ||
105 | class="btn btn-default boton-accion" |
src/views/foca-abm-vehiculos-listado.html
1 | <div class="col-12"> | 1 | <div class="col-12"> |
2 | <h4>Vehiculos</h4> | 2 | <h4>Vehiculos</h4> |
3 | <div class="form-group"> | 3 | <div class="col-4 form-group input-group"> |
4 | <input | ||
5 | class="form-control form-control-sm" | ||
6 | ng-model="filtros" | ||
7 | placeholder="Transportista" | ||
8 | /> | ||
9 | <div class="input-group-append"> | ||
10 | <button | ||
11 | class="btn btn-outline-secondary form-control-sm" | ||
12 | ng-click="seleccionarTransportista()" | ||
13 | ><i class="fa fa-search" aria-hidden="true"></i></button> | ||
14 | </div> | ||
15 | </div> | ||
16 | <!-- <div class="col-6 form-group"> | ||
4 | <input | 17 | <input |
5 | type="text" | 18 | type="text" |
6 | teclado-virtual | 19 | teclado-virtual |
7 | class="form-control form-control-sm" | 20 | class="form-control form-control-sm" |
8 | placeholder="Búsqueda" | 21 | placeholder="Búsqueda" |
9 | ng-model="filtros" | 22 | ng-model="filtros" |
10 | /> | 23 | /> |
11 | </div> | 24 | </div> --> |
12 | <table class="table table-sm table-striped table-dark"> | 25 | <table class="table table-sm table-striped table-dark"> |
13 | <thead> | 26 | <thead> |
14 | <tr> | 27 | <tr> |
15 | <th>Código</th> | 28 | <th>Código</th> |
16 | <th>Transportista</th> | ||
17 | <th>Tractor</th> | 29 | <th>Tractor</th> |
18 | <th>Capacidad</th> | 30 | <th>Capacidad</th> |
19 | <th class="text-center"> | 31 | <th class="text-center"> |
20 | <button class="btn btn-default boton-accion" ng-click="editar(0)"> | 32 | <button class="btn btn-default boton-accion" ng-click="editar(0)"> |
21 | <i class="fa fa-plus"></i> | 33 | <i class="fa fa-plus"></i> |
22 | </button> | 34 | </button> |
23 | </th> | 35 | </th> |
24 | </tr> | 36 | </tr> |
25 | </thead> | 37 | </thead> |
26 | <tbody> | 38 | <tbody> |
27 | <tr ng-repeat="vehiculo in vehiculosFiltrados | filter:filtros"> | 39 | <tr ng-repeat="vehiculo in vehiculos | filter:filtros"> |
28 | <td ng-bind="vehiculo.id"></td> | 40 | <td ng-bind="vehiculo.id"></td> |
29 | <td ng-bind="vehiculo.transportista.NOM || 'No tiene'"></td> | ||
30 | <td ng-bind="vehiculo.tractor"></td> | 41 | <td ng-bind="vehiculo.tractor"></td> |
31 | <td ng-bind="vehiculo.capacidad"></td> | 42 | <td ng-bind="vehiculo.capacidad"></td> |
32 | <td class="text-center"> | 43 | <td class="text-center"> |
33 | <button | 44 | <button |
34 | class="btn btn-default boton-accion" | 45 | class="btn btn-default boton-accion" |
35 | ng-click="editar(vehiculo.id)" | 46 | ng-click="editar(vehiculo.id)" |
36 | > | 47 | > |
37 | <i class="fa fa-pencil"></i> | 48 | <i class="fa fa-pencil"></i> |
38 | </button> | 49 | </button> |
39 | <button | 50 | <button |
40 | class="btn btn-default boton-accion" | 51 | class="btn btn-default boton-accion" |
41 | ng-click="solicitarConfirmacion(vehiculo)" | 52 | ng-click="solicitarConfirmacion(vehiculo)" |
42 | > | 53 | > |
43 | <i class="fa fa-trash"></i> | 54 | <i class="fa fa-trash"></i> |
44 | </button> | 55 | </button> |
45 | </td> | 56 | </td> |
46 | </tr> | 57 | </tr> |
47 | </body> | 58 | </body> |
48 | </table> | 59 | </table> |