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

27 lines
625 B
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
add() {
this.$.model.insert({
packagingFk: null,
quantity: null,
created: Date.vnNew(),
ticketFk: this.$params.id
});
}
onSubmit() {
this.$.watcher.check();
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
});
}
}
ngModule.vnComponent('vnTicketPackage', {
template: require('./index.html'),
controller: Controller
});