Commit f2b06cf51095e10b890df48f18fe8ab295640309
1 parent
e768070ce7
Exists in
master
no busca por defecto, form enter proximo campo
Showing
4 changed files
with
54 additions
and
31 deletions
Show diff stats
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', | 4 | 'focaModalService', 'focaBotoneraLateralService', '$timeout', |
5 | function($scope, focaAbmPreciosCondicionesService, $location, | 5 | function($scope, focaAbmPreciosCondicionesService, $location, |
6 | focaModalService, focaBotoneraLateralService, $timeout) { | 6 | focaModalService, focaBotoneraLateralService, $timeout) { |
7 | focaAbmPreciosCondicionesService.obtenerPreciosCondiciones().then(function(datos) { | ||
8 | $scope.preciosCondiciones = datos.data; | ||
9 | $scope.preciosCondiciones.forEach(function(precioCondicion) { | ||
10 | precioCondicion.plazoPago.sort(function(a, b) { | ||
11 | return a.dias- b.dias; | ||
12 | }); | ||
13 | }); | ||
14 | }); | ||
15 | 7 | ||
16 | $timeout(function() { | 8 | $timeout(function() { |
17 | focaBotoneraLateralService.showSalir(true); | 9 | focaBotoneraLateralService.showSalir(true); |
18 | focaBotoneraLateralService.showPausar(false); | 10 | focaBotoneraLateralService.showPausar(false); |
19 | focaBotoneraLateralService.showCancelar(false); | 11 | focaBotoneraLateralService.showCancelar(false); |
20 | focaBotoneraLateralService.showGuardar(false); | 12 | focaBotoneraLateralService.showGuardar(false); |
21 | }); | 13 | }); |
22 | 14 | $scope.filters = ''; | |
23 | $scope.now = new Date(); | 15 | $scope.now = new Date(); |
24 | $scope.editar = function(id) { | 16 | $scope.editar = function(id) { |
25 | $location.path('/precio-condicion/' + id); | 17 | $location.path('/precio-condicion/' + id); |
26 | }; | 18 | }; |
27 | $scope.solicitarConfirmacion = function(precioCondicion) { | 19 | $scope.solicitarConfirmacion = function(precioCondicion) { |
28 | focaModalService.confirm('¿Está seguro que desea borrar el precio condición' + | 20 | focaModalService.confirm('¿Está seguro que desea borrar el precio condición' + |
29 | precioCondicion.codigo + ' ' + precioCondicion.nombre + ' ?').then( | 21 | precioCondicion.codigo + ' ' + precioCondicion.nombre + ' ?').then( |
30 | function(data) { | 22 | function(data) { |
31 | if (data) { | 23 | if (data) { |
32 | focaAbmPreciosCondicionesService | 24 | focaAbmPreciosCondicionesService |
33 | .borrarPrecioCondicion(precioCondicion.id); | 25 | .borrarPrecioCondicion(precioCondicion.id); |
34 | $scope.preciosCondiciones.splice( | 26 | $scope.preciosCondiciones.splice( |
35 | $scope.preciosCondiciones.indexOf(precioCondicion), 1 | 27 | $scope.preciosCondiciones.indexOf(precioCondicion), 1 |
36 | ); | 28 | ); |
37 | } | 29 | } |
38 | } | 30 | } |
39 | ); | 31 | ); |
40 | }; | 32 | }; |
33 | |||
34 | $scope.buscar = function(key) { | ||
35 | if(key === 13){ | ||
36 | focaAbmPreciosCondicionesService | ||
37 | .obtenerPreciosCondiciones($scope.filters) | ||
38 | .then(function(datos) { | ||
39 | $scope.preciosCondiciones = datos.data; | ||
40 | $scope.preciosCondiciones.forEach(function(precioCondicion) { | ||
41 | precioCondicion.plazoPago.sort(function(a, b) { | ||
42 | return a.dias- b.dias; | ||
43 | }); | ||
44 | }); | ||
45 | }); | ||
46 | } | ||
47 | }; | ||
41 | } | 48 | } |
42 | ]) | 49 | ]) |
43 | .controller('focaAbmPrecioCondicionController', [ | 50 | .controller('focaAbmPrecioCondicionController', [ |
44 | '$scope', 'focaAbmPreciosCondicionesService', 'focaBotoneraLateralService', | 51 | '$scope', 'focaAbmPreciosCondicionesService', 'focaBotoneraLateralService', |
45 | '$routeParams', '$location', 'focaModalService', '$timeout', '$uibModal', '$window', | 52 | '$routeParams', '$location', 'focaModalService', '$timeout', '$uibModal', '$window', |
46 | function( | 53 | function( |
47 | $scope, focaAbmPreciosCondicionesService, focaBotoneraLateralService, | 54 | $scope, focaAbmPreciosCondicionesService, focaBotoneraLateralService, |
48 | $routeParams, $location, focaModalService, $timeout, $uibModal, $window | 55 | $routeParams, $location, focaModalService, $timeout, $uibModal, $window |
49 | ) { | 56 | ) { |
57 | $scope.focused = 1; | ||
50 | $scope.plazosAEliminar = []; | 58 | $scope.plazosAEliminar = []; |
51 | $scope.mostrarPlazos = $routeParams.id > 0; | 59 | $scope.mostrarPlazos = $routeParams.id > 0; |
52 | $scope.now = new Date(); | 60 | $scope.now = new Date(); |
53 | $scope.listaPrecioLabel = ''; | 61 | $scope.listaPrecioLabel = ''; |
54 | focaAbmPreciosCondicionesService.obtenerPrecioCondicion($routeParams.id) | 62 | focaAbmPreciosCondicionesService.obtenerPrecioCondicion($routeParams.id) |
55 | .then(function(datos) { | 63 | .then(function(datos) { |
56 | $scope.precioCondicion = { | 64 | $scope.precioCondicion = { |
57 | id: 0, | 65 | id: 0, |
58 | codigo: '', | 66 | codigo: '', |
59 | nombre: '', | 67 | nombre: '', |
60 | descripcion: '', | 68 | descripcion: '', |
61 | idListaPrecio: 0, | 69 | idListaPrecio: 0, |
62 | vigencia: new Date() | 70 | vigencia: new Date() |
63 | }; | 71 | }; |
64 | if(datos.data.id) { | 72 | if(datos.data.id) { |
65 | $scope.precioCondicion = datos.data; | 73 | $scope.precioCondicion = datos.data; |
66 | $scope.listaPrecioLabel = datos.data.listaPrecio.ID.trim() + | 74 | $scope.listaPrecioLabel = datos.data.listaPrecio.ID.trim() + |
67 | ' - ' + datos.data.listaPrecio.DES; | 75 | ' - ' + datos.data.listaPrecio.DES; |
68 | $scope.$broadcast('addCabecera', { | 76 | $scope.$broadcast('addCabecera', { |
69 | label: 'Precio y condición:', | 77 | label: 'Precio y condición:', |
70 | valor: datos.data.nombre | 78 | valor: datos.data.nombre |
71 | }); | 79 | }); |
72 | focaAbmPreciosCondicionesService.obtenerPlazoPago(datos.data.id) | 80 | focaAbmPreciosCondicionesService.obtenerPlazoPago(datos.data.id) |
73 | .then(function(datos) { | 81 | .then(function(datos) { |
74 | $scope.precioCondicion.plazos = datos.data; | 82 | $scope.precioCondicion.plazos = datos.data; |
75 | $scope.precioCondicion.plazos.sort(function(a, b) { | 83 | $scope.precioCondicion.plazos.sort(function(a, b) { |
76 | return a.dias- b.dias; | 84 | return a.dias- b.dias; |
77 | }); | 85 | }); |
78 | $scope.plazoACargar = | 86 | $scope.plazoACargar = |
79 | { | 87 | { |
80 | item: datos.data.length + 1 | 88 | item: datos.data.length + 1 |
81 | }; | 89 | }; |
82 | }); | 90 | }); |
83 | } | 91 | } |
84 | }); | 92 | }); |
85 | 93 | ||
86 | $timeout(function() { | 94 | $timeout(function() { |
87 | focaBotoneraLateralService.showSalir(false); | 95 | focaBotoneraLateralService.showSalir(false); |
88 | focaBotoneraLateralService.showPausar(true); | 96 | focaBotoneraLateralService.showPausar(true); |
89 | focaBotoneraLateralService.showCancelar(true); | 97 | focaBotoneraLateralService.showCancelar(true); |
90 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); | 98 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); |
91 | }); | 99 | }); |
92 | 100 | ||
93 | $scope.cancelar = function() { | 101 | $scope.cancelar = function() { |
94 | $location.path('/precio-condicion'); | 102 | $location.path('/precio-condicion'); |
95 | }; | 103 | }; |
96 | $scope.guardar = function() { | 104 | $scope.guardar = function() { |
97 | var promises = []; | 105 | var promises = []; |
98 | var precioCondicion = $scope.precioCondicion; | 106 | var precioCondicion = $scope.precioCondicion; |
99 | precioCondicion.idListaPrecio = precioCondicion.listaPrecio.ID; | 107 | precioCondicion.idListaPrecio = precioCondicion.listaPrecio.ID; |
100 | delete precioCondicion.listaPrecio; | 108 | delete precioCondicion.listaPrecio; |
101 | if($scope.mostrarPlazos) { | 109 | if($scope.mostrarPlazos) { |
102 | promises.push( | 110 | promises.push( |
103 | focaAbmPreciosCondicionesService | 111 | focaAbmPreciosCondicionesService |
104 | .guardarPlazosPago($scope.precioCondicion.plazos) | 112 | .guardarPlazosPago($scope.precioCondicion.plazos) |
105 | ); | 113 | ); |
106 | $scope.plazosAEliminar.forEach(function(id) { | 114 | $scope.plazosAEliminar.forEach(function(id) { |
107 | promises.push( | 115 | promises.push( |
108 | focaAbmPreciosCondicionesService | 116 | focaAbmPreciosCondicionesService |
109 | .borrarPlazoPago(id) | 117 | .borrarPlazoPago(id) |
110 | ); | 118 | ); |
111 | }); | 119 | }); |
112 | } | 120 | } |
113 | promises.push( | 121 | promises.push( |
114 | focaAbmPreciosCondicionesService | 122 | focaAbmPreciosCondicionesService |
115 | .guardarPrecioCondicion(precioCondicion) | 123 | .guardarPrecioCondicion(precioCondicion) |
116 | ); | 124 | ); |
117 | 125 | ||
118 | Promise.all(promises).then(function() { | 126 | Promise.all(promises).then(function() { |
119 | $window.location.assign('/#!/precio-condicion'); | 127 | $window.location.assign('/#!/precio-condicion'); |
120 | }, function(err){ | 128 | }, function(err){ |
121 | console.error(err); | 129 | console.error(err); |
122 | }); | 130 | }); |
123 | }; | 131 | }; |
124 | 132 | ||
125 | $scope.agregarPlazo = function(key) { | 133 | $scope.agregarPlazo = function(key) { |
126 | if(key === 13) { | 134 | if(key === 13) { |
127 | if(!$scope.plazoACargar.dias) { | 135 | if(!$scope.plazoACargar.dias) { |
128 | focaModalService.alert('Ingrese cantidad de días'); | 136 | focaModalService.alert('Ingrese cantidad de días'); |
129 | return; | 137 | return; |
130 | } | 138 | } |
131 | var tieneEseDia = $scope.precioCondicion.plazos.filter(function(a) { | 139 | var tieneEseDia = $scope.precioCondicion.plazos.filter(function(a) { |
132 | return a.dias === $scope.plazoACargar.dias; | 140 | return a.dias === $scope.plazoACargar.dias; |
133 | }); | 141 | }); |
134 | if(tieneEseDia.length > 0) { | 142 | if(tieneEseDia.length > 0) { |
135 | focaModalService.alert('Ya ha ingresado un plazo con esos días'); | 143 | focaModalService.alert('Ya ha ingresado un plazo con esos días'); |
136 | return; | 144 | return; |
137 | } | 145 | } |
138 | $scope.plazoACargar.idPreciosCondiciones = $scope.precioCondicion.id; | 146 | $scope.plazoACargar.idPreciosCondiciones = $scope.precioCondicion.id; |
139 | $scope.plazoACargar.activo = true; | 147 | $scope.plazoACargar.activo = true; |
140 | $scope.precioCondicion.plazos.push($scope.plazoACargar); | 148 | $scope.precioCondicion.plazos.push($scope.plazoACargar); |
141 | $scope.plazoACargar = | 149 | $scope.plazoACargar = |
142 | { | 150 | { |
143 | item: $scope.precioCondicion.plazos.length + 1 | 151 | item: $scope.precioCondicion.plazos.length + 1 |
144 | }; | 152 | }; |
145 | } | 153 | } |
146 | }; | 154 | }; |
147 | $scope.quitarPlazo = function(key) { | 155 | $scope.quitarPlazo = function(key) { |
148 | if($scope.precioCondicion.plazos[key].id) | 156 | if($scope.precioCondicion.plazos[key].id) |
149 | $scope.plazosAEliminar.push($scope.precioCondicion.plazos[key].id); | 157 | $scope.plazosAEliminar.push($scope.precioCondicion.plazos[key].id); |
150 | 158 | ||
151 | $scope.precioCondicion.plazos.splice(key, 1); | 159 | $scope.precioCondicion.plazos.splice(key, 1); |
152 | $scope.plazoACargar = | 160 | $scope.plazoACargar = |
153 | { | 161 | { |
154 | item: $scope.precioCondicion.plazos.length + 1 | 162 | item: $scope.precioCondicion.plazos.length + 1 |
155 | }; | 163 | }; |
156 | }; | 164 | }; |
157 | $scope.solicitarConfirmacionPlazoPago = function(plazoPago) { | 165 | $scope.solicitarConfirmacionPlazoPago = function(plazoPago) { |
158 | focaModalService.confirm('¿Está seguro que desea borrar el plazo de pago ' + | 166 | focaModalService.confirm('¿Está seguro que desea borrar el plazo de pago ' + |
159 | plazoPago.item + ' ' + plazoPago.dias + ' ?').then( | 167 | plazoPago.item + ' ' + plazoPago.dias + ' ?').then( |
160 | function(confirm) { | 168 | function(confirm) { |
161 | if (confirm) { | 169 | if (confirm) { |
162 | focaAbmPreciosCondicionesService.borrarPlazoPago(plazoPago.id); | 170 | focaAbmPreciosCondicionesService.borrarPlazoPago(plazoPago.id); |
163 | $scope.precioCondicion.plazos.splice( | 171 | $scope.precioCondicion.plazos.splice( |
164 | $scope.precioCondicion.plazos.indexOf(plazoPago), 1 | 172 | $scope.precioCondicion.plazos.indexOf(plazoPago), 1 |
165 | ); | 173 | ); |
166 | } | 174 | } |
167 | } | 175 | } |
168 | ); | 176 | ); |
169 | }; | 177 | }; |
170 | 178 | ||
171 | $scope.seleccionarListaPrecio = function() { | 179 | $scope.seleccionarListaPrecio = function(key) { |
172 | var modalInstance = $uibModal.open( | 180 | if(key === 13){ |
173 | { | 181 | var modalInstance = $uibModal.open( |
174 | ariaLabelledBy: 'Busqueda de Listas de precio', | 182 | { |
175 | templateUrl: 'modal-lista-precio.html', | 183 | ariaLabelledBy: 'Busqueda de Listas de precio', |
176 | controller: 'focaModalListaPrecioCtrl', | 184 | templateUrl: 'modal-lista-precio.html', |
177 | size: 'lg' | 185 | controller: 'focaModalListaPrecioCtrl', |
178 | } | 186 | size: 'lg' |
179 | ); | 187 | } |
180 | modalInstance.result.then(function(listaPrecio) { | 188 | ); |
181 | $scope.precioCondicion.listaPrecio = listaPrecio; | 189 | modalInstance.result.then(function(listaPrecio) { |
182 | $scope.listaPrecioLabel = listaPrecio.ID + ' - ' + listaPrecio.DES; | 190 | $scope.precioCondicion.listaPrecio = listaPrecio; |
183 | }); | 191 | $scope.listaPrecioLabel = listaPrecio.ID + ' - ' + listaPrecio.DES; |
192 | $scope.focused = 4; | ||
193 | }); | ||
194 | } |
src/js/service.js
1 | angular.module('focaAbmPreciosCondiciones') | 1 | angular.module('focaAbmPreciosCondiciones') |
2 | .service('focaAbmPreciosCondicionesService', [ | 2 | .service('focaAbmPreciosCondicionesService', [ |
3 | '$http', 'API_ENDPOINT', | 3 | '$http', 'API_ENDPOINT', |
4 | function($http, API_ENDPOINT) { | 4 | function($http, API_ENDPOINT) { |
5 | return { | 5 | return { |
6 | obtenerPreciosCondiciones: function() { | 6 | obtenerPreciosCondiciones: function(nombre) { |
7 | return $http.get(API_ENDPOINT.URL + '/precio-condicion'); | 7 | return $http.post(API_ENDPOINT.URL + '/precios-condiciones', {nombre: nombre}); |
8 | }, | 8 | }, |
9 | obtenerPrecioCondicion: function(id) { | 9 | obtenerPrecioCondicion: function(id) { |
10 | return $http.get(API_ENDPOINT.URL + '/precio-condicion/' + id); | 10 | return $http.get(API_ENDPOINT.URL + '/precio-condicion/' + id); |
11 | }, | 11 | }, |
12 | guardarPrecioCondicion: function(precioCondicion) { | 12 | guardarPrecioCondicion: function(precioCondicion) { |
13 | return $http.post( | 13 | return $http.post( |
14 | API_ENDPOINT.URL + '/precio-condicion', | 14 | API_ENDPOINT.URL + '/precio-condicion', |
15 | {precioCondicion: precioCondicion} | 15 | {precioCondicion: precioCondicion} |
16 | ); | 16 | ); |
17 | }, | 17 | }, |
18 | borrarPrecioCondicion: function(id) { | 18 | borrarPrecioCondicion: function(id) { |
19 | return $http.delete(API_ENDPOINT.URL + '/precio-condicion/' + id); | 19 | return $http.delete(API_ENDPOINT.URL + '/precio-condicion/' + id); |
20 | }, | 20 | }, |
21 | obtenerPlazoPago: function(idPrecioCondicion) { | 21 | obtenerPlazoPago: function(idPrecioCondicion) { |
22 | return $http.get( | 22 | return $http.get( |
23 | API_ENDPOINT.URL + '/plazo-pago/precio-condicion/' + idPrecioCondicion | 23 | API_ENDPOINT.URL + '/plazo-pago/precio-condicion/' + idPrecioCondicion |
24 | ); | 24 | ); |
25 | }, | 25 | }, |
26 | borrarPlazoPago: function(id) { | 26 | borrarPlazoPago: function(id) { |
27 | return $http.delete(API_ENDPOINT.URL + '/plazo-pago/' + id); | 27 | return $http.delete(API_ENDPOINT.URL + '/plazo-pago/' + id); |
28 | }, | 28 | }, |
29 | guardarPlazosPago: function(plazos){ | 29 | guardarPlazosPago: function(plazos){ |
30 | return $http.post( | 30 | return $http.post( |
31 | API_ENDPOINT.URL + '/plazos-pago', | 31 | API_ENDPOINT.URL + '/plazos-pago', |
32 | {plazosPago: plazos} | 32 | {plazosPago: plazos} |
33 | ); | 33 | ); |
34 | } | 34 | } |
35 | }; | 35 | }; |
36 | } | 36 | } |
37 | ]); | 37 | ]); |
38 | 38 |
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"> |
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" | ||
29 | ng-focus="focused = 1" | ||
30 | ng-keypress="next($event.keyCode)" | ||
28 | teclado-virtual | 31 | teclado-virtual |
29 | /> | 32 | /> |
30 | </div> | 33 | </div> |
31 | <div class="form-group row"> | 34 | <div class="form-group row"> |
32 | <label class="col-sm-2 col-form-label">Descripción</label> | 35 | <label class="col-sm-2 col-form-label">Descripción</label> |
33 | <input | 36 | <input |
34 | class="form-control col-sm-10" | 37 | class="form-control col-sm-10" |
35 | type="text" | 38 | type="text" |
36 | name="nombre" | 39 | name="nombre" |
37 | ng-model="precioCondicion.descripcion" | 40 | ng-model="precioCondicion.descripcion" |
38 | autocomplete="off" | 41 | autocomplete="off" |
42 | foca-focus="focused == 2" | ||
43 | ng-focus="focused = 2" | ||
44 | ng-keypress="next($event.keyCode)" | ||
39 | teclado-virtual | 45 | teclado-virtual |
40 | /> | 46 | /> |
41 | </div> | 47 | </div> |
42 | <div class="row"> | 48 | <div class="row"> |
43 | <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> |
44 | <div class="col-sm-4 input-group p-0"> | 50 | <div class="col-sm-4 input-group p-0"> |
45 | <input | 51 | <input |
46 | ng-model="listaPrecioLabel" | 52 | ng-model="listaPrecioLabel" |
47 | class="form-control" | 53 | class="form-control" |
54 | foca-focus="focused == 3" | ||
55 | ng-focus="focused = 3" | ||
56 | ng-keypress="seleccionarListaPrecio($event.keyCode)" | ||
48 | readonly | 57 | readonly |
49 | /> | 58 | /> |
50 | <div class="input-group-append"> | 59 | <div class="input-group-append"> |
51 | <button | 60 | <button |
52 | ladda="searchLoading" | 61 | ladda="searchLoading" |
53 | class="btn btn-outline-secondary form-control" | 62 | class="btn btn-outline-secondary form-control" |
54 | title="Buscar" | 63 | title="Buscar" |
55 | type="button" | 64 | type="button" |
56 | ng-click="seleccionarListaPrecio()" | 65 | ng-click="seleccionarListaPrecio(13)" |
57 | foca-focus="focused == 3" | ||
58 | > | 66 | > |
59 | <i class="fa fa-search" aria-hidden="true"></i> | 67 | <i class="fa fa-search" aria-hidden="true"></i> |
60 | </button> | 68 | </button> |
61 | </div> | 69 | </div> |
62 | </div> | 70 | </div> |
63 | <label class="col-sm-2 col-form-label" ng-show="mostrarPlazos">Plazos</label> | 71 | <label class="col-sm-2 col-form-label" ng-show="mostrarPlazos">Plazos</label> |
64 | <div class="col-sm-4 p-0" ng-show="mostrarPlazos"> | 72 | <div class="col-sm-4 p-0" ng-show="mostrarPlazos"> |
65 | <div class="input-group p-0"> | 73 | <div class="input-group p-0"> |
66 | <input | 74 | <input |
67 | type="number" | 75 | type="number" |
68 | class="form-control text-right" | 76 | class="form-control text-right" |
69 | min="0" | 77 | min="0" |
70 | ng-model="plazoACargar.dias" | 78 | ng-model="plazoACargar.dias" |
71 | ng-keypress="agregarPlazo($event.keyCode)" | 79 | ng-keypress="agregarPlazo($event.keyCode)" |
72 | foca-focus="ingreso" | 80 | foca-focus="focused == 4" |
81 | ng-focus="focused = 4" | ||
73 | placeholder="Días" | 82 | placeholder="Días" |
74 | /> | 83 | /> |
75 | <div class="input-group-append"> | 84 | <div class="input-group-append"> |
76 | <button | 85 | <button |
77 | class="btn btn-outline-secondary form-control" | 86 | class="btn btn-outline-secondary form-control" |
78 | title="Agregar" | 87 | title="Agregar" |
79 | type="button" | 88 | type="button" |
80 | ng-click="agregarPlazo(13)" | 89 | ng-click="agregarPlazo(13)" |
81 | foca-focus="focused == 3" | ||
82 | > | 90 | > |
83 | <i class="fa fa-save" aria-hidden="true"></i> | 91 | <i class="fa fa-save" aria-hidden="true"></i> |
84 | </button> | 92 | </button> |
85 | </div> | 93 | </div> |
86 | </div> | 94 | </div> |
87 | <table class="table table-striped table-sm"> | 95 | <table class="table table-striped table-sm"> |
88 | <tbody> | 96 | <tbody> |
89 | <tr ng-repeat="(key, plazo) in precioCondicion.plazos"> | 97 | <tr ng-repeat="(key, plazo) in precioCondicion.plazos"> |
90 | <td class="text-right" > | 98 | <td class="text-right" > |
91 | <span ng-bind="plazo.dias + ' días'"></span> | 99 | <span ng-bind="plazo.dias + ' días'"></span> |
92 | <button | 100 | <button |
93 | type="button" | 101 | type="button" |
94 | title="Eliminar" | 102 | title="Eliminar" |
95 | class="btn btn-outline-secondary ml-1" | 103 | class="btn btn-outline-secondary ml-1" |
96 | ng-click="quitarPlazo(key)" | 104 | ng-click="quitarPlazo(key)" |
97 | > | 105 | > |
98 | <i class="fa fa-trash"></i> | 106 | <i class="fa fa-trash"></i> |
99 | </button> | 107 | </button> |
100 | </td> | 108 | </td> |
101 | </tr> | 109 | </tr> |
102 | </tbody> | 110 | </tbody> |
103 | </table> | 111 | </table> |
104 | </div> | 112 | </div> |
105 | </div> | 113 | </div> |
106 | </form> | 114 | </form> |
src/views/foca-abm-precios-condiciones-listado.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 | <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> | 9 | <div class="col-12 col-md-10 p-0 mt-4 border border-white rounded"> |
10 | <div class="form-group input-group mt-3 px-5"> | 10 | <div class="form-group input-group mt-3 px-5"> |
11 | <input | 11 | <input |
12 | type="text" | 12 | type="text" |
13 | class="form-control form-control-sm" | 13 | class="form-control form-control-sm" |
14 | id="search" | 14 | id="search" |
15 | placeholder="Búsqueda" | 15 | placeholder="Búsqueda" |
16 | teclado-virtual | 16 | teclado-virtual |
17 | ng-keypress="busquedaPress($event.keyCode)" | 17 | ng-keypress="buscar($event.keyCode)" |
18 | ng-model="filters" | 18 | ng-model="filters" |
19 | /> | 19 | /> |
20 | <div class="input-group-append"> | 20 | <div class="input-group-append"> |
21 | <button | 21 | <button |
22 | ladda="searchLoading" | 22 | ladda="searchLoading" |
23 | class="btn btn-outline-secondary" | 23 | class="btn btn-outline-secondary" |
24 | type="button" | 24 | type="button" |
25 | ng-click="busquedaPress(13)" | 25 | ng-click="buscar(13)" |
26 | > | 26 | > |
27 | <i class="fa fa-search" aria-hidden="true"></i> | 27 | <i class="fa fa-search" aria-hidden="true"></i> |
28 | </button> | 28 | </button> |
29 | </div> | 29 | </div> |
30 | </div> | 30 | </div> |
31 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> | 31 | <table class="table table-default table-hover table-sm table-abm table-striped mb-0"> |
32 | <thead> | 32 | <thead> |
33 | <tr> | 33 | <tr> |
34 | <th>Código</th> | 34 | <th>Código</th> |
35 | <th>Nombre</th> | 35 | <th>Nombre</th> |
36 | <th>Lista de precio</th> | 36 | <th>Lista de precio</th> |
37 | <th>Plazos</th> | 37 | <th>Plazos</th> |
38 | <th colspan="2" class="text-center"> | 38 | <th colspan="2" class="text-center"> |
39 | <button | 39 | <button |
40 | title="Agregar" | 40 | title="Agregar" |
41 | class="btn btn-outline-debo boton-accion" | 41 | class="btn btn-outline-debo boton-accion" |
42 | ng-click="editar(0)"> | 42 | ng-click="editar(0)"> |
43 | <i class="fa fa-plus"></i> | 43 | <i class="fa fa-plus"></i> |
44 | </button> | 44 | </button> |
45 | </th> | 45 | </th> |
46 | </tr> | 46 | </tr> |
47 | </thead> | 47 | </thead> |
48 | <tbody> | 48 | <tbody> |
49 | <tr ng-repeat="precioCondicion in preciosCondiciones | filter: filters"> | 49 | <tr ng-repeat="precioCondicion in preciosCondiciones"> |
50 | <td ng-bind="precioCondicion.id | rellenarDigitos: 4: 0"></td> | 50 | <td ng-bind="precioCondicion.id | rellenarDigitos: 4: 0"></td> |
51 | <td ng-bind="precioCondicion.nombre"></td> | 51 | <td ng-bind="precioCondicion.nombre"></td> |
52 | <td ng-bind="precioCondicion.listaPrecio.ID + ' - ' + precioCondicion.listaPrecio.DES + ' - ' + precioCondicion.listaPrecio.moneda.DETALLE"></td> | 52 | <td ng-bind="precioCondicion.listaPrecio.ID + ' - ' + precioCondicion.listaPrecio.DES + ' - ' + precioCondicion.listaPrecio.moneda.DETALLE"></td> |
53 | <td><span | 53 | <td><span |
54 | ng-repeat="plazo in precioCondicion.plazoPago" | 54 | ng-repeat="plazo in precioCondicion.plazoPago" |
55 | ng-if="plazo.activo" | 55 | ng-if="plazo.activo" |
56 | ng-bind="$last ? plazo.dias : plazo.dias + ', '"></span></td> | 56 | ng-bind="$last ? plazo.dias : plazo.dias + ', '"></span></td> |
57 | <td class="text-center"> | 57 | <td class="text-center"> |
58 | <button | 58 | <button |
59 | title="Editar" | 59 | title="Editar" |
60 | class="btn btn-outline-dark boton-accion" | 60 | class="btn btn-outline-dark boton-accion" |
61 | ng-click="editar(precioCondicion.id)"> | 61 | ng-click="editar(precioCondicion.id)"> |
62 | <i class="fa fa-pencil"></i> | 62 | <i class="fa fa-pencil"></i> |
63 | </button> | 63 | </button> |
64 | <button | 64 | <button |
65 | title="Eliminar" | 65 | title="Eliminar" |
66 | class="btn btn-outline-dark boton-accion" | 66 | class="btn btn-outline-dark boton-accion" |
67 | ng-click="solicitarConfirmacion(precioCondicion)"> | 67 | ng-click="solicitarConfirmacion(precioCondicion)"> |
68 | <i class="fa fa-trash"></i> | 68 | <i class="fa fa-trash"></i> |
69 | </button> | 69 | </button> |
70 | </td> | 70 | </td> |
71 | </tr> | 71 | </tr> |
72 | </tbody> | 72 | </tbody> |
73 | </table> | 73 | </table> |
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | 76 |