Commit 7336e61af568247f07edbe9581ff356fd0c4540f
1 parent
c000ab1734
Exists in
master
buscador en header, paginado en footer, cambio icons
Showing
2 changed files
with
60 additions
and
54 deletions
Show diff stats
package.json
1 | { | 1 | { |
2 | "name": "foca-modal-precio-condiciones", | 2 | "name": "foca-modal-precio-condiciones", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Modal de búsqueda de precios y condiciones", | 4 | "description": "Modal de búsqueda de precios y condiciones", |
5 | "main": "index.js", | 5 | "main": "index.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | "test": "echo \"Error: no test specified\" && exit 1", | 7 | "test": "echo \"Error: no test specified\" && exit 1", |
8 | "gulp-pre-commit": "gulp pre-commit", | 8 | "gulp-pre-commit": "gulp pre-commit", |
9 | "compile": "gulp uglify", | 9 | "compile": "gulp uglify", |
10 | "postinstall": "npm run compile && gulp clean-post-install", | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
11 | "install-dev": "npm install -D angular font-awesome jquery bootstrap ui-bootstrap4 jshint gulp gulp-uglify gulp-concat gulp-htmlmin gulp-rename gulp-uglify gulp-jshint gulp-replace gulp-connect gulp-clean gulp-angular-templatecache git+https://debo.suite.repo/modulos-npm/foca-directivas.git git+https://debo.suite.repo/modulos-npm/foca-modal.git" | 11 | "install-dev": "npm install -D angular font-awesome jquery bootstrap ui-bootstrap4 jshint gulp gulp-uglify gulp-concat gulp-htmlmin gulp-rename gulp-uglify gulp-jshint gulp-replace gulp-connect gulp-clean gulp-angular-templatecache git+ssh://git@git.focasoftware.com:npm/foca-directivas.git git+ssh://git@git.focasoftware.com:npm/foca-modal.git" |
12 | }, | 12 | }, |
13 | "pre-commit": [ | 13 | "pre-commit": [ |
14 | "gulp-pre-commit" | 14 | "gulp-pre-commit" |
15 | ], | 15 | ], |
16 | "repository": { | 16 | "repository": { |
17 | "type": "git", | 17 | "type": "git", |
18 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git" | 18 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git" |
19 | }, | 19 | }, |
20 | "author": "Foca Software", | 20 | "author": "Foca Software", |
21 | "license": "ISC", | 21 | "license": "ISC", |
22 | "devDependencies": { | 22 | "devDependencies": { |
23 | "angular": "^1.7.5", | 23 | "angular": "^1.7.5", |
24 | "bootstrap": "^4.1.3", | 24 | "bootstrap": "^4.1.3", |
25 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | 25 | "foca-directivas": "git+ssh://git@git.focasoftware.com:npm/foca-directivas.git", |
26 | "foca-modal": "git+https://debo.suite.repo/modulos-npm/foca-modal.git", | 26 | "foca-modal": "git+ssh://git@git.focasoftware.com:npm/foca-modal.git", |
27 | "font-awesome": "^4.7.0", | 27 | "font-awesome": "^4.7.0", |
28 | "gulp": "^3.9.1", | 28 | "gulp": "^3.9.1", |
29 | "gulp-angular-templatecache": "^2.2.2", | 29 | "gulp-angular-templatecache": "^2.2.2", |
30 | "gulp-clean": "^0.4.0", | 30 | "gulp-clean": "^0.4.0", |
31 | "gulp-concat": "^2.6.1", | 31 | "gulp-concat": "^2.6.1", |
32 | "gulp-connect": "^5.6.1", | 32 | "gulp-connect": "^5.6.1", |
33 | "gulp-htmlmin": "^5.0.1", | 33 | "gulp-htmlmin": "^5.0.1", |
34 | "gulp-jshint": "^2.1.0", | 34 | "gulp-jshint": "^2.1.0", |
35 | "gulp-rename": "^1.4.0", | 35 | "gulp-rename": "^1.4.0", |
36 | "gulp-replace": "^1.0.0", | 36 | "gulp-replace": "^1.0.0", |
37 | "gulp-uglify": "^3.0.1", | 37 | "gulp-uglify": "^3.0.1", |
38 | "jquery": "^3.3.1", | 38 | "jquery": "^3.3.1", |
39 | "jshint": "^2.9.6", | 39 | "jshint": "^2.9.6", |
40 | "pump": "^3.0.0", | 40 | "pump": "^3.0.0", |
41 | "ui-bootstrap4": "^3.0.5" | 41 | "ui-bootstrap4": "^3.0.5" |
42 | } | 42 | } |
43 | } | 43 | } |
44 | 44 |
src/views/modal-precio-condicion.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <h5 ng-show="!ingreso" class="modal-title">Busqueda de Precio-Condición</h5> | 2 | <div class="row w-100"> |
3 | <h5 ng-show="ingreso" class="modal-title">Nuevos Plazos</h5> | 3 | <div class="col-lg-6"> |
4 | </div> | 4 | <h5 ng-show="!ingreso" class="modal-title my-1">Busqueda de Precio-Condición</h5> |
5 | <div class="modal-body" id="modal-body"> | 5 | <h5 ng-show="ingreso" class="modal-title my-1">Nuevos Plazos</h5> |
6 | <div class="input-group" ng-show="!ingreso"> | 6 | </div> |
7 | <input | 7 | <div class="input-group col-lg-6 pr-0 my-2" ng-show="!ingreso"> |
8 | type="text" | 8 | <input |
9 | class="form-control form-control-sm" | 9 | type="text" |
10 | placeholder="Busqueda" | 10 | class="form-control form-control-sm" |
11 | ng-model="filters" | 11 | placeholder="Busqueda" |
12 | ng-change="search()" | 12 | ng-model="filters" |
13 | ng-keydown="busquedaDown($event.keyCode)" | 13 | ng-change="search()" |
14 | ng-keypress="busquedaPress($event.keyCode)" | 14 | ng-keydown="busquedaDown($event.keyCode)" |
15 | foca-focus="selectedPrecioCondicion == -1" | 15 | ng-keypress="busquedaPress($event.keyCode)" |
16 | ng-focus="selectedPrecioCondicion = -1" | 16 | foca-focus="selectedPrecioCondicion == -1" |
17 | teclado-virtual | 17 | ng-focus="selectedPrecioCondicion = -1" |
18 | > | 18 | teclado-virtual |
19 | <div class="input-group-append"> | 19 | > |
20 | <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> | 20 | <div class="input-group-append"> |
21 | <i class="fa fa-search" aria-hidden="true"></i> | 21 | <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> |
22 | </button> | 22 | <i class="fa fa-search" aria-hidden="true"></i> |
23 | </button> | ||
24 | </div> | ||
23 | </div> | 25 | </div> |
24 | </div> | 26 | </div> |
27 | </div> | ||
28 | <div class="modal-body" id="modal-body"> | ||
29 | |||
25 | 30 | ||
26 | <table ng-show="!ingreso" class="table table-striped table-sm"> | 31 | <table ng-show="!ingreso" class="table table-striped table-sm"> |
27 | <thead> | 32 | <thead> |
28 | <tr> | 33 | <tr> |
29 | <th>Código</th> | 34 | <th>Código</th> |
30 | <th>Nombre</th> | 35 | <th>Nombre</th> |
31 | <th>Lista Precio</th> | 36 | <th>Lista Precio</th> |
32 | <th>Plazos</th> | 37 | <th>Plazos</th> |
33 | <th></th> | 38 | <th></th> |
34 | </tr> | 39 | </tr> |
35 | </thead> | 40 | </thead> |
36 | <tbody> | 41 | <tbody> |
37 | <tr ng-show="currentPagePrecioCondicion.length == 0"> | 42 | <tr ng-show="currentPagePrecioCondicion.length == 0"> |
38 | <td colspan="6"> | 43 | <td colspan="6"> |
39 | No se encontraron resultados. | 44 | No se encontraron resultados. |
40 | </td> | 45 | </td> |
41 | </tr> | 46 | </tr> |
42 | <tr> | 47 | <tr> |
43 | <td colspan="4" ng-show="!ingreso"> | 48 | <td colspan="4" ng-show="!ingreso"> |
44 | <input | 49 | <input |
45 | class="form-control form-control-sm" | 50 | class="form-control form-control-sm" |
46 | type="text" | 51 | type="text" |
47 | placeholder="Selección manual" | 52 | placeholder="Selección manual" |
48 | readonly | 53 | readonly |
49 | ng-click="ingreso = !ingreso" | 54 | ng-click="ingreso = !ingreso" |
50 | /> | 55 | /> |
51 | </td> | 56 | </td> |
52 | <td colspan="1" ng-show="!ingreso"> | 57 | <td colspan="1" ng-show="!ingreso"> |
53 | <button | 58 | <button |
54 | type="button" | 59 | type="button" |
55 | class="btn btn-sm p-1 float-right" | 60 | class="btn btn-sm p-1 float-right" |
56 | ng-class="{ | 61 | ng-class="{ |
57 | 'btn-secondary': selectedPrecioCondicion != 0, | 62 | 'btn-secondary': selectedPrecioCondicion != 0, |
58 | 'btn-primary': selectedPrecioCondicion == 0 | 63 | 'btn-primary': selectedPrecioCondicion == 0 |
59 | }" | 64 | }" |
60 | foca-focus="selectedPrecioCondicion == 0" | 65 | foca-focus="selectedPrecioCondicion == 0" |
61 | ng-keydown="itemProducto($event.keyCode)" | 66 | ng-keydown="itemProducto($event.keyCode)" |
62 | ng-click="ingreso = !ingreso" | 67 | ng-click="ingreso = !ingreso" |
63 | > | 68 | > |
64 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 69 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
65 | </button> | 70 | </button> |
66 | </td> | 71 | </td> |
67 | </tr> | 72 | </tr> |
68 | <tr class="selectable" | 73 | <tr class="selectable" |
69 | ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion" | 74 | ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion" |
70 | ng-click="select(precioCondicion)"> | 75 | ng-click="select(precioCondicion)"> |
71 | <td ng-bind="precioCondicion.codigo"></td> | 76 | <td ng-bind="precioCondicion.codigo"></td> |
72 | <td ng-bind="precioCondicion.nombre"></td> | 77 | <td ng-bind="precioCondicion.nombre"></td> |
73 | <td ng-bind="precioCondicion.idListaPrecio"></td> | 78 | <td ng-bind="precioCondicion.idListaPrecio"></td> |
74 | <td ng-bind="precioCondicion.plazos"></td> | 79 | <td ng-bind="precioCondicion.plazos"></td> |
75 | <td> | 80 | <td> |
76 | <button | 81 | <button |
77 | type="button" | 82 | type="button" |
78 | class="btn btn-sm p-1 float-right" | 83 | class="btn btn-sm p-1 float-right" |
79 | ng-class="{ | 84 | ng-class="{ |
80 | 'btn-secondary': selectedPrecioCondicion != key + 1, | 85 | 'btn-secondary': selectedPrecioCondicion != key + 1, |
81 | 'btn-primary': selectedPrecioCondicion == key + 1 | 86 | 'btn-primary': selectedPrecioCondicion == key + 1 |
82 | }" | 87 | }" |
83 | foca-focus="selectedPrecioCondicion == {{key + 1}}" | 88 | foca-focus="selectedPrecioCondicion == {{key + 1}}" |
84 | ng-keydown="itemProducto($event.keyCode)" | 89 | ng-keydown="itemProducto($event.keyCode)" |
85 | > | 90 | > |
86 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 91 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
87 | </button> | 92 | </button> |
88 | </td> | 93 | </td> |
89 | </tr> | 94 | </tr> |
90 | </tbody> | 95 | </tbody> |
91 | </table> | 96 | </table> |
92 | <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso"> | 97 | |
93 | <ul class="pagination pagination-sm mb-0"> | ||
94 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | ||
95 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | ||
96 | <span aria-hidden="true">«</span> | ||
97 | <span class="sr-only">Anterior</span> | ||
98 | </a> | ||
99 | </li> | ||
100 | <li | ||
101 | class="page-item" | ||
102 | ng-repeat="pagina in paginas" | ||
103 | ng-class="{'active': pagina == currentPage}" | ||
104 | > | ||
105 | <a | ||
106 | class="page-link" | ||
107 | href="javascript:void();" | ||
108 | ng-click="selectPage(pagina)" | ||
109 | ng-bind="pagina" | ||
110 | ></a> | ||
111 | </li> | ||
112 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | ||
113 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | ||
114 | <span aria-hidden="true">»</span> | ||
115 | <span class="sr-only">Siguiente</span> | ||
116 | </a> | ||
117 | </li> | ||
118 | </ul> | ||
119 | </nav> | ||
120 | <table class="table table-striped table-sm" ng-show="ingreso"> | 98 | <table class="table table-striped table-sm" ng-show="ingreso"> |
121 | <thead> | 99 | <thead> |
122 | <tr> | 100 | <tr> |
123 | <th>Item</th> | 101 | <th>Item</th> |
124 | <th>Días</th> | 102 | <th>Días</th> |
125 | <th></th> | 103 | <th></th> |
126 | </tr> | 104 | </tr> |
127 | </thead> | 105 | </thead> |
128 | <tbody> | 106 | <tbody> |
129 | <tr> | 107 | <tr> |
130 | <td> | 108 | <td> |
131 | <input | 109 | <input |
132 | type="number" | 110 | type="number" |
133 | class="form-control text-right" | 111 | class="form-control text-right" |
134 | ng-model="plazoACargar.item" | 112 | ng-model="plazoACargar.item" |
135 | readonly | 113 | readonly |
136 | /> | 114 | /> |
137 | </td> | 115 | </td> |
138 | <td> | 116 | <td> |
139 | <input | 117 | <input |
140 | type="number" | 118 | type="number" |
141 | class="form-control text-right" | 119 | class="form-control text-right" |
142 | min="0" | 120 | min="0" |
143 | ng-model="plazoACargar.dias" | 121 | ng-model="plazoACargar.dias" |
144 | ng-keypress="agregarPlazo($event.keyCode)" | 122 | ng-keypress="agregarPlazo($event.keyCode)" |
145 | foca-focus="ingreso" | 123 | foca-focus="ingreso" |
146 | /> | 124 | /> |
147 | </td> | 125 | </td> |
148 | <td class="text-center"> | 126 | <td class="text-center"> |
149 | <button | 127 | <button |
150 | class="btn btn-outline-secondary" | 128 | class="btn btn-outline-secondary" |
151 | ng-click="agregarPlazo(13)" | 129 | ng-click="agregarPlazo(13)" |
152 | > | 130 | > |
153 | <i class="fa fa-save"></i> | 131 | <i class="fa fa-save"></i> |
154 | </button> | 132 | </button> |
155 | </td> | 133 | </td> |
156 | </tr> | 134 | </tr> |
157 | <tr ng-repeat="(key, plazo) in plazosNuevos"> | 135 | <tr ng-repeat="(key, plazo) in plazosNuevos"> |
158 | <td class="text-right" ng-bind="key + 1"></td> | 136 | <td class="text-right" ng-bind="key + 1"></td> |
159 | <td class="text-right" ng-bind="plazo.dias"></td> | 137 | <td class="text-right" ng-bind="plazo.dias"></td> |
160 | <td class="text-center"> | 138 | <td class="text-center"> |
161 | <button | 139 | <button |
162 | class="btn btn-outline-secondary" | 140 | class="btn btn-outline-secondary" |
163 | ng-click="quitarPlazo(key)" | 141 | ng-click="quitarPlazo(key)" |
164 | > | 142 | > |
165 | <i class="fa fa-trash"></i> | 143 | <i class="fa fa-trash"></i> |
166 | </button> | 144 | </button> |
167 | </td> | 145 | </td> |
168 | </tr> | 146 | </tr> |
169 | </tbody> | 147 | </tbody> |
170 | </table> | 148 | </table> |
171 | </div> | 149 | </div> |
172 | <div class="modal-footer py-1"> | 150 | <div class="modal-footer py-1"> |
151 | <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso" class="mr-auto"> | ||
152 | <ul class="pagination pagination-sm mb-0"> | ||
153 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | ||
154 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | ||
155 | <span aria-hidden="true">«</span> | ||
156 | <span class="sr-only">Anterior</span> | ||
157 | </a> | ||
158 | </li> | ||
159 | <li | ||
160 | class="page-item" | ||
161 | ng-repeat="pagina in paginas" | ||
162 | ng-class="{'active': pagina == currentPage}" | ||
163 | > | ||
164 | <a | ||
165 | class="page-link" | ||
166 | href="javascript:void();" | ||
167 | ng-click="selectPage(pagina)" | ||
168 | ng-bind="pagina" | ||
169 | ></a> | ||
170 | </li> | ||
171 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | ||
172 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | ||
173 | <span aria-hidden="true">»</span> | ||
174 | <span class="sr-only">Siguiente</span> | ||
175 | </a> |