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

53 lines
1.5 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: ['name']
}
}
}
}, {
relation: 'ticket',
scope: {
fields: ['zoneFk'],
include: {
relation: 'zone'
}
}
}, {
relation: 'claimState',
scope: {
fields: ['id', 'description']
}
}, {
relation: 'client',
scope: {
fields: ['salesPersonFk', 'name', 'email'],
include: {
relation: 'salesPersonUser'
}
}
}
]
};
this.$http.get(`Claims/${this.$params.id}`, {filter})
.then(res => this.claim = res.data);
}
}
ngModule.vnComponent('vnClaimCard', {
template: require('./index.html'),
controller: Controller
});