Commit c09a3d927163b8e70a8937c57ef16a910d150cb2
1 parent
2f2e6dfd62
Exists in
master
radio button start with 'NO'
function to show modal fletes
Showing
1 changed file
with
21 additions
and
1 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -40,7 +40,7 @@ angular.module('focaCrearNotaPedido') |
40 | 40 | $scope.notaPedido.fechaCarga = new Date(); |
41 | 41 | $scope.notaPedido.domicilio = [{ id: 0 }]; |
42 | 42 | $scope.notaPedido.bomba = '1'; |
43 | - $scope.notaPedido.flete = '1'; | |
43 | + $scope.notaPedido.flete = '0'; | |
44 | 44 | idLista = undefined; |
45 | 45 | } |
46 | 46 | $scope.addNewDom = function() { |
... | ... | @@ -216,6 +216,26 @@ angular.module('focaCrearNotaPedido') |
216 | 216 | } |
217 | 217 | ); |
218 | 218 | }; |
219 | + $scope.abrirModalFlete = function() { | |
220 | + if($scope.notaPedido.flete==='1') { | |
221 | + var modalInstance = $uibModal.open( | |
222 | + { | |
223 | + ariaLabelledBy: 'Busqueda de Flete', | |
224 | + templateUrl: 'modal-flete.html', | |
225 | + controller: 'focaModalFleteController', | |
226 | + size: 'lg' | |
227 | + } | |
228 | + ); | |
229 | + modalInstance.result.then( | |
230 | + function(flete) { | |
231 | + $scope.notaPedido.fleteNombre = flete.nombre; | |
232 | + $scope.notaPedido.costoUnitarioKmFlete = flete.costoKilometro; | |
233 | + }, function() { | |
234 | + | |
235 | + } | |
236 | + ); | |
237 | + } | |
238 | + }; | |
219 | 239 | } |
220 | 240 | ] |
221 | 241 | ) |