2018-05-23 12:26:51 +00:00
|
|
|
import ngModule from '../../module';
|
2017-12-04 07:17:29 +00:00
|
|
|
|
2018-05-23 12:26:51 +00:00
|
|
|
class Controller {
|
2017-12-13 14:13:13 +00:00
|
|
|
constructor($scope, $state, $filter) {
|
2017-12-04 07:17:29 +00:00
|
|
|
this.$ = $scope;
|
|
|
|
this.$state = $state;
|
2017-12-13 14:13:13 +00:00
|
|
|
this.greuge = {
|
2018-10-24 12:10:48 +00:00
|
|
|
shipped: new Date(),
|
|
|
|
clientFk: $state.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
|
|
|
|
2018-10-17 07:28:38 +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
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2018-05-23 12:26:51 +00:00
|
|
|
Controller.$inject = ['$scope', '$state', '$filter'];
|
2017-12-04 07:17:29 +00:00
|
|
|
|
|
|
|
ngModule.component('vnClientGreugeCreate', {
|
2018-05-23 12:26:51 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
2017-12-04 07:17:29 +00:00
|
|
|
});
|