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