Commit 74f5232f02bceba4dc23fa865d7ff545e590fa86
1 parent
10b0f94bf6
Exists in
master
and in
1 other branch
fuera validacion producto en editar cisterna
Showing
1 changed file
with
3 additions
and
5 deletions
Show diff stats
src/js/controllerCisterna.js
| ... | ... | @@ -52,12 +52,9 @@ angular.module('focaAbmVehiculo') |
| 52 | 52 | focaModalService.alert('Ingrese unidad de medida'); |
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | - if(!$scope.cisterna.cisternaCarga.articulo) { | |
| 56 | - focaModalService.alert('Ingrese producto'); | |
| 57 | - return; | |
| 58 | - } | |
| 59 | 55 | existeCodigoCisterna().then(function() { |
| 60 | 56 | $scope.cisterna.idVehiculo = $routeParams.idVehiculo; |
| 57 | + delete $scope.cisterna.vehiculo; | |
| 61 | 58 | delete $scope.cisterna.unidadMedida; |
| 62 | 59 | delete $scope.cisterna.cisternaCarga.articulo; |
| 63 | 60 | focaAbmVehiculoService.guardarCisterna($scope.cisterna).then(function(){ |
| ... | ... | @@ -117,7 +114,8 @@ angular.module('focaAbmVehiculo') |
| 117 | 114 | .then(function(res){ |
| 118 | 115 | //Valida si existe numero de unidad |
| 119 | 116 | var existe = res.data.filter(function(cisterna) { |
| 120 | - return cisterna.codigo === $scope.cisterna.codigo; | |
| 117 | + return cisterna.codigo === $scope.cisterna.codigo && | |
| 118 | + cisterna.id !== $scope.cisterna.id; | |
| 121 | 119 | }); |
| 122 | 120 | |
| 123 | 121 | if(existe.length){ |