Commit 96705170022395db72030a64c73cda6f18fc255a
1 parent
46fd86bb20
Exists in
master
Boton Cancelar
Showing
2 changed files
with
13 additions
and
3 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -102,12 +102,22 @@ angular.module('focaAbmPreciosCondiciones') |
102 | 102 | $timeout(function() { |
103 | 103 | focaBotoneraLateralService.showSalir(false); |
104 | 104 | focaBotoneraLateralService.showPausar(true); |
105 | - focaBotoneraLateralService.showCancelar(true); | |
105 | + focaBotoneraLateralService.showCancelar(false); | |
106 | 106 | focaBotoneraLateralService.showGuardar(true, $scope.guardar); |
107 | + focaBotoneraLateralService.addCustomButton('Cancelar', $scope.cancelar); | |
107 | 108 | }); |
108 | 109 | |
109 | 110 | $scope.cancelar = function() { |
110 | - $location.path('/precio-condicion'); | |
111 | + | |
112 | + if ($scope.formPrecioCondicion.$pristine == false) { | |
113 | + focaModalService.confirm( | |
114 | + '¿Está seguro de que desea salir? Se perderán todos los datos cargados.' | |
115 | + ).then(function(data) { | |
116 | + if (data) { | |
117 | + $location.path('/precio-condicion'); | |
118 | + } | |
119 | + }); | |
120 | + } | |
111 | 121 | }; |
112 | 122 | $scope.guardar = function() { |
113 | 123 |
src/views/foca-abm-precios-condiciones-item.html
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | ></foca-cabecera-facturador> |
7 | 7 | </div> |
8 | 8 | <div class="row"> |
9 | - <form class="col-md-10"> | |
9 | + <form class= "col-md-10" name="formPrecioCondicion"> | |
10 | 10 | <input type="hidden" name="id" ng-model="precioCondicion.id" /> |
11 | 11 | <div class="row mb-3"> |
12 | 12 | <label class="col-sm-2 col-form-label">Código</label> |