salix/modules/ticket/front/sale-checked/index.js

49 lines
1.2 KiB
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
constructor($element, $) {
super($element, $);
this.filter = {
include: [{
relation: 'item'
},
{
relation: 'isChecked',
scope: {
fields: ['isChecked']
}
}]
};
}
showDescriptor(event, sale) {
this.quicklinks = {
btnThree: {
icon: 'icon-transaction',
state: `item.card.diary({
id: ${sale.itemFk},
warehouseFk: ${this.ticket.warehouseFk},
lineFk: ${sale.id}
})`,
tooltip: 'Item diary'
}
};
this.$.descriptor.itemFk = sale.itemFk;
this.$.descriptor.parent = event.target;
this.$.descriptor.show();
}
onDescriptorLoad() {
this.$.popover.relocate();
}
}
ngModule.component('vnTicketSaleChecked', {
template: require('./index.html'),
controller: Controller,
bindings: {
ticket: '<'
}
});