Commit a3b913502cc7d3eca943a096885ded974ca7cb99
1 parent
ea1df75ff6
Exists in
master
and in
1 other branch
fuera simbolo moneda
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
package.json
1 | { | 1 | { |
2 | "name": "foca-modal-busqueda-productos", | 2 | "name": "foca-modal-busqueda-productos", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Modal para seleccion de productos", | 4 | "description": "Modal para seleccion de productos", |
5 | "scripts": { | 5 | "scripts": { |
6 | "test": "echo \"Error: no test specified\" && exit 1", | 6 | "test": "echo \"Error: no test specified\" && exit 1", |
7 | "gulp-pre-commit": "gulp pre-commit", | 7 | "gulp-pre-commit": "gulp pre-commit", |
8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
9 | "postinstall": "npm run compile && gulp clean-post-install", | 9 | "postinstall": "npm run compile && gulp clean-post-install", |
10 | "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+http://git.focasoftware.com/npm/foca-directivas" | 10 | "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+http://git.focasoftware.com/npm/foca-directivas.git" |
11 | }, | 11 | }, |
12 | "pre-commit": [ | 12 | "pre-commit": [ |
13 | "gulp-pre-commit" | 13 | "gulp-pre-commit" |
14 | ], | 14 | ], |
15 | "repository": { | 15 | "repository": { |
16 | "type": "git", | 16 | "type": "git", |
17 | "url": "http://git.focasoftware.com/npm/foca-modal-busqueda-productos" | 17 | "url": "http://git.focasoftware.com/npm/foca-modal-busqueda-productos" |
18 | }, | 18 | }, |
19 | "author": "Nicolás Guarnieri", | 19 | "author": "Nicolás Guarnieri", |
20 | "license": "ISC", | 20 | "license": "ISC", |
21 | "peerDependencies": { | 21 | "peerDependencies": { |
22 | "angular": "^1.7.4", | 22 | "angular": "^1.7.4", |
23 | "bootstrap": "^4.1.3", | 23 | "bootstrap": "^4.1.3", |
24 | "font-awesome": "^4.7.0", | 24 | "font-awesome": "^4.7.0", |
25 | "ui-bootstrap4": "^3.0.4", | 25 | "ui-bootstrap4": "^3.0.4", |
26 | "gulp": "^3.9.1", | 26 | "gulp": "^3.9.1", |
27 | "gulp-angular-templatecache": "^2.2.1", | 27 | "gulp-angular-templatecache": "^2.2.1", |
28 | "gulp-concat": "^2.6.1", | 28 | "gulp-concat": "^2.6.1", |
29 | "gulp-connect": "^5.6.1", | 29 | "gulp-connect": "^5.6.1", |
30 | "gulp-htmlmin": "^5.0.1", | 30 | "gulp-htmlmin": "^5.0.1", |
31 | "gulp-rename": "^1.4.0", | 31 | "gulp-rename": "^1.4.0", |
32 | "gulp-replace": "^1.0.0", | 32 | "gulp-replace": "^1.0.0", |
33 | "gulp-uglify": "^3.0.1", | 33 | "gulp-uglify": "^3.0.1", |
34 | "jquery": "^3.3.1", | 34 | "jquery": "^3.3.1", |
35 | "pump": "^3.0.0", | 35 | "pump": "^3.0.0", |
36 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas" | 36 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git" |
37 | }, | 37 | }, |
38 | "devDependencies": { | 38 | "devDependencies": { |
39 | "angular": "^1.7.5", | 39 | "angular": "^1.7.5", |
40 | "angular-ladda": "^0.4.3", | 40 | "angular-ladda": "^0.4.3", |
41 | "bootstrap": "^4.1.3", | 41 | "bootstrap": "^4.1.3", |
42 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas", | 42 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", |
43 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", |
44 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", |
45 | "gulp-angular-templatecache": "^2.2.3", | 45 | "gulp-angular-templatecache": "^2.2.3", |
46 | "gulp-clean": "^0.4.0", | 46 | "gulp-clean": "^0.4.0", |
47 | "gulp-concat": "^2.6.1", | 47 | "gulp-concat": "^2.6.1", |
48 | "gulp-connect": "^5.6.1", | 48 | "gulp-connect": "^5.6.1", |
49 | "gulp-htmlmin": "^5.0.1", | 49 | "gulp-htmlmin": "^5.0.1", |
50 | "gulp-jshint": "^2.1.0", | 50 | "gulp-jshint": "^2.1.0", |
51 | "gulp-rename": "^1.4.0", | 51 | "gulp-rename": "^1.4.0", |
52 | "gulp-replace": "^1.0.0", | 52 | "gulp-replace": "^1.0.0", |
53 | "gulp-uglify": "^3.0.1", | 53 | "gulp-uglify": "^3.0.1", |
54 | "jasmine-core": "^3.3.0", | 54 | "jasmine-core": "^3.3.0", |
55 | "jquery": "^3.3.1", | 55 | "jquery": "^3.3.1", |
56 | "jshint": "^2.9.6", | 56 | "jshint": "^2.9.6", |
57 | "ladda": "1.0.6", | 57 | "ladda": "1.0.6", |
58 | "pre-commit": "^1.2.2", | 58 | "pre-commit": "^1.2.2", |
59 | "pump": "^3.0.0", | 59 | "pump": "^3.0.0", |
60 | "ui-bootstrap4": "^3.0.5" | 60 | "ui-bootstrap4": "^3.0.5" |
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 |
src/views/modal-busqueda-productos.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-lg-6"> | 3 | <div class="col-lg-6"> |
4 | <h5 class="modal-title my-1">Busqueda de Productos</h5> | 4 | <h5 class="modal-title my-1">Busqueda de Productos</h5> |
5 | </div> | 5 | </div> |
6 | <div class="input-group col-lg-6 pr-0 my-2"> | 6 | <div class="input-group col-lg-6 pr-0 my-2"> |
7 | <input | 7 | <input |
8 | ladda="searchLoading" | 8 | ladda="searchLoading" |
9 | type="text" | 9 | type="text" |
10 | class="form-control form-control-sm" | 10 | class="form-control form-control-sm" |
11 | id="search" | 11 | id="search" |
12 | placeholder="Busqueda" | 12 | placeholder="Busqueda" |
13 | ng-model="filters" | 13 | ng-model="filters" |
14 | ng-change="search()" | 14 | ng-change="search()" |
15 | ng-keydown="busquedaDown($event.keyCode)" | 15 | ng-keydown="busquedaDown($event.keyCode)" |
16 | ng-keypress="busquedaPress($event.keyCode)" | 16 | ng-keypress="busquedaPress($event.keyCode)" |
17 | foca-focus="selectedProducto == -1" | 17 | foca-focus="selectedProducto == -1" |
18 | ng-focus="selectedProducto = -1" | 18 | ng-focus="selectedProducto = -1" |
19 | teclado-virtual | 19 | teclado-virtual |
20 | > | 20 | > |
21 | <div class="input-group-append"> | 21 | <div class="input-group-append"> |
22 | <button | 22 | <button |
23 | ladda="searchLoading" | 23 | ladda="searchLoading" |
24 | data-spinner-color="#FF0000" | 24 | data-spinner-color="#FF0000" |
25 | class="btn btn-outline-secondary" | 25 | class="btn btn-outline-secondary" |
26 | type="button" | 26 | type="button" |
27 | ng-click="busquedaPress(13)" | 27 | ng-click="busquedaPress(13)" |
28 | > | 28 | > |
29 | <i class="fa fa-search" aria-hidden="true"></i> | 29 | <i class="fa fa-search" aria-hidden="true"></i> |
30 | </button> | 30 | </button> |
31 | </div> | 31 | </div> |
32 | </div> | 32 | </div> |
33 | </div> | 33 | </div> |
34 | </div> | 34 | </div> |
35 | <div class="modal-body" id="modal-body"> | 35 | <div class="modal-body" id="modal-body"> |
36 | 36 | ||
37 | <div ng-show="!primerBusqueda"> | 37 | <div ng-show="!primerBusqueda"> |
38 | Debe realizar una primer búsqueda. | 38 | Debe realizar una primer búsqueda. |
39 | </div> | 39 | </div> |
40 | 40 | ||
41 | <table ng-show="primerBusqueda" class="table table-striped table-sm"> | 41 | <table ng-show="primerBusqueda" class="table table-striped table-sm"> |
42 | <thead> | 42 | <thead> |
43 | <tr> | 43 | <tr> |
44 | <th>Código</th> | 44 | <th>Código</th> |
45 | <th>Descripción</th> | 45 | <th>Descripción</th> |
46 | <th class="text-right">P. Base</th> | 46 | <th class="text-right">P. Base</th> |
47 | <th></th> | 47 | <th></th> |
48 | </tr> | 48 | </tr> |
49 | </thead> | 49 | </thead> |
50 | <tbody> | 50 | <tbody> |
51 | <tr ng-show="currentPageProductos.length == 0 && primerBusqueda"> | 51 | <tr ng-show="currentPageProductos.length == 0 && primerBusqueda"> |
52 | <td colspan="5"> | 52 | <td colspan="5"> |
53 | No se encontraron resultados. | 53 | No se encontraron resultados. |
54 | </td> | 54 | </td> |
55 | </tr> | 55 | </tr> |
56 | <tr class="selectable" | 56 | <tr class="selectable" |
57 | ng-repeat="(key,producto) in currentPageProductos" | 57 | ng-repeat="(key,producto) in currentPageProductos" |
58 | ng-click="select(producto)"> | 58 | ng-click="select(producto)"> |
59 | <td ng-bind="producto.sector + '-' + producto.codigo"></td> | 59 | <td ng-bind="producto.sector + '-' + producto.codigo"></td> |
60 | <td ng-bind="producto.descripcion"></td> | 60 | <td ng-bind="producto.descripcion"></td> |
61 | <td class="text-right" ng-bind="producto.precio | currency: simbolo : 2"></td> | 61 | <td class="text-right" ng-bind="producto.precio | number: 2"></td> |
62 | <td class="d-md-none text-primary"> | 62 | <td class="d-md-none text-primary"> |
63 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 63 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
64 | </td> | 64 | </td> |
65 | <td class="d-none d-md-table-cell"> | 65 | <td class="d-none d-md-table-cell"> |
66 | <button | 66 | <button |
67 | type="button" | 67 | type="button" |
68 | class="btn btn-xs p-1 float-right" | 68 | class="btn btn-xs p-1 float-right" |
69 | ng-class="{ | 69 | ng-class="{ |
70 | 'btn-secondary': selectedProducto != key, | 70 | 'btn-secondary': selectedProducto != key, |
71 | 'btn-primary': selectedProducto == key | 71 | 'btn-primary': selectedProducto == key |
72 | }" | 72 | }" |
73 | foca-focus="selectedProducto == {{key}}" | 73 | foca-focus="selectedProducto == {{key}}" |
74 | ng-keydown="itemProducto($event.keyCode)"> | 74 | ng-keydown="itemProducto($event.keyCode)"> |
75 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 75 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
76 | </button> | 76 | </button> |
77 | </td> | 77 | </td> |
78 | </tr> | 78 | </tr> |
79 | </tbody> | 79 | </tbody> |
80 | </table> | 80 | </table> |
81 | 81 | ||
82 | </div> | 82 | </div> |
83 | <div class="modal-footer py-1"> | 83 | <div class="modal-footer py-1"> |
84 | <nav ng-show="currentPageProductos.length > 0 && primerBusqueda" class="mr-auto"> | 84 | <nav ng-show="currentPageProductos.length > 0 && primerBusqueda" class="mr-auto"> |
85 | <ul class="pagination pagination-sm justify-content mb-0"> | 85 | <ul class="pagination pagination-sm justify-content mb-0"> |
86 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 86 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
87 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | 87 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> |
88 | <span aria-hidden="true">«</span> | 88 | <span aria-hidden="true">«</span> |
89 | <span class="sr-only">Anterior</span> | 89 | <span class="sr-only">Anterior</span> |
90 | </a> | 90 | </a> |
91 | </li> | 91 | </li> |
92 | <li | 92 | <li |
93 | class="page-item" | 93 | class="page-item" |
94 | ng-repeat="pagina in paginas" | 94 | ng-repeat="pagina in paginas" |
95 | ng-class="{'active': pagina == currentPage}" | 95 | ng-class="{'active': pagina == currentPage}" |
96 | > | 96 | > |
97 | <a | 97 | <a |
98 | class="page-link" | 98 | class="page-link" |
99 | href="javascript:void();" | 99 | href="javascript:void();" |
100 | ng-click="selectPage(pagina)" | 100 | ng-click="selectPage(pagina)" |
101 | ng-bind="pagina" | 101 | ng-bind="pagina" |
102 | ></a> | 102 | ></a> |
103 | </li> | 103 | </li> |
104 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 104 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
105 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | 105 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> |
106 | <span aria-hidden="true">»</span> | 106 | <span aria-hidden="true">»</span> |
107 | <span class="sr-only">Siguiente</span> | 107 | <span class="sr-only">Siguiente</span> |
108 | </a> | 108 | </a> |
109 | </li> | 109 | </li> |
110 | </ul> | 110 | </ul> |
111 | </nav> | 111 | </nav> |
112 | <button class="btn btn-sm btn-secondary my-1" type="button" ng-click="cancel()">Cancelar</button> | 112 | <button class="btn btn-sm btn-secondary my-1" type="button" ng-click="cancel()">Cancelar</button> |
113 | </div> | 113 | </div> |
114 | 114 |