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

31 lines
750 B
JavaScript

import ngModule from '../module';
import Summary from 'salix/components/summary';
import './style.scss';
class Controller extends Summary {
set invoiceOut(value) {
this._invoiceOut = value;
if (value && value.id) {
this.getSummary();
this.$.ticketsModel.url = `InvoiceOuts/${this.invoiceOut.id}/getTickets`;
}
}
get invoiceOut() {
return this._invoiceOut;
}
getSummary() {
return this.$http.get(`InvoiceOuts/${this.invoiceOut.id}/summary`)
.then(res => this.summary = res.data);
}
}
ngModule.vnComponent('vnInvoiceOutSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
invoiceOut: '<'
}
});