salix/modules/claim/front/card/index.js

63 lines
1.9 KiB
JavaScript

import ngModule from '../module';
import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
let filter = {
include: [
{
relation: 'worker',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
}, {
relation: 'ticket',
scope: {
fields: ['agencyModeFk'],
include: {
relation: 'agencyMode'
}
}
}, {
relation: 'claimState',
scope: {
fields: ['id', 'description']
}
}, {
relation: 'client',
scope: {
fields: ['salesPersonFk', 'name', 'email'],
include: {
relation: 'salesPerson',
scope: {
fields: ['userFk'],
include: {
relation: 'user',
scope: {
fields: ['nickname']
}
}
}
}
}
}
]
};
this.$http.get(`Claims/${this.$params.id}`, {filter})
.then(res => this.claim = res.data);
}
}
ngModule.vnComponent('vnClaimCard', {
template: require('./index.html'),
controller: Controller
});