Commit 47c65ce5d8e909f2a5d26f0a8fc581912212a33d
1 parent
2e1c1db0c9
Exists in
master
and in
1 other branch
- Agregué ícono lupa a los campos vendedor y cliente.
- Agregué implementación parcial de ficha cliente.
Showing
4 changed files
with
167 additions
and
45 deletions
Show diff stats
package.json
| ... | ... | @@ -11,25 +11,25 @@ |
| 11 | 11 | }, |
| 12 | 12 | "repository": { |
| 13 | 13 | "type": "git", |
| 14 | - "url": "https://192.168.0.11/modulos-npm/foca-crear-nota-pedido.git" | |
| 14 | + "url": "https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido.git" | |
| 15 | 15 | }, |
| 16 | 16 | "author": "Foca Software", |
| 17 | 17 | "license": "ISC", |
| 18 | 18 | "dependencies": { |
| 19 | - "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas.git", | |
| 20 | - "foca-modal-busqueda-productos": "git+https://192.168.0.11/nguarnieri/foca-modal-busqueda-productos", | |
| 21 | - "foca-modal-petroleras": "git+https://192.168.0.11/modulos-npm/foca-modal-petroleras.git", | |
| 22 | - "foca-modal-vendedores": "git+https://192.168.0.11/modulos-npm/foca-modal-vendedores.git", | |
| 19 | + "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | |
| 20 | + "foca-modal-busqueda-productos": "git+https://debo.suite.repo/nguarnieri/foca-modal-busqueda-productos", | |
| 21 | + "foca-modal-petroleras": "git+https://debo.suite.repo/modulos-npm/foca-modal-petroleras.git", | |
| 22 | + "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", | |
| 23 | 23 | "jquery": "^3.3.x" |
| 24 | 24 | }, |
| 25 | 25 | "devDependencies": { |
| 26 | 26 | "angular": "^1.7.5", |
| 27 | 27 | "angular-route": "^1.7.5", |
| 28 | 28 | "bootstrap": "^4.1.3", |
| 29 | - "foca-busqueda-cliente": "git+https://192.168.0.11/modulos-npm/foca-busqueda-cliente", | |
| 29 | + "foca-busqueda-cliente": "git+https://debo.suite.repo/modulos-npm/foca-busqueda-cliente", | |
| 30 | 30 | "font-awesome": "^4.7.0", |
| 31 | 31 | "gulp": "^3.9.1", |
| 32 | - "gulp-angular-templatecache": "^2.2.2", | |
| 32 | + "gulp-angular-templatecache": "2.2.2", | |
| 33 | 33 | "gulp-clean": "^0.4.0", |
| 34 | 34 | "gulp-concat": "^2.6.1", |
| 35 | 35 | "gulp-connect": "^5.6.1", |
src/js/controller.js
| ... | ... | @@ -6,10 +6,13 @@ angular.module('focaCrearNotaPedido') |
| 6 | 6 | |
| 7 | 7 | $scope.dateOptions = { |
| 8 | 8 | maxDate: new Date(), |
| 9 | - minDate: new Date(2010,0,1) | |
| 9 | + minDate: new Date(2010, 0, 1) | |
| 10 | 10 | }; |
| 11 | 11 | |
| 12 | - $scope.notaPedido = {}; | |
| 12 | + $scope.notaPedido = { | |
| 13 | + vendedor: {}, | |
| 14 | + cliente: {} | |
| 15 | + }; | |
| 13 | 16 | $scope.articulosTabla = []; |
| 14 | 17 | var idLista; |
| 15 | 18 | var notaPedidoTemp = crearNotaPedidoService.getNotaPedido(); |
| ... | ... | @@ -81,11 +84,12 @@ angular.module('focaCrearNotaPedido') |
| 81 | 84 | ) |
| 82 | 85 | var articulosNotaPedido = $scope.articulosTabla; |
| 83 | 86 | for(var i = 0; i< articulosNotaPedido.length;i++) { |
| 84 | - crearNotaPedidoService.crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( | |
| 85 | - function(res) { | |
| 86 | - return; | |
| 87 | - } | |
| 88 | - ) | |
| 87 | + crearNotaPedidoService | |
| 88 | + .crearArticulosParaNotaPedido(articulosNotaPedido[i]).then( | |
| 89 | + function(res) { | |
| 90 | + return; | |
| 91 | + } | |
| 92 | + ) | |
| 89 | 93 | } |
| 90 | 94 | |
| 91 | 95 | } |
| ... | ... | @@ -135,7 +139,7 @@ angular.module('focaCrearNotaPedido') |
| 135 | 139 | ) |
| 136 | 140 | modalInstance.result.then( |
| 137 | 141 | function(vendedor) { |
| 138 | - $scope.notaPedido.vendedor = vendedor.NomVen; | |
| 142 | + $scope.notaPedido.vendedor.nombre = vendedor.NomVen; | |
| 139 | 143 | }, function() { |
| 140 | 144 | |
| 141 | 145 | } |
| ... | ... | @@ -169,12 +173,22 @@ angular.module('focaCrearNotaPedido') |
| 169 | 173 | ) |
| 170 | 174 | modalInstance.result.then( |
| 171 | 175 | function(cliente) { |
| 172 | - $scope.notaPedido.cliente = cliente.nom; | |
| 176 | + $scope.notaPedido.cliente.nombre = cliente.nom; | |
| 173 | 177 | }, function() { |
| 174 | 178 | |
| 175 | 179 | } |
| 176 | 180 | ); |
| 177 | - } | |
| 181 | + }; | |
| 182 | + $scope.mostrarFichaCliente = function() { | |
| 183 | + $uibModal.open( | |
| 184 | + { | |
| 185 | + ariaLabelledBy: 'Datos del Cliente', | |
| 186 | + templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', | |
| 187 | + controller: 'focaCrearNotaPedidoFichaClienteController', | |
| 188 | + size: 'lg' | |
| 189 | + } | |
| 190 | + ); | |
| 191 | + }; | |
| 178 | 192 | $scope.obtenerDomicilios = function(id) { |
| 179 | 193 | crearNotaPedidoService.getDomicilios(id).then( |
| 180 | 194 | function(res) { |
| ... | ... | @@ -219,3 +233,21 @@ angular.module('focaCrearNotaPedido') |
| 219 | 233 | } |
| 220 | 234 | } |
| 221 | 235 | ]) |
| 236 | + .controller('focaCrearNotaPedidoFichaClienteController', [ | |
| 237 | + '$scope', | |
| 238 | + 'crearNotaPedidoService', | |
| 239 | + '$location', | |
| 240 | + function($scope, crearNotaPedidoService, $location) { | |
| 241 | + crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | |
| 242 | + $scope.notaPedidos = datos.data; | |
| 243 | + }); | |
| 244 | + $scope.editar = function(notaPedido) { | |
| 245 | + crearNotaPedidoService.setNotaPedido(notaPedido); | |
| 246 | + $location.path('/venta-nota-pedido/abm/'); | |
| 247 | + } | |
| 248 | + $scope.crearPedido = function() { | |
| 249 | + crearNotaPedidoService.clearNotaPedido(); | |
| 250 | + $location.path('/venta-nota-pedido/abm/'); | |
| 251 | + } | |
| 252 | + } | |
| 253 | + ]); |
src/views/foca-crear-nota-pedido-ficha-cliente.html
| ... | ... | @@ -0,0 +1,78 @@ |
| 1 | +<div class="modal-header"> | |
| 2 | + <h3 class="modal-title"></h3> | |
| 3 | +</div> | |
| 4 | +<div class="modal-body" id="modal-body"> | |
| 5 | + <div class="input-group mb-3"> | |
| 6 | + <input | |
| 7 | + type="text" | |
| 8 | + class="form-control" | |
| 9 | + placeholder="Busqueda" | |
| 10 | + ng-model="filters" | |
| 11 | + ng-change="search()" | |
| 12 | + ng-keydown="busquedaDown($event.keyCode)" | |
| 13 | + ng-keypress="busquedaPress($event.keyCode)" | |
| 14 | + foca-focus="selectedVendedor == -1" | |
| 15 | + ng-focus="selectedVendedor = -1" | |
| 16 | + > | |
| 17 | + <table class="table table-striped table-sm"> | |
| 18 | + <thead> | |
| 19 | + <tr> | |
| 20 | + <th>Código</th> | |
| 21 | + <th>Nombre</th> | |
| 22 | + <th></th> | |
| 23 | + </tr> | |
| 24 | + </thead> | |
| 25 | + <tbody> | |
| 26 | + <tr ng-repeat="(key, vendedor) in currentPageVendedores"> | |
| 27 | + <td ng-bind="vendedor.CodVen"></td> | |
| 28 | + <td ng-bind="vendedor.NomVen"></td> | |
| 29 | + <td> | |
| 30 | + <button | |
| 31 | + type="button" | |
| 32 | + class="btn p-2 float-right btn-sm" | |
| 33 | + ng-class="{ | |
| 34 | + 'btn-secondary': selectedVendedor != key, | |
| 35 | + 'btn-primary': selectedVendedor == key | |
| 36 | + }" | |
| 37 | + ng-click="select(vendedor)" | |
| 38 | + foca-focus="selectedVendedor == {{key}}" | |
| 39 | + ng-keydown="itemVendedor($event.keyCode)"> | |
| 40 | + <i class="fa fa-arrow-right" aria-hidden="true"></i> | |
| 41 | + </button> | |
| 42 | + </td> | |
| 43 | + </tr> | |
| 44 | + </tbody> | |
| 45 | + </table> | |
| 46 | + <nav> | |
| 47 | + <ul class="pagination justify-content-end"> | |
| 48 | + <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | |
| 49 | + <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> | |
| 50 | + <span aria-hidden="true">«</span> | |
| 51 | + <span class="sr-only">Anterior</span> | |
| 52 | + </a> | |
| 53 | + </li> | |
| 54 | + <li | |
| 55 | + class="page-item" | |
| 56 | + ng-repeat="pagina in paginas" | |
| 57 | + ng-class="{'active': pagina == currentPage}" | |
| 58 | + > | |
| 59 | + <a | |
| 60 | + class="page-link" | |
| 61 | + href="#" | |
| 62 | + ng-click="selectPage(pagina)" | |
| 63 | + ng-bind="pagina" | |
| 64 | + ></a> | |
| 65 | + </li> | |
| 66 | + <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | |
| 67 | + <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> | |
| 68 | + <span aria-hidden="true">»</span> | |
| 69 | + <span class="sr-only">Siguiente</span> | |
| 70 | + </a> | |
| 71 | + </li> | |
| 72 | + </ul> | |
| 73 | + </nav> | |
| 74 | + </div> | |
| 75 | +</div> | |
| 76 | +<div class="modal-footer"> | |
| 77 | + <button class="btn btn-secondary" data-dismiss="modal">Cerrar</button> | |
| 78 | +</div> |
src/views/nota-pedido.html
| ... | ... | @@ -3,17 +3,17 @@ |
| 3 | 3 | <div class="row bg-secondary p-3"> |
| 4 | 4 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 5 | 5 | <div class="input-group"> |
| 6 | - <input | |
| 7 | - type="text" | |
| 8 | - class="form-control" | |
| 9 | - uib-datepicker-popup="dd/MM/yyyy" | |
| 10 | - ng-model="notaPedido.fechaCarga" | |
| 11 | - is-open="popup1.opened" | |
| 12 | - datepicker-options="dateOptions" | |
| 6 | + <input | |
| 7 | + type="text" | |
| 8 | + class="form-control" | |
| 9 | + uib-datepicker-popup="dd/MM/yyyy" | |
| 10 | + ng-model="notaPedido.fechaCarga" | |
| 11 | + is-open="popup1.opened" | |
| 12 | + datepicker-options="dateOptions" | |
| 13 | 13 | close-text="Cerrar" |
| 14 | 14 | current-text="Hoy" |
| 15 | 15 | clear-text="Borrar" |
| 16 | - alt-input-formats="altInputFormats" | |
| 16 | + alt-input-formats="altInputFormats" | |
| 17 | 17 | /> |
| 18 | 18 | <span class="input-group-append"> |
| 19 | 19 | <button type="button" class="btn btn-default" ng-click="popup1.opened = true"> |
| ... | ... | @@ -23,27 +23,40 @@ |
| 23 | 23 | </div> |
| 24 | 24 | </div> |
| 25 | 25 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 26 | - <input | |
| 27 | - class="form-control selectable" | |
| 28 | - type="text" | |
| 29 | - readonly="true" | |
| 30 | - ng-bind="cliente.nombre" | |
| 31 | - ng-click="seleccionarVendedor()" | |
| 32 | - placeholder="Seleccione Vendedor" | |
| 33 | - > | |
| 26 | + <div class="input-group"> | |
| 27 | + <input | |
| 28 | + class="form-control" | |
| 29 | + type="text" | |
| 30 | + ng-model="notaPedido.vendedor.nombre" | |
| 31 | + placeholder="Seleccione Vendedor" | |
| 32 | + readonly="true" | |
| 33 | + > | |
| 34 | + <span class="input-group-append"> | |
| 35 | + <button type="button" class="btn btn-default" ng-click="seleccionarVendedor()"> | |
| 36 | + <i class="fa fa-search"></i> | |
| 37 | + </button> | |
| 38 | + </span> | |
| 39 | + </div> | |
| 34 | 40 | </div> |
| 35 | 41 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 36 | - <input | |
| 37 | - class="form-control selectable" | |
| 38 | - type="text" | |
| 39 | - readonly="true" | |
| 40 | - ng-bind="vendedor.nombre" | |
| 41 | - ng-click="seleccionarCliente()" | |
| 42 | - placeholder="Seleccione Cliente" | |
| 43 | - > | |
| 42 | + <div class="input-group"> | |
| 43 | + <input | |
| 44 | + class="form-control selectable" | |
| 45 | + type="text" | |
| 46 | + ng-model="notaPedido.cliente.nombre" | |
| 47 | + placeholder="Seleccione Cliente" | |
| 48 | + readonly="true" | |
| 49 | + ng-click="mostrarFichaCliente()" | |
| 50 | + > | |
| 51 | + <span class="input-group-append"> | |
| 52 | + <button type="button" class="btn btn-default" ng-click="seleccionarCliente()"> | |
| 53 | + <i class="fa fa-search"></i> | |
| 54 | + </button> | |
| 55 | + </span> | |
| 56 | + </div> | |
| 44 | 57 | </div> |
| 45 | 58 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 46 | - <input | |
| 59 | + <input | |
| 47 | 60 | class="form-control selectable" |
| 48 | 61 | type="text" |
| 49 | 62 | readonly="true" |
| ... | ... | @@ -53,7 +66,7 @@ |
| 53 | 66 | > |
| 54 | 67 | </div> |
| 55 | 68 | <div class="form-group col-12 col-sm-6 col-md-4"> |
| 56 | - <input | |
| 69 | + <input | |
| 57 | 70 | class="form-control selectable" |
| 58 | 71 | type="text" |
| 59 | 72 | readonly="true" |
| ... | ... | @@ -68,7 +81,6 @@ |
| 68 | 81 | <div class="row"> |
| 69 | 82 | <div class="col-md-10 col-lg-8 offset-md-1 offset-lg-2"> |
| 70 | 83 | <div class="row"> |
| 71 | - | |
| 72 | 84 | </div> |
| 73 | 85 | <div class="row"> |
| 74 | 86 | <table class="table table-striped table-sm"> |
| ... | ... | @@ -86,7 +98,7 @@ |
| 86 | 98 | </thead> |
| 87 | 99 | <tbody> |
| 88 | 100 | <tr> |
| 89 | - <td colspan="2"><input class="form-control" readonly></td> | |
| 101 | + <td colspan="2"><input class="form-control" readonly ng-click="seleccionarArticulo()"></td> | |
| 90 | 102 | <td></td> |
| 91 | 103 | <td></td> |
| 92 | 104 | <td></td> |