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

33 lines
758 B
JavaScript

import ngModule from '../module';
import Component from 'core/lib/component';
import './style.scss';
class Controller extends Component {
addStowaway(stowaway) {
let params = {id: stowaway.id, shipFk: this.ticket.id};
this.$http.post(`Stowaways/`, params)
.then(() => this.cardReload())
.then(() => {
this.vnApp.showSuccess(this.$t('Data saved!'));
this.$.dialog.hide();
});
}
show() {
this.$.dialog.show();
}
hide() {
this.$.dialog.hide();
}
}
ngModule.vnComponent('vnAddStowaway', {
template: require('./addStowaway.html'),
controller: Controller,
bindings: {
ticket: '<',
cardReload: '&?'
}
});