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 {
|
2021-08-12 11:55:10 +00:00
|
|
|
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) {
|
2021-08-12 11:55:10 +00:00
|
|
|
this.loadData();
|
|
|
|
this.loadTickets();
|
2021-07-13 06:59:36 +00:00
|
|
|
}
|
2019-03-28 10:55:23 +00:00
|
|
|
}
|
|
|
|
|
2021-08-12 11:55:10 +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
|
|
|
}
|
|
|
|
|
2021-08-12 11:55:10 +00:00
|
|
|
loadTickets() {
|
|
|
|
this.$.$applyAsync(() => this.$.ticketsModel.refresh());
|
2019-03-28 10:55:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-24 12:22:30 +00:00
|
|
|
ngModule.vnComponent('vnInvoiceOutSummary', {
|
2019-03-28 10:55:23 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
invoiceOut: '<'
|
|
|
|
}
|
|
|
|
});
|