Commit 07bd823d18ea22a94f3340a7c6d9a4cbd2b4a542
Exists in
master
Merge remote-tracking branch 'upstream/develop'
Showing
4 changed files
Show diff stats
package.json
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | "description": "Modal de búsqueda de precios y condiciones", |
5 | 5 | "main": "index.js", |
6 | 6 | "scripts": { |
7 | + "refresh": "gulp uglify && cp tmp/foca-modal-precio-condiciones.js ../wrapper-demo/node_modules/foca-modal-precio-condiciones/dist/foca-modal-precio-condiciones.min.js", | |
7 | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
8 | 9 | "gulp-pre-commit": "gulp pre-commit", |
9 | 10 | "compile": "gulp uglify", |
... | ... | @@ -38,6 +39,7 @@ |
38 | 39 | "jquery": "^3.3.1", |
39 | 40 | "jshint": "^2.9.6", |
40 | 41 | "pump": "^3.0.0", |
41 | - "ui-bootstrap4": "^3.0.5" | |
42 | + "ui-bootstrap4": "^3.0.5", | |
43 | + "popper.js": "^1.15.0" | |
42 | 44 | } |
43 | 45 | } |
src/js/controller.js
1 | 1 | angular.module('focaModalPrecioCondicion') |
2 | - .controller('focaModalPrecioCondicionController', | |
2 | + .controller('focaModalPrecioCondicionController', | |
3 | 3 | [ |
4 | 4 | '$timeout', |
5 | 5 | '$filter', |
... | ... | @@ -9,166 +9,72 @@ angular.module('focaModalPrecioCondicion') |
9 | 9 | 'focaModalService', |
10 | 10 | 'focaModalPrecioCondicionService', |
11 | 11 | 'idListaPrecio', |
12 | - function( | |
12 | + 'idCliente', | |
13 | + function ( | |
13 | 14 | $timeout, $filter, $scope, $uibModal, $uibModalInstance, |
14 | - focaModalService, focaModalPrecioCondicionService, idListaPrecio | |
15 | + focaModalService, focaModalPrecioCondicionService, idListaPrecio, idCliente | |
15 | 16 | ) { |
16 | - | |
17 | - $scope.filters = ''; | |
18 | - $scope.ingreso = false; | |
19 | - $scope.plazosNuevos = []; | |
20 | - $scope.plazoACargar = | |
21 | - { | |
22 | - item: 1 | |
23 | - }; | |
24 | - // pagination | |
25 | - $scope.numPerPage = 10; | |
26 | - $scope.currentPage = 1; | |
27 | - $scope.filteredPrecioCondicion = []; | |
28 | - $scope.currentPagePrecioCondicion = []; | |
29 | - $scope.selectedPrecioCondicion = -1; | |
30 | - | |
31 | - var funcionGet = idListaPrecio ? 'getPreciosCondicionesByIdListaPrecio' : | |
32 | - 'getPreciosCondiciones'; | |
33 | - | |
34 | - focaModalPrecioCondicionService | |
35 | - [funcionGet](idListaPrecio) | |
36 | - .then(function(res) { | |
37 | - for (var i = 0; i < res.data.length; i++) { | |
38 | - var plazosTemp = ''; | |
39 | - res.data[i].plazoPago.sort(function(a, b) { | |
40 | - return a.dias - b.dias; | |
17 | + $scope.plazos = [ | |
18 | + { | |
19 | + dias: 0, | |
20 | + idCliente: idCliente, | |
21 | + activo: true | |
22 | + } | |
23 | + ]; | |
24 | + $scope.openModalListaDePrecios = false; | |
25 | + $scope.associatedList = true; | |
26 | + $scope.listaDePreciosAlternativa = null; | |
27 | + | |
28 | + onInit(); | |
29 | + | |
30 | + function onInit() { | |
31 | + //Metodo para traer la lista de precio asociada al cliente | |
32 | + focaModalPrecioCondicionService.getListaPrecio(idListaPrecio) | |
33 | + .then(function (res) { | |
34 | + $scope.listaDePreciosAsociada = res.data[0]; | |
35 | + }) | |
36 | + .catch(function (e) { console.error(e) }); | |
37 | + focaModalPrecioCondicionService.getPlazosByIdCliente(idCliente) | |
38 | + .then(function (res) { | |
39 | + res.data.forEach(function (item) { | |
40 | + $scope.plazos.push(item); | |
41 | 41 | }); |
42 | - for (var j = 0; j < res.data[i].plazoPago.length; j++) { | |
43 | - if (j + 1 === res.data[i].plazoPago.length) { | |
44 | - plazosTemp += res.data[i].plazoPago[j].dias; | |
45 | - } else { | |
46 | - plazosTemp += res.data[i].plazoPago[j].dias + ', '; | |
47 | - } | |
48 | - } | |
49 | - res.data[i].plazos = plazosTemp.trim(); | |
50 | - } | |
51 | - $scope.precioCondicion = res.data; | |
52 | - $scope.search(); | |
53 | - }); | |
54 | - | |
55 | - //METODOS | |
56 | - $scope.agregarPlazo = function(key) { | |
57 | - if(key === 13) { | |
58 | - if(!$scope.plazoACargar.dias) { | |
59 | - focaModalService.alert('Ingrese cantidad de días'); | |
60 | - return; | |
61 | - } | |
62 | - var tieneEseDia = $scope.plazosNuevos.filter(function(a) { | |
63 | - return a.dias === $scope.plazoACargar.dias; | |
64 | - }); | |
65 | - if(tieneEseDia.length > 0) { | |
66 | - focaModalService.alert('Ya ha ingresado un plazo con esos días'); | |
67 | - return; | |
68 | - } | |
69 | - $scope.plazosNuevos.push($scope.plazoACargar); | |
70 | - $scope.plazoACargar = | |
71 | - { | |
72 | - item: $scope.plazosNuevos.length + 1 | |
73 | - }; | |
74 | - } | |
75 | - }; | |
76 | - | |
77 | - $scope.volver = function() { | |
78 | - $scope.ingreso = false; | |
79 | - $scope.plazosNuevos = []; | |
80 | - $scope.plazoACargar = | |
81 | - { | |
82 | - item: $scope.plazosNuevos.length + 1 | |
83 | - }; | |
84 | - }; | |
85 | - | |
86 | - $scope.quitarPlazo = function(key) { | |
87 | - $scope.plazosNuevos.splice(key, 1); | |
88 | - $scope.plazoACargar = | |
89 | - { | |
90 | - item: $scope.plazosNuevos.length + 1 | |
91 | - }; | |
92 | - }; | |
93 | - | |
94 | - $scope.search = function(pressed) { | |
95 | - $scope.filteredPrecioCondicion = $filter('filter')( | |
96 | - $scope.precioCondicion, | |
97 | - {$: $scope.filters} | |
98 | - ); | |
42 | + }) | |
43 | + .catch(function (e) { console.error(e) }); | |
44 | + } | |
99 | 45 | |
100 | - if(pressed) { | |
101 | - if($scope.filteredPrecioCondicion.length === 0) { | |
102 | - $timeout(function() { | |
103 | - angular.element('#search')[0].focus(); | |
104 | - $scope.filters = ''; | |
46 | + //#region Metodos para la lista de precios | |
47 | + $scope.openListaDePrecios = function () { | |
48 | + var datos = null; | |
49 | + focaModalPrecioCondicionService.getAllListaPrecio() | |
50 | + .then(function (res) { | |
51 | + datos = res.data; | |
52 | + focaModalService.modal({ | |
53 | + titulo: 'Lista de precios', | |
54 | + data: datos, | |
55 | + size: 'md', | |
56 | + columnas: [ | |
57 | + { | |
58 | + propiedad: 'ID', | |
59 | + nombre: 'Codigo' | |
60 | + }, | |
61 | + { | |
62 | + propiedad: 'DES', | |
63 | + NOMBRE: 'Nombre' | |
64 | + } | |
65 | + ], | |
66 | + }).then(function (res) { | |
67 | + $scope.associatedList = false; | |
68 | + $scope.listaDePreciosAlternativa = res; | |
69 | + }).catch(function (e) { | |
70 | + console.error(e); | |
105 | 71 | }); |
106 | - }else { | |
107 | - primera(); | |
108 | - } | |
109 | - } | |
110 | - | |
111 | - $scope.lastPage = Math.ceil( | |
112 | - $scope.filteredPrecioCondicion.length / $scope.numPerPage | |
113 | - ); | |
114 | - | |
115 | - $scope.resetPage(); | |
116 | - }; | |
117 | - | |
118 | - $scope.resetPage = function() { | |
119 | - $scope.currentPage = 1; | |
120 | - $scope.selectPage(1); | |
121 | - }; | |
122 | - | |
123 | - $scope.selectPage = function(page) { | |
124 | - var start = (page - 1) * $scope.numPerPage; | |
125 | - var end = start + $scope.numPerPage; | |
126 | - $scope.paginas = []; | |
127 | - $scope.paginas = calcularPages(page); | |
128 | - $scope.currentPagePrecioCondicion = | |
129 | - $scope.filteredPrecioCondicion.slice(start, end); | |
130 | - $scope.currentPage = page; | |
131 | - }; | |
132 | - | |
133 | - $scope.select = function(precioCondicion) { | |
134 | - $uibModalInstance.close(precioCondicion); | |
135 | - }; | |
136 | - | |
137 | - $scope.cancel = function() { | |
138 | - $uibModalInstance.dismiss('cancel'); | |
139 | - }; | |
140 | - | |
141 | - $scope.busquedaDown = function(key) { | |
142 | - if (key === 40) { | |
143 | - primera(key); | |
144 | - } | |
145 | - }; | |
146 | - | |
147 | - $scope.busquedaPress = function(key) { | |
148 | - if (key === 13) { | |
149 | - $scope.search(true); | |
150 | - } | |
72 | + }); | |
151 | 73 | }; |
152 | - | |
153 | - $scope.itemProducto = function(key) { | |
154 | - if (key === 38) { | |
155 | - anterior(key); | |
156 | - } | |
157 | - | |
158 | - if (key === 40) { | |
159 | - siguiente(key); | |
160 | - } | |
161 | - | |
162 | - if (key === 37) { | |
163 | - retrocederPagina(); | |
164 | - } | |
165 | - | |
166 | - if (key === 39) { | |
167 | - avanzarPagina(); | |
168 | - } | |
74 | + $scope.selectListaDePrecios = function () { | |
75 | + $scope.associatedList = true; | |
169 | 76 | }; |
170 | - | |
171 | - $scope.verListaPrecio = function(id) { | |
77 | + $scope.verListaProductos = function (id) { | |
172 | 78 | $uibModal.open( |
173 | 79 | { |
174 | 80 | ariaLabelledBy: 'Busqueda de Productos', |
... | ... | @@ -176,7 +82,7 @@ angular.module('focaModalPrecioCondicion') |
176 | 82 | controller: 'modalBusquedaProductosCtrl', |
177 | 83 | resolve: { |
178 | 84 | parametroProducto: { |
179 | - idLista: id, | |
85 | + idLista: parseInt(id), | |
180 | 86 | cotizacion: 1, |
181 | 87 | simbolo: '$', |
182 | 88 | soloMostrar: true |
... | ... | @@ -186,71 +92,53 @@ angular.module('focaModalPrecioCondicion') |
186 | 92 | } |
187 | 93 | ); |
188 | 94 | }; |
189 | - | |
190 | - function calcularPages(paginaActual) { | |
191 | - var paginas = []; | |
192 | - paginas.push(paginaActual); | |
193 | - | |
194 | - if (paginaActual - 1 > 1) { | |
195 | - | |
196 | - paginas.unshift(paginaActual - 1); | |
197 | - if (paginaActual - 2 > 1) { | |
198 | - paginas.unshift(paginaActual - 2); | |
199 | - } | |
200 | - } | |
201 | - | |
202 | - if (paginaActual + 1 < $scope.lastPage) { | |
203 | - paginas.push(paginaActual + 1); | |
204 | - if (paginaActual + 2 < $scope.lastPage) { | |
205 | - paginas.push(paginaActual + 2); | |
95 | + //#endregion | |
96 | + | |
97 | + //#region Metodos para los plazos | |
98 | + $scope.addPlazo = function () { | |
99 | + if ($scope.plazos.length === 100) return; | |
100 | + for (var i = 1; i < $scope.plazos.length; i++) { | |
101 | + if ($scope.plazos[0].dias == $scope.plazos[i].dias) { | |
102 | + focaModalService.alert("Ya existe un plazo con este valor"); | |
103 | + return; | |
206 | 104 | } |
207 | 105 | } |
208 | - | |
209 | - if (paginaActual !== 1) { | |
210 | - paginas.unshift(1); | |
211 | - } | |
212 | - | |
213 | - if (paginaActual !== $scope.lastPage) { | |
214 | - paginas.push($scope.lastPage); | |
215 | - } | |
216 | - | |
217 | - return paginas; | |
218 | - } | |
219 | - | |
220 | - function primera() { | |
221 | - $scope.selectedPrecioCondicion = 0; | |
222 | - } | |
223 | - | |
224 | - function anterior() { | |
225 | - if ($scope.selectedPrecioCondicion === 0 && $scope.currentPage > 1) { | |
226 | - retrocederPagina(); | |
227 | - } else { | |
228 | - $scope.selectedPrecioCondicion--; | |
106 | + $scope.plazos.unshift({ dias: 0, idCliente: idCliente, activo: true }); | |
107 | + }; | |
108 | + $scope.deletePlazo = function (index) { | |
109 | + $scope.plazos[index].activo = false; | |
110 | + }; | |
111 | + $scope.validateMinMax = function (plazo, min, max) { | |
112 | + plazo.dias = parseInt(plazo.dias); | |
113 | + if (plazo.dias === null || plazo.dias === undefined || isNaN(plazo.dias)) { | |
114 | + plazo.dias = '0'; | |
115 | + return; | |
229 | 116 | } |
230 | - } | |
231 | - | |
232 | - function siguiente() { | |
233 | - if ($scope.selectedPrecioCondicion < | |
234 | - $scope.currentPagePrecioCondicion.length ) { | |
235 | - $scope.selectedPrecioCondicion++; | |
236 | - } else { | |
237 | - avanzarPagina(); | |
117 | + if (parseInt(plazo.dias) < min) { | |
118 | + plazo.dias = '0'; | |
119 | + return; | |
238 | 120 | } |
239 | - } | |
240 | - | |
241 | - function retrocederPagina() { | |
242 | - if ($scope.currentPage > 1) { | |
243 | - $scope.selectPage($scope.currentPage - 1); | |
244 | - $scope.selectedPrecioCondicion = $scope.numPerPage - 1; | |
121 | + if (parseInt(plazo.dias) > max) { | |
122 | + plazo.dias = '365'; | |
123 | + return; | |
245 | 124 | } |
246 | - } | |
125 | + }; | |
126 | + //#endregion | |
247 | 127 | |
248 | - function avanzarPagina() { | |
249 | - if ($scope.currentPage < $scope.lastPage) { | |
250 | - $scope.selectPage($scope.currentPage + 1); | |
251 | - $scope.selectedPrecioCondicion = 0; | |
252 | - } | |
128 | + $scope.closeModalPrecioCondicion = function () { | |
129 | + $uibModalInstance.dismiss('cancel'); | |
130 | + }; | |
131 | + $scope.guardarPrecioCondicion = function () { | |
132 | + $scope.plazos.shift(); | |
133 | + focaModalPrecioCondicionService.createPlazo($scope.plazos) | |
134 | + .then(function () { | |
135 | + var precioCondicion = { | |
136 | + listaPrecio: $scope.associatedList ? $scope.listaDePreciosAsociada : $scope.listaDePreciosAlternativa, | |
137 | + plazoPago: $filter('filter')($scope.plazos, { activo: true }, true) | |
138 | + }; | |
139 | + $uibModalInstance.close(precioCondicion); | |
140 | + }) | |
141 | + .catch(function (e) { console.error(e) }) | |
253 | 142 | } |
254 | 143 | } |
255 | - ] | |
256 | - ); | |
144 | + ]); |
src/js/service.js
... | ... | @@ -2,17 +2,30 @@ angular.module('focaModalPrecioCondicion') |
2 | 2 | .service('focaModalPrecioCondicionService', [ |
3 | 3 | '$http', |
4 | 4 | 'API_ENDPOINT', |
5 | - function($http, API_ENDPOINT) { | |
5 | + function ($http, API_ENDPOINT) { | |
6 | 6 | return { |
7 | - getPlazosByIdPrecioCondicion: function(id) { | |
7 | + getPlazosByIdPrecioCondicion: function (id) { | |
8 | 8 | return $http.get(API_ENDPOINT.URL + '/plazo-pago/precio-condicion/' + id); |
9 | 9 | }, |
10 | - getPreciosCondiciones: function() { | |
10 | + getPreciosCondiciones: function () { | |
11 | 11 | return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago'); |
12 | 12 | }, |
13 | - getPreciosCondicionesByIdListaPrecio: function(idListaPrecio) { | |
13 | + getPreciosCondicionesByIdListaPrecio: function (idListaPrecio) { | |
14 | 14 | return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago/' + |
15 | 15 | idListaPrecio); |
16 | + }, | |
17 | + getListaPrecio: function (idListaPrecio) { | |
18 | + return $http.get(API_ENDPOINT.URL + '/lista-precio/' + | |
19 | + idListaPrecio); | |
20 | + }, | |
21 | + getAllListaPrecio: function () { | |
22 | + return $http.get(API_ENDPOINT.URL + '/lista-precio'); | |
23 | + }, | |
24 | + getPlazosByIdCliente: function (id) { | |
25 | + return $http.get(API_ENDPOINT.URL + '/plazo-pago/cliente/' + id); | |
26 | + }, | |
27 | + createPlazo: function (plazosPago){ | |
28 | + return $http.post(API_ENDPOINT.URL + '/plazos-pago', { plazosPago: plazosPago }); | |
16 | 29 | } |
17 | 30 | }; |
18 | 31 | } |
src/views/modal-precio-condicion.html
1 | 1 | <div class="modal-header py-1"> |
2 | 2 | <div class="row w-100"> |
3 | 3 | <div class="col-lg-6"> |
4 | - <h5 ng-show="!ingreso" class="modal-title my-1">Búsqueda de Precio-Condición</h5> | |
5 | - <h5 ng-show="ingreso" class="modal-title my-1">Nuevos Plazos</h5> | |
6 | - </div> | |
7 | - <div class="input-group col-lg-6 pr-0 my-2" ng-show="!ingreso"> | |
8 | - <button | |
9 | - class="btn btn-outline-debo mr-2" | |
10 | - ng-click="ingreso = true" | |
11 | - ng-show="!ingreso" | |
12 | - title="Nuevo"> | |
13 | - <i class="fa fa-plus" aria-hidden="true"></i> | |
14 | - </button> | |
15 | - <input | |
16 | - type="text" | |
17 | - class="form-control form-control-sm" | |
18 | - id="search" | |
19 | - placeholder="Busqueda" | |
20 | - ng-model="filters" | |
21 | - ng-change="search()" | |
22 | - ng-keydown="busquedaDown($event.keyCode)" | |
23 | - ng-keypress="busquedaPress($event.keyCode)" | |
24 | - foca-focus="selectedPrecioCondicion == -1" | |
25 | - ng-focus="selectedPrecioCondicion = -1" | |
26 | - teclado-virtual | |
27 | - > | |
28 | - <div class="input-group-append"> | |
29 | - <button | |
30 | - class="btn btn-outline-secondary" | |
31 | - type="button" | |
32 | - title="Buscar" | |
33 | - ng-click="busquedaPress(13)"> | |
34 | - <i class="fa fa-search" aria-hidden="true"></i> | |
35 | - </button> | |
36 | - </div> | |
4 | + <h5 class="modal-title my-1">Precio-Condición</h5> | |
37 | 5 | </div> |
38 | 6 | </div> |
39 | 7 | </div> |
40 | 8 | <div class="modal-body" id="modal-body"> |
41 | - | |
42 | - | |
43 | - <table ng-show="!ingreso" class="table table-striped table-sm"> | |
44 | - <thead> | |
45 | - <tr> | |
46 | - <th>Código</th> | |
47 | - <th>Nombre</th> | |
48 | - <th>Lista Precio</th> | |
49 | - <th>Plazos</th> | |
50 | - <th></th> | |
51 | - </tr> | |
52 | - </thead> | |
53 | - <tbody> | |
54 | - <tr ng-show="currentPagePrecioCondicion.length == 0"> | |
55 | - <td colspan="6"> | |
56 | - No se encontraron resultados. | |
57 | - </td> | |
58 | - </tr> | |
59 | - <tr class="selectable" | |
60 | - ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion"> | |
61 | - <td ng-bind="precioCondicion.id | rellenarDigitos: 4: 0" | |
62 | - ng-click="select(precioCondicion)"></td> | |
63 | - <td ng-bind="precioCondicion.nombre" | |
64 | - ng-click="select(precioCondicion)"></td> | |
65 | - <td ng-bind="precioCondicion.idListaPrecio" | |
66 | - ng-click="select(precioCondicion)"></td> | |
67 | - <td ng-bind="precioCondicion.plazos" | |
68 | - ng-click="select(precioCondicion)"></td> | |
69 | - <td> | |
70 | - <button | |
71 | - type="button" | |
72 | - class="btn btn-sm p-1 float-right" | |
73 | - title="Seleccionar" | |
74 | - ng-class="{ | |
75 | - 'btn-secondary': selectedPrecioCondicion != key + 1, | |
76 | - 'btn-primary': selectedPrecioCondicion == key + 1 | |
77 | - }" | |
78 | - foca-focus="selectedPrecioCondicion == {{key + 1}}" | |
79 | - ng-keydown="itemProducto($event.keyCode)" | |
80 | - ng-click="select(precioCondicion)" | |
81 | - > | |
82 | - <i class="fa fa-circle-thin" aria-hidden="true"></i> | |
83 | - </button> | |
84 | - <button | |
85 | - type="button" | |
86 | - class="btn btn-sm p-1 float-right btn-secondary mr-2" | |
87 | - title="Ver lista precio" | |
88 | - ng-click="verListaPrecio(precioCondicion.idListaPrecio)" | |
89 | - > | |
90 | - <i class="fa fa-eye" aria-hidden="true"></i> | |
91 | - </button> | |
92 | - </td> | |
93 | - </tr> | |
94 | - </tbody> | |
95 | - </table> | |
96 | - | |
97 | - <table class="table table-striped table-sm" ng-show="ingreso"> | |
98 | - <thead> | |
99 | - <tr> | |
100 | - <th>Item</th> | |
101 | - <th>Días</th> | |
102 | - <th></th> | |
103 | - </tr> | |
104 | - </thead> | |
105 | - <tbody> | |
106 | - <tr> | |
107 | - <td> | |
108 | - <input | |
109 | - type="number" | |
110 | - class="form-control text-right" | |
111 | - ng-model="plazoACargar.item" | |
112 | - readonly | |
113 | - /> | |
114 | - </td> | |
115 | - <td> | |
116 | - <input | |
117 | - type="number" | |
118 | - class="form-control text-right" | |
119 | - min="0" | |
120 | - ng-model="plazoACargar.dias" | |
121 | - ng-keypress="agregarPlazo($event.keyCode)" | |
122 | - foca-focus="ingreso" | |
123 | - /> | |
124 | - </td> | |
125 | - <td class="text-center"> | |
126 | - <button | |
127 | - class="btn btn-outline-secondary" | |
128 | - title="Agregar" | |
129 | - ng-click="agregarPlazo(13)" | |
130 | - > | |
131 | - <i class="fa fa-save"></i> | |
132 | - </button> | |
133 | - </td> | |
134 | - </tr> | |
135 | - <tr ng-repeat="(key, plazo) in plazosNuevos"> | |
136 | - <td class="text-right" ng-bind="key + 1"></td> | |
137 | - <td class="text-right" ng-bind="plazo.dias"></td> | |
138 | - <td class="text-center"> | |
139 | - <button | |
140 | - class="btn btn-outline-secondary" | |
141 | - title="Eliminar" | |
142 | - ng-click="quitarPlazo(key)" | |
143 | - > | |
144 | - <i class="fa fa-trash"></i> | |
145 | - </button> | |
146 | - </td> | |
147 | - </tr> | |
148 | - </tbody> | |
149 | - </table> | |
9 | + <div ng-show="!ingreso"> | |
10 | + <div class="row" ng-show="listaDePreciosAsociada.length == 0"> | |
11 | + <div class="col"> | |
12 | + No se encontraron resultados. | |
13 | + </div> | |
14 | + </div> | |
15 | + <div class="row px-2"> | |
16 | + <div class="col-lg-6"> | |
17 | + <div class="row border-top py-2"> | |
18 | + <div class="col-lg-9 col-9">Lista asociada al cliente</div> | |
19 | + <div class="col-lg-3 col-3 text-center"> | |
20 | + <button | |
21 | + ng-class="{'btn-primary': associatedList, 'btn-default': !associatedList}" | |
22 | + class="btn btn-sm p-1" | |
23 | + ng-click="selectListaDePrecios(listaDePreciosAsociada)"> | |
24 | + <span class="fa fa-circle-thin"></span> | |
25 | + </button> | |
26 | + </div> | |
27 | + </div> | |
28 | + <div class="row align-items-center pb-2"> | |
29 | + <div class="col-lg-2 col-2 text-center" ng-bind="listaDePreciosAsociada.ID"></div> | |
30 | + <div class="col-lg-7 col-7" ng-bind="listaDePreciosAsociada.DES"></div> | |
31 | + <div class="col-lg-3 col-3 text-center"> | |
32 | + <button ng-click="verListaProductos(listaDePreciosAsociada.ID)" class="btn btn-sm p-1"> | |
33 | + <span class="fa fa-eye"></span> | |
34 | + </button> | |
35 | + </div> | |
36 | + </div> | |
37 | + <div class="row border-top py-2"> | |
38 | + <div class="col-lg-9 col-9">Trabajar con otra lista</div> | |
39 | + <div class="col-lg-3 col-3 text-center"> | |
40 | + <button | |
41 | + ng-class="{'btn-primary': !associatedList, 'btn-default': associatedList}" | |
42 | + class="btn btn-sm btn-default p-1" | |
43 | + ng-click="openListaDePrecios()"> | |
44 | + <span class="fa fa-circle-thin"></span> | |
45 | + </button> | |
46 | + </div> | |
47 | + </div> | |
48 | + <div ng-show="listaDePreciosAlternativa != null" class="row align-items-center pb-1"> | |
49 | + <div class="col-lg-2 col-2 text-center" ng-bind="listaDePreciosAlternativa.ID"></div> | |
50 | + <div class="col-lg-7 col-7" ng-bind="listaDePreciosAlternativa.DES"></div> | |
51 | + <div class="col-lg-3 col-3 text-center"> | |
52 | + <button ng-click="verListaProductos(listaDePreciosAlternativa.ID)" class="btn btn-sm p-1"> | |
53 | + <span class="fa fa-eye"></span> | |
54 | + </button> | |
55 | + </div> | |
56 | + </div> | |
57 | + </div> | |
58 | + <div class="col"> | |
59 | + <div class="row py-1"> | |
60 | + <div class="col text-center font-weight-bold">Plazos</div> | |
61 | + </div> | |
62 | + <div class="row"> | |
63 | + <div class="col"> | |
64 | + <table class="table table-sm table-striped"> | |
65 | + <thead> | |
66 | + <tr> | |
67 | + <th colspan="2">Dias</th> | |
68 | + </tr> | |
69 | + </thead> | |
70 | + <tbody> | |
71 | + <tr ng-repeat="(i, plazo) in plazos" ng-show="plazo.activo"> | |
72 | + <td align="center" ng-class="{'pt-2': i > 0}"> | |
73 | + <span | |
74 | + ng-show="i > 0" | |
75 | + ng-bind="plazo.dias"> | |
76 | + </span> | |
77 | + <input | |
78 | + ng-show="i == 0" | |
79 | + type="text" | |
80 | + class="form-control form-control-sm text-center" | |
81 | + ng-model="plazo.dias" | |
82 | + limite-numeros-max="3" | |
83 | + ng-keyup="validateMinMax(plazo, 0, 365)" | |
84 | + select-on-click | |
85 | + teclado-virtual | |
86 | + foca-tipo-input | |
87 | + solo-positivos> | |
88 | + </td> | |
89 | + <td> | |
90 | + <button | |
91 | + ng-show="i === 0" | |
92 | + class="btn btn-primary" | |
93 | + ng-click="addPlazo()"> | |
94 | + <span class="fa fa-save"></span> | |
95 | + </button> | |
96 | + <button | |
97 | + ng-show="i > 0" | |
98 | + class="btn btn-default" | |
99 | + ng-click="deletePlazo(i)"> | |
100 | + <span class="fa fa-trash"></span> | |
101 | + </button> | |
102 | + </td> | |
103 | + </tr> | |
104 | + </tbody> | |
105 | + </table> | |
106 | + </div> | |
107 | + </div> | |
108 | + </div> | |
109 | + </div> | |
110 | + </div> | |
150 | 111 | </div> |
151 | -<div class="modal-footer py-1"> | |
152 | - <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso" class="mr-auto"> | |
153 | - <ul class="pagination pagination-sm mb-0"> | |
154 | - <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | |
155 | - <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> | |
156 | - <span aria-hidden="true">«</span> | |
157 | - <span class="sr-only">Anterior</span> | |
158 | - </a> | |
159 | - </li> | |
160 | - <li | |
161 | - class="page-item" | |
162 | - ng-repeat="pagina in paginas" | |
163 | - ng-class="{'active': pagina == currentPage}" | |
164 | - > | |
165 | - <a | |
166 | - class="page-link" | |
167 | - href="javascript:void();" | |
168 | - ng-click="selectPage(pagina)" | |
169 | - ng-bind="pagina" | |
170 | - ></a> | |
171 | - </li> | |
172 | - <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | |
173 | - <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> | |
174 | - <span aria-hidden="true">»</span> | |
175 | - <span class="sr-only">Siguiente</span> | |
176 | - </a> | |
177 | - </li> | |
178 | - </ul> | |
179 | - </nav> | |
180 | - <button | |
181 | - ng-show="!ingreso" | |
182 | - class="btn btn-sm btn-secondary" | |
183 | - type="button" | |
184 | - ng-click="cancel()" | |
185 | - >Cancelar | |
186 | - </button> | |
187 | - <button | |
188 | - ng-show="ingreso" | |
189 | - ng-disabled="plazosNuevos.length === 0" | |
190 | - class="btn btn-sm btn-primary" | |
191 | - type="button" | |
192 | - ng-click="select(plazosNuevos)" | |
193 | - >Aceptar | |
112 | +<div class="modal-footer py-2"> | |
113 | + <button class="btn btn-sm btn-secondary" type="button" ng-click="closeModalPrecioCondicion()">Cerrar | |
194 | 114 | </button> |
195 | - <button | |
196 | - ng-show="ingreso" | |
197 | - class="btn btn-sm btn-secondary" | |
198 | - type="button" | |
199 | - ng-click="volver()" | |
200 | - >Volver | |
115 | + <button class="btn btn-sm btn-primary" type="button" ng-click="guardarPrecioCondicion()">Guardar | |
201 | 116 | </button> |
202 | 117 | </div> |