git-svn-id: https://svn.coded.pt/svn/SIPRP@1956 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
João Maurício 11 years ago
parent d7bde6c5fa
commit 3e07e1e300

@ -17,6 +17,10 @@
$scope.add = function(selected){ $scope.add = function(selected){
$scope.editForm.$reset();
$scope.editing = angular.copy(selected);
globals.plugins.buildFloatingSideMenu({ globals.plugins.buildFloatingSideMenu({
title: 'Ficha de Aptidão', title: 'Ficha de Aptidão',
documentclick: function(){ documentclick: function(){
@ -24,13 +28,23 @@
$scope.openModalDocumentos(); $scope.openModalDocumentos();
} }
}); });
};
$scope.edit = function(selected){
$scope.editForm.$reset(); $scope.editForm.$reset();
$scope.editing = angular.copy(selected); $scope.storeFichasClinicas.extraParams = {
fichaID: selected.id
}; };
$scope.edit = function(selected){ $scope.storeFichasClinicas.get(function(response, status, headers, config, items){
$scope.selected = items;
$scope.editing = angular.copy($scope.selected);
$timeout(function () {
globals.plugins.buildFloatingSideMenu({ globals.plugins.buildFloatingSideMenu({
title: 'Ficha de Aptidão', title: 'Ficha de Aptidão',
@ -40,22 +54,9 @@
} }
}); });
$timeout(function () {
$scope.editForm.$reset();
//$scope.storeFichasClinicas.extraParams = {
// fichaID: selected.id
//};
//$scope.storeFichasClinicas.get(function(response, status, headers, config, items){
// $scope.selected = items;
// $scope.editing = angular.copy($scope.selected);
//});
}, 0); }, 0);
});
}; };
$scope.save = function(complete){ $scope.save = function(complete){
@ -64,27 +65,10 @@
if(isValid) if(isValid)
{ {
//if(complete) $scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing){
//{
// $scope.editing.ficha.data_conclusao = new Date();
//} });
//else
//{
// $scope.editing.ficha.data_conclusao = null;
//}
//$scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing, isNewRecord){
// if(response.success && complete)
// {
// globals.plugins.hideFloatingSideMenu();
// $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){
// angular.element(scope.comboTrabalhadores.domEl).triggerHandler('change');
// });
// }
//});
} }
}; };

@ -11,8 +11,8 @@
$scope.storeLogin.broadcastEvents = false; $scope.storeLogin.broadcastEvents = false;
$scope.editing = { $scope.editing = {
user: '', user: 'admin',
pass: '' pass: '2Yz146Oss5Q'
}; };
$scope.login = function(e) { $scope.login = function(e) {

@ -113,12 +113,12 @@
</button> </button>
</td> </td>
<td class="p-l-none"> <td class="p-l-none">
<button ng-show="!item.fichaAptidaoEmitida && possuiFichaAptidao(item)" data-toggle="tooltip" data-placement="right" title="Emitir Ficha de Aptidão" <button ng-show="item.emissao_ficha_aptidao == null && possuiFichaAptidao(item)" data-toggle="tooltip" data-placement="right" title="Emitir Ficha de Aptidão"
ng-click="emitirFichaAptidao(item)" type="button" class="btn btn-xs btn-default"> ng-click="emitirFichaAptidao(item)" type="button" class="btn btn-xs btn-default">
<span class="glyphicon glyphicon-plus"></span> <span>Emitir</span> <span class="glyphicon glyphicon-plus"></span> <span>Emitir</span>
</button> </button>
<span ng-show="item.fichaAptidaoEmitida && possuiFichaAptidao(item)" class="label label-success" data-toggle="tooltip" data-placement="right" title="Ficha de Aptidão Emitida">Emitida</span> <span ng-show="item.emissao_ficha_aptidao != null && possuiFichaAptidao(item)" class="label label-success" data-toggle="tooltip" data-placement="right" title="Ficha de Aptidão Emitida">Emitida</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save