Commit 24e882ee92c0a2bc5655208f0da87f7fc4a053d7

Authored by Jose Pinto
1 parent 75d79b6832
Exists in master

agrego foca-botonera-lateral

1 { 1 {
2 "name": "foca-abm-precios-condiciones", 2 "name": "foca-abm-precios-condiciones",
3 "version": "1.0.0", 3 "version": "1.0.0",
4 "description": "ABM de precios y condiciones", 4 "description": "ABM de precios y condiciones",
5 "main": "dist/foca-abm-precios-condiciones.js", 5 "main": "dist/foca-abm-precios-condiciones.js",
6 "scripts": { 6 "scripts": {
7 "test": "echo \"Error: no test specified\" && exit 1", 7 "test": "echo \"Error: no test specified\" && exit 1",
8 "compile": "gulp uglify", 8 "compile": "gulp uglify",
9 "gulp-pre-commit": "gulp pre-commit", 9 "gulp-pre-commit": "gulp pre-commit",
10 "postinstall": "npm run compile && gulp clean-post-install", 10 "postinstall": "npm run compile && gulp clean-post-install",
11 "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify gulp-replace jquery jshint pump git+https://192.168.0.11/modulos-npm/foca-modal.git" 11 "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify gulp-replace jquery jshint pump git+http://git.focasoftware.com/npm/foca-modal.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://192.168.0.11/modulos-npm/foca-abm-precios-condiciones.git" 18 "url": "https://192.168.0.11/modulos-npm/foca-abm-precios-condiciones.git"
19 }, 19 },
20 "author": "Foca Software", 20 "author": "Foca Software",
21 "license": "ISC", 21 "license": "ISC",
22 "peerDependencies": { 22 "peerDependencies": {
23 "angular": "^1.7.x", 23 "angular": "^1.7.x",
24 "bootstrap": "^4.1.x", 24 "bootstrap": "^4.1.x",
25 "jquery": "^3.3.x", 25 "jquery": "^3.3.x",
26 "font-awesome": "^4.7.x", 26 "font-awesome": "^4.7.x",
27 "gulp": "^3.9.x", 27 "gulp": "^3.9.x",
28 "gulp-concat": "2.6.x", 28 "gulp-concat": "2.6.x",
29 "gulp-jshint": "^2.1.x", 29 "gulp-jshint": "^2.1.x",
30 "gulp-rename": "^1.4.x", 30 "gulp-rename": "^1.4.x",
31 "gulp-replace": "^1.0.x", 31 "gulp-replace": "^1.0.x",
32 "gulp-uglify-es": "^1.0.x", 32 "gulp-uglify-es": "^1.0.x",
33 "jshint": "^2.9.x", 33 "jshint": "^2.9.x",
34 "pump": "^3.0.x" 34 "pump": "^3.0.x"
35 }, 35 },
36 "devDependencies": { 36 "devDependencies": {
37 "angular": "^1.7.4", 37 "angular": "^1.7.4",
38 "angular-route": "^1.7.5", 38 "angular-route": "^1.7.5",
39 "bootstrap": "^4.1.3", 39 "bootstrap": "^4.1.3",
40 "foca-modal": "git+https://192.168.0.11/modulos-npm/foca-modal.git", 40 "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git",
41 "font-awesome": "^4.7.0", 41 "font-awesome": "^4.7.0",
42 "gulp": "^3.9.1", 42 "gulp": "^3.9.1",
43 "gulp-angular-templatecache": "^2.2.1", 43 "gulp-angular-templatecache": "^2.2.1",
44 "gulp-clean": "^0.4.0", 44 "gulp-clean": "^0.4.0",
45 "gulp-connect": "^5.6.1", 45 "gulp-connect": "^5.6.1",
46 "gulp-htmlmin": "^5.0.1", 46 "gulp-htmlmin": "^5.0.1",
47 "gulp-jshint": "^2.1.0", 47 "gulp-jshint": "^2.1.0",
48 "gulp-rename": "^1.4.0", 48 "gulp-rename": "^1.4.0",
49 "gulp-replace": "^1.0.0", 49 "gulp-replace": "^1.0.0",
50 "gulp-sequence": "^1.0.0", 50 "gulp-sequence": "^1.0.0",
51 "gulp-uglify": "^3.0.1", 51 "gulp-uglify": "^3.0.1",
52 "gulp-uglify-es": "^1.0.4", 52 "gulp-uglify-es": "^1.0.4",
53 "jasmine-core": "^3.2.1", 53 "jasmine-core": "^3.2.1",
54 "jquery": "^3.3.1", 54 "jquery": "^3.3.1",
55 "jshint": "^2.9.6", 55 "jshint": "^2.9.6",
56 "pre-commit": "^1.2.2", 56 "pre-commit": "^1.2.2",
57 "pump": "^3.0.0", 57 "pump": "^3.0.0",
58 "ui-bootstrap4": "^3.0.5" 58 "ui-bootstrap4": "^3.0.5"
59 } 59 }
60 } 60 }
61 61
1 angular.module('focaAbmPreciosCondiciones', ['ngRoute', 'ui.bootstrap', 'focaModal']); 1 angular.module('focaAbmPreciosCondiciones', [
2 'ngRoute',
3 'ui.bootstrap',
4 'focaModal',
5 'focaBotoneraLateral'
6 ]);
2 7
src/js/controller.js
1 angular.module('focaAbmPreciosCondiciones') 1 angular.module('focaAbmPreciosCondiciones')
2 .controller('focaAbmPreciosCondicionesController', [ 2 .controller('focaAbmPreciosCondicionesController', [
3 '$scope', 'focaAbmPreciosCondicionesService', '$location', 'focaModalService', 3 '$scope', 'focaAbmPreciosCondicionesService', '$location',
4 function($scope, focaAbmPreciosCondicionesService, $location, focaModalService) { 4 'focaModalService', 'focaBotoneraLateralService', '$timeout',
5 function($scope, focaAbmPreciosCondicionesService, $location,
6 focaModalService, focaBotoneraLateralService, $timeout) {
5 focaAbmPreciosCondicionesService.obtenerPreciosCondiciones().then(function(datos) { 7 focaAbmPreciosCondicionesService.obtenerPreciosCondiciones().then(function(datos) {
6 $scope.preciosCondiciones = datos.data; 8 $scope.preciosCondiciones = datos.data;
7 }); 9 });
10
11 $timeout(function() {
12 focaBotoneraLateralService.showSalir(true);
13 focaBotoneraLateralService.showPausar(false);
14 focaBotoneraLateralService.showCancelar(false);
15 focaBotoneraLateralService.showGuardar(false);
16 });
17
8 $scope.editar = function(id) { 18 $scope.editar = function(id) {
9 $location.path('/precio-condicion/' + id); 19 $location.path('/precio-condicion/' + id);
10 }; 20 };
11 $scope.solicitarConfirmacion = function(precioCondicion) { 21 $scope.solicitarConfirmacion = function(precioCondicion) {
12 focaModalService.confirm('¿Está seguro que desea borrar el precio condición' + 22 focaModalService.confirm('¿Está seguro que desea borrar el precio condición' +
13 precioCondicion.codigo + ' ' + precioCondicion.nombre + ' ?').then( 23 precioCondicion.codigo + ' ' + precioCondicion.nombre + ' ?').then(
14 function(data) { 24 function(data) {
15 if (data) { 25 if (data) {
16 focaAbmPreciosCondicionesService 26 focaAbmPreciosCondicionesService
17 .borrarPrecioCondicion(precioCondicion.id); 27 .borrarPrecioCondicion(precioCondicion.id);
18 $scope.preciosCondiciones.splice( 28 $scope.preciosCondiciones.splice(
19 $scope.preciosCondiciones.indexOf(precioCondicion), 1 29 $scope.preciosCondiciones.indexOf(precioCondicion), 1
20 ); 30 );
21 } 31 }
22 } 32 }
23 ); 33 );
24 }; 34 };
25 } 35 }
26 ]) 36 ])
27 .controller('focaAbmPrecioCondicionController', [ 37 .controller('focaAbmPrecioCondicionController', [
28 '$scope', 'focaAbmPreciosCondicionesService', 38 '$scope', 'focaAbmPreciosCondicionesService', 'focaBotoneraLateralService',
29 '$routeParams', '$location', 'focaModalService', 39 '$routeParams', '$location', 'focaModalService', '$timeout',
30 function( 40 function(
31 $scope, focaAbmPreciosCondicionesService, 41 $scope, focaAbmPreciosCondicionesService, focaBotoneraLateralService,
32 $routeParams, $location, focaModalService 42 $routeParams, $location, focaModalService, $timeout
33 ) { 43 ) {
34 $scope.mostrarPlazos = $routeParams.id > 0; 44 $scope.mostrarPlazos = $routeParams.id > 0;
35 focaAbmPreciosCondicionesService.obtenerPrecioCondicion($routeParams.id) 45 focaAbmPreciosCondicionesService.obtenerPrecioCondicion($routeParams.id)
36 .then(function(datos) { 46 .then(function(datos) {
37 $scope.precioCondicion = { 47 $scope.precioCondicion = {
38 id: 0, 48 id: 0,
39 codigo: '', 49 codigo: '',
40 nombre: '', 50 nombre: '',
41 descripcion: '', 51 descripcion: '',
42 idListaPrecio: 0, 52 idListaPrecio: 0,
43 vigencia: new Date() 53 vigencia: new Date()
44 }; 54 };
45 if (datos.data.id) { 55 if (datos.data.id) {
46 $scope.precioCondicion = datos.data; 56 $scope.precioCondicion = datos.data;
47 focaAbmPreciosCondicionesService.obtenerPlazoPago(datos.data.id) 57 focaAbmPreciosCondicionesService.obtenerPlazoPago(datos.data.id)
48 .then(function(datos) { 58 .then(function(datos) {
49 $scope.precioCondicion.plazos = datos.data; 59 $scope.precioCondicion.plazos = datos.data;
50 }); 60 });
51 } 61 }
52 }); 62 });
63
64 $timeout(function() {
65 focaBotoneraLateralService.showSalir(false);
66 focaBotoneraLateralService.showPausar(true);
67 focaBotoneraLateralService.showCancelar(true);
68 focaBotoneraLateralService.showGuardar(true, $scope.guardar);
69 });
70
53 $scope.cancelar = function() { 71 $scope.cancelar = function() {
54 $location.path('/precio-condicion'); 72 $location.path('/precio-condicion');
55 }; 73 };
56 $scope.guardar = function(precioCondicion) { 74 $scope.guardar = function(precioCondicion) {
57 focaAbmPreciosCondicionesService.guardarPrecioCondicion(precioCondicion) 75 focaAbmPreciosCondicionesService.guardarPrecioCondicion(precioCondicion)
58 .then(function() { 76 .then(function() {
59 $location.path('/precio-condicion'); 77 $location.path('/precio-condicion');
60 }); 78 });
61 }; 79 };
62 $scope.editarPlazoPago = function(id) { 80 $scope.editarPlazoPago = function(id) {
63 $location.path( 81 $location.path(
64 '/precio-condicion/' + $scope.precioCondicion.id + 82 '/precio-condicion/' + $scope.precioCondicion.id +
65 '/plazo-pago/' + id 83 '/plazo-pago/' + id
66 ); 84 );
67 }; 85 };
68 $scope.solicitarConfirmacionPlazoPago = function(plazoPago) { 86 $scope.solicitarConfirmacionPlazoPago = function(plazoPago) {
69 focaModalService.confirm('¿Está seguro que desea borrar el plazo de pago ' + 87 focaModalService.confirm('¿Está seguro que desea borrar el plazo de pago ' +
70 plazoPago.item + ' ' + plazoPago.dias + ' ?').then( 88 plazoPago.item + ' ' + plazoPago.dias + ' ?').then(
71 function(confirm) { 89 function(confirm) {
72 if (confirm) { 90 if (confirm) {
73 focaAbmPreciosCondicionesService.borrarPlazoPago(plazoPago.id); 91 focaAbmPreciosCondicionesService.borrarPlazoPago(plazoPago.id);
74 $scope.precioCondicion.plazos.splice( 92 $scope.precioCondicion.plazos.splice(
75 $scope.precioCondicion.plazos.indexOf(plazoPago), 1 93 $scope.precioCondicion.plazos.indexOf(plazoPago), 1
76 ); 94 );
77 } 95 }
78 } 96 }
79 ); 97 );
80 }; 98 };
81 } 99 }
82 ]); 100 ]);
83 101
src/views/foca-abm-precios-condiciones-item.html
1 <h4>Precios y Condiciones</h4> 1 <h4>Precios y Condiciones</h4>
2 <form> 2 <form>
3 <input type="hidden" name="id" ng-model="precioCondicion.id" /> 3 <input type="hidden" name="id" ng-model="precioCondicion.id" />
4 <div class="form-group row"> 4 <div class="form-group row">
5 <label class="offset-sm-1 col-sm-2 col-form-label">Código</label> 5 <label class="offset-sm-1 col-sm-2 col-form-label">Código</label>
6 <div class="col-sm-4"> 6 <div class="col-sm-4">
7 <input 7 <input
8 class="form-control" 8 class="form-control"
9 type="text" 9 type="text"
10 name="codigo" 10 name="codigo"
11 ng-model="precioCondicion.codigo" 11 ng-model="precioCondicion.codigo"
12 autocomplete="off" 12 autocomplete="off"
13 teclado-virtual 13 teclado-virtual
14 /> 14 />
15 </div> 15 </div>
16 </div> 16 </div>
17 <div class="form-group row"> 17 <div class="form-group row">
18 <label class="offset-sm-1 col-sm-2 col-form-label">Nombre</label> 18 <label class="offset-sm-1 col-sm-2 col-form-label">Nombre</label>
19 <div class="col-sm-4"> 19 <div class="col-sm-4">
20 <input 20 <input
21 class="form-control" 21 class="form-control"
22 type="text" 22 type="text"
23 name="nombre" 23 name="nombre"
24 ng-model="precioCondicion.nombre" 24 ng-model="precioCondicion.nombre"
25 autocomplete="off" 25 autocomplete="off"
26 teclado-virtual 26 teclado-virtual
27 /> 27 />
28 </div> 28 </div>
29 </div> 29 </div>
30 <div class="form-group row"> 30 <div class="form-group row">
31 <label class="offset-sm-1 col-sm-2 col-form-label">Descripción</label> 31 <label class="offset-sm-1 col-sm-2 col-form-label">Descripción</label>
32 <div class="col-sm-4"> 32 <div class="col-sm-4">
33 <input 33 <input
34 class="form-control" 34 class="form-control"
35 type="text" 35 type="text"
36 name="nombre" 36 name="nombre"
37 ng-model="precioCondicion.descripcion" 37 ng-model="precioCondicion.descripcion"
38 autocomplete="off" 38 autocomplete="off"
39 teclado-virtual 39 teclado-virtual
40 /> 40 />
41 </div> 41 </div>
42 </div> 42 </div>
43 <div class="form-group row"> 43 <div class="form-group row">
44 <label class="offset-sm-1 col-sm-2 col-form-label">Lista de precios</label> 44 <label class="offset-sm-1 col-sm-2 col-form-label">Lista de precios</label>
45 <div class="col-sm-4"> 45 <div class="col-sm-4">
46 <input 46 <input
47 class="form-control" 47 class="form-control"
48 type="text" 48 type="text"
49 name="nombre" 49 name="nombre"
50 ng-model="precioCondicion.idListaPrecio" 50 ng-model="precioCondicion.idListaPrecio"
51 autocomplete="off" 51 autocomplete="off"
52 /> 52 />
53 </div> 53 </div>
54 </div> 54 </div>
55 <div class="form-group row" ng-show="mostrarPlazos"> 55 <div class="form-group row" ng-show="mostrarPlazos">
56 <label class="offset-sm-1 col-sm-2 col-form-label">Plazos</label> 56 <label class="offset-sm-1 col-sm-2 col-form-label">Plazos</label>
57 <div class="col-sm-4"> 57 <div class="col-sm-4">
58 <table class="table table-sm table-hover lista"> 58 <table class="table table-sm table-hover lista">
59 <thead> 59 <thead>
60 <tr> 60 <tr>
61 <th>Item</th> 61 <th>Item</th>
62 <th>Dias</th> 62 <th>Dias</th>
63 <th colspan="2" class="text-center"> 63 <th colspan="2" class="text-center">
64 <button class="btn btn-default boton-accion" ng-click="editarPlazoPago(0)"> 64 <button class="btn btn-default boton-accion" ng-click="editarPlazoPago(0)">
65 <i class="fa fa-plus"></i> 65 <i class="fa fa-plus"></i>
66 </button> 66 </button>
67 </th> 67 </th>
68 </tr> 68 </tr>
69 </thead> 69 </thead>
70 <tbody> 70 <tbody>
71 <tr ng-repeat="plazo in precioCondicion.plazos"> 71 <tr ng-repeat="plazo in precioCondicion.plazos">
72 <td ng-bind="plazo.item"></td> 72 <td ng-bind="plazo.item"></td>
73 <td ng-bind="plazo.dias"></td> 73 <td ng-bind="plazo.dias"></td>
74 <td class="text-center"> 74 <td class="text-center">
75 <button class="btn btn-default boton-accion" ng-click="editarPlazoPago(plazo.id)"> 75 <button class="btn btn-default boton-accion" ng-click="editarPlazoPago(plazo.id)">
76 <i class="fa fa-pencil"></i> 76 <i class="fa fa-pencil"></i>
77 </button> 77 </button>
78 <button 78 <button
79 class="btn btn-default boton-accion" 79 class="btn btn-default boton-accion"
80 ng-click="solicitarConfirmacionPlazoPago(plazo)" 80 ng-click="solicitarConfirmacionPlazoPago(plazo)"
81 > 81 >
82 <i class="fa fa-trash"></i> 82 <i class="fa fa-trash"></i>
83 </button> 83 </button>
84 </td> 84 </td>
85 </tr> 85 </tr>
86 </tbody> 86 </tbody>
87 </table> 87 </table>
88 </div> 88 </div>
89 </div> 89 </div>
90 <div class="form-group row">
91 <div class="col-sm-7 text-right">
92 <button class="btn btn-primary" ng-click="guardar(precioCondicion)">Guardar</button>
93 <button class="btn btn-default" ng-click="cancelar()">Cancelar</button>
94 </div>
95 </div>
96 </form> 90 </form>
97 <a href="#!/" title="Salir"
98 class="btn btn-secondary btn-block float-right col-md-2"
99 >
100 Salir
101 </a>
src/views/foca-abm-precios-condiciones-listado.html
1 <div class="lista"> 1 <div class="lista">
2 <h4>Precios y Condiciones</h4> 2 <h4>Precios y Condiciones</h4>
3 <table class="table table-sm table-hover table-nonfluid"> 3 <table class="table table-sm table-hover table-nonfluid">
4 <thead> 4 <thead>
5 <tr> 5 <tr>
6 <th>Código</th> 6 <th>Código</th>
7 <th>Nombre</th> 7 <th>Nombre</th>
8 <th colspan="2" class="text-center"> 8 <th colspan="2" class="text-center">
9 <button class="btn btn-default boton-accion" ng-click="editar(0)"> 9 <button class="btn btn-default boton-accion" ng-click="editar(0)">
10 <i class="fa fa-plus"></i> 10 <i class="fa fa-plus"></i>
11 </button> 11 </button>
12 </th> 12 </th>
13 </tr> 13 </tr>
14 </thead> 14 </thead>
15 <tbody> 15 <tbody>
16 <tr ng-repeat="precioCondicion in preciosCondiciones"> 16 <tr ng-repeat="precioCondicion in preciosCondiciones">
17 <td ng-bind="precioCondicion.codigo"></td> 17 <td ng-bind="precioCondicion.codigo"></td>
18 <td ng-bind="precioCondicion.nombre"></td> 18 <td ng-bind="precioCondicion.nombre"></td>
19 <td> 19 <td>
20 <button class="btn btn-default boton-accion" ng-click="editar(precioCondicion.id)"> 20 <button class="btn btn-default boton-accion" ng-click="editar(precioCondicion.id)">
21 <i class="fa fa-pencil"></i> 21 <i class="fa fa-pencil"></i>
22 </button> 22 </button>
23 <button class="btn btn-default boton-accion" ng-click="solicitarConfirmacion(precioCondicion)"> 23 <button class="btn btn-default boton-accion" ng-click="solicitarConfirmacion(precioCondicion)">
24 <i class="fa fa-trash"></i> 24 <i class="fa fa-trash"></i>
25 </button> 25 </button>
26 </td> 26 </td>
27 </tr> 27 </tr>
28 </tbody> 28 </tbody>
29 </table> 29 </table>
30 </div> 30 </div>
31 <a href="#!/" title="Salir"
32 class="btn btn-secondary btn-block float-right col-md-2"
33 >
34 Salir
35 </a>
36 31