Commit 892ceca8ea74261e4d48f0d228d5e6ff5c53b7f1
1 parent
5ba7a885b0
Exists in
master
Corregido problema con la vista, y creado metodo init.
Showing
2 changed files
with
21 additions
and
13 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -13,16 +13,13 @@ angular.module('focaModalDetalleHojaRuta') |
13 | 13 | $scope.cargando = false; |
14 | 14 | //#endregion |
15 | 15 | |
16 | - init(); | |
17 | 16 | function init() { |
18 | 17 | if ($scope.remito.rechazado) { |
19 | 18 | $scope.readonly = true; |
20 | 19 | } |
21 | - var articuloAChequear = $scope.remito.articulosRemito.filter( | |
22 | - function (articulo) { | |
23 | - return !articulo.descargado; | |
24 | - }); | |
25 | - | |
20 | + var articuloAChequear = $scope.remito.articulosRemito.filter(function (articulo) { | |
21 | + return !articulo.descargado; | |
22 | + }); | |
26 | 23 | if (!articuloAChequear.length || $scope.remito.rechazado) { |
27 | 24 | $scope.readonly = true; |
28 | 25 | $scope.cambio($scope.remito.articulosRemito[0]); |
... | ... | @@ -191,6 +188,9 @@ angular.module('focaModalDetalleHojaRuta') |
191 | 188 | delete remitoRechazado.articulosRemito; |
192 | 189 | delete remitoRechazado.notaPedido; |
193 | 190 | delete remitoRechazado.cisternas; |
191 | + delete remitoRechazado.cotizacion; | |
192 | + delete remitoRechazado.proveedor; | |
193 | + delete remitoRechazado.vendedor; | |
194 | 194 | remitoRechazado.rechazado = true; |
195 | 195 | remitoRechazado.motivoRechazo = motivo; |
196 | 196 | remitoRechazado.fechaRemito = |
... | ... | @@ -202,14 +202,19 @@ angular.module('focaModalDetalleHojaRuta') |
202 | 202 | 'Entrega de producto', |
203 | 203 | res.data[1].id, |
204 | 204 | motivo); |
205 | - success(); | |
205 | + $scope.remito.rechazado = true; | |
206 | + success().then(function () { | |
207 | + $uibModalInstance.close($scope.remito); | |
208 | + }); | |
206 | 209 | }) |
207 | 210 | .catch(error); |
208 | 211 | $scope.readonly = true; |
209 | - }); | |
212 | + }) | |
213 | + .catch(function (e) { console.info("modal", e); }); | |
210 | 214 | }; |
211 | 215 | |
212 | 216 | //#region FUNCIONES |
217 | + init(); | |
213 | 218 | function error(error) { |
214 | 219 | focaModalService.alert('Hubo un error ' + error); |
215 | 220 | } |
src/views/modal-detalle-hoja-ruta.html
... | ... | @@ -139,11 +139,14 @@ |
139 | 139 | Descargar |
140 | 140 | </button> |
141 | 141 | </div> |
142 | - </div> | |
143 | - | |
144 | - <label | |
145 | - class="col-12 bg-danger text-white" ng-show="remito.rechazado" | |
146 | - >Remito rechazado</label> | |
142 | + </div> | |
143 | + <div class="row mt-3" ng-show="remito.rechazado"> | |
144 | + <div class="col-12"> | |
145 | + <div class="bg-danger text-center text-white p-2"> | |
146 | + Remito rechazado | |
147 | + </div> | |
148 | + </div> | |
149 | + </div> | |
147 | 150 | </div> |
148 | 151 | </div> |
149 | 152 | </form> |