From 21e8f5701a6c96d927e9aceb6c9fbe49c1eb8514 Mon Sep 17 00:00:00 2001 From: Pablo Marco del Pont Date: Wed, 17 Oct 2018 14:54:22 -0300 Subject: [PATCH] - Modificaciones para que funcione correctamente. --- .gitignore | 2 +- foca-busqueda-cliente-modal.html | 35 ----- gulpfile.js | 4 +- index.html | 15 +- package.json | 14 +- src/etc/develop.ejemplo.js | 3 + src/js/app.js | 29 ++-- src/sass/_contenedor.scss | 9 ++ src/sass/_lista.scss | 34 +++++ src/sass/_login.scss | 28 ++++ src/sass/_tabla.scss | 5 + src/sass/general.scss | 4 + vendor/foca-crear-nota-pedido.js | 291 --------------------------------------- 13 files changed, 113 insertions(+), 360 deletions(-) delete mode 100644 foca-busqueda-cliente-modal.html create mode 100644 src/etc/develop.ejemplo.js create mode 100644 src/sass/_contenedor.scss create mode 100644 src/sass/_lista.scss create mode 100644 src/sass/_login.scss create mode 100644 src/sass/_tabla.scss delete mode 100644 vendor/foca-crear-nota-pedido.js diff --git a/.gitignore b/.gitignore index bfa8b8a..76890cc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ node_modules/ dist/ - +/src/etc/develop.js package-lock\.json diff --git a/foca-busqueda-cliente-modal.html b/foca-busqueda-cliente-modal.html deleted file mode 100644 index fd42ef9..0000000 --- a/foca-busqueda-cliente-modal.html +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/gulpfile.js b/gulpfile.js index 00b3d29..3f8eb78 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -43,7 +43,7 @@ gulp.task('html', function() { }) gulp.task('sass', function() { - return gulp.src('src/style/scss/**/*.scss') + return gulp.src('src/sass/*.scss') .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) .pipe(gulp.dest('css')); }); @@ -60,7 +60,7 @@ gulp.task('pre-commit', function() { gulp.start('uglify'); gulp.start('sass'); }); - + gulp.task('webserver', function() { pump [ connect.server( diff --git a/index.html b/index.html index c02f342..f50a781 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,7 @@ + @@ -16,12 +17,13 @@ - + - + + @@ -29,19 +31,14 @@ + +
diff --git a/package.json b/package.json index 1acf5d9..11a30f5 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "type": "git", "url": "https://192.168.0.11/Wrappers/wrapper-demo.git" }, - "author": "Nicolas Guarnieri", + "author": "Foca Software", "license": "ISC", "dependencies": { "angular": "^1.7.4", @@ -28,7 +28,9 @@ "foca-abm-sectores": "git+https://192.168.0.11/modulos-npm/foca-abm-sectores", "foca-botonera-horizontal": "git+https://192.168.0.11/modulos-npm/foca-botonera-horizontal.git", "foca-busqueda-cliente": "git+https://192.168.0.11/modulos-npm/foca-busqueda-cliente.git", + "foca-crear-nota-pedido": "git+https://192.168.0.11/modulos-npm/foca-crear-nota-pedido.git", "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas.git", + "foca-modal": "git+https://192.168.0.11/modulos-npm/foca-modal", "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", @@ -38,21 +40,23 @@ "gulp-htmlmin": "^5.0.1", "gulp-uglify": "^3.0.1", "jquery": "3.3.1", + "node-sass": "4.9.4", "uglify": "^0.1.5", "ui-bootstrap4": "^3.0.5" }, "devDependencies": { "electron": "^3.0.2", "gulp": "^3.9.1", - "gulp-concat": "2.6.1", + "gulp-clean": "^0.4.0", + "gulp-concat": "^2.6.1", "gulp-connect": "^5.6.1", "gulp-jshint": "^2.1.0", - "gulp-rename": "1.4.0", + "gulp-rename": "^1.4.0", "gulp-replace": "^1.0.0", - "gulp-sass": "4.0.1", + "gulp-sass": "^4.0.1", "gulp-uglify-es": "^1.0.4", "gulp-watch": "^5.0.1", - "jasmine-core": "3.2.1", + "jasmine-core": "^3.2.1", "jshint": "^2.9.6", "pre-commit": "^1.2.2", "pump": "^3.0.0" diff --git a/src/etc/develop.ejemplo.js b/src/etc/develop.ejemplo.js new file mode 100644 index 0000000..6c837a6 --- /dev/null +++ b/src/etc/develop.ejemplo.js @@ -0,0 +1,3 @@ +angular.module('appWrapperDemo').constant("API_ENDPOINT", { + 'URL': '//127.0.0.1:9000' +}); diff --git a/src/js/app.js b/src/js/app.js index b642956..1b3536a 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,17 +1,12 @@ -angular - .module('appWrapperDemo', [ - 'ngRoute', - 'ui.bootstrap', - - 'focaBotoneraHorizontal', - 'focaTurnoApertura', - 'focaAbmPreciosCondiciones', - 'focaAbmPlazoPago', - 'focaAbmSectores', - 'focaBusquedaCliente', - 'focaCrearNotaPedido' - ]) - .constant("API_ENDPOINT", { - 'URL': '//201.190.140.28:9900' - }); - +angular.module('appWrapperDemo', [ + 'ngRoute', + 'ui.bootstrap', + 'focaBotoneraHorizontal', + 'focaTurnoApertura', + 'focaAbmPreciosCondiciones', + 'focaAbmPlazoPago', + 'focaAbmSectores', + 'focaBusquedaCliente', + 'focaCrearNotaPedido', + 'focaModal' +]); diff --git a/src/sass/_contenedor.scss b/src/sass/_contenedor.scss new file mode 100644 index 0000000..b6425bf --- /dev/null +++ b/src/sass/_contenedor.scss @@ -0,0 +1,9 @@ +body { + background-color: #cccccc; +} + +.contenedor { + background-image: radial-gradient(circle at 50% 50%, #ebecf1, #abaec3); + min-height: 600px; + min-width: 800px; +} diff --git a/src/sass/_lista.scss b/src/sass/_lista.scss new file mode 100644 index 0000000..7c49d18 --- /dev/null +++ b/src/sass/_lista.scss @@ -0,0 +1,34 @@ +.lista { + background-color: rgba(0,0,0,0.8); + padding: 10px; + tr { + background: linear-gradient(rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.5)); + } + tbody { + td { + border-top: none; + color: #ffffff; + } + } + thead { + th { + border-bottom: 1px solid #ffffff; + border-top: none; + color: #ffffff; + font-family: sans-serif; + font-size: 12px; + } + } + .boton { + &-accion { + background: none; + color: #ffffff; + border: 1px solid #ffffff; + border-radius: 30px; + padding: 5px 7px; + i { + font-size: 16px; + } + } + } +} diff --git a/src/sass/_login.scss b/src/sass/_login.scss new file mode 100644 index 0000000..7c1402a --- /dev/null +++ b/src/sass/_login.scss @@ -0,0 +1,28 @@ +.login { + background-color: #bdbdbd; + border: 1px solid #000000; + border-radius: 3px; + height: 150px; + left: calc(50% - 130px); + opacity: 0.7; + position: absolute; + text-align: center; + top: 190px; + width: 260px; + &-titulo { + border-bottom: 1px solid #ffffff; + padding: 5px 0; + } + &-campo { + label { + display: block; + font-size: 12px; + margin: 5px 0 0; + } + input { + &:focus { + outline: 3px solid #ff9900; + } + } + } +} diff --git a/src/sass/_tabla.scss b/src/sass/_tabla.scss new file mode 100644 index 0000000..cf98a7c --- /dev/null +++ b/src/sass/_tabla.scss @@ -0,0 +1,5 @@ +.table { + &-nonfluid { + width: auto; + } +} diff --git a/src/sass/general.scss b/src/sass/general.scss index e69de29..4823856 100644 --- a/src/sass/general.scss +++ b/src/sass/general.scss @@ -0,0 +1,4 @@ +@import 'tabla'; +@import 'lista'; +@import 'login'; +@import 'contenedor'; diff --git a/vendor/foca-crear-nota-pedido.js b/vendor/foca-crear-nota-pedido.js deleted file mode 100644 index e0eea1b..0000000 --- a/vendor/foca-crear-nota-pedido.js +++ /dev/null @@ -1,291 +0,0 @@ -angular.module('focaCrearNotaPedido', ['ngRoute', 'ui.bootstrap', 'focaModalVendedores', - 'focaBusquedaProductos', 'focaModalPetroleras', 'focaBusquedaCliente']) - .config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/venta-nota-pedido/crear', { - controller: 'notaPedidoListaCtrl', - templateUrl: 'nota-pedido-lista.html' - }); - }]) - .config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/venta-nota-pedido/abm', { - controller: 'notaPedidoCtrl', - templateUrl: 'nota-pedido.html' - }); - }]); - -angular.module('focaCrearNotaPedido') - .controller('notaPedidoCtrl', - [ - '$scope', - '$uibModal', - '$location', - 'crearNotaPedidoService', - function($scope, $uibModal, $location, crearNotaPedidoService) { - $scope.notaPedido = {}; - $scope.articulosTabla = []; - var idLista; - var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); - $scope.domiciliosCliente = crearNotaPedidoService.getDomicilios(1); - crearNotaPedidoService.getPrecioCondicion().then( - function(res) { - $scope.precioCondiciones = res.data; - } - ); - if (notaPedidoTemp != undefined) { - notaPedidoTemp.fechaCarga = new Date(notaPedidoTemp.fechaCarga); - $scope.notaPedido = notaPedidoTemp; - $scope.notaPedido.flete = ($scope.notaPedido.flete).toString(); - $scope.notaPedido.bomba = ($scope.notaPedido.bomba).toString(); - idLista = $scope.notaPedido.precioCondicion; - crearNotaPedidoService.getArticulosByIdNotaPedido($scope.notaPedido.id).then( - function(res) { - $scope.articulosTabla = res.data; - } - ); - crearNotaPedidoService.getDomiciliosByIdNotaPedido($scope.notaPedido.id).then( - function(res) { - $scope.notaPedido.domicilio = res.data; - } - ) - } else { - $scope.notaPedido.fechaCarga = new Date(); - $scope.notaPedido.domicilio = [{ id: 0 }] - $scope.notaPedido.bomba = '1'; - $scope.notaPedido.flete = '1'; - idLista = undefined; - } - $scope.addNewDom = function() { - $scope.notaPedido.domicilio.push({ 'id': 0 }); - } - $scope.removeNewChoice = function(choice) { - if ($scope.notaPedido.domicilio.length > 1) { - $scope.notaPedido.domicilio.splice($scope.notaPedido.domicilio.findIndex(c => c.$$hashKey == choice.$$hashKey), 1) - } - } - $scope.crearNotaPedido = function() { - var total = 0; - for (var i = $scope.articulosTabla.length - 1; i >= 0; i--) { - total += $scope.articulosTabla[i].precio * $scope.articulosTabla[i].cantidad; - } - - var notaPedido = { - id: 0, - precioCondicion: $scope.notaPedido.precioCondicion, - fechaCarga: $scope.notaPedido.fechaCarga, - vendedor: $scope.notaPedido.vendedor, - cliente: $scope.notaPedido.cliente, - producto: $scope.notaPedido.producto, - bomba: $scope.notaPedido.bomba, - petrolera: $scope.notaPedido.petrolera, - domicilio: $scope.notaPedido.domicilio, - kilometros: $scope.notaPedido.kilometros, - jurisdiccionIIBB: $scope.notaPedido.jurisdiccionIIBB, - costoFinanciacion: $scope.notaPedido.costoFinanciacion, - flete: $scope.notaPedido.flete, - costoUnitarioKmFlete: $scope.notaPedido.costoUnitarioKmFlete, - total : total - } - crearNotaPedidoService.crearNotaPedido(notaPedido).then( - function(res) { - $location.path('/venta-nota-pedido/crear'); - } - ) - var articulosNotaPedido = $scope.articulosTabla; - for(var i = 0; i< articulosNotaPedido.length;i++) { - crearNotaPedidoService.crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( - function(res) { - return; - } - ) - } - - } - $scope.siguienteTab = function() { - $scope.active = 1; - } - $scope.seleccionarArticulo = function() { - if (idLista == undefined) { - alert('primero seleccione una lista de precio y condicion'); - return; - } - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Productos', - templateUrl: 'modal-busqueda-productos.html', - controller: 'modalBusquedaProductosCtrl', - resolve: { idLista: function() { return idLista } }, - size: 'lg' - } - ) - modalInstance.result.then( - function(producto) { - var newArt = - { - id: 0, - codigo: producto.FiltroSectorCodigo, - item: $scope.articulosTabla.length + 1, - nombre: producto.descripcion, - precio: producto.precio, - costoUnitario: producto.costo, - cantidad: 1 - } - $scope.articulosTabla.unshift(newArt); - }, function() { - // funcion ejecutada cuando se cancela el modal - } - ); - } - $scope.seleccionarVendedor = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Vendedores', - templateUrl: 'modal-vendedores.html', - controller: 'modalVendedoresCtrl', - size: 'lg' - } - ) - modalInstance.result.then( - function(vendedor) { - $scope.notaPedido.vendedor = vendedor.NomVen; - }, function() { - - } - ); - } - $scope.seleccionarPetrolera = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Petrolera', - templateUrl: 'modal-petroleras.html', - controller: 'modalPetrolerasCtrl', - size: 'lg' - } - ) - modalInstance.result.then( - function(petrolera) { - $scope.notaPedido.petrolera = petrolera.NOM; - }, function() { - - } - ); - } - $scope.seleccionarCliente = function() { - var modalInstance = $uibModal.open( - { - ariaLabelledBy: 'Busqueda de Cliente', - templateUrl: 'foca-busqueda-cliente-modal.html', - controller: 'focaBusquedaClienteModalController', - size: 'lg' - } - ) - modalInstance.result.then( - function(cliente) { - $scope.notaPedido.cliente = cliente.nom; - }, function() { - - } - ); - } - $scope.obtenerDomicilios = function(id) { - crearNotaPedidoService.getDomicilios(id).then( - function(res) { - $scope.notaPedido.domicilio = res.data; - } - ) - } - $scope.getSubTotal = function(item) { - var subTotal = 0; - var array = $scope.articulosTabla.filter(a => a.item <= item); - for (var i = 0; i < array.length; i++) { - subTotal += array[i].precio * array[i].cantidad - } - return subTotal.toFixed(2); - } - $scope.cargarArticulos = function() { - idLista = $scope.notaPedido.precioCondicion; - $scope.articulosTabla = []; - } - } - ] - ) - .controller('notaPedidoListaCtrl', [ - '$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/'); - } - } - ]) - -angular.module('focaCrearNotaPedido') - .service('crearNotaPedidoService', ['$http', 'API_ENDPOINT',function($http, API_ENDPOINT) { - var route = API_ENDPOINT.URL; - var notaPedido; - return { - crearNotaPedido: function(notaPedido) { - return $http.post(route + '/nota-pedido', {notaPedido: notaPedido}); - }, - obtenerNotaPedido: function() { - return $http.get(route +'/nota-pedido'); - }, - setNotaPedido: function(notaPedido) { - this.notaPedido = notaPedido; - }, - clearNotaPedido: function() { - this.notaPedido = undefined; - }, - getNotaPedido: function() { - return this.notaPedido; - }, - getArticulosByIdNotaPedido: function(id) { - return $http.get(route+'/articulos/nota-pedido/'+id); - }, - crearArticulosParaNotaPedido: function(articuloNotaPedido) { - return $http.post(route + '/articulos/nota-pedido', {articuloNotaPedido}); - }, - getDomiciliosByIdNotaPedido: function(id) { - return $http.get(route +'/nota-pedido/'+id+'/domicilios'); - }, - //EN DESARROLLO - getDomicilios: function(id) { - // return $http.get(route + '/'+id) - var domicilio = [ - { - id: 1, - dom: 'RISSO PATRON 781' - }, - { - id: 2, - dom: 'MARIANO MORENO 533' - }, - { - id: 3, - dom: 'SALTA 796' - } - ] - return domicilio; - }, - getPrecioCondicion: function() { - return $http.get(route + '/precio-condicion') - }, - getPrecioCondicionById: function(id) { - return $http.get(route + '/precio-condicion/' + id) - }, - getPlazoPagoByPrecioCondicion: function(id) { - return $http.get(route + '/plazo-pago/precio-condicion/'+ id) - } - } - }]) - -angular.module('focaCrearNotaPedido').run(['$templateCache', function($templateCache) {$templateCache.put('nota-pedido-lista.html','\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
C\xF3digoVendedorClientePetroleraTotal
\r\n \r\n \r\n
\r\n'); -$templateCache.put('nota-pedido.html','
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
$
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
$
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n No se encontraron resultados.\r\n
\r\n
\r\n -\r\n +\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
C\xF3digoNombrePrecio unitarioCosto unitario brutoCantidadSubtotal
\r\n
\r\n
\r\n
\r\n
');}]); \ No newline at end of file -- 1.9.1