salix/modules/route/front/basic-data/index.js

35 lines
918 B
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
onSubmit() {
this.$.watcher.submit().then(() =>
this.card.reload()
);
}
constructor($element, $) {
super($element, $);
this.$http.get(`UserConfigs/getUserConfig`)
.then(res => {
if (res && res.data) {
this.$http.post(`Vehicles/sorted`, {warehouseFk: res.data.warehouseFk})
.then(res => {
if (res && res.data)
this.vehicles = res.data;
});
}
});
}
}
ngModule.vnComponent('vnRouteBasicData', {
template: require('./index.html'),
controller: Controller,
bindings: {
route: '<'
},
require: {
card: '^vnRouteCard'
}
});