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

27 lines
625 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,
2023-01-16 14:18:24 +00:00
created: Date.vnNew(),
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
}
}
ngModule.vnComponent('vnTicketPackage', {
template: require('./index.html'),
controller: Controller
});