Commit ddf14b9dbc591dee576a13586175ae63ac8880b8
Exists in
master
Merge branch 'master' into 'master'
Master See merge request modulos-npm/foca-modal-cotizacion!1
Showing
3 changed files
Show diff stats
index.html
1 | <html ng-app="focaModalCotizacion"> | 1 | <html ng-app="focaModalCotizacion"> |
2 | <head> | 2 | <head> |
3 | <meta charset="UTF-8"/> | 3 | <meta charset="UTF-8"/> |
4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | 4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
5 | 5 | ||
6 | <!--CSS--> | 6 | <!--CSS--> |
7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> | 7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"/> |
8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> | 8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet"/> |
9 | 9 | ||
10 | <!--VENDOR JS--> | 10 | <!--VENDOR JS--> |
11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | 11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> |
12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | 12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> |
13 | <script src="node_modules/angular/angular.min.js"></script> | 13 | <script src="node_modules/angular/angular.min.js"></script> |
14 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | 14 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> |
15 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> | 15 | <script src="node_modules/foca-directivas/dist/foca-directivas.min.js"></script> |
16 | 16 | ||
17 | <!-- BUILD --> | 17 | <!-- BUILD --> |
18 | <script src="src/js/app.js"></script> | 18 | <script src="src/js/app.js"></script> |
19 | <script src="src/js/controller.js"></script> | 19 | <script src="src/js/controller.js"></script> |
20 | <script src="src/js/service.js"></script> | 20 | <script src="src/js/service.js"></script> |
21 | 21 | ||
22 | <!-- /BUILD --> | 22 | <!-- /BUILD --> |
23 | 23 | ||
24 | <!-- CONFIG PARA DEVELOP --> | 24 | <!-- CONFIG PARA DEVELOP --> |
25 | <script src="src/etc/develop.js"></script> | 25 | <script src="src/etc/develop.js"></script> |
26 | <script type="text/javascript"> | 26 | <script type="text/javascript"> |
27 | angular.module('focaModalCotizacion') | 27 | angular.module('focaModalCotizacion') |
28 | .controller('controller', [ | 28 | .controller('controller', [ |
29 | '$scope', | 29 | '$scope', |
30 | '$uibModal', | 30 | '$uibModal', |
31 | '$timeout', | 31 | '$timeout', |
32 | function($scope, $uibModal, $timeout) { | 32 | function($scope, $uibModal, $timeout) { |
33 | openModal(); | 33 | openModal(); |
34 | 34 | ||
35 | function openModal() { | 35 | function openModal() { |
36 | var modalInstance = $uibModal.open( | 36 | var modalInstance = $uibModal.open( |
37 | { | 37 | { |
38 | ariaLabelledBy: 'Busqueda de Precio Condicion', | 38 | ariaLabelledBy: 'Busqueda de Precio Condicion', |
39 | templateUrl: 'src/views/modal-cotizacion.html', | 39 | templateUrl: 'src/views/modal-cotizacion.html', |
40 | controller: 'focaModalCotizacionController', | 40 | controller: 'focaModalCotizacionController', |
41 | size: 'lg' | 41 | size: 'lg', |
42 | resolve: {idMoneda: 1} | ||
42 | } | 43 | } |
43 | ); | 44 | ); |
44 | 45 | ||
45 | modalInstance.result.then( | 46 | modalInstance.result.then( |
46 | function (selectedItem) { | 47 | function (selectedItem) { |
47 | console.info(selectedItem); | 48 | console.info(selectedItem); |
48 | $timeout(openModal, 500); | 49 | $timeout(openModal, 500); |
49 | }, function () { | 50 | }, function () { |
50 | console.info('modal-component dismissed at: ' + new Date()); | 51 | console.info('modal-component dismissed at: ' + new Date()); |
51 | $timeout(openModal, 500); | 52 | $timeout(openModal, 500); |
52 | } | 53 | } |
53 | ); | 54 | ); |
54 | } | 55 | } |
55 | } | 56 | } |
56 | ]); | 57 | ]); |
57 | </script> | 58 | </script> |
58 | </head> | 59 | </head> |
59 | <body ng-controller="controller"> | 60 | <body ng-controller="controller"> |
60 | </body> | 61 | </body> |
61 | </html> | 62 | </html> |
62 | 63 |
package.json
1 | { | 1 | { |
2 | "name": "foca-modal-cotizacion", | 2 | "name": "foca-modal-cotizacion", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Modal de búsqueda de cotizaciones", | 4 | "description": "Modal de búsqueda de cotizaciones", |
5 | "main": "index.js", | 5 | "main": "index.js", |
6 | "scripts": { | 6 | "scripts": { |
7 | "test": "echo \"Error: no test specified\" && exit 1", | 7 | "test": "echo \"Error: no test specified\" && exit 1", |
8 | "gulp-pre-commit": "gulp pre-commit", | 8 | "gulp-pre-commit": "gulp pre-commit", |
9 | "compile": "gulp uglify", | 9 | "compile": "gulp uglify", |
10 | "postinstall": "npm run compile && gulp clean-post-install", | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
11 | "install-dev": "npm install -D angular font-awesome pump 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+https://debo.suite.repo/modulos-npm/foca-directivas.git" | 11 | "install-dev": "npm install -D angular font-awesome pump 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+https://debo.suite.repo/modulos-npm/foca-directivas.git" |
12 | }, | 12 | }, |
13 | "pre-commit": [ | 13 | "pre-commit": [ |
14 | "gulp-pre-commit" | 14 | "gulp-pre-commit" |
15 | ], | 15 | ], |
16 | "repository": { | 16 | "repository": { |
17 | "type": "git", | 17 | "type": "git", |
18 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-cotizacion.git" | 18 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-cotizacion.git" |
19 | }, | 19 | }, |
20 | "author": "Foca Software", | 20 | "author": "Foca Software", |
21 | "license": "ISC", | 21 | "license": "ISC", |
22 | "devDependencies": { | 22 | "devDependencies": { |
23 | "angular": "^1.7.5", | 23 | "angular": "^1.7.5", |
24 | "bootstrap": "^4.1.3", | 24 | "bootstrap": "^4.1.3", |
25 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | 25 | "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", |
26 | "font-awesome": "^4.7.0", | 26 | "font-awesome": "^4.7.0", |
27 | "gulp": "3.9.1", | 27 | "gulp": "^3.9.1", |
28 | "gulp-angular-templatecache": "2.2.3", | 28 | "gulp-angular-templatecache": "^2.2.3", |
29 | "gulp-clean": "0.4.0", | 29 | "gulp-clean": "^0.4.0", |
30 | "gulp-concat": "2.6.1", | 30 | "gulp-concat": "^2.6.1", |
31 | "gulp-connect": "^5.6.1", | 31 | "gulp-connect": "^5.6.1", |
32 | "gulp-htmlmin": "5.0.1", | 32 | "gulp-htmlmin": "^5.0.1", |
33 | "gulp-jshint": "^2.1.0", | 33 | "gulp-jshint": "^2.1.0", |
34 | "gulp-rename": "1.4.0", | 34 | "gulp-rename": "^1.4.0", |
35 | "gulp-replace": "1.0.0", | 35 | "gulp-replace": "^1.0.0", |
36 | "gulp-uglify": "3.0.1", | 36 | "gulp-uglify": "^3.0.1", |
37 | "jquery": "^3.3.1", | 37 | "jquery": "^3.3.1", |
38 | "jshint": "^2.9.6", | 38 | "jshint": "^2.9.6", |
39 | "pump": "3.0.0", | 39 | "pump": "^3.0.0", |
40 | "ui-bootstrap4": "^3.0.5" | 40 | "ui-bootstrap4": "^3.0.5" |
41 | } | 41 | } |
42 | } | 42 | } |
43 | 43 |
src/views/modal-cotizacion.html
1 | <div class="modal-header py-1"> | 1 | <div class="modal-header py-1"> |
2 | <h5 class="modal-title">Seleccione Cotización <span ng-bind="moneda.SIMBOLO"></span></h5> | 2 | <h5 class="modal-title">Seleccione Cotización <span ng-bind="moneda.SIMBOLO"></span></h5> |
3 | </div> | 3 | </div> |
4 | <div class="modal-body" id="modal-body"> | 4 | <div class="modal-body" id="modal-body"> |
5 | <div class="input-group"> | 5 | <div class="input-group"> |
6 | <table class="table table-striped table-sm"> | 6 | <table class="table table-striped table-sm"> |
7 | <thead> | 7 | <thead> |
8 | <tr> | 8 | <tr> |
9 | <th>Fecha</th> | 9 | <th>Fecha</th> |
10 | <th>Cotización</th> | 10 | <th>Compra</th> |
11 | <th>Vendedor</th> | 11 | <th>Venta</th> |
12 | <th></th> | 12 | <th></th> |
13 | </tr> | 13 | </tr> |
14 | </thead> | 14 | </thead> |
15 | <tbody> | 15 | <tbody> |
16 | <tr | 16 | <tr |
17 | class="selectable" | 17 | class="selectable" |
18 | ng-repeat="(key,cotizacion) in currentPageCotizacion" | 18 | ng-repeat="(key,cotizacion) in currentPageCotizacion" |
19 | ng-click="select(cotizacion)" | 19 | ng-click="select(cotizacion)" |
20 | > | 20 | > |
21 | <td ng-bind="cotizacion.FECHA | date:'dd/MM/yyyy HH:mm'"></td> | 21 | <td ng-bind="cotizacion.FECHA | date:'dd/MM/yyyy HH:mm'"></td> |
22 | <td ng-bind="cotizacion.COTIZACION"></td> | 22 | <td ng-bind="cotizacion.COTIZACION"></td> |
23 | <td ng-bind="cotizacion.VENDEDOR"></td> | 23 | <td ng-bind="cotizacion.VENDEDOR"></td> |
24 | <td> | 24 | <td> |
25 | <button | 25 | <button |
26 | type="button" | 26 | type="button" |
27 | class="btn btn-xs p-1 float-right" | 27 | class="btn btn-xs p-1 float-right" |
28 | ng-class="{ | 28 | ng-class="{ |
29 | 'btn-secondary': selectedCotizacion != key, | 29 | 'btn-secondary': selectedCotizacion != key, |
30 | 'btn-primary': selectedCotizacion == key | 30 | 'btn-primary': selectedCotizacion == key |
31 | }" | 31 | }" |
32 | foca-focus="selectedCotizacion == {{key}}" | 32 | foca-focus="selectedCotizacion == {{key}}" |
33 | ng-keydown="itemProducto($event.keyCode)" | 33 | ng-keydown="itemProducto($event.keyCode)" |
34 | > | 34 | > |
35 | <i class="fa fa-arrow-right" aria-hidden="true"></i> | 35 | <i class="fa fa-arrow-right" aria-hidden="true"></i> |
36 | </button> | 36 | </button> |
37 | </td> | 37 | </td> |
38 | </tr> | 38 | </tr> |
39 | </tbody> | 39 | </tbody> |
40 | </table> | 40 | </table> |
41 | <nav> | 41 | <nav> |
42 | <ul class="pagination pagination-sm justify-content-end mb-0"> | 42 | <ul class="pagination pagination-sm justify-content-end mb-0"> |
43 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 43 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
44 | <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage - 1)"> | 44 | <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage - 1)"> |
45 | <span aria-hidden="true">«</span> | 45 | <span aria-hidden="true">«</span> |
46 | <span class="sr-only">Anterior</span> | 46 | <span class="sr-only">Anterior</span> |
47 | </a> | 47 | </a> |
48 | </li> | 48 | </li> |
49 | <li | 49 | <li |
50 | class="page-item" | 50 | class="page-item" |
51 | ng-repeat="pagina in paginas" | 51 | ng-repeat="pagina in paginas" |
52 | ng-class="{'active': pagina == currentPage}" | 52 | ng-class="{'active': pagina == currentPage}" |
53 | > | 53 | > |
54 | <a | 54 | <a |
55 | class="page-link" | 55 | class="page-link" |
56 | href="javascript:void()" | 56 | href="javascript:void()" |
57 | ng-click="selectPage(pagina)" | 57 | ng-click="selectPage(pagina)" |
58 | ng-bind="pagina" | 58 | ng-bind="pagina" |
59 | ></a> | 59 | ></a> |
60 | </li> | 60 | </li> |
61 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 61 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
62 | <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage + 1)"> | 62 | <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage + 1)"> |
63 | <span aria-hidden="true">»</span> | 63 | <span aria-hidden="true">»</span> |
64 | <span class="sr-only">Siguiente</span> | 64 | <span class="sr-only">Siguiente</span> |
65 | </a> | 65 | </a> |
66 | </li> | 66 | </li> |
67 | </ul> | 67 | </ul> |
68 | </nav> | 68 | </nav> |
69 | </div> | 69 | </div> |
70 | </div> | 70 | </div> |
71 | <div class="modal-footer py-1"> | 71 | <div class="modal-footer py-1"> |
72 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 72 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
73 | </div> | 73 | </div> |
74 | 74 |