Commit 3b341b74ed04aa561446a7862f35c4711bdbab3b
Exists in
master
Merge branch 'master' into 'master'
implentacion modal detalle hoja de ruta See merge request modulos-npm/foca-hoja-ruta!2
Showing
2 changed files
Show diff stats
src/js/controller.js
1 | 1 | angular.module('focaListaHojaRuta') |
2 | 2 | .controller('listaHojaRutaCtrl', |
3 | 3 | [ |
4 | - '$scope', '$filter', 'hojaRutaService', | |
5 | - function($scope, $filter, hojaRutaService) { | |
4 | + '$scope', '$filter', '$uibModal', 'hojaRutaService', | |
5 | + function($scope, $filter, $uibModal, hojaRutaService) { | |
6 | 6 | hojaRutaService.getHojasRuta().then(function(res) { |
7 | 7 | $scope.hojasRuta = res.data; |
8 | 8 | }); |
... | ... | @@ -14,7 +14,32 @@ angular.module('focaListaHojaRuta') |
14 | 14 | $scope.now = new Date(); |
15 | 15 | $scope.puntoVenta = '0000'; |
16 | 16 | $scope.comprobante = '00000000'; |
17 | - | |
17 | + | |
18 | + $scope.verDetalle = function(hojaRuta) { | |
19 | + var modalInstance = $uibModal.open( | |
20 | + { | |
21 | + ariaLabelledBy: 'Detalle hoja ruta', | |
22 | + templateUrl: 'modal-detalle-hoja-ruta.html', | |
23 | + controller: 'focaModalDetalleHojaRutaController', | |
24 | + resolve: { | |
25 | + parametrosDetalleHojaRuta: function(){ | |
26 | + return { | |
27 | + remito: '00001-00000001', | |
28 | + cliente: 'Rubén Gomez', | |
29 | + domicilio: 'Patricias Mendocinas 5050', | |
30 | + producto: 'Super', | |
31 | + litros: 20 | |
32 | + }; | |
33 | + } | |
34 | + }, | |
35 | + size: 'lg' | |
36 | + } | |
37 | + ); | |
38 | + modalInstance.result.then(function() { | |
39 | + | |
40 | + }) | |
41 | + }; | |
42 | + | |
18 | 43 | function addCabecera(label, valor) { |
19 | 44 | var propiedad = $filter('filter')($scope.cabecera, {label: label}, true); |
20 | 45 | if(propiedad.length === 1) { |
src/views/lista-hoja-ruta.html
... | ... | @@ -84,6 +84,7 @@ |
84 | 84 | <th>#</th> |
85 | 85 | <th>Sucursal</th> |
86 | 86 | <th>#HojaRuta</th> |
87 | + <th></th> | |
87 | 88 | </tr> |
88 | 89 | </thead> |
89 | 90 | <tbody class="tabla-articulo-body"> |
... | ... | @@ -93,6 +94,14 @@ |
93 | 94 | <td ng-bind="key + 1"></td> |
94 | 95 | <td ng-bind="hojaRuta.sucursal"></td> |
95 | 96 | <td ng-bind="hojaRuta.numeroHojaRuta"></td> |
97 | + <td> | |
98 | + <button | |
99 | + class="btn btn-secondary" | |
100 | + type="button" | |
101 | + ng-click="verDetalle(hojaRuta)" | |
102 | + ><i class="fa fa-search" aria-hidden="true"></i> | |
103 | + </button> | |
104 | + </td> | |
96 | 105 | </tr> |
97 | 106 | </tbody> |
98 | 107 | </table> |