Commit dfec27a773e8d15ed434e8e6e4db093f68e73d25
1 parent
c29a9a6525
Exists in
master
agrego valor disponible, boton grafico
Showing
4 changed files
with
52 additions
and
16 deletions
Show diff stats
src/js/app.js
src/js/controller.js
| 1 | 1 | angular.module('focaEstadoCisternas') |
| 2 | 2 | .controller('focaEstadoCisternasController', [ |
| 3 | - '$scope', 'focaEstadoCisternasService', '$location', 'focaModalService', | |
| 3 | + '$scope', 'focaEstadoCisternasService', 'focaModalService', | |
| 4 | 4 | '$uibModal', 'focaBotoneraLateralService', '$timeout', |
| 5 | - function($scope, focaEstadoCisternasService, $location, focaModalService, | |
| 5 | + function($scope, focaEstadoCisternasService, focaModalService, | |
| 6 | 6 | $uibModal, focaBotoneraLateralService, $timeout) { |
| 7 | 7 | |
| 8 | 8 | $scope.now = new Date(); |
| 9 | 9 | $scope.fecha = new Date(); |
| 10 | 10 | $scope.cisternas = []; |
| 11 | - $scope.botonera = [{ | |
| 12 | - label: 'Transportista', | |
| 13 | - image: 'transportista.png' | |
| 14 | - }, | |
| 15 | - { | |
| 16 | - label: 'Vehiculo', | |
| 17 | - image: 'vehiculos.png' | |
| 18 | - }, | |
| 19 | - { | |
| 20 | - label: 'Fecha', | |
| 21 | - image: 'fechaDeReparto.png' | |
| 22 | - }]; | |
| 11 | + $scope.botonera = focaEstadoCisternasService.getBotonera(); | |
| 23 | 12 | |
| 24 | 13 | //SETEO BOTONERA LATERAL |
| 25 | 14 | focaBotoneraLateralService.showSalir(true); |
| ... | ... | @@ -94,6 +83,26 @@ angular.module('focaEstadoCisternas') |
| 94 | 83 | }); |
| 95 | 84 | }; |
| 96 | 85 | |
| 86 | + $scope.seleccionarGrafico = function() { | |
| 87 | + if(!$scope.cisternas.length){ | |
| 88 | + focaModalService.alert('Primero seleccione un vehículo'); | |
| 89 | + return; | |
| 90 | + } | |
| 91 | + $uibModal.open( | |
| 92 | + { | |
| 93 | + ariaLabelledBy: 'Grafico de cisternas', | |
| 94 | + templateUrl: 'modal-grafico-cisternas.html', | |
| 95 | + controller: 'focaModalGraficoCisternasController', | |
| 96 | + size: 'md', | |
| 97 | + resolve:{ | |
| 98 | + filters: { | |
| 99 | + cisternas: $scope.cisternas | |
| 100 | + } | |
| 101 | + } | |
| 102 | + } | |
| 103 | + ); | |
| 104 | + }; | |
| 105 | + | |
| 97 | 106 | function elegirTransportista(transportista) { |
| 98 | 107 | var codigo = ('00000' + transportista.COD).slice(-5); |
| 99 | 108 | $scope.idTransportista = transportista.COD; |
src/js/service.js
| ... | ... | @@ -25,6 +25,26 @@ angular.module('focaEstadoCisternas') |
| 25 | 25 | getEstadoCisterna: function(id, fecha) { |
| 26 | 26 | return $http.post(API_ENDPOINT.URL + '/cisterna/stock', |
| 27 | 27 | {idCisterna: id, fecha: fecha}); |
| 28 | + }, | |
| 29 | + getBotonera: function() { | |
| 30 | + return [ | |
| 31 | + { | |
| 32 | + label: 'Transportista', | |
| 33 | + image: 'transportista.png' | |
| 34 | + }, | |
| 35 | + { | |
| 36 | + label: 'Vehiculo', | |
| 37 | + image: 'vehiculos.png' | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + label: 'Fecha', | |
| 41 | + image: 'fechaDeReparto.png' | |
| 42 | + }, | |
| 43 | + { | |
| 44 | + label: 'Grafico', | |
| 45 | + image: 'fechaDeReparto.png' | |
| 46 | + } | |
| 47 | + ]; | |
| 28 | 48 | } |
| 29 | 49 | }; |
| 30 | 50 | }]); |
src/views/foca-estado-cisterna.html
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> |
| 10 | 10 | <div class="row px-5 py-2 botonera-secundaria"> |
| 11 | 11 | <div class="col-12"> |
| 12 | - <foca-botonera-facturador botones="botonera" extra="3" class="row"> | |
| 12 | + <foca-botonera-facturador botones="botonera" extra="2" class="row"> | |
| 13 | 13 | </foca-botonera-facturador> |
| 14 | 14 | </div> |
| 15 | 15 | </div> |
| ... | ... | @@ -19,6 +19,7 @@ |
| 19 | 19 | <th>Código</th> |
| 20 | 20 | <th>Capacidad total</th> |
| 21 | 21 | <th>Carga</th> |
| 22 | + <th>Disponible</th> | |
| 22 | 23 | <th>Producto</th> |
| 23 | 24 | </tr> |
| 24 | 25 | </thead> |
| ... | ... | @@ -27,6 +28,7 @@ |
| 27 | 28 | <td ng-bind="cisterna.codigo"></td> |
| 28 | 29 | <td ng-bind="cisterna.capacidad + ' ' + cisterna.unidadMedida.NOM"></td> |
| 29 | 30 | <td ng-bind="cisterna.estado.cantidad"></td> |
| 31 | + <td ng-bind="cisterna.capacidad - cisterna.estado.cantidad"></td> | |
| 30 | 32 | <td ng-bind="(cisterna.estado.producto) ? cisterna.estado.producto.DetArt : '-'"></td> |
| 31 | 33 | </tr> |
| 32 | 34 | </body> |