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

43 lines
1.1 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']
}
}
]
};
}
showItemDescriptor(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.$.itemDescriptor.show(event.target, sale.itemFk);
}
}
ngModule.vnComponent('vnTicketSaleChecked', {
template: require('./index.html'),
controller: Controller,
bindings: {
ticket: '<'
}
});