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

32 lines
801 B
JavaScript

import ngModule from '../module';
import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
let filter = {
include: [
{
relation: 'warehouseIn',
scope: {
fields: ['id', 'name']
}
}, {
relation: 'warehouseOut',
scope: {
fields: ['id', 'name']
}
}
]
};
this.$http.get(`Travels/${this.$params.id}`, {filter})
.then(response => this.travel = response.data);
}
}
ngModule.vnComponent('vnTravelCard', {
template: require('./index.html'),
controller: Controller
});