Commit d097bdfe3a579276112eb91728e02c0611352973
Exists in
master
and in
1 other branch
Merge branch 'master' of https://debo.suite.repo/modulos-npm/foca-crear-nota-pedido
Showing
4 changed files
Show diff stats
package.json
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | "foca-modal-vendedores": "git+https://debo.suite.repo/modulos-npm/foca-modal-vendedores.git", |
| 39 | 39 | "font-awesome": "^4.7.0", |
| 40 | 40 | "gulp": "^3.9.1", |
| 41 | - "gulp-angular-templatecache": "^2.2.2", | |
| 41 | + "gulp-angular-templatecache": "2.2.2", | |
| 42 | 42 | "gulp-clean": "^0.4.0", |
| 43 | 43 | "gulp-concat": "^2.6.1", |
| 44 | 44 | "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(); |
| ... | ... | @@ -88,7 +91,6 @@ angular.module('focaCrearNotaPedido') |
| 88 | 91 | } |
| 89 | 92 | ); |
| 90 | 93 | } |
| 91 | - | |
| 92 | 94 | }; |
| 93 | 95 | $scope.siguienteTab = function() { |
| 94 | 96 | $scope.active = 1; |
| ... | ... | @@ -136,7 +138,7 @@ angular.module('focaCrearNotaPedido') |
| 136 | 138 | ); |
| 137 | 139 | modalInstance.result.then( |
| 138 | 140 | function(vendedor) { |
| 139 | - $scope.notaPedido.vendedor = vendedor.NomVen; | |
| 141 | + $scope.notaPedido.vendedor.nombre = vendedor.NomVen; | |
| 140 | 142 | }, function() { |
| 141 | 143 | |
| 142 | 144 | } |
| ... | ... | @@ -170,12 +172,22 @@ angular.module('focaCrearNotaPedido') |
| 170 | 172 | ); |
| 171 | 173 | modalInstance.result.then( |
| 172 | 174 | function(cliente) { |
| 173 | - $scope.notaPedido.cliente = cliente.nom; | |
| 175 | + $scope.notaPedido.cliente.nombre = cliente.nom; | |
| 174 | 176 | }, function() { |
| 175 | 177 | |
| 176 | 178 | } |
| 177 | 179 | ); |
| 178 | 180 | }; |
| 181 | + $scope.mostrarFichaCliente = function() { | |
| 182 | + $uibModal.open( | |
| 183 | + { | |
| 184 | + ariaLabelledBy: 'Datos del Cliente', | |
| 185 | + templateUrl: 'foca-crear-nota-pedido-ficha-cliente.html', | |
| 186 | + controller: 'focaCrearNotaPedidoFichaClienteController', | |
| 187 | + size: 'lg' | |
| 188 | + } | |
| 189 | + ); | |
| 190 | + }; | |
| 179 | 191 | $scope.obtenerDomicilios = function(id) { |
| 180 | 192 | crearNotaPedidoService.getDomicilios(id).then( |
| 181 | 193 | function(res) { |
| ... | ... | @@ -236,4 +248,22 @@ angular.module('focaCrearNotaPedido') |
| 236 | 248 | $location.path('/venta-nota-pedido/abm/'); |
| 237 | 249 | }; |
| 238 | 250 | } |
| 251 | + ]) | |
| 252 | + .controller('focaCrearNotaPedidoFichaClienteController', [ | |
| 253 | + '$scope', | |
| 254 | + 'crearNotaPedidoService', | |
| 255 | + '$location', | |
| 256 | + function($scope, crearNotaPedidoService, $location) { | |
| 257 | + crearNotaPedidoService.obtenerNotaPedido().then(function(datos) { | |
| 258 | + $scope.notaPedidos = datos.data; | |
| 259 | + }); | |
| 260 | + $scope.editar = function(notaPedido) { | |
| 261 | + crearNotaPedidoService.setNotaPedido(notaPedido); | |
| 262 | + $location.path('/venta-nota-pedido/abm/'); | |
| 263 | + } | |
| 264 | + $scope.crearPedido = function() { | |
| 265 | + crearNotaPedidoService.clearNotaPedido(); | |
| 266 | + $location.path('/venta-nota-pedido/abm/'); | |
| 267 | + } | |
| 268 | + } | |
| 239 | 269 | ]); |
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> |