Commit 40bf835974641a606c2048275a3ed2fce5a47046
Exists in
master
Merge branch 'master' into 'master'
plazos con comas, codigo correcto See merge request !3
Showing
2 changed files
Show diff stats
src/js/controller.js
1 | angular.module('focaModalPrecioCondicion') | 1 | angular.module('focaModalPrecioCondicion') |
2 | .controller('focaModalPrecioCondicionController', | 2 | .controller('focaModalPrecioCondicionController', |
3 | [ | 3 | [ |
4 | '$timeout', | 4 | '$timeout', |
5 | '$filter', | 5 | '$filter', |
6 | '$scope', | 6 | '$scope', |
7 | '$uibModalInstance', | 7 | '$uibModalInstance', |
8 | 'focaModalService', | 8 | 'focaModalService', |
9 | 'focaModalPrecioCondicionService', | 9 | 'focaModalPrecioCondicionService', |
10 | function( | 10 | function( |
11 | $timeout, $filter, $scope, $uibModalInstance, | 11 | $timeout, $filter, $scope, $uibModalInstance, |
12 | focaModalService, focaModalPrecioCondicionService | 12 | focaModalService, focaModalPrecioCondicionService |
13 | ) { | 13 | ) { |
14 | 14 | ||
15 | focaModalPrecioCondicionService.getPreciosCondicionesPlazosPagos().then( | 15 | focaModalPrecioCondicionService.getPreciosCondicionesPlazosPagos().then( |
16 | function(res) { | 16 | function(res) { |
17 | for(var i = 0; i < res.data.length; i++) { | 17 | for(var i = 0; i < res.data.length; i++) { |
18 | var plazosTemp = ''; | 18 | var plazosTemp = ''; |
19 | for(var j = 0; j < res.data[i].plazoPago.length; j++) { | 19 | for(var j = 0; j < res.data[i].plazoPago.length; j++) { |
20 | plazosTemp += res.data[i].plazoPago[j].dias + ' '; | 20 | if(j + 1 === res.data[i].plazoPago.length) { |
21 | plazosTemp += res.data[i].plazoPago[j].dias; | ||
22 | }else { | ||
23 | plazosTemp += res.data[i].plazoPago[j].dias + ', '; | ||
24 | } | ||
21 | } | 25 | } |
22 | res.data[i].plazos = plazosTemp.trim(); | 26 | res.data[i].plazos = plazosTemp.trim(); |
23 | } | 27 | } |
24 | $scope.precioCondicion = res.data; | 28 | $scope.precioCondicion = res.data; |
25 | $scope.search(); | 29 | $scope.search(); |
26 | } | 30 | } |
27 | ); | 31 | ); |
28 | $scope.filters = ''; | 32 | $scope.filters = ''; |
29 | $scope.ingreso = false; | 33 | $scope.ingreso = false; |
30 | $scope.plazosNuevos = []; | 34 | $scope.plazosNuevos = []; |
31 | $scope.plazoACargar = | 35 | $scope.plazoACargar = |
32 | { | 36 | { |
33 | item: 1 | 37 | item: 1 |
34 | }; | 38 | }; |
35 | // pagination | 39 | // pagination |
36 | $scope.numPerPage = 10; | 40 | $scope.numPerPage = 10; |
37 | $scope.currentPage = 1; | 41 | $scope.currentPage = 1; |
38 | $scope.filteredPrecioCondicion = []; | 42 | $scope.filteredPrecioCondicion = []; |
39 | $scope.currentPagePrecioCondicion = []; | 43 | $scope.currentPagePrecioCondicion = []; |
40 | $scope.selectedPrecioCondicion = -1; | 44 | $scope.selectedPrecioCondicion = -1; |
41 | 45 | ||
42 | //METODOS | 46 | //METODOS |
43 | 47 | ||
44 | $scope.agregarPlazo = function(key) { | 48 | $scope.agregarPlazo = function(key) { |
45 | if(key === 13) { | 49 | if(key === 13) { |
46 | if(!$scope.plazoACargar.dias) { | 50 | if(!$scope.plazoACargar.dias) { |
47 | focaModalService.alert('Ingrese cantidad de días'); | 51 | focaModalService.alert('Ingrese cantidad de días'); |
48 | return; | 52 | return; |
49 | } | 53 | } |
50 | var tieneEseDia = $scope.plazosNuevos.filter(function(a) { | 54 | var tieneEseDia = $scope.plazosNuevos.filter(function(a) { |
51 | return a.dias === $scope.plazoACargar.dias; | 55 | return a.dias === $scope.plazoACargar.dias; |
52 | }); | 56 | }); |
53 | if(tieneEseDia.length > 0) { | 57 | if(tieneEseDia.length > 0) { |
54 | focaModalService.alert('Ya ha ingresado un plazo con esos días'); | 58 | focaModalService.alert('Ya ha ingresado un plazo con esos días'); |
55 | return; | 59 | return; |
56 | } | 60 | } |
57 | $scope.plazosNuevos.push($scope.plazoACargar); | 61 | $scope.plazosNuevos.push($scope.plazoACargar); |
58 | $scope.plazoACargar = | 62 | $scope.plazoACargar = |
59 | { | 63 | { |
60 | item: $scope.plazosNuevos.length + 1 | 64 | item: $scope.plazosNuevos.length + 1 |
61 | }; | 65 | }; |
62 | } | 66 | } |
63 | }; | 67 | }; |
64 | 68 | ||
65 | $scope.volver = function() { | 69 | $scope.volver = function() { |
66 | $scope.ingreso = false; | 70 | $scope.ingreso = false; |
67 | $scope.plazosNuevos = []; | 71 | $scope.plazosNuevos = []; |
68 | $scope.plazoACargar = | 72 | $scope.plazoACargar = |
69 | { | 73 | { |
70 | item: $scope.plazosNuevos.length + 1 | 74 | item: $scope.plazosNuevos.length + 1 |
71 | }; | 75 | }; |
72 | }; | 76 | }; |
73 | 77 | ||
74 | $scope.quitarPlazo = function(key) { | 78 | $scope.quitarPlazo = function(key) { |
75 | $scope.plazosNuevos.splice(key, 1); | 79 | $scope.plazosNuevos.splice(key, 1); |
76 | $scope.plazoACargar = | 80 | $scope.plazoACargar = |
77 | { | 81 | { |
78 | item: $scope.plazosNuevos.length + 1 | 82 | item: $scope.plazosNuevos.length + 1 |
79 | }; | 83 | }; |
80 | }; | 84 | }; |
81 | 85 | ||
82 | $scope.search = function(pressed) { | 86 | $scope.search = function(pressed) { |
83 | $scope.filteredPrecioCondicion = $filter('filter')( | 87 | $scope.filteredPrecioCondicion = $filter('filter')( |
84 | $scope.precioCondicion, | 88 | $scope.precioCondicion, |
85 | {$: $scope.filters} | 89 | {$: $scope.filters} |
86 | ); | 90 | ); |
87 | 91 | ||
88 | if(pressed) { | 92 | if(pressed) { |
89 | if($scope.filteredPrecioCondicion.length === 0) { | 93 | if($scope.filteredPrecioCondicion.length === 0) { |
90 | $timeout(function() { | 94 | $timeout(function() { |
91 | angular.element('#search')[0].focus(); | 95 | angular.element('#search')[0].focus(); |
92 | $scope.filters = ''; | 96 | $scope.filters = ''; |
93 | }); | 97 | }); |
94 | }else { | 98 | }else { |
95 | primera(); | 99 | primera(); |
96 | } | 100 | } |
97 | } | 101 | } |
98 | 102 | ||
99 | $scope.lastPage = Math.ceil( | 103 | $scope.lastPage = Math.ceil( |
100 | $scope.filteredPrecioCondicion.length / $scope.numPerPage | 104 | $scope.filteredPrecioCondicion.length / $scope.numPerPage |
101 | ); | 105 | ); |
102 | 106 | ||
103 | $scope.resetPage(); | 107 | $scope.resetPage(); |
104 | }; | 108 | }; |
105 | 109 | ||
106 | $scope.resetPage = function() { | 110 | $scope.resetPage = function() { |
107 | $scope.currentPage = 1; | 111 | $scope.currentPage = 1; |
108 | $scope.selectPage(1); | 112 | $scope.selectPage(1); |
109 | }; | 113 | }; |
110 | 114 | ||
111 | $scope.selectPage = function(page) { | 115 | $scope.selectPage = function(page) { |
112 | var start = (page - 1) * $scope.numPerPage; | 116 | var start = (page - 1) * $scope.numPerPage; |
113 | var end = start + $scope.numPerPage; | 117 | var end = start + $scope.numPerPage; |
114 | $scope.paginas = []; | 118 | $scope.paginas = []; |
115 | $scope.paginas = calcularPages(page); | 119 | $scope.paginas = calcularPages(page); |
116 | $scope.currentPagePrecioCondicion = | 120 | $scope.currentPagePrecioCondicion = |
117 | $scope.filteredPrecioCondicion.slice(start, end); | 121 | $scope.filteredPrecioCondicion.slice(start, end); |
118 | $scope.currentPage = page; | 122 | $scope.currentPage = page; |
119 | }; | 123 | }; |
120 | 124 | ||
121 | $scope.select = function(precioCondicion) { | 125 | $scope.select = function(precioCondicion) { |
122 | $uibModalInstance.close(precioCondicion); | 126 | $uibModalInstance.close(precioCondicion); |
123 | }; | 127 | }; |
124 | 128 | ||
125 | $scope.cancel = function() { | 129 | $scope.cancel = function() { |
126 | $uibModalInstance.dismiss('cancel'); | 130 | $uibModalInstance.dismiss('cancel'); |
127 | }; | 131 | }; |
128 | 132 | ||
129 | $scope.busquedaDown = function(key) { | 133 | $scope.busquedaDown = function(key) { |
130 | if (key === 40) { | 134 | if (key === 40) { |
131 | primera(key); | 135 | primera(key); |
132 | } | 136 | } |
133 | }; | 137 | }; |
134 | 138 | ||
135 | $scope.busquedaPress = function(key) { | 139 | $scope.busquedaPress = function(key) { |
136 | if (key === 13) { | 140 | if (key === 13) { |
137 | $scope.search(true); | 141 | $scope.search(true); |
138 | } | 142 | } |
139 | }; | 143 | }; |
140 | 144 | ||
141 | $scope.itemProducto = function(key) { | 145 | $scope.itemProducto = function(key) { |
142 | if (key === 38) { | 146 | if (key === 38) { |
143 | anterior(key); | 147 | anterior(key); |
144 | } | 148 | } |
145 | 149 | ||
146 | if (key === 40) { | 150 | if (key === 40) { |
147 | siguiente(key); | 151 | siguiente(key); |
148 | } | 152 | } |
149 | 153 | ||
150 | if (key === 37) { | 154 | if (key === 37) { |
151 | retrocederPagina(); | 155 | retrocederPagina(); |
152 | } | 156 | } |
153 | 157 | ||
154 | if (key === 39) { | 158 | if (key === 39) { |
155 | avanzarPagina(); | 159 | avanzarPagina(); |
156 | } | 160 | } |
157 | }; | 161 | }; |
158 | 162 | ||
159 | function calcularPages(paginaActual) { | 163 | function calcularPages(paginaActual) { |
160 | var paginas = []; | 164 | var paginas = []; |
161 | paginas.push(paginaActual); | 165 | paginas.push(paginaActual); |
162 | 166 | ||
163 | if (paginaActual - 1 > 1) { | 167 | if (paginaActual - 1 > 1) { |
164 | 168 | ||
165 | paginas.unshift(paginaActual - 1); | 169 | paginas.unshift(paginaActual - 1); |
166 | if (paginaActual - 2 > 1) { | 170 | if (paginaActual - 2 > 1) { |
167 | paginas.unshift(paginaActual - 2); | 171 | paginas.unshift(paginaActual - 2); |
168 | } | 172 | } |
169 | } | 173 | } |
170 | 174 | ||
171 | if (paginaActual + 1 < $scope.lastPage) { | 175 | if (paginaActual + 1 < $scope.lastPage) { |
172 | paginas.push(paginaActual + 1); | 176 | paginas.push(paginaActual + 1); |
173 | if (paginaActual + 2 < $scope.lastPage) { | 177 | if (paginaActual + 2 < $scope.lastPage) { |
174 | paginas.push(paginaActual + 2); | 178 | paginas.push(paginaActual + 2); |
175 | } | 179 | } |
176 | } | 180 | } |
177 | 181 | ||
178 | if (paginaActual !== 1) { | 182 | if (paginaActual !== 1) { |
179 | paginas.unshift(1); | 183 | paginas.unshift(1); |
180 | } | 184 | } |
181 | 185 | ||
182 | if (paginaActual !== $scope.lastPage) { | 186 | if (paginaActual !== $scope.lastPage) { |
183 | paginas.push($scope.lastPage); | 187 | paginas.push($scope.lastPage); |
184 | } | 188 | } |
185 | 189 | ||
186 | return paginas; | 190 | return paginas; |
187 | } | 191 | } |
188 | 192 | ||
189 | function primera() { | 193 | function primera() { |
190 | $scope.selectedPrecioCondicion = 0; | 194 | $scope.selectedPrecioCondicion = 0; |
191 | } | 195 | } |
192 | 196 | ||
193 | function anterior() { | 197 | function anterior() { |
194 | if ($scope.selectedPrecioCondicion === 0 && $scope.currentPage > 1) { | 198 | if ($scope.selectedPrecioCondicion === 0 && $scope.currentPage > 1) { |
195 | retrocederPagina(); | 199 | retrocederPagina(); |
196 | } else { | 200 | } else { |
197 | $scope.selectedPrecioCondicion--; | 201 | $scope.selectedPrecioCondicion--; |
198 | } | 202 | } |
199 | } | 203 | } |
200 | 204 | ||
201 | function siguiente() { | 205 | function siguiente() { |
202 | if ($scope.selectedPrecioCondicion < | 206 | if ($scope.selectedPrecioCondicion < |
203 | $scope.currentPagePrecioCondicion.length ) { | 207 | $scope.currentPagePrecioCondicion.length ) { |
204 | $scope.selectedPrecioCondicion++; | 208 | $scope.selectedPrecioCondicion++; |
205 | } else { | 209 | } else { |
206 | avanzarPagina(); | 210 | avanzarPagina(); |
207 | } | 211 | } |
208 | } | 212 | } |
209 | 213 | ||
210 | function retrocederPagina() { | 214 | function retrocederPagina() { |
211 | if ($scope.currentPage > 1) { | 215 | if ($scope.currentPage > 1) { |
212 | $scope.selectPage($scope.currentPage - 1); | 216 | $scope.selectPage($scope.currentPage - 1); |
213 | $scope.selectedPrecioCondicion = $scope.numPerPage - 1; | 217 | $scope.selectedPrecioCondicion = $scope.numPerPage - 1; |
214 | } | 218 | } |
215 | } | 219 | } |
216 | 220 | ||
217 | function avanzarPagina() { | 221 | function avanzarPagina() { |
218 | if ($scope.currentPage < $scope.lastPage) { | 222 | if ($scope.currentPage < $scope.lastPage) { |
219 | $scope.selectPage($scope.currentPage + 1); | 223 | $scope.selectPage($scope.currentPage + 1); |
220 | $scope.selectedPrecioCondicion = 0; | 224 | $scope.selectedPrecioCondicion = 0; |
221 | } | 225 | } |
222 | } | 226 | } |
223 | } | 227 | } |
224 | ] | 228 | ] |
225 | ); | 229 | ); |
226 | 230 |
src/views/modal-precio-condicion.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <div class="row w-100"> | 2 | <div class="row w-100"> |
3 | <div class="col-lg-6"> | 3 | <div class="col-lg-6"> |
4 | <h5 ng-show="!ingreso" class="modal-title my-1">Busqueda de Precio-Condición</h5> | 4 | <h5 ng-show="!ingreso" class="modal-title my-1">Busqueda de Precio-Condición</h5> |
5 | <h5 ng-show="ingreso" class="modal-title my-1">Nuevos Plazos</h5> | 5 | <h5 ng-show="ingreso" class="modal-title my-1">Nuevos Plazos</h5> |
6 | </div> | 6 | </div> |
7 | <div class="input-group col-lg-6 pr-0 my-2" ng-show="!ingreso"> | 7 | <div class="input-group col-lg-6 pr-0 my-2" ng-show="!ingreso"> |
8 | <input | 8 | <input |
9 | type="text" | 9 | type="text" |
10 | class="form-control form-control-sm" | 10 | class="form-control form-control-sm" |
11 | id="search" | 11 | id="search" |
12 | placeholder="Busqueda" | 12 | placeholder="Busqueda" |
13 | ng-model="filters" | 13 | ng-model="filters" |
14 | ng-change="search()" | 14 | ng-change="search()" |
15 | ng-keydown="busquedaDown($event.keyCode)" | 15 | ng-keydown="busquedaDown($event.keyCode)" |
16 | ng-keypress="busquedaPress($event.keyCode)" | 16 | ng-keypress="busquedaPress($event.keyCode)" |
17 | foca-focus="selectedPrecioCondicion == -1" | 17 | foca-focus="selectedPrecioCondicion == -1" |
18 | ng-focus="selectedPrecioCondicion = -1" | 18 | ng-focus="selectedPrecioCondicion = -1" |
19 | teclado-virtual | 19 | teclado-virtual |
20 | > | 20 | > |
21 | <div class="input-group-append"> | 21 | <div class="input-group-append"> |
22 | <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> | 22 | <button class="btn btn-outline-secondary" type="button" ng-click="busquedaPress(13)"> |
23 | <i class="fa fa-search" aria-hidden="true"></i> | 23 | <i class="fa fa-search" aria-hidden="true"></i> |
24 | </button> | 24 | </button> |
25 | </div> | 25 | </div> |
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
29 | <div class="modal-body" id="modal-body"> | 29 | <div class="modal-body" id="modal-body"> |
30 | 30 | ||
31 | 31 | ||
32 | <table ng-show="!ingreso" class="table table-striped table-sm"> | 32 | <table ng-show="!ingreso" class="table table-striped table-sm"> |
33 | <thead> | 33 | <thead> |
34 | <tr> | 34 | <tr> |
35 | <th>Código</th> | 35 | <th>Código</th> |
36 | <th>Nombre</th> | 36 | <th>Nombre</th> |
37 | <th>Lista Precio</th> | 37 | <th>Lista Precio</th> |
38 | <th>Plazos</th> | 38 | <th>Plazos</th> |
39 | <th></th> | 39 | <th></th> |
40 | </tr> | 40 | </tr> |
41 | </thead> | 41 | </thead> |
42 | <tbody> | 42 | <tbody> |
43 | <tr ng-show="currentPagePrecioCondicion.length == 0"> | 43 | <tr ng-show="currentPagePrecioCondicion.length == 0"> |
44 | <td colspan="6"> | 44 | <td colspan="6"> |
45 | No se encontraron resultados. | 45 | No se encontraron resultados. |
46 | </td> | 46 | </td> |
47 | </tr> | 47 | </tr> |
48 | <tr> | 48 | <tr> |
49 | <td colspan="4" ng-show="!ingreso"> | 49 | <td colspan="4" ng-show="!ingreso"> |
50 | <input | 50 | <input |
51 | class="form-control form-control-sm" | 51 | class="form-control form-control-sm" |
52 | type="text" | 52 | type="text" |
53 | placeholder="Selección manual" | 53 | placeholder="Selección manual" |
54 | readonly | 54 | readonly |
55 | ng-click="ingreso = !ingreso" | 55 | ng-click="ingreso = !ingreso" |
56 | /> | 56 | /> |
57 | </td> | 57 | </td> |
58 | <td colspan="1" ng-show="!ingreso"> | 58 | <td colspan="1" ng-show="!ingreso"> |
59 | <button | 59 | <button |
60 | type="button" | 60 | type="button" |
61 | class="btn btn-sm p-1 float-right" | 61 | class="btn btn-sm p-1 float-right" |
62 | ng-class="{ | 62 | ng-class="{ |
63 | 'btn-secondary': selectedPrecioCondicion != 0, | 63 | 'btn-secondary': selectedPrecioCondicion != 0, |
64 | 'btn-primary': selectedPrecioCondicion == 0 | 64 | 'btn-primary': selectedPrecioCondicion == 0 |
65 | }" | 65 | }" |
66 | foca-focus="selectedPrecioCondicion == 0" | 66 | foca-focus="selectedPrecioCondicion == 0" |
67 | ng-keydown="itemProducto($event.keyCode)" | 67 | ng-keydown="itemProducto($event.keyCode)" |
68 | ng-click="ingreso = !ingreso" | 68 | ng-click="ingreso = !ingreso" |
69 | > | 69 | > |
70 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 70 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
71 | </button> | 71 | </button> |
72 | </td> | 72 | </td> |
73 | </tr> | 73 | </tr> |
74 | <tr class="selectable" | 74 | <tr class="selectable" |
75 | ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion" | 75 | ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion" |
76 | ng-click="select(precioCondicion)"> | 76 | ng-click="select(precioCondicion)"> |
77 | <td ng-bind="precioCondicion.codigo"></td> | 77 | <td ng-bind="precioCondicion.id | rellenarDigitos: 4: 0"></td> |
78 | <td ng-bind="precioCondicion.nombre"></td> | 78 | <td ng-bind="precioCondicion.nombre"></td> |
79 | <td ng-bind="precioCondicion.idListaPrecio"></td> | 79 | <td ng-bind="precioCondicion.idListaPrecio"></td> |
80 | <td ng-bind="precioCondicion.plazos"></td> | 80 | <td ng-bind="precioCondicion.plazos"></td> |
81 | <td> | 81 | <td> |
82 | <button | 82 | <button |
83 | type="button" | 83 | type="button" |
84 | class="btn btn-sm p-1 float-right" | 84 | class="btn btn-sm p-1 float-right" |
85 | ng-class="{ | 85 | ng-class="{ |
86 | 'btn-secondary': selectedPrecioCondicion != key + 1, | 86 | 'btn-secondary': selectedPrecioCondicion != key + 1, |
87 | 'btn-primary': selectedPrecioCondicion == key + 1 | 87 | 'btn-primary': selectedPrecioCondicion == key + 1 |
88 | }" | 88 | }" |
89 | foca-focus="selectedPrecioCondicion == {{key + 1}}" | 89 | foca-focus="selectedPrecioCondicion == {{key + 1}}" |
90 | ng-keydown="itemProducto($event.keyCode)" | 90 | ng-keydown="itemProducto($event.keyCode)" |
91 | > | 91 | > |
92 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 92 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
93 | </button> | 93 | </button> |
94 | </td> | 94 | </td> |
95 | </tr> | 95 | </tr> |
96 | </tbody> | 96 | </tbody> |
97 | </table> | 97 | </table> |
98 | 98 | ||
99 | <table class="table table-striped table-sm" ng-show="ingreso"> | 99 | <table class="table table-striped table-sm" ng-show="ingreso"> |
100 | <thead> | 100 | <thead> |
101 | <tr> | 101 | <tr> |
102 | <th>Item</th> | 102 | <th>Item</th> |
103 | <th>Días</th> | 103 | <th>Días</th> |
104 | <th></th> | 104 | <th></th> |
105 | </tr> | 105 | </tr> |
106 | </thead> | 106 | </thead> |
107 | <tbody> | 107 | <tbody> |
108 | <tr> | 108 | <tr> |
109 | <td> | 109 | <td> |
110 | <input | 110 | <input |
111 | type="number" | 111 | type="number" |
112 | class="form-control text-right" | 112 | class="form-control text-right" |
113 | ng-model="plazoACargar.item" | 113 | ng-model="plazoACargar.item" |
114 | readonly | 114 | readonly |
115 | /> | 115 | /> |
116 | </td> | 116 | </td> |
117 | <td> | 117 | <td> |
118 | <input | 118 | <input |
119 | type="number" | 119 | type="number" |
120 | class="form-control text-right" | 120 | class="form-control text-right" |
121 | min="0" | 121 | min="0" |
122 | ng-model="plazoACargar.dias" | 122 | ng-model="plazoACargar.dias" |
123 | ng-keypress="agregarPlazo($event.keyCode)" | 123 | ng-keypress="agregarPlazo($event.keyCode)" |
124 | foca-focus="ingreso" | 124 | foca-focus="ingreso" |
125 | /> | 125 | /> |
126 | </td> | 126 | </td> |
127 | <td class="text-center"> | 127 | <td class="text-center"> |
128 | <button | 128 | <button |
129 | class="btn btn-outline-secondary" | 129 | class="btn btn-outline-secondary" |
130 | ng-click="agregarPlazo(13)" | 130 | ng-click="agregarPlazo(13)" |
131 | > | 131 | > |
132 | <i class="fa fa-save"></i> | 132 | <i class="fa fa-save"></i> |
133 | </button> | 133 | </button> |
134 | </td> | 134 | </td> |
135 | </tr> | 135 | </tr> |
136 | <tr ng-repeat="(key, plazo) in plazosNuevos"> | 136 | <tr ng-repeat="(key, plazo) in plazosNuevos"> |
137 | <td class="text-right" ng-bind="key + 1"></td> | 137 | <td class="text-right" ng-bind="key + 1"></td> |
138 | <td class="text-right" ng-bind="plazo.dias"></td> | 138 | <td class="text-right" ng-bind="plazo.dias"></td> |
139 | <td class="text-center"> | 139 | <td class="text-center"> |
140 | <button | 140 | <button |
141 | class="btn btn-outline-secondary" | 141 | class="btn btn-outline-secondary" |
142 | ng-click="quitarPlazo(key)" | 142 | ng-click="quitarPlazo(key)" |
143 | > | 143 | > |
144 | <i class="fa fa-trash"></i> | 144 | <i class="fa fa-trash"></i> |
145 | </button> | 145 | </button> |
146 | </td> | 146 | </td> |
147 | </tr> | 147 | </tr> |
148 | </tbody> | 148 | </tbody> |
149 | </table> | 149 | </table> |
150 | </div> | 150 | </div> |
151 | <div class="modal-footer py-1"> | 151 | <div class="modal-footer py-1"> |
152 | <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso" class="mr-auto"> | 152 | <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso" class="mr-auto"> |
153 | <ul class="pagination pagination-sm mb-0"> | 153 | <ul class="pagination pagination-sm mb-0"> |
154 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 154 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
155 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | 155 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> |
156 | <span aria-hidden="true">«</span> | 156 | <span aria-hidden="true">«</span> |
157 | <span class="sr-only">Anterior</span> | 157 | <span class="sr-only">Anterior</span> |
158 | </a> | 158 | </a> |
159 | </li> | 159 | </li> |
160 | <li | 160 | <li |
161 | class="page-item" | 161 | class="page-item" |
162 | ng-repeat="pagina in paginas" | 162 | ng-repeat="pagina in paginas" |
163 | ng-class="{'active': pagina == currentPage}" | 163 | ng-class="{'active': pagina == currentPage}" |
164 | > | 164 | > |
165 | <a | 165 | <a |
166 | class="page-link" | 166 | class="page-link" |
167 | href="javascript:void();" | 167 | href="javascript:void();" |
168 | ng-click="selectPage(pagina)" | 168 | ng-click="selectPage(pagina)" |
169 | ng-bind="pagina" | 169 | ng-bind="pagina" |
170 | ></a> | 170 | ></a> |
171 | </li> | 171 | </li> |
172 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 172 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
173 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | 173 | <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> |
174 | <span aria-hidden="true">»</span> | 174 | <span aria-hidden="true">»</span> |
175 | <span class="sr-only">Siguiente</span> | 175 | <span class="sr-only">Siguiente</span> |
176 | </a> | 176 | </a> |
177 | </li> | 177 | </li> |
178 | </ul> | 178 | </ul> |
179 | </nav> | 179 | </nav> |
180 | <button | 180 | <button |
181 | ng-show="!ingreso" | 181 | ng-show="!ingreso" |
182 | class="btn btn-sm btn-secondary" | 182 | class="btn btn-sm btn-secondary" |
183 | type="button" | 183 | type="button" |
184 | ng-click="cancel()" | 184 | ng-click="cancel()" |
185 | >Cancelar | 185 | >Cancelar |
186 | </button> | 186 | </button> |
187 | <button | 187 | <button |
188 | ng-show="ingreso" | 188 | ng-show="ingreso" |
189 | ng-disabled="plazosNuevos.length === 0" | 189 | ng-disabled="plazosNuevos.length === 0" |
190 | class="btn btn-sm btn-primary" | 190 | class="btn btn-sm btn-primary" |
191 | type="button" | 191 | type="button" |
192 | ng-click="select(plazosNuevos)" | 192 | ng-click="select(plazosNuevos)" |
193 | >Aceptar | 193 | >Aceptar |
194 | </button> | 194 | </button> |
195 | <button | 195 | <button |
196 | ng-show="ingreso" | 196 | ng-show="ingreso" |
197 | class="btn btn-sm btn-secondary" | 197 | class="btn btn-sm btn-secondary" |
198 | type="button" | 198 | type="button" |
199 | ng-click="volver()" | 199 | ng-click="volver()" |
200 | >Volver | 200 | >Volver |
201 | </button> | 201 | </button> |
202 | </div> | 202 | </div> |
203 | 203 |