Commit 1d11b89a3fd67c8bb0fa3adb79600bc4661c6612

Authored by Jose Pinto
Exists in master

Merge branch 'master' into 'develop'

Master

See merge request !13
src/js/controller.js
1 angular.module('focaAbmPreciosCondiciones') 1 angular.module('focaAbmPreciosCondiciones')
2 .controller('focaAbmPreciosCondicionesController', [ 2 .controller('focaAbmPreciosCondicionesController', [
3 '$scope', 'focaAbmPreciosCondicionesService', '$location', 3 '$scope', 'focaAbmPreciosCondicionesService', '$location',
4 'focaModalService', 'focaBotoneraLateralService', '$timeout', '$localStorage', 4 'focaModalService', 'focaBotoneraLateralService', '$timeout', '$localStorage',
5 function($scope, focaAbmPreciosCondicionesService, $location, 5 function($scope, focaAbmPreciosCondicionesService, $location,
6 focaModalService, focaBotoneraLateralService, $timeout, $localStorage) { 6 focaModalService, focaBotoneraLateralService, $timeout, $localStorage) {
7 7
8 $timeout(function() { 8 $timeout(function() {
9 focaBotoneraLateralService.showSalir(true); 9 focaBotoneraLateralService.showSalir(true);
10 focaBotoneraLateralService.showPausar(false); 10 focaBotoneraLateralService.showPausar(false);
11 focaBotoneraLateralService.showCancelar(false); 11 focaBotoneraLateralService.showCancelar(false);
12 focaBotoneraLateralService.showGuardar(false); 12 focaBotoneraLateralService.showGuardar(false);
13 }); 13 });
14 14
15 $scope.filters = ''; 15 $scope.filters = '';
16 $scope.now = new Date(); 16 $scope.now = new Date();
17 $scope.editar = function(id) { 17 $scope.editar = function(id) {
18 $location.path('/precio-condicion/' + id); 18 $location.path('/precio-condicion/' + id);
19 }; 19 };
20 $scope.solicitarConfirmacion = function(precioCondicion) { 20 $scope.solicitarConfirmacion = function(precioCondicion) {
21 focaModalService.confirm('¿Está seguro que desea borrar el precio condición' + 21 focaModalService.confirm('¿Está seguro que desea borrar el precio condición' +
22 precioCondicion.codigo + ' ' + precioCondicion.nombre + ' ?').then( 22 precioCondicion.codigo + ' ' + precioCondicion.nombre + ' ?').then(
23 function(data) { 23 function(data) {
24 if (data) { 24 if (data) {
25 focaAbmPreciosCondicionesService 25 focaAbmPreciosCondicionesService
26 .borrarPrecioCondicion(precioCondicion.id); 26 .borrarPrecioCondicion(precioCondicion.id);
27 $scope.preciosCondiciones.splice( 27 $scope.preciosCondiciones.splice(
28 $scope.preciosCondiciones.indexOf(precioCondicion), 1 28 $scope.preciosCondiciones.indexOf(precioCondicion), 1
29 ); 29 );
30 } 30 }
31 } 31 }
32 ); 32 );
33 }; 33 };
34 34
35 $scope.buscar = function(key) { 35 $scope.buscar = function(key) {
36 if(key === 13){ 36 if(key === 13){
37 focaAbmPreciosCondicionesService 37 focaAbmPreciosCondicionesService
38 .obtenerPreciosCondiciones($scope.filters) 38 .obtenerPreciosCondiciones($scope.filters)
39 .then(function(datos) { 39 .then(function(datos) {
40 $scope.preciosCondiciones = datos.data; 40 $scope.preciosCondiciones = datos.data;
41 $scope.preciosCondiciones.forEach(function(precioCondicion) { 41 $scope.preciosCondiciones.forEach(function(precioCondicion) {
42 precioCondicion.plazoPago.sort(function(a, b) { 42 precioCondicion.plazoPago.sort(function(a, b) {
43 return a.dias- b.dias; 43 return a.dias- b.dias;
44 }); 44 });
45 }); 45 });
46 }); 46 });
47 } 47 }
48 }; 48 };
49 49
50 if ($localStorage.precioCondicion) { 50 if ($localStorage.precioCondicion) {
51 var precioCondicion = JSON.parse($localStorage.precioCondicion); 51 var precioCondicion = JSON.parse($localStorage.precioCondicion);
52 if (!precioCondicion.id) { precioCondicion.id = 0; } 52 if (!precioCondicion.id) { precioCondicion.id = 0; }
53 $location.path('/precio-condicion/' + precioCondicion.id); 53 $location.path('/precio-condicion/' + precioCondicion.id);
54 } 54 }
55 } 55 }
56 ]) 56 ])
57 .controller('focaAbmPrecioCondicionController', [ 57 .controller('focaAbmPrecioCondicionController', [
58 '$scope', 'focaAbmPreciosCondicionesService', 'focaBotoneraLateralService', 58 '$scope', 'focaAbmPreciosCondicionesService', 'focaBotoneraLateralService',
59 '$routeParams', '$location', 'focaModalService', '$timeout', '$uibModal', '$window', '$localStorage', '$filter', 59 '$routeParams', '$location', 'focaModalService', '$timeout', '$uibModal', '$window', '$localStorage', '$filter',
60 function( 60 function(
61 $scope, focaAbmPreciosCondicionesService, focaBotoneraLateralService, 61 $scope, focaAbmPreciosCondicionesService, focaBotoneraLateralService,
62 $routeParams, $location, focaModalService, $timeout, $uibModal, $window, $localStorage, $filter) { 62 $routeParams, $location, focaModalService, $timeout, $uibModal, $window, $localStorage, $filter) {
63 $scope.focused = 1; 63 $scope.focused = 1;
64 $scope.plazosAEliminar = []; 64 $scope.plazosAEliminar = [];
65 $scope.mostrarPlazos = $routeParams.id > 0; 65 $scope.mostrarPlazos = $routeParams.id > 0;
66 $scope.now = new Date(); 66 $scope.now = new Date();
67 $scope.listaPrecioLabel = ''; 67 $scope.listaPrecioLabel = '';
68 focaAbmPreciosCondicionesService.obtenerPrecioCondicion($routeParams.id) 68 focaAbmPreciosCondicionesService.obtenerPrecioCondicion($routeParams.id)
69 .then(function(datos) { 69 .then(function(datos) {
70 $scope.precioCondicion = { 70 $scope.precioCondicion = {
71 id: 0, 71 id: 0,
72 codigo: '', 72 codigo: '',
73 nombre: '', 73 nombre: '',
74 descripcion: '', 74 descripcion: '',
75 idListaPrecio: 0, 75 idListaPrecio: 0,
76 vigencia: new Date() 76 vigencia: new Date()
77 }; 77 };
78 if (datos.data.id) { 78 if (datos.data.id) {
79 $scope.precioCondicion = datos.data; 79 $scope.precioCondicion = datos.data;
80 $scope.listaPrecioLabel = datos.data.listaPrecio.ID.trim() + 80 $scope.listaPrecioLabel = datos.data.listaPrecio.ID.trim() +
81 ' - ' + datos.data.listaPrecio.DES; 81 ' - ' + datos.data.listaPrecio.DES;
82 $scope.$broadcast('addCabecera', { 82 $scope.$broadcast('addCabecera', {
83 label: 'Precio y condición:', 83 label: 'Precio y condición:',
84 valor: datos.data.nombre 84 valor: datos.data.nombre
85 }); 85 });
86 focaAbmPreciosCondicionesService.obtenerPlazoPago(datos.data.id) 86 focaAbmPreciosCondicionesService.obtenerPlazoPago(datos.data.id)
87 .then(function(datos) { 87 .then(function(datos) {
88 $scope.precioCondicion.plazos = datos.data; 88 $scope.precioCondicion.plazos = datos.data;
89 $scope.precioCondicion.plazos.sort(function(a, b) { 89 $scope.precioCondicion.plazos.sort(function(a, b) {
90 return a.dias- b.dias; 90 return a.dias- b.dias;
91 }); 91 });
92 $scope.plazoACargar = 92 $scope.plazoACargar =
93 { 93 {
94 item: datos.data.length + 1 94 item: datos.data.length + 1
95 }; 95 };
96 }); 96 });
97 } 97 }
98 }); 98 });
99 99
100 $timeout(function() {getLSPrecioC();}); 100 $timeout(function() {getLSPrecioC();});
101 101
102 $timeout(function() { 102 $timeout(function() {
103 focaBotoneraLateralService.showSalir(false); 103 focaBotoneraLateralService.showSalir(false);
104 focaBotoneraLateralService.showPausar(true); 104 focaBotoneraLateralService.showPausar(true);
105 focaBotoneraLateralService.showCancelar(true); 105 focaBotoneraLateralService.showCancelar(false);
106 focaBotoneraLateralService.showGuardar(true, $scope.guardar); 106 focaBotoneraLateralService.showGuardar(true, $scope.guardar);
107 focaBotoneraLateralService.addCustomButton('Cancelar', $scope.cancelar);
107 }); 108 });
108 109
109 $scope.cancelar = function() { 110 $scope.cancelar = function() {
110 $location.path('/precio-condicion'); 111
112 if ($scope.formPrecioCondicion.$pristine == false) {
113 focaModalService.confirm(
114 '¿Está seguro de que desea salir? Se perderán todos los datos cargados.'
115 ).then(function(data) {
116 if (data) {
117 $location.path('/precio-condicion');
118 }
119 });
120 }
111 }; 121 };
112 $scope.guardar = function() { 122 $scope.guardar = function() {
113 123
114 if (!$scope.precioCondicion.nombre) { 124 if (!$scope.precioCondicion.nombre) {
115 focaModalService.alert('Ingrese nombre'); 125 focaModalService.alert('Ingrese nombre');
116 return; 126 return;
117 } else if (!$scope.precioCondicion.descripcion) { 127 } else if (!$scope.precioCondicion.descripcion) {
118 focaModalService.alert('Ingrese descripcion'); 128 focaModalService.alert('Ingrese descripcion');
119 return; 129 return;
120 } else if (!$scope.precioCondicion.idListaPrecio) { 130 } else if (!$scope.precioCondicion.idListaPrecio) {
121 focaModalService.alert('Seleccione precio'); 131 focaModalService.alert('Seleccione precio');
122 return; 132 return;
123 } 133 }
124 134
125 var promises = []; 135 var promises = [];
126 var precioCondicion = $scope.precioCondicion; 136 var precioCondicion = $scope.precioCondicion;
127 precioCondicion.idListaPrecio = precioCondicion.listaPrecio.ID; 137 precioCondicion.idListaPrecio = precioCondicion.listaPrecio.ID;
128 delete precioCondicion.listaPrecio; 138 delete precioCondicion.listaPrecio;
129 if ($scope.mostrarPlazos) { 139 if ($scope.mostrarPlazos) {
130 promises.push( 140 promises.push(
131 focaAbmPreciosCondicionesService 141 focaAbmPreciosCondicionesService
132 .guardarPlazosPago($scope.precioCondicion.plazos) 142 .guardarPlazosPago($scope.precioCondicion.plazos)
133 ); 143 );
134 $scope.plazosAEliminar.forEach(function(id) { 144 $scope.plazosAEliminar.forEach(function(id) {
135 promises.push( 145 promises.push(
136 focaAbmPreciosCondicionesService 146 focaAbmPreciosCondicionesService
137 .borrarPlazoPago(id) 147 .borrarPlazoPago(id)
138 ); 148 );
139 }); 149 });
140 } 150 }
141 promises.push( 151 promises.push(
142 focaAbmPreciosCondicionesService 152 focaAbmPreciosCondicionesService
143 .guardarPrecioCondicion(precioCondicion) 153 .guardarPrecioCondicion(precioCondicion)
144 ); 154 );
145 155
146 Promise.all(promises).then(function() { 156 Promise.all(promises).then(function() {
147 $timeout(function() { 157 $timeout(function() {
148 $location.path('/precio-condicion'); 158 $location.path('/precio-condicion');
149 }, 0); 159 }, 0);
150 }, function(err){ 160 }, function(err){
151 console.error(err); 161 console.error(err);
152 }); 162 });
153 }; 163 };
154 164
155 $scope.agregarPlazo = function(key) { 165 $scope.agregarPlazo = function(key) {
156 if (key === 13) { 166 if (key === 13) {
157 if (!$scope.plazoACargar.dias && $scope.plazoACargar.dias !== 0) { 167 if (!$scope.plazoACargar.dias && $scope.plazoACargar.dias !== 0) {
158 focaModalService.alert('Ingrese cantidad de días'); 168 focaModalService.alert('Ingrese cantidad de días');
159 return; 169 return;
160 } 170 }
161 var tieneEseDia = $scope.precioCondicion.plazos.filter(function(a) { 171 var tieneEseDia = $scope.precioCondicion.plazos.filter(function(a) {
162 return a.dias === $scope.plazoACargar.dias; 172 return a.dias === $scope.plazoACargar.dias;
163 }); 173 });
164 if (tieneEseDia.length > 0) { 174 if (tieneEseDia.length > 0) {
165 focaModalService.alert('Ya ha ingresado un plazo con esos días'); 175 focaModalService.alert('Ya ha ingresado un plazo con esos días');
166 return; 176 return;
167 } 177 }
168 $scope.plazoACargar.idPreciosCondiciones = $scope.precioCondicion.id; 178 $scope.plazoACargar.idPreciosCondiciones = $scope.precioCondicion.id;
169 $scope.plazoACargar.activo = true; 179 $scope.plazoACargar.activo = true;
170 $scope.precioCondicion.plazos.push($scope.plazoACargar); 180 $scope.precioCondicion.plazos.push($scope.plazoACargar);
171 $scope.plazoACargar = 181 $scope.plazoACargar =
172 { 182 {
173 item: $scope.precioCondicion.plazos.length + 1 183 item: $scope.precioCondicion.plazos.length + 1
174 }; 184 };
175 } 185 }
176 }; 186 };
177 $scope.quitarPlazo = function(key) { 187 $scope.quitarPlazo = function(key) {
178 if ($scope.precioCondicion.plazos[key].id) 188 if ($scope.precioCondicion.plazos[key].id)
179 $scope.plazosAEliminar.push($scope.precioCondicion.plazos[key].id); 189 $scope.plazosAEliminar.push($scope.precioCondicion.plazos[key].id);
180 190
181 $scope.precioCondicion.plazos.splice(key, 1); 191 $scope.precioCondicion.plazos.splice(key, 1);
182 $scope.plazoACargar = 192 $scope.plazoACargar =
183 { 193 {
184 item: $scope.precioCondicion.plazos.length + 1 194 item: $scope.precioCondicion.plazos.length + 1
185 }; 195 };
186 }; 196 };
187 $scope.solicitarConfirmacionPlazoPago = function(plazoPago) { 197 $scope.solicitarConfirmacionPlazoPago = function(plazoPago) {
188 focaModalService.confirm('¿Está seguro que desea borrar el plazo de pago ' + 198 focaModalService.confirm('¿Está seguro que desea borrar el plazo de pago ' +
189 plazoPago.item + ' ' + plazoPago.dias + ' ?').then( 199 plazoPago.item + ' ' + plazoPago.dias + ' ?').then(
190 function(confirm) { 200 function(confirm) {
191 if (confirm) { 201 if (confirm) {
192 focaAbmPreciosCondicionesService.borrarPlazoPago(plazoPago.id); 202 focaAbmPreciosCondicionesService.borrarPlazoPago(plazoPago.id);
193 $scope.precioCondicion.plazos.splice( 203 $scope.precioCondicion.plazos.splice(
194 $scope.precioCondicion.plazos.indexOf(plazoPago), 1 204 $scope.precioCondicion.plazos.indexOf(plazoPago), 1
195 ); 205 );
196 } 206 }
197 } 207 }
198 ); 208 );
199 }; 209 };
200 210
201 $scope.seleccionarListaPrecio = function(key) { 211 $scope.seleccionarListaPrecio = function(key) {
202 if (key === 13){ 212 if (key === 13){
203 var modalInstance = $uibModal.open( 213 var modalInstance = $uibModal.open(
204 { 214 {
205 ariaLabelledBy: 'Busqueda de Listas de precio', 215 ariaLabelledBy: 'Busqueda de Listas de precio',
206 templateUrl: 'modal-lista-precio.html', 216 templateUrl: 'modal-lista-precio.html',
207 controller: 'focaModalListaPrecioCtrl', 217 controller: 'focaModalListaPrecioCtrl',
208 size: 'lg' 218 size: 'lg'
209 } 219 }
210 ); 220 );
211 modalInstance.result.then(function(listaPrecio) { 221 modalInstance.result.then(function(listaPrecio) {
212 $scope.precioCondicion.idListaPrecio = listaPrecio.ID; 222 $scope.precioCondicion.idListaPrecio = listaPrecio.ID;
213 $scope.precioCondicion.listaPrecio = listaPrecio; 223 $scope.precioCondicion.listaPrecio = listaPrecio;
214 $scope.listaPrecioLabel = listaPrecio.ID + ' - ' + listaPrecio.DES; 224 $scope.listaPrecioLabel = listaPrecio.ID + ' - ' + listaPrecio.DES;
215 $scope.focused = 4; 225 $scope.focused = 4;
216 }); 226 });
217 } 227 }
218 }; 228 };
219 229
220 $scope.verProductosListaPrecio = function() { 230 $scope.verProductosListaPrecio = function() {
221 $uibModal.open( 231 $uibModal.open(
222 { 232 {
223 ariaLabelledBy: 'Busqueda de Productos', 233 ariaLabelledBy: 'Busqueda de Productos',
224 templateUrl: 'modal-busqueda-productos.html', 234 templateUrl: 'modal-busqueda-productos.html',
225 controller: 'modalBusquedaProductosCtrl', 235 controller: 'modalBusquedaProductosCtrl',
226 resolve: { 236 resolve: {
227 parametroProducto: { 237 parametroProducto: {
228 idLista: $scope.precioCondicion.listaPrecio.ID, 238 idLista: $scope.precioCondicion.listaPrecio.ID,
229 cotizacion: 1, 239 cotizacion: 1,
230 simbolo: '$', 240 simbolo: '$',
231 soloMostrar: true 241 soloMostrar: true
232 } 242 }
233 }, 243 },
234 size: 'md' 244 size: 'md'
235 } 245 }
236 ); 246 );
237 }; 247 };
238 248
239 $scope.next = function(key) { 249 $scope.next = function(key) {
240 if (key === 13) $scope.focused++; 250 if (key === 13) $scope.focused++;
241 }; 251 };
242 252
243 //watch 253 //watch
244 $scope.$watch('precioCondicion', function(newValue) { 254 $scope.$watch('precioCondicion', function(newValue) {
245 focaBotoneraLateralService.setPausarData({ 255 focaBotoneraLateralService.setPausarData({
246 label: 'precioCondicion', 256 label: 'precioCondicion',
247 val: newValue 257 val: newValue
248 }); 258 });
249 }, true); 259 }, true);
250 260
251 function setearPrecioCondicion(precioCondicion) { 261 function setearPrecioCondicion(precioCondicion) {
252 $scope.precioCondicion = precioCondicion; 262 $scope.precioCondicion = precioCondicion;
253 $scope.$broadcast('addCabecera', { 263 $scope.$broadcast('addCabecera', {
254 label: 'Precio y Condicion:', 264 label: 'Precio y Condicion:',
255 valor: $filter('rellenarDigitos')(precioCondicion.id) 265 valor: $filter('rellenarDigitos')(precioCondicion.id)
256 }); 266 });
257 } 267 }
258 268
259 function getLSPrecioC() { 269 function getLSPrecioC() {
260 var precioCondicion = JSON.parse($localStorage.precioCondicion || null); 270 var precioCondicion = JSON.parse($localStorage.precioCondicion || null);
261 271
262 if (precioCondicion) { 272 if (precioCondicion) {
263 setearPrecioCondicion(precioCondicion); 273 setearPrecioCondicion(precioCondicion);
264 delete $localStorage.precioCondicion; 274 delete $localStorage.precioCondicion;
265 } 275 }
266 } 276 }
267 } 277 }
268 ]); 278 ]);
269 279
src/views/foca-abm-precios-condiciones-item.html
1 <div class="row"> 1 <div class="row">
2 <foca-cabecera-facturador 2 <foca-cabecera-facturador
3 titulo="'Precios y condiciones'" 3 titulo="'Precios y condiciones'"
4 fecha="now" 4 fecha="now"
5 class="mb-0 col-lg-12" 5 class="mb-0 col-lg-12"
6 ></foca-cabecera-facturador> 6 ></foca-cabecera-facturador>
7 </div> 7 </div>
8 <div class="row"> 8 <div class="row">
9 <form class="col-md-10"> 9 <form class= "col-md-10" name="formPrecioCondicion">
10 <input type="hidden" name="id" ng-model="precioCondicion.id" /> 10 <input type="hidden" name="id" ng-model="precioCondicion.id" />
11 <div class="row mb-3"> 11 <div class="row mb-3">
12 <label class="col-sm-2 col-form-label">Código</label> 12 <label class="col-sm-2 col-form-label">Código</label>
13 <input 13 <input
14 class="form-control col-sm-4" 14 class="form-control col-sm-4"
15 type="text" 15 type="text"
16 name="codigo" 16 name="codigo"
17 ng-value="precioCondicion.id | rellenarDigitos: 4: 0" 17 ng-value="precioCondicion.id | rellenarDigitos: 4: 0"
18 autocomplete="off" 18 autocomplete="off"
19 readonly 19 readonly
20 /> 20 />
21 <label class="col-sm-2 col-form-label">Nombre</label> 21 <label class="col-sm-2 col-form-label">Nombre</label>
22 <input 22 <input
23 class="form-control col-sm-4" 23 class="form-control col-sm-4"
24 type="text" 24 type="text"
25 name="nombre" 25 name="nombre"
26 ng-model="precioCondicion.nombre" 26 ng-model="precioCondicion.nombre"
27 autocomplete="off" 27 autocomplete="off"
28 foca-focus="focused == 1" 28 foca-focus="focused == 1"
29 ng-focus="focused = 1" 29 ng-focus="focused = 1"
30 ng-keypress="next($event.keyCode)" 30 ng-keypress="next($event.keyCode)"
31 teclado-virtual 31 teclado-virtual
32 /> 32 />
33 </div> 33 </div>
34 <div class="form-group row"> 34 <div class="form-group row">
35 <label class="col-sm-2 col-form-label">Descripción</label> 35 <label class="col-sm-2 col-form-label">Descripción</label>
36 <input 36 <input
37 class="form-control col-sm-10" 37 class="form-control col-sm-10"
38 type="text" 38 type="text"
39 name="nombre" 39 name="nombre"
40 ng-model="precioCondicion.descripcion" 40 ng-model="precioCondicion.descripcion"
41 autocomplete="off" 41 autocomplete="off"
42 foca-focus="focused == 2" 42 foca-focus="focused == 2"
43 ng-focus="focused = 2" 43 ng-focus="focused = 2"
44 ng-keypress="next($event.keyCode)" 44 ng-keypress="next($event.keyCode)"
45 teclado-virtual 45 teclado-virtual
46 /> 46 />
47 </div> 47 </div>
48 <div class="row"> 48 <div class="row">
49 <label class="col-sm-2 col-form-label">Lista de precios</label> 49 <label class="col-sm-2 col-form-label">Lista de precios</label>
50 <div class="col-sm-4 input-group p-0"> 50 <div class="col-sm-4 input-group p-0">
51 <input 51 <input
52 ng-model="listaPrecioLabel" 52 ng-model="listaPrecioLabel"
53 class="form-control" 53 class="form-control"
54 foca-focus="focused == 3" 54 foca-focus="focused == 3"
55 ng-focus="focused = 3" 55 ng-focus="focused = 3"
56 ng-keypress="seleccionarListaPrecio($event.keyCode)" 56 ng-keypress="seleccionarListaPrecio($event.keyCode)"
57 readonly 57 readonly
58 /> 58 />
59 <div class="input-group-append"> 59 <div class="input-group-append">
60 <button 60 <button
61 class="btn btn-outline-secondary form-control" 61 class="btn btn-outline-secondary form-control"
62 title="Ver productos" 62 title="Ver productos"
63 type="button" 63 type="button"
64 ng-click="verProductosListaPrecio()" 64 ng-click="verProductosListaPrecio()"
65 ng-show="precioCondicion.listaPrecio" 65 ng-show="precioCondicion.listaPrecio"
66 > 66 >
67 <i class="fa fa-eye" aria-hidden="true"></i> 67 <i class="fa fa-eye" aria-hidden="true"></i>
68 </button> 68 </button>
69 <button 69 <button
70 ladda="searchLoading" 70 ladda="searchLoading"
71 class="btn btn-outline-secondary form-control" 71 class="btn btn-outline-secondary form-control"
72 title="Buscar" 72 title="Buscar"
73 type="button" 73 type="button"
74 ng-click="seleccionarListaPrecio(13)" 74 ng-click="seleccionarListaPrecio(13)"
75 > 75 >
76 <i class="fa fa-search" aria-hidden="true"></i> 76 <i class="fa fa-search" aria-hidden="true"></i>
77 </button> 77 </button>
78 </div> 78 </div>
79 </div> 79 </div>
80 <label class="col-sm-2 col-form-label" ng-show="mostrarPlazos">Plazos</label> 80 <label class="col-sm-2 col-form-label" ng-show="mostrarPlazos">Plazos</label>
81 <div class="col-sm-4 p-0" ng-show="mostrarPlazos"> 81 <div class="col-sm-4 p-0" ng-show="mostrarPlazos">
82 <div class="input-group p-0"> 82 <div class="input-group p-0">
83 <input 83 <input
84 type="number" 84 type="number"
85 class="form-control text-right" 85 class="form-control text-right"
86 min="0" 86 min="0"
87 ng-model="plazoACargar.dias" 87 ng-model="plazoACargar.dias"
88 ng-keypress="agregarPlazo($event.keyCode)" 88 ng-keypress="agregarPlazo($event.keyCode)"
89 foca-focus="focused == 4" 89 foca-focus="focused == 4"
90 ng-focus="focused = 4" 90 ng-focus="focused = 4"
91 placeholder="Días" 91 placeholder="Días"
92 /> 92 />
93 <div class="input-group-append"> 93 <div class="input-group-append">
94 <button 94 <button
95 class="btn btn-outline-secondary form-control" 95 class="btn btn-outline-secondary form-control"
96 title="Agregar" 96 title="Agregar"
97 type="button" 97 type="button"
98 ng-click="agregarPlazo(13)" 98 ng-click="agregarPlazo(13)"
99 > 99 >
100 <i class="fa fa-save" aria-hidden="true"></i> 100 <i class="fa fa-save" aria-hidden="true"></i>
101 </button> 101 </button>
102 </div> 102 </div>
103 </div> 103 </div>
104 <table class="table table-striped table-sm"> 104 <table class="table table-striped table-sm">
105 <tbody> 105 <tbody>
106 <tr ng-repeat="(key, plazo) in precioCondicion.plazos"> 106 <tr ng-repeat="(key, plazo) in precioCondicion.plazos">
107 <td class="text-right" > 107 <td class="text-right" >
108 <span ng-bind="plazo.dias + ' días'"></span> 108 <span ng-bind="plazo.dias + ' días'"></span>
109 <button 109 <button
110 type="button" 110 type="button"
111 title="Eliminar" 111 title="Eliminar"
112 class="btn btn-outline-secondary ml-1" 112 class="btn btn-outline-secondary ml-1"
113 ng-click="quitarPlazo(key)" 113 ng-click="quitarPlazo(key)"
114 > 114 >
115 <i class="fa fa-trash"></i> 115 <i class="fa fa-trash"></i>
116 </button> 116 </button>
117 </td> 117 </td>
118 </tr> 118 </tr>
119 </tbody> 119 </tbody>
120 </table> 120 </table>
121 </div> 121 </div>
122 </div> 122 </div>
123 </form> 123 </form>
124 </div> 124 </div>
125 125