2018-05-23 12:26:51 +00:00
|
|
|
import ngModule from '../../module';
|
2018-03-01 10:55:28 +00:00
|
|
|
|
2018-05-23 12:26:51 +00:00
|
|
|
class Controller {
|
2018-03-01 10:55:28 +00:00
|
|
|
constructor($scope, $state, $filter) {
|
|
|
|
this.$ = $scope;
|
|
|
|
this.$state = $state;
|
|
|
|
this.recovery = {
|
2018-05-24 14:02:54 +00:00
|
|
|
started: new Date()
|
2018-03-01 10:55:28 +00:00
|
|
|
};
|
|
|
|
}
|
2018-07-25 11:37:27 +00:00
|
|
|
|
2018-10-17 07:28:38 +00:00
|
|
|
cancel() {
|
2018-07-25 11:37:27 +00:00
|
|
|
this.goToIndex();
|
|
|
|
}
|
|
|
|
|
|
|
|
goToIndex() {
|
|
|
|
this.$state.go('client.card.recovery.index');
|
|
|
|
}
|
|
|
|
|
2018-03-01 10:55:28 +00:00
|
|
|
onSubmit() {
|
|
|
|
this.recovery.clientFk = this.$state.params.id;
|
|
|
|
this.$.watcher.submit().then(
|
|
|
|
() => {
|
2018-07-25 11:37:27 +00:00
|
|
|
this.goToIndex();
|
2018-03-01 10:55:28 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2018-05-23 12:26:51 +00:00
|
|
|
Controller.$inject = ['$scope', '$state', '$filter'];
|
2018-03-01 10:55:28 +00:00
|
|
|
|
|
|
|
ngModule.component('vnClientRecoveryCreate', {
|
2018-05-23 12:26:51 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
2018-03-01 10:55:28 +00:00
|
|
|
});
|