Commit 0c6a8b9725daea9eced4d805d9ce33ed74548078
1 parent
bc01eac4db
Exists in
master
and in
2 other branches
Agregado condicion para boton terminar.
Showing
2 changed files
with
21 additions
and
3 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -148,6 +148,24 @@ angular.module('focaHojaRuta') |
148 | 148 | } |
149 | 149 | return true; |
150 | 150 | }; |
151 | + $scope.estaPendiente = function () { | |
152 | + var pendiente = false; | |
153 | + $scope.hojaRuta.remitos.forEach(function (remito) { | |
154 | + if (pendiente === false) { | |
155 | + var aDescargado = false; | |
156 | + for (var i = 0; i < remito.articulosRemito.length; i++) { | |
157 | + if (remito.articulosRemito[i].cantidadDescargada > 0) | |
158 | + aDescargado = true; | |
159 | + } | |
160 | + pendiente = (!aDescargado && remito.rechazado == null) ? true : false; | |
161 | + } | |
162 | + }); | |
163 | + if (pendiente) { | |
164 | + focaModalService.alert('Todavia hay remitos pendientes'); | |
165 | + return; | |
166 | + } | |
167 | + $scope.terminarHojaRuta(); | |
168 | + }; | |
151 | 169 | $rootScope.$on('estadoRed', function (event, value) { |
152 | 170 | $scope.estadoRed = value; |
153 | 171 | }); |
src/views/lista-hoja-ruta.html
... | ... | @@ -94,13 +94,13 @@ |
94 | 94 | ng-show="articulosDescargados(remito.articulosRemito)" |
95 | 95 | class="btn btn-secondary my-1 rounded" |
96 | 96 | type="button"> |
97 | - <i class="fa fa-check fa-lg text-success" aria-hidden="true"></i> | |
97 | + <i class="fa fa-check fa-lg foca-text-success" aria-hidden="true"></i> | |
98 | 98 | </button> |
99 | 99 | <button |
100 | 100 | ng-show="remito.rechazado" |
101 | 101 | class="btn btn-secondary my-1 rounded" |
102 | 102 | type="button"> |
103 | - <i class="fa fa-remove fa-lg text-danger" aria-hidden="true"></i> | |
103 | + <i class="fa fa-remove fa-lg foca-text-danger" aria-hidden="true"></i> | |
104 | 104 | </button> |
105 | 105 | </div> |
106 | 106 | </td> |
... | ... | @@ -156,7 +156,7 @@ |
156 | 156 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> |
157 | 157 | <span |
158 | 158 | class="mr-3 ml-auto" |
159 | - ng-click="terminarHojaRuta()" | |
159 | + ng-click="estaPendiente()" | |
160 | 160 | ladda="saveLoading" |
161 | 161 | data-style="expand-left" |
162 | 162 | >Terminar</span> |