Commit 39a9112fe4e9882debc8f958d7643a75e77e5400
1 parent
275df735ff
Exists in
master
- Tareas gulp.
- Agregué botones lupa y nota pedido.
Showing
3 changed files
with
87 additions
and
5 deletions
Show diff stats
gulpfile.js
... | ... | @@ -86,10 +86,14 @@ gulp.task('clean-post-install', function() { |
86 | 86 | gulp.task('default', ['webserver']); |
87 | 87 | |
88 | 88 | gulp.task('watch', function() { |
89 | - gulp.watch([paths.srcJS, paths.srcViews], ['copy']); | |
89 | + gulp.watch([paths.srcJS, paths.srcViews], ['uglify']); | |
90 | 90 | }); |
91 | 91 | |
92 | -gulp.task('copy', ['uglify'], function(){ | |
92 | +gulp.task('copy', ['uglify'], function() { | |
93 | 93 | return gulp.src('dist/*.js') |
94 | - .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-crear-remito/dist')); | |
94 | + .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-crear-remito/dist/')); | |
95 | +}); | |
96 | + | |
97 | +gulp.task('watchAndCopy', function() { | |
98 | + return gulp.watch([paths.srcJS, paths.srcViews], ['copy']); | |
95 | 99 | }); |
src/js/controller.js
... | ... | @@ -7,6 +7,7 @@ angular.module('focaCrearRemito') .controller('remitoController', |
7 | 7 | focaSeguimientoService, remitoBusinessService |
8 | 8 | ) { |
9 | 9 | $scope.botonera = [ |
10 | + {texto: 'Nota Pedido', accion: function() {$scope.seleccionarNotaPedido();}}, | |
10 | 11 | {texto: 'Vendedor', accion: function() {$scope.seleccionarVendedor();}}, |
11 | 12 | {texto: 'Cliente', accion: function() {$scope.seleccionarCliente();}}, |
12 | 13 | {texto: 'Proveedor', accion: function() {$scope.seleccionarProveedor();}}, |
... | ... | @@ -15,7 +16,6 @@ angular.module('focaCrearRemito') .controller('remitoController', |
15 | 16 | texto: 'Precios y condiciones', |
16 | 17 | accion: function() {$scope.abrirModalListaPrecio();}}, |
17 | 18 | {texto: 'Flete', accion: function() {$scope.abrirModalFlete();}}, |
18 | - {texto: '', accion: function() {}}, | |
19 | 19 | {texto: '', accion: function() {}} |
20 | 20 | ]; |
21 | 21 | $scope.datepickerAbierto = false; |
... | ... | @@ -69,6 +69,84 @@ angular.module('focaCrearRemito') .controller('remitoController', |
69 | 69 | $scope.precioCondiciones = res.data; |
70 | 70 | } |
71 | 71 | ); |
72 | + $scope.seleccionarNotaPedido = function() { | |
73 | + var modalInstance = $uibModal.open( | |
74 | + { | |
75 | + ariaLabelledBy: 'Busqueda de Nota de Pedido', | |
76 | + templateUrl: 'foca-modal-nota-pedido.html', | |
77 | + controller: 'focaModalNotaPedidoController', | |
78 | + resolve: { | |
79 | + parametroNotaPedido: { | |
80 | + idLista: $scope.idLista, | |
81 | + cotizacion: $scope.remito.cotizacion.COTIZACION, | |
82 | + simbolo: $scope.remito.moneda.simbolo | |
83 | + } | |
84 | + }, | |
85 | + size: 'lg' | |
86 | + } | |
87 | + ); | |
88 | + modalInstance.result.then( | |
89 | + function(producto) { | |
90 | + var newArt = | |
91 | + { | |
92 | + id: 0, | |
93 | + codigo: producto.codigo, | |
94 | + sector: producto.sector, | |
95 | + sectorCodigo: producto.sector + '-' + producto.codigo, | |
96 | + descripcion: producto.descripcion, | |
97 | + item: $scope.articulosTabla.length + 1, | |
98 | + nombre: producto.descripcion, | |
99 | + precio: parseFloat(producto.precio.toFixed(4)), | |
100 | + costoUnitario: producto.costo, | |
101 | + editCantidad: false, | |
102 | + editPrecio: false | |
103 | + }; | |
104 | + $scope.articuloACargar = newArt; | |
105 | + $scope.cargando = false; | |
106 | + }, function() { | |
107 | + // funcion ejecutada cuando se cancela el modal | |
108 | + } | |
109 | + ); | |
110 | + } | |
111 | + $scope.seleccionarRemito = function() { | |
112 | + var modalInstance = $uibModal.open( | |
113 | + { | |
114 | + ariaLabelledBy: 'Busqueda de Remito', | |
115 | + templateUrl: 'foca-modal-remito.html', | |
116 | + controller: 'focaModalRemitoController', | |
117 | + resolve: { | |
118 | + parametroRemito: { | |
119 | + idLista: $scope.idLista, | |
120 | + cotizacion: $scope.remito.cotizacion.COTIZACION, | |
121 | + simbolo: $scope.remito.moneda.simbolo | |
122 | + } | |
123 | + }, | |
124 | + size: 'lg' | |
125 | + } | |
126 | + ); | |
127 | + modalInstance.result.then( | |
128 | + function(producto) { | |
129 | + var newArt = | |
130 | + { | |
131 | + id: 0, | |
132 | + codigo: producto.codigo, | |
133 | + sector: producto.sector, | |
134 | + sectorCodigo: producto.sector + '-' + producto.codigo, | |
135 | + descripcion: producto.descripcion, | |
136 | + item: $scope.articulosTabla.length + 1, | |
137 | + nombre: producto.descripcion, | |
138 | + precio: parseFloat(producto.precio.toFixed(4)), | |
139 | + costoUnitario: producto.costo, | |
140 | + editCantidad: false, | |
141 | + editPrecio: false | |
142 | + }; | |
143 | + $scope.articuloACargar = newArt; | |
144 | + $scope.cargando = false; | |
145 | + }, function() { | |
146 | + // funcion ejecutada cuando se cancela el modal | |
147 | + } | |
148 | + ); | |
149 | + } | |
72 | 150 | //La pantalla solo se usa para cargar remitos |
73 | 151 | // if (remitoTemp !== undefined) { |
74 | 152 | // remitoTemp.fechaCarga = new Date(remitoTemp.fechaCarga); |