diff --git a/package.json b/package.json index 88e11c8..3916ddf 100644 --- a/package.json +++ b/package.json @@ -11,25 +11,25 @@ }, "repository": { "type": "git", - "url": "https://192.168.0.11/modulos-npm/foca-crear-nota-pedido.git" + "url": "https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git" }, "author": "Foca Software", "license": "ISC", "dependencies": { - "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas.git", - "foca-modal-busqueda-productos": "git+https://192.168.0.11/nguarnieri/foca-modal-busqueda-productos", - "foca-modal-petroleras": "git+https://192.168.0.11/modulos-npm/foca-modal-petroleras.git", - "foca-modal-vendedores": "git+https://192.168.0.11/modulos-npm/foca-modal-vendedores.git", + "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", + "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos", + "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", + "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", "jquery": "^3.3.x" }, "devDependencies": { "angular": "^1.7.5", "angular-route": "^1.7.5", "bootstrap": "^4.1.3", - "foca-busqueda-cliente": "git+https://192.168.0.11/modulos-npm/foca-busqueda-cliente", + "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente", "font-awesome": "^4.7.0", "gulp": "^3.9.1", - "gulp-angular-templatecache": "^2.2.2", + "gulp-angular-templatecache": "2.2.2", "gulp-clean": "^0.4.0", "gulp-concat": "^2.6.1", "gulp-connect": "^5.6.1", diff --git a/src/js/controller.js b/src/js/controller.js index 0d011f6..465e657 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -6,10 +6,13 @@ angular.module('focaCrearNotaPedido') $scope.dateOptions = { maxDate: new Date(), - minDate: new Date(2010,0,1) + minDate: new Date(2010, 0, 1) }; - $scope.notaPedido = {}; + $scope.notaPedido = { + vendedor: {}, + cliente: {} + }; $scope.articulosTabla = []; var idLista; var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); @@ -81,11 +84,12 @@ angular.module('focaCrearNotaPedido') ) var articulosNotaPedido = $scope.articulosTabla; for(var i = 0; i< articulosNotaPedido.length;i++) { - crearNotaPedidoService.crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( - function(res) { - return; - } - ) + crearNotaPedidoService + .crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( + function(res) { + return; + } + ) } } @@ -135,7 +139,7 @@ angular.module('focaCrearNotaPedido') ) modalInstance.result.then( function(vendedor) { - $scope.notaPedido.vendedor = vendedor.NomVen; + $scope.notaPedido.vendedor.nombre = vendedor.NomVen; }, function() { } @@ -169,12 +173,22 @@ angular.module('focaCrearNotaPedido') ) modalInstance.result.then( function(cliente) { - $scope.notaPedido.cliente = cliente.nom; + $scope.notaPedido.cliente.nombre = cliente.nom; }, function() { } ); - } + }; + $scope.mostrarFichaCliente = function() { + $uibModal.open( + { + ariaLabelledBy: 'Datos del Cliente', + templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', + controller: 'focaCrearNotaPedidoFichaClienteController', + size: 'lg' + } + ); + }; $scope.obtenerDomicilios = function(id) { crearNotaPedidoService.getDomicilios(id).then( function(res) { @@ -219,3 +233,21 @@ angular.module('focaCrearNotaPedido') } } ]) + .controller('focaCrearNotaPedidoFichaClienteController', [ + '$scope', + 'crearNotaPedidoService', + '$location', + function($scope, crearNotaPedidoService, $location) { + crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { + $scope.notaPedidos = datos.data; + }); + $scope.editar = function(notaPedido) { + crearNotaPedidoService.setNotaPedido(notaPedido); + $location.path('/venta-nota-pedido/abm/'); + } + $scope.crearPedido = function() { + crearNotaPedidoService.clearNotaPedido(); + $location.path('/venta-nota-pedido/abm/'); + } + } + ]); diff --git a/src/views/foca-crear-nota-pedido-ficha-cliente.html b/src/views/foca-crear-nota-pedido-ficha-cliente.html new file mode 100644 index 0000000..b6b831a --- /dev/null +++ b/src/views/foca-crear-nota-pedido-ficha-cliente.html @@ -0,0 +1,78 @@ + + + diff --git a/src/views/nota-pedido.html b/src/views/nota-pedido.html index dcd9356..606081b 100644 --- a/src/views/nota-pedido.html +++ b/src/views/nota-pedido.html @@ -3,17 +3,17 @@
-
- +
+ + + + +
- +
+ + + + +
-
-
-
@@ -86,7 +98,7 @@ - +