modal-domicilio.html
7.57 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
195
196
197
198
199
200
201
202
203
204
<div class="modal-header">
<h3 class="modal-title">Busqueda de Domicilios</h3>
</div>
<div class="modal-body" id="modal-body">
<div class="input-group mb-3" ng-show="!ingreso">
<input
type="text"
class="form-control"
placeholder="Busqueda"
ng-model="filters"
ng-change="search()"
ng-keydown="busquedaDown($event.keyCode)"
ng-keypress="busquedaPress($event.keyCode)"
foca-focus="selectedDomicilio == -1"
ng-focus="selectedDomicilio = -1"
teclado-virtual
>
<table ng-show="!ingreso" class="table table-striped table-sm">
<thead>
<tr>
<th>Titulo</th>
<th>Calle</th>
<th>Localidad</th>
<th>Provincia</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-show="currentPageDomicilios.length == 0 && primerBusqueda">
<td colspan="5">
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': selectedDomicilio != 0,
'btn-primary': selectedDomicilio == 0
}"
foca-focus="selectedDomicilio == 0"
ng-keydown="itemDomicilio($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,domicilio) in currentPageDomicilios"
ng-click="select(domicilio)">
<td ng-bind="domicilio.titulo"></td>
<td ng-bind="domicilio.Calle + ' ' + domicilio.Numero"></td>
<td ng-bind="domicilio.Localidad"></td>
<td ng-bind="domicilio.Provincia"></td>
<td>
<button
type="button"
class="btn p-2 float-right"
ng-class="{
'btn-secondary': selectedDomicilio != key + 1,
'btn-primary': selectedDomicilio == key + 1
}"
foca-focus="selectedDomicilio == {{key + 1}}"
ng-keydown="itemDomicilio($event.keyCode)"
>
<i class="fa fa-arrow-right" aria-hidden="true"></i>
</button>
</td>
</tr>
</tbody>
</table>
<nav ng-show="currentPageDomicilios.length > 0 && !ingreso">
<ul class="pagination justify-content-end">
<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>
</div>
<form name="formDomicilio" ng-show="ingreso">
<div class="row">
<div class="col-4">
<label>Tipo</label>
<select
class="form-control"
ng-disabled="true"
>
<option ng-value="2">Entrega</option>
</select>
</div>
<div class="col-8">
<label>Titulo</label>
<input
type="text"
foca-focus="ingreso"
class="form-control"
ng-model="domicilio.titulo"
placeholder="Ingrese título"
ng-required="true"
teclado-virtual
/>
</div>
<div class="col-9">
<label>Calle</label>
<input
type="text"
class="form-control"
ng-model="domicilio.calle"
placeholder="Ingrese calle"
ng-required="true"
/>
</div>
<div class="col-3">
<label>Nº</label>
<input
type="text"
class="form-control"
ng-model="domicilio.numeroCalle"
placeholder="Ingrese Numero"
ng-required="true"
teclado-virtual
/>
</div>
<div class="col-6">
<label>Localidad</label>
<input
type="text"
class="form-control"
ng-model="domicilio.localidad"
placeholder="Ingrese localidad"
ng-required="true"
teclado-virtual
/>
</div>
<div class="col-6">
<label>Provincia</label>
<input
type="text"
class="form-control"
ng-model="domicilio.provincia"
placeholder="Ingrese provincia"
ng-required="true"
/>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button
ng-show="!ingreso"
class="btn btn-secondary"
type="button"
ng-click="cancel()"
>Seleccionar otro cliente
</button>
<button
ng-show="ingreso"
class="btn btn-secondary"
type="button"
ng-click="ingreso = !ingreso; domicilio = {}; contactos = [{}]"
>Cancelar
</button>
<button
ng-show="ingreso"
class="btn btn-primary"
type="button"
ng-click="agregarDomicilio()"
ng-disabled="!formDomicilio.$valid"
>Agregar domicilio
</button>
</div>