2018-05-25 08:03:45 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-18 07:35:59 +00:00
|
|
|
import Section from 'salix/components/section';
|
2018-03-15 13:36:09 +00:00
|
|
|
|
2020-03-18 07:35:59 +00:00
|
|
|
class Controller extends Section {
|
2018-08-30 06:50:03 +00:00
|
|
|
add() {
|
2020-03-18 07:35:59 +00:00
|
|
|
this.$.model.insert({
|
2018-08-30 06:50:03 +00:00
|
|
|
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() {
|
2020-03-18 07:35:59 +00:00
|
|
|
this.$.watcher.check();
|
2020-03-18 08:41:23 +00:00
|
|
|
this.$.model.save().then(() => {
|
|
|
|
this.$.watcher.notifySaved();
|
|
|
|
this.$.watcher.updateOriginalData();
|
|
|
|
});
|
2018-03-21 10:08:59 +00:00
|
|
|
}
|
2018-03-15 13:36:09 +00:00
|
|
|
}
|
|
|
|
|
2019-05-01 16:49:39 +00:00
|
|
|
ngModule.component('vnTicketPackage', {
|
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
|
|
|
});
|