2018-05-25 08:03:45 +00:00
|
|
|
import ngModule from '../module';
|
2018-03-15 13:36:09 +00:00
|
|
|
|
|
|
|
class Controller {
|
2018-08-30 06:50:03 +00:00
|
|
|
constructor($scope, $stateParams) {
|
2018-08-17 12:53:25 +00:00
|
|
|
this.$scope = $scope;
|
|
|
|
this.$stateParams = $stateParams;
|
2018-03-21 10:08:59 +00:00
|
|
|
}
|
|
|
|
|
2018-08-30 06:50:03 +00:00
|
|
|
add() {
|
|
|
|
this.$scope.model.insert({
|
|
|
|
packagingFk: null,
|
|
|
|
quantity: null,
|
|
|
|
created: new Date(),
|
|
|
|
ticketFk: this.$stateParams.id
|
2018-03-21 10:08:59 +00:00
|
|
|
});
|
2018-08-30 06:50:03 +00:00
|
|
|
}
|
2018-03-21 10:08:59 +00:00
|
|
|
|
2018-08-30 06:50:03 +00:00
|
|
|
onSubmit() {
|
2018-08-17 12:53:25 +00:00
|
|
|
this.$scope.watcher.check();
|
2018-08-30 06:50:03 +00:00
|
|
|
this.$scope.model.save().then(() => {
|
2018-08-17 12:53:25 +00:00
|
|
|
this.$scope.watcher.notifySaved();
|
|
|
|
this.$scope.model.refresh();
|
2018-03-21 10:08:59 +00:00
|
|
|
});
|
|
|
|
}
|
2018-03-15 13:36:09 +00:00
|
|
|
}
|
|
|
|
|
2018-08-30 06:50:03 +00:00
|
|
|
Controller.$inject = ['$scope', '$stateParams'];
|
2018-03-15 13:36:09 +00:00
|
|
|
|
2018-03-27 13:06:22 +00:00
|
|
|
ngModule.component('vnTicketPackageIndex', {
|
2018-05-25 08:03:45 +00:00
|
|
|
template: require('./index.html'),
|
2018-08-30 06:50:03 +00:00
|
|
|
controller: Controller
|
2018-03-15 13:36:09 +00:00
|
|
|
});
|