Compare View

switch
from
...
to
 
Commits (41)
1 { 1 {
2 "name": "foca-modal-precio-condiciones", 2 "name": "foca-modal-precio-condiciones",
3 "version": "0.0.1", 3 "version": "v0.1.1A",
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 "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", 8 "test": "echo \"Error: no test specified\" && exit 1",
8 "test": "echo \"Error: no test specified\" && exit 1", 9 "gulp-pre-commit": "gulp pre-commit",
9 "gulp-pre-commit": "gulp pre-commit", 10 "compile": "gulp uglify",
10 "compile": "gulp uglify", 11 "postinstall": "npm run compile && gulp clean-post-install",
11 "postinstall": "npm run compile && gulp clean-post-install", 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 "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" 13 },
13 }, 14 "pre-commit": [
14 "pre-commit": [ 15 "gulp-pre-commit"
15 "gulp-pre-commit" 16 ],
16 ], 17 "repository": {
17 "repository": { 18 "type": "git",
18 "type": "git", 19 "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" 20 },
20 }, 21 "author": "Foca Software",
21 "author": "Foca Software", 22 "license": "ISC",
22 "license": "ISC", 23 "devDependencies": {
23 "devDependencies": { 24 "angular": "^1.7.5",
24 "angular": "^1.7.5", 25 "bootstrap": "^4.1.3",
25 "bootstrap": "^4.1.3", 26 "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git",
26 "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", 27 "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git",
27 "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git", 28 "font-awesome": "^4.7.0",
28 "font-awesome": "^4.7.0", 29 "gulp": "^3.9.1",
29 "gulp": "^3.9.1", 30 "gulp-angular-templatecache": "^2.2.2",
30 "gulp-angular-templatecache": "^2.2.2", 31 "gulp-clean": "^0.4.0",
31 "gulp-clean": "^0.4.0", 32 "gulp-concat": "^2.6.1",
32 "gulp-concat": "^2.6.1", 33 "gulp-connect": "^5.6.1",
33 "gulp-connect": "^5.6.1", 34 "gulp-htmlmin": "^5.0.1",
34 "gulp-htmlmin": "^5.0.1", 35 "gulp-jshint": "^2.1.0",
35 "gulp-jshint": "^2.1.0", 36 "gulp-rename": "^1.4.0",
36 "gulp-rename": "^1.4.0", 37 "gulp-replace": "^1.0.0",
37 "gulp-replace": "^1.0.0", 38 "gulp-uglify": "^3.0.1",
38 "gulp-uglify": "^3.0.1", 39 "jquery": "^3.3.1",
39 "jquery": "^3.3.1", 40 "jshint": "^2.9.6",
40 "jshint": "^2.9.6", 41 "pump": "^3.0.0",
41 "pump": "^3.0.0", 42 "ui-bootstrap4": "^3.0.5",
43 "popper.js": "^1.15.0"
42 "ui-bootstrap4": "^3.0.5", 44 }
43 "popper.js": "^1.15.0" 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 'parametros', 11 'parametros',
12 function ( 12 function (
13 $timeout, $filter, $scope, $uibModal, $uibModalInstance, 13 $timeout, $filter, $scope, $uibModal, $uibModalInstance,
14 focaModalService, focaModalPrecioCondicionService, parametros 14 focaModalService, focaModalPrecioCondicionService, parametros
15 ) { 15 ) {
16 $scope.plazos = [ 16 $scope.plazos = [
17 { 17 {
18 dias: 0, 18 dias: 0,
19 idCliente: parametros.idCliente, 19 idCliente: parametros.idCliente,
20 activo: true 20 activo: true
21 } 21 }
22 ]; 22 ];
23 $scope.remito = parametros.remito; 23 $scope.remito = parametros.remito;
24 $scope.notaPedido = parametros.notaPedido; 24 $scope.notaPedido = parametros.notaPedido;
25 $scope.openModalListaDePrecios = false; 25 $scope.openModalListaDePrecios = false;
26 $scope.associatedList = true; 26 $scope.associatedList = true;
27 $scope.listaDePreciosAlternativa = null; 27 $scope.listaDePreciosAlternativa = null;
28 28
29 onInit(); 29 onInit();
30 30
31 function onInit() { 31 function onInit() {
32 //Metodo para traer la lista de precio asociada al cliente 32 //Metodo para traer la lista de precio asociada al cliente
33 focaModalPrecioCondicionService.getListaPrecio(parametros.idListaPrecio) 33 focaModalPrecioCondicionService.getListaPrecio(parametros.idListaPrecio)
34 .then(function (res) { 34 .then(function (res) {
35 $scope.listaDePreciosAsociada = res.data[0]; 35 $scope.listaDePreciosAsociada = res.data[0];
36 }) 36 })
37 .catch(function (e) { console.error(e) }); 37 .catch(function (e) { console.error(e) });
38 focaModalPrecioCondicionService.getPlazosByIdCliente(parametros.idCliente) 38 focaModalPrecioCondicionService.getPlazosByIdCliente(parametros.idCliente)
39 .then(function (res) { 39 .then(function (res) {
40 res.data.forEach(function (item) { 40 res.data.forEach(function (item) {
41 $scope.plazos.push(item); 41 $scope.plazos.push(item);
42 });
43 })
44 .catch(function (e) { console.error(e) });
45 }
46
47 //#region Metodos para la lista de precios
48 $scope.openListaDePrecios = function () {
49 var datos = null;
50 focaModalPrecioCondicionService.getAllListaPrecio()
51 .then(function (res) {
52 datos = res.data;
53 focaModalService.modal({
54 titulo: 'Lista de precios',
55 data: datos,
56 size: 'md',
57 columnas: [
58 {
59 propiedad: 'ID',
60 nombre: 'Codigo'
61 },
62 {
63 propiedad: 'DES',
64 NOMBRE: 'Nombre' 42 });
65 } 43 })
66 ], 44 .catch(function (e) { console.error(e) });
67 }).then(function (res) { 45 }
68 focaModalService.confirm('¿Desea cambiar la lista de precios?\n'+
69 'Se perderan los productos ingresados').then(function (data){
70 if (data) {
71 if ($scope.notaPedido) {
72 if ($scope.notaPedido.articulosNotaPedido.length > 0) {
73 $scope.notaPedido.articulosNotaPedido = [];
74 }
75 } else if ($scope.remito) {
76 if ($scope.remito.articulosRemito.length > 0) {
77 $scope.remito.articulosRemito = [];
78 }
79 }
80 $scope.associatedList = false;
81 $scope.listaDePreciosAlternativa = res;
82 }
83 });
84 }).catch(function (e) {
85 console.error(e); 46
86 }); 47 //#region Metodos para la lista de precios
87 }); 48 $scope.openListaDePrecios = function () {
88 }; 49 var datos = null;
89 $scope.selectListaDePrecios = function () { 50 focaModalPrecioCondicionService.getAllListaPrecio()
90 $scope.associatedList = true; 51 .then(function (res) {
91 }; 52 datos = res.data;
92 $scope.verListaProductos = function (id) { 53 focaModalService.modal({
93 $uibModal.open( 54 titulo: 'Lista de precios',
94 { 55 data: datos,
95 ariaLabelledBy: 'Busqueda de Productos', 56 size: 'md',
96 templateUrl: 'modal-busqueda-productos.html', 57 columnas: [
97 controller: 'modalBusquedaProductosCtrl', 58 {
98 resolve: { 59 propiedad: 'ID',
99 parametroProducto: { 60 nombre: 'Codigo'
100 idLista: parseInt(id), 61 },
101 cotizacion: 1, 62 {
102 simbolo: '$', 63 propiedad: 'DES',
103 soloMostrar: true 64 NOMBRE: 'Nombre'
104 } 65 }
66 ],
67 }).then(function (res) {
68 focaModalService.confirm('¿Desea cambiar la lista de precios?\n'+
69 'Se perderan los productos ingresados').then(function (data){
70 if (data) {
71 if ($scope.notaPedido) {
72 if ($scope.notaPedido.articulosNotaPedido.length > 0) {
73 $scope.notaPedido.articulosNotaPedido = [];
74 }
75 } else if ($scope.remito) {
76 if ($scope.remito.articulosRemito.length > 0) {
77 $scope.remito.articulosRemito = [];
78 }
79 }
80 $scope.associatedList = false;
81 $scope.listaDePreciosAlternativa = res;
82 }
105 }, 83 });
106 size: 'md' 84 }).catch(function (e) {
107 } 85 console.error(e);
108 ); 86 });
109 }; 87 });
110 //#endregion
111
112 //#region Metodos para los plazos
113 $scope.addPlazo = function (key) {
114 if (key != 13) return;
115 if ($scope.plazos.length === 100) return;
116 for (var i = 1; i < $scope.plazos.length; i++) {
117 if ($scope.plazos[0].dias == $scope.plazos[i].dias && $scope.plazos[i].activo == true) {
118 focaModalService.alert("Ya existe un plazo con este valor");
119 return;
120 }
121 }
122 $scope.plazos.unshift({ dias: 0, idCliente: parametros.idCliente, activo: true });
123 $scope.focused = 1;
124 };
125 $scope.deletePlazo = function (index) {
126 $scope.plazos[index].activo = false;
127 };
128 $scope.validateMinMax = function (plazo, min, max) {
129 plazo.dias = parseInt(plazo.dias);
130 if (plazo.dias === null || plazo.dias === undefined || isNaN(plazo.dias)) {
131 plazo.dias = '0';
132 return;
133 }
134 if (parseInt(plazo.dias) < min) {
135 plazo.dias = '0';
136 return;
137 }
138 if (parseInt(plazo.dias) > max) {
139 plazo.dias = '365';
140 return;
141 }
142 };
143 //#endregion
144
145 $scope.closeModalPrecioCondicion = function () {
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 'parametros',
12 function (
13 $timeout, $filter, $scope, $uibModal, $uibModalInstance,
14 focaModalService, focaModalPrecioCondicionService, parametros
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(parametros.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 mod = $scope.associatedList ? parseInt($scope.listaDePreciosAsociada.ID) : parseInt($scope.listaDePreciosAlternativa.ID);
86
87 focaModalPrecioCondicionService.actualizarLista(parametros.idCliente, mod).then(function (){
88 var precioCondicion = {
89 listaPrecio: $scope.associatedList ? $scope.listaDePreciosAsociada : $scope.listaDePreciosAlternativa,
90 };
91 $uibModalInstance.close(precioCondicion);
92 });
93 };
94 }
95 ])
96
97 .controller('focaModalListaPlazosController',
98 [
99 '$timeout',
100 '$filter',
101 '$scope',
102 '$uibModal',
103 '$uibModalInstance',
104 'focaModalService',
105 'focaModalPrecioCondicionService',
106 'parametros',
107 function (
108 $timeout, $filter, $scope, $uibModal, $uibModalInstance,
109 focaModalService, focaModalPrecioCondicionService,parametros
110 ) {
111 $scope.plazos = [
112 {
113 dias: 0,
114 idCliente: parametros.idCliente,
115 activo: true
116 }
117 ];
118
119 onInit();
120
121 function onInit() {
122 focaModalPrecioCondicionService.getPlazosByIdCliente(parametros.idCliente)
123 .then(function (res) {
124 res.data.forEach(function (item) {
125 $scope.plazos.push(item);
126 });
127 })
128 .catch(function (e) { console.error(e) });
129 }
130
131 //#region Metodos para los plazos
132 $scope.addPlazo = function (key) {
133 if (key != 13) return;
134 if ($scope.plazos.length === 100) return;
135 for (var i = 1; i < $scope.plazos.length; i++) {
136 if ($scope.plazos[0].dias == $scope.plazos[i].dias && $scope.plazos[i].activo == true) {
137 focaModalService.alert("Ya existe un plazo con este valor");
138 return;
139 }
140 }
141 $scope.plazos.unshift({ dias: 0, idCliente: parametros.idCliente, activo: true });
142 $scope.focused = 1;
143 };
144 $scope.deletePlazo = function (index) {
145 $scope.plazos[index].activo = false;
146 };
147 $scope.validateMinMax = function (plazo, min, max) {
148 plazo.dias = parseInt(plazo.dias);
149 if (plazo.dias === null || plazo.dias === undefined || isNaN(plazo.dias)) {
150 plazo.dias = '0';
151 return;
152 }
153 if (parseInt(plazo.dias) < min) {
154 plazo.dias = '0';
155 return;
156 }
157 if (parseInt(plazo.dias) > max) {
158 plazo.dias = '365';
159 return;
160 }
161 };
162 //#endregion
163
164 $scope.closeModalPrecioCondicion = function () {
165 $uibModalInstance.dismiss('cancel');
166 };
167 $scope.guardarPlazos = function () {
168 $scope.plazos.shift();
169 focaModalPrecioCondicionService.createPlazo($scope.plazos)
170 .then(function () {
171 var precioCondicion = {
172 plazoPago: $filter('filter')($scope.plazos, { activo: true }, true)
173 };
174 $uibModalInstance.close(precioCondicion);
175 })
176 .catch(function (e) { console.error(e) })
177 };
178 }
179 ]);
1 angular.module('focaModalPrecioCondicion') 180
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 });
29 },
30 actualizarLista: function(id , mod) {
31 return $http.post(API_ENDPOINT.URL + '/cliente/update/mod', { id: id, mod: mod});
16 }, 32 }
17 getListaPrecio: function (idListaPrecio) { 33 };
18 return $http.get(API_ENDPOINT.URL + '/lista-precio/' + 34 }
19 idListaPrecio); 35 ]);
20 }, 36
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>
1 <div class="modal-header py-1"> 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 class="modal-title my-1">Precio-Condición</h5> 4 <h5 class="modal-title my-1">Precio-Condición</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-6">
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> 5 </div>
31 <div class="col-lg-3 col-3 text-center"> 6 </div>
32 <button ng-click="verListaProductos(listaDePreciosAsociada.ID)" class="btn btn-sm p-1"> 7 </div>
33 <span class="fa fa-eye"></span> 8 <div class="modal-body" id="modal-body">
34 </button> 9 <div ng-show="!ingreso">
35 </div> 10 <div class="row" ng-show="listaDePreciosAsociada.length == 0">
36 </div> 11 <div class="col">
37 <div class="row border-top py-2"> 12 No se encontraron resultados.
38 <div class="col-lg-9 col-9">Trabajar con otra lista</div> 13 </div>
39 <div class="col-lg-3 col-3 text-center"> 14 </div>
40 <button 15 <div class="row px-2">
41 ng-class="{'btn-primary': !associatedList, 'btn-default': associatedList}" 16 <div class="col-lg-6">
42 class="btn btn-sm btn-default p-1" 17 <div class="row border-top py-2">
43 ng-click="openListaDePrecios()"> 18 <div class="col-lg-9 col-9">Lista asociada al cliente</div>
44 <span class="fa fa-circle-thin"></span> 19 <div class="col-lg-3 col-3 text-center">
45 </button> 20 <button
46 </div> 21 ng-class="{'btn-primary': associatedList, 'btn-default': !associatedList}"
47 </div> 22 class="btn btn-sm p-1"
48 <div ng-show="listaDePreciosAlternativa != null" class="row align-items-center pb-1"> 23 ng-click="selectListaDePrecios(listaDePreciosAsociada)">
49 <div class="col-lg-2 col-2 text-center" ng-bind="listaDePreciosAlternativa.ID"></div> 24 <span class="fa fa-circle-thin"></span>
50 <div class="col-lg-7 col-7" ng-bind="listaDePreciosAlternativa.DES"></div> 25 </button>
51 <div class="col-lg-3 col-3 text-center"> 26 </div>
52 <button ng-click="verListaProductos(listaDePreciosAlternativa.ID)" class="btn btn-sm p-1"> 27 </div>
53 <span class="fa fa-eye"></span> 28 <div class="row align-items-center pb-2">
54 </button> 29 <div class="col-lg-2 col-2 text-center" ng-bind="listaDePreciosAsociada.ID"></div>
55 </div> 30 <div class="col-lg-7 col-7" ng-bind="listaDePreciosAsociada.DES"></div>
56 </div> 31 <div class="col-lg-3 col-3 text-center">
57 </div> 32 <button ng-click="verListaProductos(listaDePreciosAsociada.ID)" class="btn btn-sm p-1">
58 <div class="col"> 33 <span class="fa fa-eye"></span>
59 <div class="row py-1"> 34 </button>
60 <div class="col text-center font-weight-bold">Plazos</div> 35 </div>
61 </div> 36 </div>
62 <div class="row"> 37 <div class="row border-top py-2">
63 <div class="col"> 38 <div class="col-lg-9 col-9">Trabajar con otra lista</div>
64 <table class="table table-sm table-striped"> 39 <div class="col-lg-3 col-3 text-center">
65 <thead> 40 <button
66 <tr> 41 ng-class="{'btn-primary': !associatedList, 'btn-default': associatedList}"
67 <th colspan="2">Dias</th> 42 class="btn btn-sm btn-default p-1"
68 </tr> 43 ng-click="openListaDePrecios()">
69 </thead> 44 <span class="fa fa-circle-thin"></span>
70 <tbody> 45 </button>
71 <tr ng-repeat="(i, plazo) in plazos" ng-show="plazo.activo"> 46 </div>
72 <td align="center" ng-class="{'pt-2': i > 0}"> 47 </div>
73 <span 48 <div ng-show="listaDePreciosAlternativa != null" class="row align-items-center pb-1">
74 ng-show="i > 0" 49 <div class="col-lg-2 col-2 text-center" ng-bind="listaDePreciosAlternativa.ID"></div>
75 ng-bind="plazo.dias"> 50 <div class="col-lg-7 col-7" ng-bind="listaDePreciosAlternativa.DES"></div>
76 </span> 51 <div class="col-lg-3 col-3 text-center">
77 <input 52 <button ng-click="verListaProductos(listaDePreciosAlternativa.ID)" class="btn btn-sm p-1">
78 ng-show="i == 0" 53 <span class="fa fa-eye"></span>
79 type="text" 54 </button>
80 class="form-control form-control-sm text-center" 55 </div>
81 ng-model="plazo.dias" 56 </div>
82 limite-numeros-max="3" 57 </div>
83 ng-keyup="validateMinMax(plazo, 0, 365)" 58 <div class="col">
84 ng-keypress="addPlazo($event.keyCode)" 59 <div class="row py-1">
85 foca-focus="focused == 1" 60 <div class="col text-center font-weight-bold">Plazos</div>
86 select-on-click 61 </div>
87 teclado-virtual 62 <div class="row">
88 foca-tipo-input 63 <div class="col">
89 solo-positivos> 64 <table class="table table-sm table-striped">
90 </td> 65 <thead>
91 <td> 66 <tr>
92 <button 67 <th colspan="2">Dias</th>
93 ng-show="i === 0" 68 </tr>
94 class="btn btn-primary" 69 </thead>
95 ng-click="addPlazo(13)"> 70 <tbody>
96 <span class="fa fa-save"></span> 71 <tr ng-repeat="(i, plazo) in plazos" ng-show="plazo.activo">
97 </button> 72 <td align="center" ng-class="{'pt-2': i > 0}">
98 <button 73 <span
99 ng-show="i > 0" 74 ng-show="i > 0"
100 class="btn btn-default" 75 ng-bind="plazo.dias">
101 ng-click="deletePlazo(i)"> 76 </span>
102 <span class="fa fa-trash"></span> 77 <input
103 </button> 78 ng-show="i == 0"
104 </td> 79 type="text"
105 </tr> 80 class="form-control form-control-sm text-center"
106 </tbody> 81 ng-model="plazo.dias"
107 </table> 82 limite-numeros-max="3"
108 </div> 83 ng-keyup="validateMinMax(plazo, 0, 365)"
109 </div> 84 ng-keypress="addPlazo($event.keyCode)"
110 </div> 85 foca-focus="focused == 1"
111 </div> 86 select-on-click
112 </div> 87 teclado-virtual
113 </div> 88 foca-tipo-input
114 <div class="modal-footer py-2"> 89 solo-positivos>
115 <button class="btn btn-sm btn-secondary" type="button" ng-click="closeModalPrecioCondicion()">Cerrar 90 </td>
116 </button> 91 <td>
117 <button class="btn btn-sm btn-primary" type="button" ng-click="guardarPrecioCondicion()">Guardar 92 <button
118 </button> 93 ng-show="i === 0"
119 </div> 94 class="btn btn-primary"
120 95 ng-click="addPlazo(13)">
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>
1 <div class="modal-header py-1"> 67