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: {
|
2023-08-30 10:48:57 +00:00
|
|
|
fields: ['id'],
|
2019-01-30 15:03:29 +00:00
|
|
|
include: {
|
|
|
|
relation: 'user',
|
|
|
|
scope: {
|
2020-09-03 13:11:16 +00:00
|
|
|
fields: ['name']
|
2019-01-30 15:03:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-11-10 10:08:44 +00:00
|
|
|
}, {
|
2019-01-30 07:44:15 +00:00
|
|
|
relation: 'ticket',
|
|
|
|
scope: {
|
2023-01-26 13:16:30 +00:00
|
|
|
fields: ['zoneFk', 'addressFk'],
|
|
|
|
include: [
|
|
|
|
{
|
|
|
|
relation: 'zone',
|
|
|
|
scope: {
|
|
|
|
fields: ['name']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
relation: 'address',
|
|
|
|
scope: {
|
|
|
|
fields: ['provinceFk'],
|
|
|
|
include: {
|
|
|
|
relation: 'province',
|
|
|
|
scope: {
|
|
|
|
fields: ['name']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}]
|
2019-01-30 07:44:15 +00:00
|
|
|
}
|
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
|
|
|
|
});
|