Commit 3e5491ca9a71e7c1de4a2ccce01115a638a8d3f2
1 parent
304ab2418e
Exists in
master
and in
2 other branches
levantar popup con datos del remito
Showing
2 changed files
with
26 additions
and
25 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -4,19 +4,21 @@ angular.module('focaHojaRuta') |
| 4 | 4 | '$scope', '$filter', '$uibModal', 'hojaRutaService', |
| 5 | 5 | function($scope, $filter, $uibModal, hojaRutaService) { |
| 6 | 6 | hojaRutaService.getHojasRuta().then(function(res) { |
| 7 | - $scope.hojasRuta = res.data; | |
| 8 | - $scope.puntoVenta = rellenar(res.data[0].sucursal, 4); | |
| 9 | - $scope.comprobante = rellenar(res.data[0].numeroHojaRuta, 8); | |
| 7 | + var hojaRuta = res.data.pop(); | |
| 8 | + $scope.hojasRuta = hojaRuta; | |
| 9 | + $scope.puntoVenta = rellenar(hojaRuta.sucursal, 4); | |
| 10 | + $scope.comprobante = rellenar(hojaRuta.numeroHojaRuta, 8); | |
| 11 | + addCabecera('Transportista:', hojaRuta.transportista[0].nombre); | |
| 12 | + addCabecera('Chofer:', hojaRuta.chofer[0].nombre); | |
| 13 | + addCabecera('Vehículo:', hojaRuta.vehiculo[0].tractor); | |
| 10 | 14 | }); |
| 11 | 15 | $scope.cabecera = []; |
| 12 | 16 | $scope.showCabecera = true; |
| 13 | - addCabecera('Transportista:', 'Andesmar'); | |
| 14 | - addCabecera('Chofer:', 'Carlos'); | |
| 15 | - addCabecera('Vehículo:', 'SCANIA'); | |
| 17 | + | |
| 16 | 18 | $scope.now = new Date(); |
| 17 | 19 | $scope.puntoVenta = '0000'; |
| 18 | 20 | $scope.comprobante = '00000000'; |
| 19 | - $scope.verDetalle = function() { | |
| 21 | + $scope.verDetalle = function(remito) { | |
| 20 | 22 | var modalInstance = $uibModal.open( |
| 21 | 23 | { |
| 22 | 24 | ariaLabelledBy: 'Detalle hoja ruta', |
| ... | ... | @@ -25,11 +27,13 @@ angular.module('focaHojaRuta') |
| 25 | 27 | resolve: { |
| 26 | 28 | parametrosDetalleHojaRuta: function(){ |
| 27 | 29 | return { |
| 28 | - remito: '00001-00000001', | |
| 29 | - cliente: 'Rubén Gomez', | |
| 30 | - domicilio: 'Patricias Mendocinas 5050', | |
| 30 | + remito: remito.numeroRemito, | |
| 31 | + cliente: remito.nombreCliente, | |
| 32 | + domicilio: remito.domicilioStamp, | |
| 31 | 33 | producto: 'Super', |
| 32 | - litros: 20 | |
| 34 | + contacto: remito.nombreCliente, | |
| 35 | + telefonoContacto: '-', | |
| 36 | + litros: remito.carga | |
| 33 | 37 | }; |
| 34 | 38 | } |
| 35 | 39 | }, |
| ... | ... | @@ -37,7 +41,7 @@ angular.module('focaHojaRuta') |
| 37 | 41 | } |
| 38 | 42 | ); |
| 39 | 43 | modalInstance.result.then(function() { |
| 40 | - | |
| 44 | + | |
| 41 | 45 | }); |
| 42 | 46 | }; |
| 43 | 47 |
src/views/lista-hoja-ruta.html
| ... | ... | @@ -82,30 +82,27 @@ |
| 82 | 82 | <thead> |
| 83 | 83 | <tr class="d-flex"> |
| 84 | 84 | <th>#</th> |
| 85 | - <th>Fecha creacion</th> | |
| 86 | - <th>sucursal</th> | |
| 87 | - <th>idTransportista</th> | |
| 88 | - <th>idChofer</th> | |
| 89 | - <th>idVehiculo</th> | |
| 85 | + <th>Razon Social</th> | |
| 86 | + <th>Domicilio</th> | |
| 87 | + <th>#Remito</th> | |
| 88 | + <th>Litros</th> | |
| 90 | 89 | <th></th> |
| 91 | 90 | </tr> |
| 92 | 91 | </thead> |
| 93 | 92 | <tbody class="tabla-articulo-body"> |
| 94 | 93 | <tr |
| 95 | - ng-repeat="(key, hojaRuta) in hojasRuta" class="d-flex" | |
| 94 | + ng-repeat="(key, remito) in remitos" class="d-flex" | |
| 96 | 95 | > |
| 97 | 96 | <td ng-bind="key + 1"></td> |
| 98 | - <td ng-bind="hojaRuta.sucursal"></td> | |
| 99 | - <td ng-bind="hojaRuta.fechaCreacion"></td> | |
| 100 | - <td ng-bind="hojaRuta.sucursal"></td> | |
| 101 | - <td ng-bind="hojaRuta.transportista[0].nombre"></td> | |
| 102 | - <td ng-bind="hojaRuta.chofer[0].nombre"></td> | |
| 103 | - <td ng-bind="hojaRuta.vehiculo[0].tractor"></td> | |
| 97 | + <td ng-bind="remito.nombreCliente"></td> | |
| 98 | + <td ng-bind="remito.domicilioStamp"></td> | |
| 99 | + <td ng-bind="remito.numeroRemito"></td> | |
| 100 | + <td ng-bind="remito.remitoCarga"></td> | |
| 104 | 101 | <td> |
| 105 | 102 | <button |
| 106 | 103 | class="btn btn-secondary" |
| 107 | 104 | type="button" |
| 108 | - ng-click="verDetalle(hojaRuta)" | |
| 105 | + ng-click="verDetalle(remito)" | |
| 109 | 106 | ><i class="fa fa-search" aria-hidden="true"></i> |
| 110 | 107 | </button> |
| 111 | 108 | </td> |