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

57 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-03-28 10:55:23 +00:00
import ngModule from '../module';
import './style.scss';
class Controller {
constructor($scope, $http, vnToken) {
this.accessToken = vnToken.token;
this.$http = $http;
this.$ = $scope;
}
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();
}
}
Controller.$inject = ['$scope', '$http', 'vnToken'];
ngModule.component('vnInvoiceOutSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
invoiceOut: '<'
}
});