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

32 lines
799 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.component('vnTravelCard', {
template: require('./index.html'),
controller: Controller
});