Commit e90b8e9ec8a41d4fca638856857d591b83bf7e5f
1 parent
6e88cccd93
Exists in
master
fuera bug abre dos veces modal puntos descarga
Showing
1 changed file
with
12 additions
and
8 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -420,7 +420,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 420 | 420 | function(puntosDescarga) { |
| 421 | 421 | $scope.notaPedido.puntosDescarga = puntosDescarga; |
| 422 | 422 | }, function() { |
| 423 | - | |
| 423 | + $scope.abrirModalDomicilios($scope.cliente); | |
| 424 | 424 | } |
| 425 | 425 | ); |
| 426 | 426 | } |
| ... | ... | @@ -499,6 +499,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 499 | 499 | modalInstance.result.then( |
| 500 | 500 | function(cliente) { |
| 501 | 501 | $scope.abrirModalDomicilios(cliente); |
| 502 | + $scope.cliente = cliente; | |
| 502 | 503 | }, function() {} |
| 503 | 504 | ); |
| 504 | 505 | } |
| ... | ... | @@ -512,8 +513,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 512 | 513 | controller: 'focaModalDomicilioController', |
| 513 | 514 | resolve: { |
| 514 | 515 | idCliente: function() { return cliente.cod; }, |
| 515 | - esNuevo: function() { return cliente.esNuevo; }, | |
| 516 | - articulos: function() { return $scope.articulosTabla; }, | |
| 516 | + esNuevo: function() { return cliente.esNuevo; } | |
| 517 | 517 | }, |
| 518 | 518 | size: 'lg', |
| 519 | 519 | } |
| ... | ... | @@ -541,11 +541,15 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 541 | 541 | label: 'Domicilio:', |
| 542 | 542 | valor: domicilioStamp |
| 543 | 543 | }); |
| 544 | - crearNotaPedidoService | |
| 545 | - .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) | |
| 546 | - .then(function(res) { | |
| 547 | - if(res.data.length) $scope.seleccionarPuntosDeDescarga(); | |
| 548 | - }); | |
| 544 | + if(domicilio.verPuntos) { | |
| 545 | + $scope.seleccionarPuntosDeDescarga(); | |
| 546 | + }else { | |
| 547 | + crearNotaPedidoService | |
| 548 | + .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) | |
| 549 | + .then(function(res) { | |
| 550 | + if(res.data.length) $scope.seleccionarPuntosDeDescarga(); | |
| 551 | + }); | |
| 552 | + } | |
| 549 | 553 | }, function() { |
| 550 | 554 | $scope.seleccionarCliente(); |
| 551 | 555 | return; |