salix/modules/ticket/front/package/index.js

27 lines
621 B
JavaScript
Raw Normal View History

import ngModule from '../module';
2020-03-18 07:35:59 +00:00
import Section from 'salix/components/section';
2020-03-18 07:35:59 +00:00
class Controller extends Section {
add() {
2020-03-18 07:35:59 +00:00
this.$.model.insert({
packagingFk: null,
quantity: null,
created: new Date(),
2020-03-18 13:08:04 +00:00
ticketFk: this.$params.id
2018-03-21 10:08:59 +00:00
});
}
2018-03-21 10:08:59 +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
}
}
2019-05-01 16:49:39 +00:00
ngModule.component('vnTicketPackage', {
template: require('./index.html'),
controller: Controller
});