57 lines
1.8 KiB
JavaScript
57 lines
1.8 KiB
JavaScript
import ngModule from '../module';
|
|
import ModuleCard from 'salix/components/module-card';
|
|
|
|
class Controller extends ModuleCard {
|
|
reload() {
|
|
let filter = {
|
|
include: [
|
|
{
|
|
relation: 'company',
|
|
scope: {
|
|
fields: ['id', 'code']
|
|
}
|
|
}, {
|
|
relation: 'travel',
|
|
scope: {
|
|
fields: ['id', 'landed', 'agencyFk', 'warehouseOutFk'],
|
|
include: [
|
|
{
|
|
relation: 'agency',
|
|
scope: {
|
|
fields: ['name']
|
|
}
|
|
},
|
|
{
|
|
relation: 'warehouseOut',
|
|
scope: {
|
|
fields: ['name']
|
|
}
|
|
},
|
|
{
|
|
relation: 'warehouseIn',
|
|
scope: {
|
|
fields: ['name']
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}, {
|
|
relation: 'supplier',
|
|
scope: {
|
|
fields: ['id', 'nickname']
|
|
}
|
|
}, {
|
|
relation: 'currency'
|
|
}
|
|
]
|
|
};
|
|
this.$http.get(`Entries/${this.$params.id}`, {filter})
|
|
.then(response => this.entry = response.data);
|
|
}
|
|
}
|
|
|
|
ngModule.component('vnEntryCard', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|