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

36 lines
994 B
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
onDialogAccept(id) {
return this.$http.delete(`Expeditions/${id}`)
.then(() => this.$.model.refresh());
}
showItemDescriptor(event, itemFk) {
if (!itemFk) return;
this.quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({
id: ${itemFk},
warehouseFk: ${this.ticket.warehouseFk},
ticketFk: ${this.ticket.id}
})`,
tooltip: 'Item diary',
},
};
this.$.itemDescriptor.itemFk = itemFk;
this.$.itemDescriptor.parent = event.target;
this.$.itemDescriptor.show();
}
}
ngModule.component('vnTicketExpedition', {
template: require('./index.html'),
controller: Controller,
bindings: {
ticket: '<',
},
});