Commit 027bad4d32d20031d98c2647b028df9004a56415
1 parent
05afa0597b
Exists in
master
no se puede aceptar hasta que haya al menos un plazo
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
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 | <h5 ng-show="!ingreso" class="modal-title">Busqueda de Precio-Condición</h5> |
3 | <h5 ng-show="ingreso" class="modal-title">Nuevos Plazos</h5> | 3 | <h5 ng-show="ingreso" class="modal-title">Nuevos Plazos</h5> |
4 | </div> | 4 | </div> |
5 | <div class="modal-body" id="modal-body"> | 5 | <div class="modal-body" id="modal-body"> |
6 | <div class="input-group" ng-show="!ingreso"> | 6 | <div class="input-group" ng-show="!ingreso"> |
7 | <input | 7 | <input |
8 | type="text" | 8 | type="text" |
9 | class="form-control form-control-sm" | 9 | class="form-control form-control-sm" |
10 | placeholder="Busqueda" | 10 | placeholder="Busqueda" |
11 | ng-model="filters" | 11 | ng-model="filters" |
12 | ng-change="search()" | 12 | ng-change="search()" |
13 | ng-keydown="busquedaDown($event.keyCode)" | 13 | ng-keydown="busquedaDown($event.keyCode)" |
14 | ng-keypress="busquedaPress($event.keyCode)" | 14 | ng-keypress="busquedaPress($event.keyCode)" |
15 | foca-focus="selectedPrecioCondicion == -1" | 15 | foca-focus="selectedPrecioCondicion == -1" |
16 | ng-focus="selectedPrecioCondicion = -1" | 16 | ng-focus="selectedPrecioCondicion = -1" |
17 | > | 17 | > |
18 | <div class="input-group-append"> | 18 | <div class="input-group-append"> |
19 | <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> | 19 | <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> |
20 | <i class="fa fa-search" aria-hidden="true"></i> | 20 | <i class="fa fa-search" aria-hidden="true"></i> |
21 | </button> | 21 | </button> |
22 | </div> | 22 | </div> |
23 | </div> | 23 | </div> |
24 | 24 | ||
25 | <table ng-show="!ingreso" class="table table-striped table-sm"> | 25 | <table ng-show="!ingreso" class="table table-striped table-sm"> |
26 | <thead> | 26 | <thead> |
27 | <tr> | 27 | <tr> |
28 | <th>Código</th> | 28 | <th>Código</th> |
29 | <th>Nombre</th> | 29 | <th>Nombre</th> |
30 | <th>Lista Precio</th> | 30 | <th>Lista Precio</th> |
31 | <th>Plazos</th> | 31 | <th>Plazos</th> |
32 | <th></th> | 32 | <th></th> |
33 | </tr> | 33 | </tr> |
34 | </thead> | 34 | </thead> |
35 | <tbody> | 35 | <tbody> |
36 | <tr ng-show="currentPagePrecioCondicion.length == 0"> | 36 | <tr ng-show="currentPagePrecioCondicion.length == 0"> |
37 | <td colspan="6"> | 37 | <td colspan="6"> |
38 | No se encontraron resultados. | 38 | No se encontraron resultados. |
39 | </td> | 39 | </td> |
40 | </tr> | 40 | </tr> |
41 | <tr> | 41 | <tr> |
42 | <td colspan="4" ng-show="!ingreso"> | 42 | <td colspan="4" ng-show="!ingreso"> |
43 | <input | 43 | <input |
44 | class="form-control form-control-sm" | 44 | class="form-control form-control-sm" |
45 | type="text" | 45 | type="text" |
46 | placeholder="Selección manual" | 46 | placeholder="Selección manual" |
47 | readonly | 47 | readonly |
48 | ng-click="ingreso = !ingreso" | 48 | ng-click="ingreso = !ingreso" |
49 | /> | 49 | /> |
50 | </td> | 50 | </td> |
51 | <td colspan="1" ng-show="!ingreso"> | 51 | <td colspan="1" ng-show="!ingreso"> |
52 | <button | 52 | <button |
53 | type="button" | 53 | type="button" |
54 | class="btn btn-sm p-1 float-right" | 54 | class="btn btn-sm p-1 float-right" |
55 | ng-class="{ | 55 | ng-class="{ |
56 | 'btn-secondary': selectedPrecioCondicion != 0, | 56 | 'btn-secondary': selectedPrecioCondicion != 0, |
57 | 'btn-primary': selectedPrecioCondicion == 0 | 57 | 'btn-primary': selectedPrecioCondicion == 0 |
58 | }" | 58 | }" |
59 | foca-focus="selectedPrecioCondicion == 0" | 59 | foca-focus="selectedPrecioCondicion == 0" |
60 | ng-keydown="itemProducto($event.keyCode)" | 60 | ng-keydown="itemProducto($event.keyCode)" |
61 | ng-click="ingreso = !ingreso" | 61 | ng-click="ingreso = !ingreso" |
62 | > | 62 | > |
63 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 63 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
64 | </button> | 64 | </button> |
65 | </td> | 65 | </td> |
66 | </tr> | 66 | </tr> |
67 | <tr class="selectable" | 67 | <tr class="selectable" |
68 | ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion" | 68 | ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion" |
69 | ng-click="select(precioCondicion)"> | 69 | ng-click="select(precioCondicion)"> |
70 | <td ng-bind="precioCondicion.codigo"></td> | 70 | <td ng-bind="precioCondicion.codigo"></td> |
71 | <td ng-bind="precioCondicion.nombre"></td> | 71 | <td ng-bind="precioCondicion.nombre"></td> |
72 | <td ng-bind="precioCondicion.idListaPrecio"></td> | 72 | <td ng-bind="precioCondicion.idListaPrecio"></td> |
73 | <td ng-bind="precioCondicion.plazos"></td> | 73 | <td ng-bind="precioCondicion.plazos"></td> |
74 | <td> | 74 | <td> |
75 | <button | 75 | <button |
76 | type="button" | 76 | type="button" |
77 | class="btn btn-sm p-1 float-right" | 77 | class="btn btn-sm p-1 float-right" |
78 | ng-class="{ | 78 | ng-class="{ |
79 | 'btn-secondary': selectedPrecioCondicion != key + 1, | 79 | 'btn-secondary': selectedPrecioCondicion != key + 1, |
80 | 'btn-primary': selectedPrecioCondicion == key + 1 | 80 | 'btn-primary': selectedPrecioCondicion == key + 1 |
81 | }" | 81 | }" |
82 | foca-focus="selectedPrecioCondicion == {{key + 1}}" | 82 | foca-focus="selectedPrecioCondicion == {{key + 1}}" |
83 | ng-keydown="itemProducto($event.keyCode)" | 83 | ng-keydown="itemProducto($event.keyCode)" |
84 | > | 84 | > |
85 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 85 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
86 | </button> | 86 | </button> |
87 | </td> | 87 | </td> |
88 | </tr> | 88 | </tr> |
89 | </tbody> | 89 | </tbody> |
90 | </table> | 90 | </table> |
91 | <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso"> | 91 | <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso"> |
92 | <ul class="pagination pagination-sm mb-0"> | 92 | <ul class="pagination pagination-sm mb-0"> |
93 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 93 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
94 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> | 94 | <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> |
95 | <span aria-hidden="true">«</span> | 95 | <span aria-hidden="true">«</span> |
96 | <span class="sr-only">Anterior</span> | 96 | <span class="sr-only">Anterior</span> |
97 | </a> | 97 | </a> |
98 | </li> | 98 | </li> |
99 | <li | 99 | <li |
100 | class="page-item" | 100 | class="page-item" |
101 | ng-repeat="pagina in paginas" | 101 | ng-repeat="pagina in paginas" |
102 | ng-class="{'active': pagina == currentPage}" | 102 | ng-class="{'active': pagina == currentPage}" |
103 | > | 103 | > |
104 | <a | 104 | <a |
105 | class="page-link" | 105 | class="page-link" |
106 | href="#" | 106 | href="#" |
107 | ng-click="selectPage(pagina)" | 107 | ng-click="selectPage(pagina)" |
108 | ng-bind="pagina" | 108 | ng-bind="pagina" |
109 | ></a> | 109 | ></a> |
110 | </li> | 110 | </li> |
111 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 111 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
112 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> | 112 | <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> |
113 | <span aria-hidden="true">»</span> | 113 | <span aria-hidden="true">»</span> |
114 | <span class="sr-only">Siguiente</span> | 114 | <span class="sr-only">Siguiente</span> |
115 | </a> | 115 | </a> |
116 | </li> | 116 | </li> |
117 | </ul> | 117 | </ul> |
118 | </nav> | 118 | </nav> |
119 | <table class="table table-striped table-sm" ng-show="ingreso"> | 119 | <table class="table table-striped table-sm" ng-show="ingreso"> |
120 | <thead> | 120 | <thead> |
121 | <tr> | 121 | <tr> |
122 | <th>Item</th> | 122 | <th>Item</th> |
123 | <th>Días</th> | 123 | <th>Días</th> |
124 | <th></th> | 124 | <th></th> |
125 | </tr> | 125 | </tr> |
126 | </thead> | 126 | </thead> |
127 | <tbody> | 127 | <tbody> |
128 | <tr> | 128 | <tr> |
129 | <td> | 129 | <td> |
130 | <input | 130 | <input |
131 | type="number" | 131 | type="number" |
132 | class="form-control text-right" | 132 | class="form-control text-right" |
133 | ng-model="plazoACargar.item" | 133 | ng-model="plazoACargar.item" |
134 | readonly | 134 | readonly |
135 | /> | 135 | /> |
136 | </td> | 136 | </td> |
137 | <td> | 137 | <td> |
138 | <input | 138 | <input |
139 | type="number" | 139 | type="number" |
140 | class="form-control text-right" | 140 | class="form-control text-right" |
141 | min="0" | 141 | min="0" |
142 | ng-model="plazoACargar.dias" | 142 | ng-model="plazoACargar.dias" |
143 | ng-keypress="agregarPlazo($event.keyCode)" | 143 | ng-keypress="agregarPlazo($event.keyCode)" |
144 | foca-focus="ingreso" | 144 | foca-focus="ingreso" |
145 | /> | 145 | /> |
146 | </td> | 146 | </td> |
147 | <td class="text-center"> | 147 | <td class="text-center"> |
148 | <button | 148 | <button |
149 | class="btn btn-outline-secondary" | 149 | class="btn btn-outline-secondary" |
150 | ng-click="agregarPlazo(13)" | 150 | ng-click="agregarPlazo(13)" |
151 | > | 151 | > |
152 | <i class="fa fa-save"></i> | 152 | <i class="fa fa-save"></i> |
153 | </button> | 153 | </button> |
154 | </td> | 154 | </td> |
155 | </tr> | 155 | </tr> |
156 | <tr ng-repeat="(key, plazo) in plazosNuevos"> | 156 | <tr ng-repeat="(key, plazo) in plazosNuevos"> |
157 | <td class="text-right" ng-bind="key + 1"></td> | 157 | <td class="text-right" ng-bind="key + 1"></td> |
158 | <td class="text-right" ng-bind="plazo.dias"></td> | 158 | <td class="text-right" ng-bind="plazo.dias"></td> |
159 | <td class="text-center"> | 159 | <td class="text-center"> |
160 | <button | 160 | <button |
161 | class="btn btn-outline-secondary" | 161 | class="btn btn-outline-secondary" |
162 | ng-click="quitarPlazo(key)" | 162 | ng-click="quitarPlazo(key)" |
163 | > | 163 | > |
164 | <i class="fa fa-trash"></i> | 164 | <i class="fa fa-trash"></i> |
165 | </button> | 165 | </button> |
166 | </td> | 166 | </td> |
167 | </tr> | 167 | </tr> |
168 | </tbody> | 168 | </tbody> |
169 | </table> | 169 | </table> |
170 | </div> | 170 | </div> |
171 | <div class="modal-footer py-1"> | 171 | <div class="modal-footer py-1"> |
172 | <button | 172 | <button |
173 | ng-show="!ingreso" | 173 | ng-show="!ingreso" |
174 | class="btn btn-sm btn-secondary" | 174 | class="btn btn-sm btn-secondary" |
175 | type="button" | 175 | type="button" |
176 | ng-click="cancel()" | 176 | ng-click="cancel()" |
177 | >Cancelar | 177 | >Cancelar |
178 | </button> | 178 | </button> |
179 | <button | 179 | <button |
180 | ng-show="ingreso" | 180 | ng-show="ingreso" |
181 | ng-disabled="plazosNuevos.length === 0" | ||
181 | class="btn btn-sm btn-primary" | 182 | class="btn btn-sm btn-primary" |
182 | type="button" | 183 | type="button" |
183 | ng-click="select(plazosNuevos)" | 184 | ng-click="select(plazosNuevos)" |
184 | >Aceptar | 185 | >Aceptar |
185 | </button> | 186 | </button> |
186 | <button | 187 | <button |
187 | ng-show="ingreso" | 188 | ng-show="ingreso" |
188 | class="btn btn-sm btn-secondary" | 189 | class="btn btn-sm btn-secondary" |
189 | type="button" | 190 | type="button" |
190 | ng-click="volver()" | 191 | ng-click="volver()" |
191 | >Volver | 192 | >Volver |
192 | </button> | 193 | </button> |
193 | </div> | 194 | </div> |
194 | 195 |