salix/modules/client/front/greuge/create/index.js

35 lines
723 B
JavaScript
Raw Normal View History

2018-05-23 12:26:51 +00:00
import ngModule from '../../module';
2020-03-17 10:17:50 +00:00
import Section from 'salix/components/section';
2017-12-04 07:17:29 +00:00
2020-03-17 10:17:50 +00:00
class Controller extends Section {
constructor($element, $) {
super($element, $);
2017-12-13 14:13:13 +00:00
this.greuge = {
2018-10-24 12:10:48 +00:00
shipped: new Date(),
2020-03-17 10:17:50 +00:00
clientFk: this.$params.id
2017-12-13 14:13:13 +00:00
};
2017-12-04 07:17:29 +00:00
}
2018-07-25 12:18:12 +00:00
cancel() {
2018-07-25 12:18:12 +00:00
this.goToIndex();
}
goToIndex() {
this.$state.go('client.card.greuge.index');
}
2017-12-04 07:17:29 +00:00
onSubmit() {
this.$.watcher.submit().then(
() => {
2018-07-25 12:18:12 +00:00
this.goToIndex();
2017-12-04 07:17:29 +00:00
}
);
}
}
2020-03-17 10:17:50 +00:00
Controller.$inject = ['$element', '$scope'];
2017-12-04 07:17:29 +00:00
ngModule.vnComponent('vnClientGreugeCreate', {
2018-05-23 12:26:51 +00:00
template: require('./index.html'),
controller: Controller
2017-12-04 07:17:29 +00:00
});