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 ngModule from '../../module';
|
||||||
import Section from 'salix/components/section';
|
import Section from 'salix/components/section';
|
||||||
|
|
||||||
class Controller extends Section {
|
export default class Controller extends Section {}
|
||||||
constructor($element, $) {
|
|
||||||
super($element, $);
|
|
||||||
}
|
|
||||||
onSubmit() {
|
|
||||||
return this.$.watcher.submit()
|
|
||||||
.then(() => this.card.reload());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngModule.vnComponent('vnWorkerDepartmentBasicData', {
|
ngModule.vnComponent('vnWorkerDepartmentBasicData', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
controller: Controller,
|
controller: Controller,
|
||||||
bindings: {
|
bindings: {
|
||||||
worker: '<'
|
department: '<'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,39 +1,25 @@
|
||||||
import ngModule from '../../module';
|
import ngModule from '../../module';
|
||||||
import Summary from 'salix/components/summary';
|
import Component from 'core/lib/component';
|
||||||
|
|
||||||
class Controller extends Summary {
|
|
||||||
get department() {
|
|
||||||
return this._department;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
class Controller extends Component {
|
||||||
set department(value) {
|
set department(value) {
|
||||||
this._department = value;
|
this._department = value;
|
||||||
this.$.department = null;
|
this.$.summary = null;
|
||||||
if (!value) return;
|
if (!value) return;
|
||||||
|
|
||||||
const query = `Departments/${value.id}`;
|
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
|
|
||||||
'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
|
|
||||||
include: [
|
include: [
|
||||||
{
|
{relation: 'client'},
|
||||||
relation: 'client',
|
{relation: 'worker'},
|
||||||
scope: {fields: ['name']}
|
{relation: 'department'}
|
||||||
},
|
|
||||||
{
|
|
||||||
relation: 'worker',
|
|
||||||
scope: {fields: ['name']}
|
|
||||||
}, {
|
|
||||||
relation: 'department',
|
|
||||||
scope: {fields: ['name']}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$http.get(query, {params: {filter}})
|
this.$http.get(`Departments/${value.id}`, {filter})
|
||||||
.then(res => {
|
.then(res => this.$.summary = res.data);
|
||||||
this.$.department = res.data;
|
}
|
||||||
});
|
get department() {
|
||||||
|
return this._department;
|
||||||
}
|
}
|
||||||
|
|
||||||
get isHr() {
|
get isHr() {
|
||||||
|
@ -41,10 +27,10 @@ class Controller extends Summary {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngModule.vnComponent('vnWorkerDepartmentSummary', {
|
ngModule.component('vnWorkerDepartmentSummary', {
|
||||||
template: require('./index.html'),
|
template: require('./index.html'),
|
||||||
controller: Controller,
|
controller: Controller,
|
||||||
bindings: {
|
bindings: {
|
||||||
worker: '<'
|
department: '<'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue