salix/modules/ticket/front/descriptor/addStowaway.js

33 lines
764 B
JavaScript
Raw Normal View History

2019-01-18 12:36:13 +00:00
import ngModule from '../module';
2020-03-18 07:35:59 +00:00
import Component from 'core/lib/component';
2019-10-10 06:07:11 +00:00
import './style.scss';
2019-01-18 12:36:13 +00:00
2020-03-18 07:35:59 +00:00
class Controller extends Component {
2019-09-25 09:26:12 +00:00
addStowaway(stowaway) {
let params = {id: stowaway.id, shipFk: this.ticket.id};
this.$http.post(`Stowaways/`, params)
.then(() => {
this.cardReload();
this.vnApp.showSuccess(this.$translate.instant('Data saved!'));
2019-06-21 11:19:51 +00:00
this.$.dialog.hide();
2019-01-18 12:36:13 +00:00
});
}
show() {
this.$.dialog.show();
2019-01-18 12:36:13 +00:00
}
hide() {
this.$.dialog.hide();
2019-01-18 12:36:13 +00:00
}
}
ngModule.component('vnAddStowaway', {
template: require('./addStowaway.html'),
controller: Controller,
bindings: {
ticket: '<',
cardReload: '&?'
2019-01-18 12:36:13 +00:00
}
});