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

35 lines
742 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';
2020-03-17 10:17:50 +00:00
class Controller extends Section {
constructor($element, $) {
super($element, $);
this.recovery = {
2023-01-16 14:18:24 +00:00
started: Date.vnNew()
};
}
2018-07-25 11:37:27 +00:00
cancel() {
2018-07-25 11:37:27 +00:00
this.goToIndex();
}
goToIndex() {
this.$state.go('client.card.recovery.index');
}
onSubmit() {
2020-03-17 10:17:50 +00:00
this.recovery.clientFk = this.$params.id;
this.$.watcher.submit().then(
() => {
2018-07-25 11:37:27 +00:00
this.goToIndex();
}
);
}
}
2020-03-17 10:17:50 +00:00
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnClientRecoveryCreate', {
2018-05-23 12:26:51 +00:00
template: require('./index.html'),
controller: Controller
});