2019-12-09 11:15:19 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
import Section from 'salix/components/section';
|
|
|
|
|
|
|
|
class Controller extends Section {
|
2020-03-10 13:09:26 +00:00
|
|
|
$onChanges() {
|
2020-03-18 11:55:22 +00:00
|
|
|
if (this.$params && this.$params.q)
|
|
|
|
this.travel = JSON.parse(this.$params.q);
|
2020-03-10 13:09:26 +00:00
|
|
|
}
|
|
|
|
|
2019-12-09 11:15:19 +00:00
|
|
|
onSubmit() {
|
|
|
|
return this.$.watcher.submit().then(
|
|
|
|
res => this.$state.go('travel.card.summary', {id: res.data.id})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ngModule.component('vnTravelCreate', {
|
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
|
|
|
});
|