50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
import ngModule from '../module';
|
|
import Section from 'salix/components/section';
|
|
import './style.scss';
|
|
|
|
class Controller extends Section {
|
|
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 => {
|
|
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: '<'
|
|
}
|
|
});
|