Commit 16959e0117189650b11987e49793284227322a9c
1 parent
9f6a02e51e
Exists in
master
code review
Showing
1 changed file
with
7 additions
and
1 deletions
Show diff stats
src/views/modal-domicilio.html
1 | <div class="modal-header"> | 1 | <div class="modal-header"> |
2 | <h3 class="modal-title">Busqueda de Domicilios</h3> | 2 | <h3 class="modal-title">Busqueda de Domicilios</h3> |
3 | </div> | 3 | </div> |
4 | <div class="modal-body" id="modal-body"> | 4 | <div class="modal-body" id="modal-body"> |
5 | <div class="input-group mb-3" ng-show="!ingreso"> | 5 | <div class="input-group mb-3" ng-show="!ingreso"> |
6 | <input | 6 | <input |
7 | type="text" | 7 | type="text" |
8 | class="form-control" | 8 | class="form-control" |
9 | placeholder="Busqueda" | 9 | placeholder="Busqueda" |
10 | ng-model="filters" | 10 | ng-model="filters" |
11 | ng-change="search()" | 11 | ng-change="search()" |
12 | ng-keydown="busquedaDown($event.keyCode)" | 12 | ng-keydown="busquedaDown($event.keyCode)" |
13 | ng-keypress="busquedaPress($event.keyCode)" | 13 | ng-keypress="busquedaPress($event.keyCode)" |
14 | foca-focus="selectedDomicilio == -1" | 14 | foca-focus="selectedDomicilio == -1" |
15 | ng-focus="selectedDomicilio = -1" | 15 | ng-focus="selectedDomicilio = -1" |
16 | > | 16 | > |
17 | <table ng-show="!ingreso" class="table table-striped table-sm"> | 17 | <table ng-show="!ingreso" class="table table-striped table-sm"> |
18 | <thead> | 18 | <thead> |
19 | <tr> | 19 | <tr> |
20 | <th>Domicilio</th> | 20 | <th>Domicilio</th> |
21 | <th>Localidad</th> | 21 | <th>Localidad</th> |
22 | <th>Provincia</th> | 22 | <th>Provincia</th> |
23 | <th colspan="5" class="text-center">Contacto</th> | 23 | <th colspan="5" class="text-center">Contacto</th> |
24 | <th></th> | 24 | <th></th> |
25 | </tr> | 25 | </tr> |
26 | <tr> | 26 | <tr> |
27 | <th></th> | 27 | <th></th> |
28 | <th></th> | 28 | <th></th> |
29 | <th></th> | 29 | <th></th> |
30 | <th>Tipo</th> | 30 | <th>Tipo</th> |
31 | <th>Contacto</th> | 31 | <th>Contacto</th> |
32 | </tr> | 32 | </tr> |
33 | </thead> | 33 | </thead> |
34 | <tbody> | 34 | <tbody> |
35 | <tr ng-show="currentPageDomicilios.length == 0 && primerBusqueda"> | 35 | <tr ng-show="currentPageDomicilios.length == 0 && primerBusqueda"> |
36 | <td colspan="6"> | 36 | <td colspan="6"> |
37 | No se encontraron resultados. | 37 | No se encontraron resultados. |
38 | </td> | 38 | </td> |
39 | </tr> | 39 | </tr> |
40 | <tr> | 40 | <tr> |
41 | <td colspan="5" ng-show="!ingreso"> | 41 | <td colspan="5" ng-show="!ingreso"> |
42 | <input | 42 | <input |
43 | class="form-control form-control-sm" | 43 | class="form-control form-control-sm" |
44 | type="text" | 44 | type="text" |
45 | placeholder="Selección manual" | 45 | placeholder="Selección manual" |
46 | readonly | 46 | readonly |
47 | ng-click="ingreso = !ingreso" | 47 | ng-click="ingreso = !ingreso" |
48 | /> | 48 | /> |
49 | </td> | 49 | </td> |
50 | <td colspan="1" ng-show="!ingreso"> | 50 | <td colspan="1" ng-show="!ingreso"> |
51 | <button | 51 | <button |
52 | type="button" | 52 | type="button" |
53 | class="btn btn-sm p-1 float-right" | 53 | class="btn btn-sm p-1 float-right" |
54 | ng-class="{ | 54 | ng-class="{ |
55 | 'btn-secondary': selectedDomicilio != 0, | 55 | 'btn-secondary': selectedDomicilio != 0, |
56 | 'btn-primary': selectedDomicilio == 0 | 56 | 'btn-primary': selectedDomicilio == 0 |
57 | }" | 57 | }" |
58 | foca-focus="selectedDomicilio == 0" | 58 | foca-focus="selectedDomicilio == 0" |
59 | ng-keydown="itemDomicilio($event.keyCode)" | 59 | ng-keydown="itemDomicilio($event.keyCode)" |
60 | ng-click="ingreso = !ingreso" | 60 | ng-click="ingreso = !ingreso" |
61 | > | 61 | > |
62 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 62 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
63 | </button> | 63 | </button> |
64 | </td> | 64 | </td> |
65 | </tr> | 65 | </tr> |
66 | <tr class="selectable" | 66 | <tr class="selectable" |
67 | ng-repeat="(key,domicilio) in currentPageDomicilios" | 67 | ng-repeat="(key,domicilio) in currentPageDomicilios" |
68 | ng-click="select(domicilio)"> | 68 | ng-click="select(domicilio)"> |
69 | <td ng-bind="domicilio.dom"></td> | 69 | <td ng-bind="domicilio.dom"></td> |
70 | <td ng-bind="domicilio.loc"></td> | 70 | <td ng-bind="domicilio.loc"></td> |
71 | <td ng-bind="domicilio.pci"></td> | 71 | <td ng-bind="domicilio.pci"></td> |
72 | <td ng-bind="domicilio.contacto[0].tipo"></td> | 72 | <td ng-bind="domicilio.contacto[0].tipo"></td> |
73 | <td ng-bind="domicilio.contacto[0].contacto"></td> | 73 | <td ng-bind="domicilio.contacto[0].contacto"></td> |
74 | <td> | 74 | <td> |
75 | <button | 75 | <button |
76 | type="button" | 76 | type="button" |
77 | class="btn p-2 float-right" | 77 | class="btn p-2 float-right" |
78 | ng-class="{ | 78 | ng-class="{ |
79 | 'btn-secondary': selectedDomicilio != key + 1, | 79 | 'btn-secondary': selectedDomicilio != key + 1, |
80 | 'btn-primary': selectedDomicilio == key + 1 | 80 | 'btn-primary': selectedDomicilio == key + 1 |
81 | }" | 81 | }" |
82 | foca-focus="selectedDomicilio == {{key + 1}}" | 82 | foca-focus="selectedDomicilio == {{key + 1}}" |
83 | ng-keydown="itemDomicilio($event.keyCode)" | 83 | ng-keydown="itemDomicilio($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="currentPageDomicilios.length > 0 && !ingreso"> | 91 | <nav ng-show="currentPageDomicilios.length > 0 && !ingreso"> |
92 | <ul class="pagination justify-content-end"> | 92 | <ul class="pagination justify-content-end"> |
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 | </div> | 119 | </div> |
120 | <form name="formDomicilio" ng-show="ingreso"> | 120 | <form name="formDomicilio" ng-show="ingreso"> |
121 | <div class="row"> | 121 | <div class="row"> |
122 | <div class="col-4"> | 122 | <div class="col-4"> |
123 | <label>Tipo</label> | 123 | <label>Tipo</label> |
124 | <select | 124 | <select |
125 | class="form-control" | 125 | class="form-control" |
126 | ng-disabled="true" | 126 | ng-disabled="true" |
127 | > | 127 | > |
128 | <option ng-value="2">Entrega</option> | 128 | <option ng-value="2">Entrega</option> |
129 | </select> | 129 | </select> |
130 | </div> | 130 | </div> |
131 | <div class="col-4"> | 131 | <div class="col-4"> |
132 | <label>Código Postal</label> | 132 | <label>Código Postal</label> |
133 | <input | 133 | <input |
134 | type="text" | 134 | type="text" |
135 | foca-focus="ingreso" | 135 | foca-focus="ingreso" |
136 | class="form-control" | 136 | class="form-control" |
137 | ng-model="domicilio.cpo" | 137 | ng-model="domicilio.cpo" |
138 | ng-required="true" | 138 | ng-required="true" |
139 | placeholder="Ingrese código postal" | 139 | placeholder="Ingrese código postal" |
140 | /> | 140 | /> |
141 | </div> | 141 | </div> |
142 | <div class="col-12"> | 142 | <div class="col-12"> |
143 | <label>Domicilio</label> | 143 | <label>Domicilio</label> |
144 | <input | 144 | <input |
145 | type="text" | 145 | type="text" |
146 | class="form-control" | 146 | class="form-control" |
147 | ng-model="domicilio.dom" | 147 | ng-model="domicilio.dom" |
148 | ng-required="true" | 148 | ng-required="true" |
149 | placeholder="Ingrese domicilio" | 149 | placeholder="Ingrese domicilio" |
150 | /> | 150 | /> |
151 | </div> | 151 | </div> |
152 | <div class="col-6"> | 152 | <div class="col-6"> |
153 | <label>Localidad</label> | 153 | <label>Localidad</label> |
154 | <input | 154 | <input |
155 | type="text" | 155 | type="text" |
156 | class="form-control" | 156 | class="form-control" |
157 | ng-model="domicilio.loc" | 157 | ng-model="domicilio.loc" |
158 | ng-required="true" | 158 | ng-required="true" |
159 | placeholder="Ingrese localidad" | 159 | placeholder="Ingrese localidad" |
160 | /> | 160 | /> |
161 | </div> | 161 | </div> |
162 | <div class="col-6"> | 162 | <div class="col-6"> |
163 | <label>Provincia</label> | 163 | <label>Provincia</label> |
164 | <input | 164 | <input |
165 | type="text" | 165 | type="text" |
166 | class="form-control" | 166 | class="form-control" |
167 | ng-model="domicilio.pci" | 167 | ng-model="domicilio.pci" |
168 | ng-required="true" | 168 | ng-required="true" |
169 | placeholder="Ingrese provincia" | 169 | placeholder="Ingrese provincia" |
170 | /> | 170 | /> |
171 | </div> | 171 | </div> |
172 | <label class="col-12">Ingrese Contactos</label> | 172 | <label class="col-12">Ingrese Contactos</label> |
173 | <div class="col-12 form-row mb-1" ng-repeat="(key, contacto) in contactos"> | 173 | <div class="col-12 form-row mb-1" ng-repeat="(key, contacto) in contactos"> |
174 | <div class="col-3"> | 174 | <div class="col-3"> |
175 | <select class="form-control" ng-model="contacto.tipo" ng-required="true"> | 175 | <select class="form-control" ng-model="contacto.tipo" ng-required="true"> |
176 | <option ng-value="0">Teléfono Móvil</option> | 176 | <option ng-value="0">Teléfono Móvil</option> |
177 | <option ng-value="1">Teléfono Fijo</option> | 177 | <option ng-value="1">Teléfono Fijo</option> |
178 | <option ng-value="2">Fax</option> | 178 | <option ng-value="2">Fax</option> |
179 | <option ng-value="3">Email</option> | 179 | <option ng-value="3">Email</option> |
180 | </select> | 180 | </select> |
181 | </div> | 181 | </div> |
182 | <div class="col-7"> | 182 | <div class="col-7"> |
183 | <input | 183 | <input |
184 | type="text" | 184 | type="text" |
185 | class="form-control" | 185 | class="form-control" |
186 | ng-model="contacto.contacto" | 186 | ng-model="contacto.contacto" |
187 | placeholder="Ingrese contacto" | 187 | placeholder="Ingrese contacto" |
188 | ng-required="true" | 188 | ng-required="true" |
189 | > | 189 | > |
190 | </div> | 190 | </div> |
191 | <div class="col-1"> | 191 | <div class="col-1"> |
192 | <button | 192 | <button |
193 | type="button" | 193 | type="button" |
194 | class="form-control" | 194 | class="form-control" |
195 | ng-click="quitarContacto(key)" | 195 | ng-click="quitarContacto(key)" |
196 | ng-disabled="contactos.length === 1" | 196 | ng-disabled="contactos.length === 1" |
197 | ><i class="fa fa-minus" aria-hidden="true"></i> | 197 | ><i class="fa fa-minus" aria-hidden="true"></i> |
198 | </button> | 198 | </button> |
199 | </div> | 199 | </div> |
200 | <div class="col-1"> | 200 | <div class="col-1"> |
201 | <button | 201 | <button |
202 | type="button" | 202 | type="button" |
203 | class="form-control" | 203 | class="form-control" |
204 | ng-click="agregarContacto()" | 204 | ng-click="agregarContacto()" |
205 | ><i class="fa fa-plus" aria-hidden="true"></i> | 205 | ><i class="fa fa-plus" aria-hidden="true"></i> |
206 | </button> | 206 | </button> |
207 | </div> | 207 | </div> |
208 | </div> | 208 | </div> |
209 | </div> | 209 | </div> |
210 | </form> | 210 | </form> |
211 | </div> | 211 | </div> |
212 | <div class="modal-footer"> | 212 | <div class="modal-footer"> |
213 | <button ng-show="!ingreso" class="btn btn-secondary" type="button" ng-click="cancel()">Seleccionar otro cliente</button> | 213 | <button |
214 | ng-show="!ingreso" | ||
215 | class="btn btn-secondary" | ||
216 | type="button" | ||
217 | ng-click="cancel()" | ||
218 | >Seleccionar otro cliente | ||
219 | </button> | ||
214 | <button | 220 | <button |
215 | ng-show="ingreso" | 221 | ng-show="ingreso" |
216 | class="btn btn-secondary" | 222 | class="btn btn-secondary" |
217 | type="button" | 223 | type="button" |
218 | ng-click="ingreso = !ingreso; domicilio = {}; contactos = [{}]" | 224 | ng-click="ingreso = !ingreso; domicilio = {}; contactos = [{}]" |
219 | >Cancelar | 225 | >Cancelar |
220 | </button> | 226 | </button> |
221 | <button | 227 | <button |
222 | ng-show="ingreso" | 228 | ng-show="ingreso" |
223 | class="btn btn-primary" | 229 | class="btn btn-primary" |
224 | type="button" | 230 | type="button" |
225 | ng-click="agregarDomicilio()" | 231 | ng-click="agregarDomicilio()" |
226 | ng-disabled="!formDomicilio.$valid" | 232 | ng-disabled="!formDomicilio.$valid" |
227 | >Agregar domicilio | 233 | >Agregar domicilio |
228 | </button> | 234 | </button> |
229 | </div> | 235 | </div> |
230 | 236 |