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

57 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-01-10 10:52:35 +00:00
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']
}
}, {
2020-02-21 11:48:34 +00:00
relation: 'travel',
scope: {
fields: ['id', 'landed', 'agencyFk', 'warehouseOutFk'],
include: [
{
relation: 'agency',
scope: {
fields: ['name']
}
},
{
relation: 'warehouseOut',
scope: {
fields: ['name']
}
},
{
relation: 'warehouseIn',
scope: {
fields: ['name']
}
}
]
}
2020-01-10 10:52:35 +00:00
}, {
relation: 'supplier',
scope: {
2020-02-21 11:48:34 +00:00
fields: ['id', 'nickname']
2020-01-10 10:52:35 +00:00
}
}, {
relation: 'currency'
}
]
};
this.$http.get(`Entries/${this.$params.id}`, {filter})
.then(response => this.entry = response.data);
}
}
2020-02-21 11:48:34 +00:00
ngModule.component('vnEntryCard', {
2020-01-10 10:52:35 +00:00
template: require('./index.html'),
controller: Controller
});