From 4cee7ed9234aec711ed288935c0bc3d383b0cbfe Mon Sep 17 00:00:00 2001 From: Eric Fernandez Date: Fri, 19 Oct 2018 13:18:36 -0300 Subject: [PATCH] demo --- gulpfile.js | 2 +- index.html | 2 ++ package.json | 3 ++- src/js/app.js | 3 ++- src/js/controller.js | 35 ++++++++++++++++++++++++++++++----- src/views/nota-pedido.html | 44 ++++++++++++++++++++++++++++++++++++++------ 6 files changed, 75 insertions(+), 14 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8716a38..932d50e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -45,7 +45,7 @@ gulp.task('uglify', ['templates'], function() { uglify(), replace('"ngRoute","ui.bootstrap","focaModalVendedores","focaBusquedaProductos",'+ '"focaModalPetroleras","focaBusquedaCliente","focaModalPrecioCondicion",'+ - '"focaModalFlete"', ''), + '"focaModalFlete","focaModal"', ''), gulp.dest(paths.dist) ] ); diff --git a/index.html b/index.html index 3d80be8..96dfcf4 100644 --- a/index.html +++ b/index.html @@ -21,6 +21,8 @@ + + diff --git a/package.json b/package.json index b4b1816..3464f3e 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "compile": "gulp uglify", "gulp-pre-commit": "gulp pre-commit", "postinstall": "npm run compile && gulp clean-post-install", - "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git git+https://debo.suite.repo/modulos-npm/foca-modal-flete" + "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify jquery jshint pump git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git git+https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git git+https://debo.suite.repo/modulos-npm/foca-modal-flete git+https://debo.suite.repo/modulos-npm/foca-modal.git" }, "pre-commit": [ "gulp-pre-commit" @@ -32,6 +32,7 @@ "bootstrap": "^4.1.3", "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git", "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", + "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos", "foca-modal-flete": "git+https://debo.suite.repo/modulos-npm/foca-modal-flete", "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", diff --git a/src/js/app.js b/src/js/app.js index 89eea39..36f9265 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -7,5 +7,6 @@ angular.module('focaCrearNotaPedido', [ 'focaBusquedaCliente', 'focaModalPrecioCondicion', 'focaModalFlete', - 'focaDirectivas' + 'focaDirectivas', + 'focaModal' ]); diff --git a/src/js/controller.js b/src/js/controller.js index 89257b7..6ae5aee 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -1,14 +1,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', - ['$scope', '$uibModal', '$location', 'crearNotaPedidoService', - function($scope, $uibModal, $location, crearNotaPedidoService) { + ['$scope', '$uibModal', '$location', 'crearNotaPedidoService', 'focaModalService', + function($scope, $uibModal, $location, crearNotaPedidoService, focaModalService) { $scope.show = false; $scope.edit = false; $scope.dateOptions = { maxDate: new Date(), minDate: new Date(2010, 0, 1) }; - $scope.notaPedido = { vendedor: {}, cliente: {} @@ -78,7 +77,7 @@ angular.module('focaCrearNotaPedido') }; crearNotaPedidoService.crearNotaPedido(notaPedido).then( function() { - alert('Nota pedido creada'); + focaModalService('Nota pedido creada'); $location.path('/venta-nota-pedido'); } ); @@ -97,7 +96,8 @@ angular.module('focaCrearNotaPedido') }; $scope.seleccionarArticulo = function() { if (idLista === undefined) { - alert('primero seleccione una lista de precio y condicion'); + focaModalService.alert( + 'primero seleccione una lista de precio y condicion'); return; } var modalInstance = $uibModal.open( @@ -245,8 +245,12 @@ angular.module('focaCrearNotaPedido') ); modalInstance.result.then( function(flete) { + $scope.choferes = ''; + $scope.vehiculos = ''; $scope.notaPedido.fleteNombre = flete.nombre; $scope.notaPedido.costoUnitarioKmFlete = flete.costoKilometro; + $scope.choferes = flete.chofer; + $scope.vehiculos = flete.vehiculo; }, function() { } @@ -270,6 +274,27 @@ angular.module('focaCrearNotaPedido') $scope.cambioEdit = function() { $scope.edit = !$scope.edit ? true : false; }; + $scope.limpiarFlete = function() { + $scope.notaPedido.fleteNombre = ''; + $scope.notaPedido.chofer = ''; + $scope.notaPedido.vehiculo = ''; + $scope.notaPedido.kilometros = ''; + $scope.notaPedido.costoUnitarioKmFlete = ''; + }; + $scope.crearPedidoDemo = function() { + focaModalService.alert('Pedido Creado'); + $scope.notaPedido.precioCondicion = ''; + $scope.articulosTabla = []; + $scope.notaPedido.fleteNombre = ''; + $scope.notaPedido.chofer = ''; + $scope.notaPedido.vehiculo = ''; + $scope.notaPedido.kilometros = ''; + $scope.notaPedido.costoUnitarioKmFlete = ''; + $scope.notaPedido.vendedor.nombre = ''; + $scope.notaPedido.cliente.nombre = ''; + $scope.domicilio.dom = ''; + $scope.notaPedido.flete = 0; + }; } ] ) diff --git a/src/views/nota-pedido.html b/src/views/nota-pedido.html index ab60017..49b5f69 100644 --- a/src/views/nota-pedido.html +++ b/src/views/nota-pedido.html @@ -46,7 +46,7 @@ ng-model="notaPedido.cliente.nombre" placeholder="Seleccione Cliente" readonly="true" - ng-click="mostrarFichaCliente()" + ng-click="seleccionarCliente()" > +
-- 1.9.1