2018-08-24 11:16:11 +00:00
|
|
|
import ngModule from '../module';
|
2019-11-10 10:08:44 +00:00
|
|
|
import ModuleCard from 'salix/components/module-card';
|
2018-08-24 11:16:11 +00:00
|
|
|
|
2019-11-10 10:08:44 +00:00
|
|
|
class Controller extends ModuleCard {
|
|
|
|
reload() {
|
|
|
|
let filter = {
|
2018-08-24 11:16:11 +00:00
|
|
|
include: [
|
2019-11-10 10:08:44 +00:00
|
|
|
{
|
|
|
|
relation: 'worker',
|
2019-01-30 15:03:29 +00:00
|
|
|
scope: {
|
|
|
|
fields: ['userFk'],
|
|
|
|
include: {
|
|
|
|
relation: 'user',
|
|
|
|
scope: {
|
|
|
|
fields: ['nickname']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
}, {
|
2019-01-30 07:44:15 +00:00
|
|
|
relation: 'ticket',
|
|
|
|
scope: {
|
|
|
|
fields: ['agencyModeFk'],
|
|
|
|
include: {
|
|
|
|
relation: 'agencyMode'
|
|
|
|
}
|
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
}, {
|
2019-01-31 13:58:14 +00:00
|
|
|
relation: 'claimState',
|
|
|
|
scope: {
|
|
|
|
fields: ['id', 'description']
|
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
}, {
|
2018-08-24 11:16:11 +00:00
|
|
|
relation: 'client',
|
|
|
|
scope: {
|
2019-11-06 07:20:45 +00:00
|
|
|
fields: ['salesPersonFk', 'name', 'email'],
|
2018-08-24 11:16:11 +00:00
|
|
|
include: {
|
2020-08-14 15:47:13 +00:00
|
|
|
relation: 'salesPersonUser'
|
2018-08-24 11:16:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
2019-11-10 10:08:44 +00:00
|
|
|
this.$http.get(`Claims/${this.$params.id}`, {filter})
|
|
|
|
.then(res => this.claim = res.data);
|
2018-08-24 11:16:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-10 10:08:44 +00:00
|
|
|
ngModule.vnComponent('vnClaimCard', {
|
2018-08-24 11:16:11 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|