forked from Coded/SIPRP
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.4 KiB
89 lines
2.4 KiB
evoapp.controller('SearchController', function($rootScope, $scope, $timeout, $compile, $injector, $filter, globals)
|
|
{
|
|
$scope.globals = globals;
|
|
|
|
$scope.searching = {Name: ''};//new globals.dataService.record('Discipline');
|
|
|
|
//TODO: this one might have a different name!!!
|
|
$scope.storeFichasTrabalhador = new globals.dataService.store({
|
|
model: null,
|
|
actions: {
|
|
get: 'getFichaEAdmissaoInicial'//TODO: ???
|
|
}
|
|
});
|
|
|
|
$scope.testArray = [];
|
|
|
|
$scope.list = function(){
|
|
|
|
//TEST
|
|
$scope.testArray = [
|
|
{
|
|
campo1: 'valor 1',
|
|
campo2: 'valor 2',
|
|
campo3: 'valor 3',
|
|
campo4: 'valor 4'
|
|
},
|
|
{
|
|
campo1: 'valor 1',
|
|
campo2: 'valor 2',
|
|
campo3: 'valor 3',
|
|
campo4: 'valor 4'
|
|
},
|
|
{
|
|
campo1: 'valor 1',
|
|
campo2: 'valor 2',
|
|
campo3: 'valor 3',
|
|
campo4: 'valor 4'
|
|
}
|
|
];
|
|
|
|
$scope.storeFichasTrabalhador.items = [];
|
|
$scope.storeFichasTrabalhador.loadData($scope.testArray);
|
|
};
|
|
|
|
$scope.edit = function(selected){
|
|
|
|
$scope.$parent.loadModule({Controller: 'Form1'}, function(className, scope, isNewModule){
|
|
|
|
scope.edit(null);
|
|
});
|
|
};
|
|
|
|
$scope.add = function(){
|
|
|
|
$scope.$parent.loadModule({Controller: 'Form1'}, function(className, scope, isNewModule){
|
|
|
|
scope.add();
|
|
});
|
|
};
|
|
|
|
$scope.clear = function(){
|
|
|
|
$scope.storeFichasTrabalhador.items = [];
|
|
};
|
|
|
|
$scope.onEmpresaChange = function(selectedValue, selectedRecord){
|
|
|
|
$scope.comboEstabelecimentos.store.extraParams = {
|
|
empresaID: selectedRecord.id,
|
|
filter: 'sede'
|
|
};
|
|
|
|
$scope.comboEstabelecimentos.loadStore(function(response, status, headers, config, items){
|
|
|
|
});
|
|
};
|
|
|
|
$scope.onEstabelecimentoChange = function(selectedValue, selectedRecord){
|
|
|
|
};
|
|
|
|
$scope.$on('afterrender', function(event, args){
|
|
|
|
$scope.comboEmpresas.loadStore(function(response, status, headers, config, items){
|
|
|
|
});
|
|
});
|
|
|
|
}); |