refs #5334 refactor summary
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
2a78a912eb
commit
f4e877dada
|
@ -1,20 +1,12 @@
|
|||
import ngModule from '../../module';
|
||||
import Section from 'salix/components/section';
|
||||
|
||||
class Controller extends Section {
|
||||
constructor($element, $) {
|
||||
super($element, $);
|
||||
}
|
||||
onSubmit() {
|
||||
return this.$.watcher.submit()
|
||||
.then(() => this.card.reload());
|
||||
}
|
||||
}
|
||||
export default class Controller extends Section {}
|
||||
|
||||
ngModule.vnComponent('vnWorkerDepartmentBasicData', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
worker: '<'
|
||||
department: '<'
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,39 +1,25 @@
|
|||
import ngModule from '../../module';
|
||||
import Summary from 'salix/components/summary';
|
||||
|
||||
class Controller extends Summary {
|
||||
get department() {
|
||||
return this._department;
|
||||
}
|
||||
import Component from 'core/lib/component';
|
||||
|
||||
class Controller extends Component {
|
||||
set department(value) {
|
||||
this._department = value;
|
||||
this.$.department = null;
|
||||
this.$.summary = null;
|
||||
if (!value) return;
|
||||
|
||||
const query = `Departments/${value.id}`;
|
||||
const filter = {
|
||||
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
|
||||
'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
|
||||
include: [
|
||||
{
|
||||
relation: 'client',
|
||||
scope: {fields: ['name']}
|
||||
},
|
||||
{
|
||||
relation: 'worker',
|
||||
scope: {fields: ['name']}
|
||||
}, {
|
||||
relation: 'department',
|
||||
scope: {fields: ['name']}
|
||||
}
|
||||
{relation: 'client'},
|
||||
{relation: 'worker'},
|
||||
{relation: 'department'}
|
||||
]
|
||||
};
|
||||
|
||||
this.$http.get(query, {params: {filter}})
|
||||
.then(res => {
|
||||
this.$.department = res.data;
|
||||
});
|
||||
this.$http.get(`Departments/${value.id}`, {filter})
|
||||
.then(res => this.$.summary = res.data);
|
||||
}
|
||||
get department() {
|
||||
return this._department;
|
||||
}
|
||||
|
||||
get isHr() {
|
||||
|
@ -41,10 +27,10 @@ class Controller extends Summary {
|
|||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnWorkerDepartmentSummary', {
|
||||
ngModule.component('vnWorkerDepartmentSummary', {
|
||||
template: require('./index.html'),
|
||||
controller: Controller,
|
||||
bindings: {
|
||||
worker: '<'
|
||||
department: '<'
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue