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

35 lines
777 B
JavaScript
Raw Normal View History

2019-03-28 10:55:23 +00:00
import ngModule from '../module';
2020-11-23 12:41:51 +00:00
import Summary from 'salix/components/summary';
2019-03-28 10:55:23 +00:00
import './style.scss';
2020-11-23 12:41:51 +00:00
class Controller extends Summary {
get invoiceOut() {
return this._invoiceOut;
}
2019-03-28 10:55:23 +00:00
set invoiceOut(value) {
this._invoiceOut = value;
2021-07-13 06:59:36 +00:00
if (value && value.id) {
this.loadData();
this.loadTickets();
2021-07-13 06:59:36 +00:00
}
2019-03-28 10:55:23 +00:00
}
loadData() {
this.$http.get(`InvoiceOuts/${this.invoiceOut.id}/summary`)
.then(res => this.summary = res.data);
2019-03-28 10:55:23 +00:00
}
loadTickets() {
this.$.$applyAsync(() => this.$.ticketsModel.refresh());
2019-03-28 10:55:23 +00:00
}
}
ngModule.vnComponent('vnInvoiceOutSummary', {
2019-03-28 10:55:23 +00:00
template: require('./index.html'),
controller: Controller,
bindings: {
invoiceOut: '<'
}
});