Commit fc72e09617d44e1e13e86b503303b3fffafe8721
Exists in
master
and in
1 other branch
Merge branch 'develop' into 'master'
Develop See merge request !16
Showing
7 changed files
Show diff stats
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-modal-precio-condiciones", | 2 | "name": "foca-modal-precio-condiciones", |
| 3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
| 4 | "description": "Modal de búsqueda de precios y condiciones", | 4 | "description": "Modal de búsqueda de precios y condiciones", |
| 5 | "main": "index.js", | 5 | "main": "index.js", |
| 6 | "scripts": { | 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 | "test": "echo \"Error: no test specified\" && exit 1", | 8 | "test": "echo \"Error: no test specified\" && exit 1", |
| 8 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 9 | "compile": "gulp uglify", | 10 | "compile": "gulp uglify", |
| 10 | "postinstall": "npm run compile && gulp clean-post-install", | 11 | "postinstall": "npm run compile && gulp clean-post-install", |
| 11 | "install-dev": "npm install -D angular font-awesome jquery bootstrap ui-bootstrap4 jshint gulp gulp-uglify gulp-concat gulp-htmlmin gulp-rename gulp-uglify gulp-jshint gulp-replace gulp-connect gulp-clean gulp-angular-templatecache git+ssh://git@git.focasoftware.com:npm/foca-directivas.git git+ssh://git@git.focasoftware.com:npm/foca-modal.git" | 12 | "install-dev": "npm install -D angular font-awesome jquery bootstrap ui-bootstrap4 jshint gulp gulp-uglify gulp-concat gulp-htmlmin gulp-rename gulp-uglify gulp-jshint gulp-replace gulp-connect gulp-clean gulp-angular-templatecache git+ssh://git@git.focasoftware.com:npm/foca-directivas.git git+ssh://git@git.focasoftware.com:npm/foca-modal.git" |
| 12 | }, | 13 | }, |
| 13 | "pre-commit": [ | 14 | "pre-commit": [ |
| 14 | "gulp-pre-commit" | 15 | "gulp-pre-commit" |
| 15 | ], | 16 | ], |
| 16 | "repository": { | 17 | "repository": { |
| 17 | "type": "git", | 18 | "type": "git", |
| 18 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git" | 19 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-precio-condiciones.git" |
| 19 | }, | 20 | }, |
| 20 | "author": "Foca Software", | 21 | "author": "Foca Software", |
| 21 | "license": "ISC", | 22 | "license": "ISC", |
| 22 | "devDependencies": { | 23 | "devDependencies": { |
| 23 | "angular": "^1.7.5", | 24 | "angular": "^1.7.5", |
| 24 | "bootstrap": "^4.1.3", | 25 | "bootstrap": "^4.1.3", |
| 25 | "foca-directivas": "git+ssh://git@git.focasoftware.com:npm/foca-directivas.git", | 26 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", |
| 26 | "foca-modal": "git+ssh://git@git.focasoftware.com:npm/foca-modal.git", | 27 | "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git", |
| 27 | "font-awesome": "^4.7.0", | 28 | "font-awesome": "^4.7.0", |
| 28 | "gulp": "^3.9.1", | 29 | "gulp": "^3.9.1", |
| 29 | "gulp-angular-templatecache": "^2.2.2", | 30 | "gulp-angular-templatecache": "^2.2.2", |
| 30 | "gulp-clean": "^0.4.0", | 31 | "gulp-clean": "^0.4.0", |
| 31 | "gulp-concat": "^2.6.1", | 32 | "gulp-concat": "^2.6.1", |
| 32 | "gulp-connect": "^5.6.1", | 33 | "gulp-connect": "^5.6.1", |
| 33 | "gulp-htmlmin": "^5.0.1", | 34 | "gulp-htmlmin": "^5.0.1", |
| 34 | "gulp-jshint": "^2.1.0", | 35 | "gulp-jshint": "^2.1.0", |
| 35 | "gulp-rename": "^1.4.0", | 36 | "gulp-rename": "^1.4.0", |
| 36 | "gulp-replace": "^1.0.0", | 37 | "gulp-replace": "^1.0.0", |
| 37 | "gulp-uglify": "^3.0.1", | 38 | "gulp-uglify": "^3.0.1", |
| 38 | "jquery": "^3.3.1", | 39 | "jquery": "^3.3.1", |
| 39 | "jshint": "^2.9.6", | 40 | "jshint": "^2.9.6", |
| 40 | "pump": "^3.0.0", | 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 | } |
| 44 | 46 |
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 | '$uibModal', | 7 | '$uibModal', |
| 8 | '$uibModalInstance', | 8 | '$uibModalInstance', |
| 9 | 'focaModalService', | 9 | 'focaModalService', |
| 10 | 'focaModalPrecioCondicionService', | 10 | 'focaModalPrecioCondicionService', |
| 11 | 'idListaPrecio', | 11 | 'idListaPrecio', |
| 12 | function( | 12 | 'idCliente', |
| 13 | function ( | ||
| 13 | $timeout, $filter, $scope, $uibModal, $uibModalInstance, | 14 | $timeout, $filter, $scope, $uibModal, $uibModalInstance, |
| 14 | focaModalService, focaModalPrecioCondicionService, idListaPrecio | 15 | focaModalService, focaModalPrecioCondicionService, idListaPrecio, idCliente |
| 15 | ) { | 16 | ) { |
| 16 | 17 | $scope.plazos = [ | |
| 17 | $scope.filters = ''; | 18 | { |
| 18 | $scope.ingreso = false; | 19 | dias: 0, |
| 19 | $scope.plazosNuevos = []; | 20 | idCliente: idCliente, |
| 20 | $scope.plazoACargar = | 21 | activo: true |
| 21 | { | 22 | } |
| 22 | item: 1 | 23 | ]; |
| 23 | }; | 24 | $scope.openModalListaDePrecios = false; |
| 24 | // pagination | 25 | $scope.associatedList = true; |
| 25 | $scope.numPerPage = 10; | 26 | $scope.listaDePreciosAlternativa = null; |
| 26 | $scope.currentPage = 1; | 27 | |
| 27 | $scope.filteredPrecioCondicion = []; | 28 | onInit(); |
| 28 | $scope.currentPagePrecioCondicion = []; | 29 | |
| 29 | $scope.selectedPrecioCondicion = -1; | 30 | function onInit() { |
| 30 | 31 | //Metodo para traer la lista de precio asociada al cliente | |
| 31 | var funcionGet = idListaPrecio ? 'getPreciosCondicionesByIdListaPrecio' : | 32 | focaModalPrecioCondicionService.getListaPrecio(idListaPrecio) |
| 32 | 'getPreciosCondiciones'; | 33 | .then(function (res) { |
| 33 | 34 | $scope.listaDePreciosAsociada = res.data[0]; | |
| 34 | focaModalPrecioCondicionService | 35 | }) |
| 35 | [funcionGet](idListaPrecio) | 36 | .catch(function (e) { console.error(e) }); |
| 36 | .then(function(res) { | 37 | focaModalPrecioCondicionService.getPlazosByIdCliente(idCliente) |
| 37 | for (var i = 0; i < res.data.length; i++) { | 38 | .then(function (res) { |
| 38 | var plazosTemp = ''; | 39 | res.data.forEach(function (item) { |
| 39 | res.data[i].plazoPago.sort(function(a, b) { | 40 | $scope.plazos.push(item); |
| 40 | return a.dias - b.dias; | ||
| 41 | }); | 41 | }); |
| 42 | for (var j = 0; j < res.data[i].plazoPago.length; j++) { | 42 | }) |
| 43 | if (j + 1 === res.data[i].plazoPago.length) { | 43 | .catch(function (e) { console.error(e) }); |
| 44 | plazosTemp += res.data[i].plazoPago[j].dias; | 44 | } |
| 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 | ); | ||
| 99 | 45 | ||
| 100 | if(pressed) { | 46 | //#region Metodos para la lista de precios |
| 101 | if($scope.filteredPrecioCondicion.length === 0) { | 47 | $scope.openListaDePrecios = function () { |
| 102 | $timeout(function() { | 48 | var datos = null; |
| 103 | angular.element('#search')[0].focus(); | 49 | focaModalPrecioCondicionService.getAllListaPrecio() |
| 104 | $scope.filters = ''; | 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 { | 72 | }); |
| 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 | } | ||
| 151 | }; | 73 | }; |
| 152 | 74 | $scope.selectListaDePrecios = function () { | |
| 153 | $scope.itemProducto = function(key) { | 75 | $scope.associatedList = true; |
| 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 | } | ||
| 169 | }; | 76 | }; |
| 170 | 77 | $scope.verListaProductos = function (id) { | |
| 171 | $scope.verListaPrecio = function(id) { | ||
| 172 | $uibModal.open( | 78 | $uibModal.open( |
| 173 | { | 79 | { |
| 174 | ariaLabelledBy: 'Busqueda de Productos', | 80 | ariaLabelledBy: 'Busqueda de Productos', |
| 175 | templateUrl: 'modal-busqueda-productos.html', | 81 | templateUrl: 'modal-busqueda-productos.html', |
| 176 | controller: 'modalBusquedaProductosCtrl', | 82 | controller: 'modalBusquedaProductosCtrl', |
| 177 | resolve: { | 83 | resolve: { |
| 178 | parametroProducto: { | 84 | parametroProducto: { |
| 179 | idLista: id, | 85 | idLista: parseInt(id), |
| 180 | cotizacion: 1, | 86 | cotizacion: 1, |
| 181 | simbolo: '$', | 87 | simbolo: '$', |
| 182 | soloMostrar: true | 88 | soloMostrar: true |
| 183 | } | 89 | } |
| 184 | }, | 90 | }, |
| 185 | size: 'md' | 91 | size: 'md' |
| 186 | } | 92 | } |
| 187 | ); | 93 | ); |
| 188 | }; | 94 | }; |
| 189 | 95 | //#endregion | |
| 190 | function calcularPages(paginaActual) { | 96 | |
| 191 | var paginas = []; | 97 | //#region Metodos para los plazos |
| 192 | paginas.push(paginaActual); | 98 | $scope.addPlazo = function (key) { |
| 193 | 99 | if (key != 13) return; | |
| 194 | if (paginaActual - 1 > 1) { | 100 | if ($scope.plazos.length === 100) return; |
| 195 | 101 | for (var i = 1; i < $scope.plazos.length; i++) { | |
| 196 | paginas.unshift(paginaActual - 1); | 102 | if ($scope.plazos[0].dias == $scope.plazos[i].dias && $scope.plazos[i].activo == true) { |
| 197 | if (paginaActual - 2 > 1) { | 103 | focaModalService.alert("Ya existe un plazo con este valor"); |
| 198 | paginas.unshift(paginaActual - 2); | 104 | return; |
| 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); | ||
| 206 | } | 105 | } |
| 207 | } | 106 | } |
| 208 | 107 | $scope.plazos.unshift({ dias: 0, idCliente: idCliente, activo: true }); | |
| 209 | if (paginaActual !== 1) { | 108 | $scope.focused = 1; |
| 210 | paginas.unshift(1); | 109 | }; |
| 211 | } | 110 | $scope.deletePlazo = function (index) { |
| 212 | 111 | $scope.plazos[index].activo = false; | |
| 213 | if (paginaActual !== $scope.lastPage) { | 112 | }; |
| 214 | paginas.push($scope.lastPage); | 113 | $scope.validateMinMax = function (plazo, min, max) { |
| 215 | } | 114 | plazo.dias = parseInt(plazo.dias); |
| 216 | 115 | if (plazo.dias === null || plazo.dias === undefined || isNaN(plazo.dias)) { | |
| 217 | return paginas; | 116 | plazo.dias = '0'; |
| 218 | } | 117 | return; |
| 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--; | ||
| 229 | } | 118 | } |
| 230 | } | 119 | if (parseInt(plazo.dias) < min) { |
| 231 | 120 | plazo.dias = '0'; | |
| 232 | function siguiente() { | 121 | return; |
| 233 | if ($scope.selectedPrecioCondicion < | ||
| 234 | $scope.currentPagePrecioCondicion.length ) { | ||
| 235 | $scope.selectedPrecioCondicion++; | ||
| 236 | } else { |
src/js/controllerCliente.js
| File was created | 1 | angular.module('focaModalPrecioCondicion') | |
| 2 | .controller('focaModalListaPreciosController', | ||
| 3 | [ | ||
| 4 | '$timeout', | ||
| 5 | '$filter', | ||
| 6 | '$scope', | ||
| 7 | '$uibModal', | ||
| 8 | '$uibModalInstance', | ||
| 9 | 'focaModalService', | ||
| 10 | 'focaModalPrecioCondicionService', | ||
| 11 | 'idListaPrecio', | ||
| 12 | function ( | ||
| 13 | $timeout, $filter, $scope, $uibModal, $uibModalInstance, | ||
| 14 | focaModalService, focaModalPrecioCondicionService, idListaPrecio | ||
| 15 | ) { | ||
| 16 | $scope.openModalListaDePrecios = false; | ||
| 17 | $scope.associatedList = true; | ||
| 18 | $scope.listaDePreciosAlternativa = null; | ||
| 19 | |||
| 20 | onInit(); | ||
| 21 | |||
| 22 | function onInit() { | ||
| 23 | //Metodo para traer la lista de precio asociada al cliente | ||
| 24 | focaModalPrecioCondicionService.getListaPrecio(idListaPrecio) | ||
| 25 | .then(function (res) { | ||
| 26 | $scope.listaDePreciosAsociada = res.data[0]; | ||
| 27 | }) | ||
| 28 | .catch(function (e) { console.error(e) }); | ||
| 29 | } | ||
| 30 | |||
| 31 | //#region Metodos para la lista de precios | ||
| 32 | $scope.openListaDePrecios = function () { | ||
| 33 | var datos = null; | ||
| 34 | focaModalPrecioCondicionService.getAllListaPrecio() | ||
| 35 | .then(function (res) { | ||
| 36 | datos = res.data; | ||
| 37 | focaModalService.modal({ | ||
| 38 | titulo: 'Lista de precios', | ||
| 39 | data: datos, | ||
| 40 | size: 'md', | ||
| 41 | columnas: [ | ||
| 42 | { | ||
| 43 | propiedad: 'ID', | ||
| 44 | nombre: 'Codigo' | ||
| 45 | }, | ||
| 46 | { | ||
| 47 | propiedad: 'DES', | ||
| 48 | NOMBRE: 'Nombre' | ||
| 49 | } | ||
| 50 | ], | ||
| 51 | }).then(function (res) { | ||
| 52 | $scope.associatedList = false; | ||
| 53 | $scope.listaDePreciosAlternativa = res; | ||
| 54 | }).catch(function (e) { | ||
| 55 | console.error(e); | ||
| 56 | }); | ||
| 57 | }); | ||
| 58 | }; | ||
| 59 | $scope.selectListaDePrecios = function () { | ||
| 60 | $scope.associatedList = true; | ||
| 61 | }; | ||
| 62 | $scope.verListaProductos = function (id) { | ||
| 63 | $uibModal.open( | ||
| 64 | { | ||
| 65 | ariaLabelledBy: 'Busqueda de Productos', | ||
| 66 | templateUrl: 'modal-busqueda-productos.html', | ||
| 67 | controller: 'modalBusquedaProductosCtrl', | ||
| 68 | resolve: { | ||
| 69 | parametroProducto: { | ||
| 70 | idLista: parseInt(id), | ||
| 71 | cotizacion: 1, | ||
| 72 | simbolo: '$', | ||
| 73 | soloMostrar: true | ||
| 74 | } | ||
| 75 | }, | ||
| 76 | size: 'md' | ||
| 77 | } | ||
| 78 | ); | ||
| 79 | }; | ||
| 80 | //#endregion | ||
| 81 | $scope.closeModalPrecioCondicion = function () { | ||
| 82 | $uibModalInstance.dismiss('cancel'); | ||
| 83 | }; | ||
| 84 | $scope.guardarPrecioCondicion = function () { | ||
| 85 | var precioCondicion = { | ||
| 86 | listaPrecio: $scope.associatedList ? $scope.listaDePreciosAsociada : $scope.listaDePreciosAlternativa, | ||
| 87 | }; | ||
| 88 | $uibModalInstance.close(precioCondicion); | ||
| 89 | }; | ||
| 90 | } | ||
| 91 | ]) | ||
| 92 | |||
| 93 | .controller('focaModalListaPlazosController', | ||
| 94 | [ | ||
| 95 | '$timeout', | ||
| 96 | '$filter', | ||
| 97 | '$scope', | ||
| 98 | '$uibModal', | ||
| 99 | '$uibModalInstance', | ||
| 100 | 'focaModalService', | ||
| 101 | 'focaModalPrecioCondicionService', | ||
| 102 | 'idCliente', | ||
| 103 | function ( | ||
| 104 | $timeout, $filter, $scope, $uibModal, $uibModalInstance, | ||
| 105 | focaModalService, focaModalPrecioCondicionService,idCliente | ||
| 106 | ) { | ||
| 107 | $scope.plazos = [ | ||
| 108 | { | ||
| 109 | dias: 0, | ||
| 110 | idCliente: idCliente, | ||
| 111 | activo: true | ||
| 112 | } | ||
| 113 | ]; | ||
| 114 | |||
| 115 | onInit(); | ||
| 116 | |||
| 117 | function onInit() { | ||
| 118 | focaModalPrecioCondicionService.getPlazosByIdCliente(idCliente) | ||
| 119 | .then(function (res) { | ||
| 120 | res.data.forEach(function (item) { | ||
| 121 | $scope.plazos.push(item); | ||
| 122 | }); | ||
| 123 | }) | ||
| 124 | .catch(function (e) { console.error(e) }); | ||
| 125 | } | ||
| 126 | |||
| 127 | //#region Metodos para los plazos | ||
| 128 | $scope.addPlazo = function (key) { | ||
| 129 | if (key != 13) return; | ||
| 130 | if ($scope.plazos.length === 100) return; | ||
| 131 | for (var i = 1; i < $scope.plazos.length; i++) { | ||
| 132 | if ($scope.plazos[0].dias == $scope.plazos[i].dias && $scope.plazos[i].activo == true) { | ||
| 133 | focaModalService.alert("Ya existe un plazo con este valor"); | ||
| 134 | return; | ||
| 135 | } | ||
| 136 | } | ||
| 137 | $scope.plazos.unshift({ dias: 0, idCliente: idCliente, activo: true }); | ||
| 138 | $scope.focused = 1; | ||
| 139 | }; | ||
| 140 | $scope.deletePlazo = function (index) { | ||
| 141 | $scope.plazos[index].activo = false; | ||
| 142 | }; | ||
| 143 | $scope.validateMinMax = function (plazo, min, max) { | ||
| 144 | plazo.dias = parseInt(plazo.dias); | ||
| 145 | if (plazo.dias === null || plazo.dias === undefined || isNaN(plazo.dias)) { | ||
| 146 | plazo.dias = '0'; | ||
| 147 | return; | ||
| 148 | } | ||
| 149 | if (parseInt(plazo.dias) < min) { | ||
| 150 | plazo.dias = '0'; | ||
| 151 | return; | ||
| 152 | } | ||
| 153 | if (parseInt(plazo.dias) > max) { | ||
| 154 | plazo.dias = '365'; | ||
| 155 | return; | ||
| 156 | } | ||
| 157 | }; | ||
| 158 | //#endregion | ||
| 159 | |||
| 160 | $scope.closeModalPrecioCondicion = function () { | ||
| 161 | $uibModalInstance.dismiss('cancel'); | ||
| 162 | }; | ||
| 163 | $scope.guardarPlazos = function () { | ||
| 164 | $scope.plazos.shift(); | ||
| 165 | focaModalPrecioCondicionService.createPlazo($scope.plazos) | ||
| 166 | .then(function () { | ||
| 167 | var precioCondicion = { | ||
| 168 | plazoPago: $filter('filter')($scope.plazos, { activo: true }, true) | ||
| 169 | }; | ||
| 170 | $uibModalInstance.close(precioCondicion); | ||
| 171 | }) | ||
| 172 | .catch(function (e) { console.error(e) }) | ||
| 173 | }; | ||
| 174 | } | ||
| 175 | ]); | ||
| 176 |
src/js/service.js
| 1 | angular.module('focaModalPrecioCondicion') | 1 | angular.module('focaModalPrecioCondicion') |
| 2 | .service('focaModalPrecioCondicionService', [ | 2 | .service('focaModalPrecioCondicionService', [ |
| 3 | '$http', | 3 | '$http', |
| 4 | 'API_ENDPOINT', | 4 | 'API_ENDPOINT', |
| 5 | function($http, API_ENDPOINT) { | 5 | function ($http, API_ENDPOINT) { |
| 6 | return { | 6 | return { |
| 7 | getPlazosByIdPrecioCondicion: function(id) { | 7 | getPlazosByIdPrecioCondicion: function (id) { |
| 8 | return $http.get(API_ENDPOINT.URL + '/plazo-pago/precio-condicion/' + id); | 8 | return $http.get(API_ENDPOINT.URL + '/plazo-pago/precio-condicion/' + id); |
| 9 | }, | 9 | }, |
| 10 | getPreciosCondiciones: function() { | 10 | getPreciosCondiciones: function () { |
| 11 | return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago'); | 11 | return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago'); |
| 12 | }, | 12 | }, |
| 13 | getPreciosCondicionesByIdListaPrecio: function(idListaPrecio) { | 13 | getPreciosCondicionesByIdListaPrecio: function (idListaPrecio) { |
| 14 | return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago/' + | 14 | return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago/' + |
| 15 | idListaPrecio); | 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 | } |
| 19 | ]); | 32 | ]); |
| 20 | 33 |
src/views/modal-plazos.html
| File was created | 1 | <div class="modal-header py-1"> | |
| 2 | <div class="row w-100"> | ||
| 3 | <div class="col-lg-6"> | ||
| 4 | <h5 class="modal-title my-1">Precio-Condición: Plazos</h5> | ||
| 5 | </div> | ||
| 6 | </div> | ||
| 7 | </div> | ||
| 8 | <div class="modal-body" id="modal-body"> | ||
| 9 | <div ng-show="!ingreso"> | ||
| 10 | <div class="row px-2"> | ||
| 11 | <div class="col-lg-12"> | ||
| 12 | <div class="row py-1"> | ||
| 13 | <div class="col text-center font-weight-bold">Plazos</div> | ||
| 14 | </div> | ||
| 15 | <div class="row"> | ||
| 16 | <div class="col"> | ||
| 17 | <table class="table table-sm table-striped"> | ||
| 18 | <thead> | ||
| 19 | <tr> | ||
| 20 | <th colspan="2">Dias</th> | ||
| 21 | </tr> | ||
| 22 | </thead> | ||
| 23 | <tbody> | ||
| 24 | <tr ng-repeat="(i, plazo) in plazos" ng-show="plazo.activo"> | ||
| 25 | <td align="center" ng-class="{'pt-2': i > 0}"> | ||
| 26 | <span | ||
| 27 | ng-show="i > 0" | ||
| 28 | ng-bind="plazo.dias"> | ||
| 29 | </span> | ||
| 30 | <input | ||
| 31 | ng-show="i == 0" | ||
| 32 | type="text" | ||
| 33 | class="form-control form-control-sm text-center" | ||
| 34 | ng-model="plazo.dias" | ||
| 35 | limite-numeros-max="3" | ||
| 36 | ng-keyup="validateMinMax(plazo, 0, 365)" | ||
| 37 | ng-keypress="addPlazo($event.keyCode)" | ||
| 38 | foca-focus="focused == 1" | ||
| 39 | select-on-click | ||
| 40 | teclado-virtual | ||
| 41 | foca-tipo-input | ||
| 42 | solo-positivos> | ||
| 43 | </td> | ||
| 44 | <td> | ||
| 45 | <button | ||
| 46 | ng-show="i === 0" | ||
| 47 | class="btn btn-primary" | ||
| 48 | ng-click="addPlazo(13)"> | ||
| 49 | <span class="fa fa-save"></span> | ||
| 50 | </button> | ||
| 51 | <button | ||
| 52 | ng-show="i > 0" | ||
| 53 | class="btn btn-default" | ||
| 54 | ng-click="deletePlazo(i)"> | ||
| 55 | <span class="fa fa-trash"></span> | ||
| 56 | </button> | ||
| 57 | </td> | ||
| 58 | </tr> | ||
| 59 | </tbody> | ||
| 60 | </table> | ||
| 61 | </div> | ||
| 62 | </div> | ||
| 63 | </div> | ||
| 64 | </div> | ||
| 65 | </div> | ||
| 66 | </div> | ||
| 67 | <div class="modal-footer py-2"> | ||
| 68 | <button class="btn btn-sm btn-secondary" type="button" ng-click="closeModalPrecioCondicion()">Cerrar | ||
| 69 | </button> | ||
| 70 | <button class="btn btn-sm btn-primary" type="button" ng-click="guardarPlazos()">Guardar | ||
| 71 | </button> | ||
| 72 | </div> | ||
| 73 |
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">Búsqueda de Precio-Condición</h5> | 4 | <h5 class="modal-title my-1">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> | ||
| 37 | </div> | 5 | </div> |
| 38 | </div> | 6 | </div> |
| 39 | </div> | 7 | </div> |
| 40 | <div class="modal-body" id="modal-body"> | 8 | <div class="modal-body" id="modal-body"> |
| 41 | 9 | <div ng-show="!ingreso"> | |
| 42 | 10 | <div class="row" ng-show="listaDePreciosAsociada.length == 0"> | |
| 43 | <table ng-show="!ingreso" class="table table-striped table-sm"> | 11 | <div class="col"> |
| 44 | <thead> | 12 | No se encontraron resultados. |
| 45 | <tr> | 13 | </div> |
| 46 | <th>Código</th> | 14 | </div> |
| 47 | <th>Nombre</th> | 15 | <div class="row px-2"> |
| 48 | <th>Lista Precio</th> | 16 | <div class="col-lg-6"> |
| 49 | <th>Plazos</th> | 17 | <div class="row border-top py-2"> |
| 50 | <th></th> | 18 | <div class="col-lg-9 col-9">Lista asociada al cliente</div> |
| 51 | </tr> | 19 | <div class="col-lg-3 col-3 text-center"> |
| 52 | </thead> | 20 | <button |
| 53 | <tbody> | 21 | ng-class="{'btn-primary': associatedList, 'btn-default': !associatedList}" |
| 54 | <tr ng-show="currentPagePrecioCondicion.length == 0"> | 22 | class="btn btn-sm p-1" |
| 55 | <td colspan="6"> | 23 | ng-click="selectListaDePrecios(listaDePreciosAsociada)"> |
| 56 | No se encontraron resultados. | 24 | <span class="fa fa-circle-thin"></span> |
| 57 | </td> | 25 | </button> |
| 58 | </tr> | 26 | </div> |
| 59 | <tr class="selectable" | 27 | </div> |
| 60 | ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion"> | 28 | <div class="row align-items-center pb-2"> |
| 61 | <td ng-bind="precioCondicion.id | rellenarDigitos: 4: 0" | 29 | <div class="col-lg-2 col-2 text-center" ng-bind="listaDePreciosAsociada.ID"></div> |
| 62 | ng-click="select(precioCondicion)"></td> | 30 | <div class="col-lg-7 col-7" ng-bind="listaDePreciosAsociada.DES"></div> |
| 63 | <td ng-bind="precioCondicion.nombre" | 31 | <div class="col-lg-3 col-3 text-center"> |
| 64 | ng-click="select(precioCondicion)"></td> | 32 | <button ng-click="verListaProductos(listaDePreciosAsociada.ID)" class="btn btn-sm p-1"> |
| 65 | <td ng-bind="precioCondicion.idListaPrecio" | 33 | <span class="fa fa-eye"></span> |
| 66 | ng-click="select(precioCondicion)"></td> | 34 | </button> |
| 67 | <td ng-bind="precioCondicion.plazos" | 35 | </div> |
| 68 | ng-click="select(precioCondicion)"></td> | 36 | </div> |
| 69 | <td> | 37 | <div class="row border-top py-2"> |
| 70 | <button | 38 | <div class="col-lg-9 col-9">Trabajar con otra lista</div> |
| 71 | type="button" | 39 | <div class="col-lg-3 col-3 text-center"> |
| 72 | class="btn btn-sm p-1 float-right" | 40 | <button |
| 73 | title="Seleccionar" | 41 | ng-class="{'btn-primary': !associatedList, 'btn-default': associatedList}" |
| 74 | ng-class="{ | 42 | class="btn btn-sm btn-default p-1" |
| 75 | 'btn-secondary': selectedPrecioCondicion != key + 1, | 43 | ng-click="openListaDePrecios()"> |
| 76 | 'btn-primary': selectedPrecioCondicion == key + 1 | 44 | <span class="fa fa-circle-thin"></span> |
| 77 | }" | 45 | </button> |
| 78 | foca-focus="selectedPrecioCondicion == {{key + 1}}" | 46 | </div> |
| 79 | ng-keydown="itemProducto($event.keyCode)" | 47 | </div> |
| 80 | ng-click="select(precioCondicion)" | 48 | <div ng-show="listaDePreciosAlternativa != null" class="row align-items-center pb-1"> |
| 81 | > | 49 | <div class="col-lg-2 col-2 text-center" ng-bind="listaDePreciosAlternativa.ID"></div> |
| 82 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 50 | <div class="col-lg-7 col-7" ng-bind="listaDePreciosAlternativa.DES"></div> |
| 83 | </button> | 51 | <div class="col-lg-3 col-3 text-center"> |
| 84 | <button | 52 | <button ng-click="verListaProductos(listaDePreciosAlternativa.ID)" class="btn btn-sm p-1"> |
| 85 | type="button" | 53 | <span class="fa fa-eye"></span> |
| 86 | class="btn btn-sm p-1 float-right btn-secondary mr-2" | 54 | </button> |
| 87 | title="Ver lista precio" | 55 | </div> |
| 88 | ng-click="verListaPrecio(precioCondicion.idListaPrecio)" | 56 | </div> |
| 89 | > | 57 | </div> |
| 90 | <i class="fa fa-eye" aria-hidden="true"></i> | 58 | <div class="col"> |
| 91 | </button> | 59 | <div class="row py-1"> |
| 92 | </td> | 60 | <div class="col text-center font-weight-bold">Plazos</div> |
| 93 | </tr> | 61 | </div> |
| 94 | </tbody> | 62 | <div class="row"> |
| 95 | </table> | 63 | <div class="col"> |
| 96 | 64 | <table class="table table-sm table-striped"> | |
| 97 | <table class="table table-striped table-sm" ng-show="ingreso"> | 65 | <thead> |
| 98 | <thead> | 66 | <tr> |
| 99 | <tr> | 67 | <th colspan="2">Dias</th> |
| 100 | <th>Item</th> | 68 | </tr> |
| 101 | <th>Días</th> | 69 | </thead> |
| 102 | <th></th> | 70 | <tbody> |
| 103 | </tr> | 71 | <tr ng-repeat="(i, plazo) in plazos" ng-show="plazo.activo"> |
| 104 | </thead> | 72 | <td align="center" ng-class="{'pt-2': i > 0}"> |
| 105 | <tbody> | 73 | <span |
| 106 | <tr> | 74 | ng-show="i > 0" |
| 107 | <td> | 75 | ng-bind="plazo.dias"> |
| 108 | <input | 76 | </span> |
| 109 | type="number" | 77 | <input |
| 110 | class="form-control text-right" | 78 | ng-show="i == 0" |
| 111 | ng-model="plazoACargar.item" | 79 | type="text" |
| 112 | readonly | 80 | class="form-control form-control-sm text-center" |
| 113 | /> | 81 | ng-model="plazo.dias" |
| 114 | </td> | 82 | limite-numeros-max="3" |
| 115 | <td> | 83 | ng-keyup="validateMinMax(plazo, 0, 365)" |
| 116 | <input | 84 | ng-keypress="addPlazo($event.keyCode)" |
| 117 | type="number" | 85 | foca-focus="focused == 1" |
| 118 | class="form-control text-right" | 86 | select-on-click |
| 119 | min="0" | 87 | teclado-virtual |
| 120 | ng-model="plazoACargar.dias" | 88 | foca-tipo-input |
| 121 | ng-keypress="agregarPlazo($event.keyCode)" | 89 | solo-positivos> |
| 122 | foca-focus="ingreso" | 90 | </td> |
| 123 | /> | 91 | <td> |
| 124 | </td> | 92 | <button |
| 125 | <td class="text-center"> | 93 | ng-show="i === 0" |
| 126 | <button | 94 | class="btn btn-primary" |
| 127 | class="btn btn-outline-secondary" | 95 | ng-click="addPlazo(13)"> |
| 128 | title="Agregar" | 96 | <span class="fa fa-save"></span> |
| 129 | ng-click="agregarPlazo(13)" | 97 | </button> |
| 130 | > | 98 | <button |
| 131 | <i class="fa fa-save"></i> | 99 | ng-show="i > 0" |
| 132 | </button> | 100 | class="btn btn-default" |
| 133 | </td> | 101 | ng-click="deletePlazo(i)"> |
| 134 | </tr> | 102 | <span class="fa fa-trash"></span> |
| 135 | <tr ng-repeat="(key, plazo) in plazosNuevos"> | 103 | </button> |
| 136 | <td class="text-right" ng-bind="key + 1"></td> | 104 | </td> |
| 137 | <td class="text-right" ng-bind="plazo.dias"></td> | 105 | </tr> |
| 138 | <td class="text-center"> | 106 | </tbody> |
| 139 | <button | 107 | </table> |
| 140 | class="btn btn-outline-secondary" | 108 | </div> |
| 141 | title="Eliminar" | 109 | </div> |
| 142 | ng-click="quitarPlazo(key)" | 110 | </div> |
| 143 | > | 111 | </div> |
| 144 | <i class="fa fa-trash"></i> | 112 | </div> |
| 145 | </button> | ||
| 146 | </td> | ||
| 147 | </tr> | ||
| 148 | </tbody> | ||
| 149 | </table> | ||
| 150 | </div> | 113 | </div> |
| 151 | <div class="modal-footer py-1"> | 114 | <div class="modal-footer py-2"> |
| 152 | <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso" class="mr-auto"> | 115 | <button class="btn btn-sm btn-secondary" type="button" ng-click="closeModalPrecioCondicion()">Cerrar |
| 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 | ||
| 194 | </button> | 116 | </button> |
| 195 | <button | 117 | <button class="btn btn-sm btn-primary" type="button" ng-click="guardarPrecioCondicion()">Guardar |
| 196 | ng-show="ingreso" | ||
| 197 | class="btn btn-sm btn-secondary" | ||
| 198 | type="button" | ||
| 199 | ng-click="volver()" | ||
| 200 | >Volver | ||
| 201 | </button> | 118 | </button> |
| 202 | </div> | 119 | </div> |
| 203 | 120 |
src/views/modal-precios.html
| File was created | 1 | <div class="modal-header py-1"> | |
| 2 | <div class="row w-100"> | ||
| 3 | <div class="col-lg-6"> | ||
| 4 | <h5 class="modal-title my-1">Precio-Condición: Listas</h5> | ||
| 5 | </div> | ||
| 6 | </div> | ||
| 7 | </div> | ||
| 8 | <div class="modal-body" id="modal-body"> | ||
| 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-12"> | ||
| 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> | ||
| 59 | </div> | ||
| 60 | </div> | ||
| 61 | <div class="modal-footer py-2"> | ||
| 62 | <button class="btn btn-sm btn-secondary" type="button" ng-click="closeModalPrecioCondicion()">Cerrar | ||
| 63 | </button> | ||
| 64 | <button class="btn btn-sm btn-primary" type="button" ng-click="guardarPrecioCondicion()">Guardar | ||
| 65 | </button> | ||
| 66 | </div> | ||
| 67 |