|
|
|
@ -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');
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|