salix/modules/invoiceOut/front/summary/index.js

50 lines
1.3 KiB
JavaScript
Raw Normal View History

2019-03-28 10:55:23 +00:00
import ngModule from '../module';
2020-03-17 13:43:46 +00:00
import Section from 'salix/components/section';
2019-03-28 10:55:23 +00:00
import './style.scss';
2020-03-17 13:43:46 +00:00
class Controller extends Section {
2019-03-28 10:55:23 +00:00
set invoiceOut(value) {
this._invoiceOut = value;
if (value && value.id)
this.getSummary();
}
get invoiceOut() {
return this._invoiceOut;
}
getSummary() {
this.$http.get(`InvoiceOuts/${this.invoiceOut.id}/summary`).then(response => {
2019-03-28 10:55:23 +00:00
this.summary = response.data;
});
}
showClientDescriptor(event, clientFk) {
this.$.clientDescriptor.clientFk = clientFk;
this.$.clientDescriptor.parent = event.target;
this.$.clientDescriptor.show();
event.preventDefault();
}
showTicketDescriptor(event, ticketFk) {
this.$.ticketDescriptor.ticketFk = ticketFk;
this.$.ticketDescriptor.parent = event.target;
this.$.ticketDescriptor.show();
event.preventDefault();
}
preview(event, invoiceOut) {
this.selectedInvoiceOut = invoiceOut;
this.$.invoiceOutSummaryDialog.show();
event.preventDefault();
}
}
ngModule.component('vnInvoiceOutSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
invoiceOut: '<'
}
});