37 lines
854 B
JavaScript
37 lines
854 B
JavaScript
import ngModule from '../../module';
|
|
import Component from 'core/lib/component';
|
|
|
|
class Controller extends Component {
|
|
set department(value) {
|
|
this._department = value;
|
|
this.$.summary = null;
|
|
if (!value) return;
|
|
|
|
const filter = {
|
|
include: [
|
|
{relation: 'client'},
|
|
{relation: 'worker'},
|
|
{relation: 'department'}
|
|
]
|
|
};
|
|
|
|
this.$http.get(`Departments/${value.id}`, {filter})
|
|
.then(res => this.$.summary = res.data);
|
|
}
|
|
get department() {
|
|
return this._department;
|
|
}
|
|
|
|
get isHr() {
|
|
return this.aclService.hasAny(['hr']);
|
|
}
|
|
}
|
|
|
|
ngModule.component('vnWorkerDepartmentSummary', {
|
|
template: require('./index.html'),
|
|
controller: Controller,
|
|
bindings: {
|
|
department: '<'
|
|
}
|
|
});
|