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

48 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-09-05 11:47:15 +00:00
import ngModule from '../module';
2020-03-16 10:58:14 +00:00
import Section from 'salix/components/section';
import './style.scss';
2018-09-05 11:47:15 +00:00
2020-03-16 10:58:14 +00:00
class Controller extends Section {
2018-09-05 11:47:15 +00:00
getSummary() {
this.$http.get(`Claims/${this.claim.id}/getSummary`).then(response => {
2018-09-05 11:47:15 +00:00
this.summary = response.data;
});
}
$onChanges() {
2020-03-16 10:58:14 +00:00
if (this.claim && this.claim.id) {
2018-09-05 11:47:15 +00:00
this.getSummary();
2020-03-16 10:58:14 +00:00
this.$.model.where = {
claimFk: this.claim.id
};
this.$.model.refresh();
}
2018-09-05 11:47:15 +00:00
}
2018-11-21 12:29:46 +00:00
showItemDescriptor(event, itemFk) {
this.$.itemDescriptor.itemFk = itemFk;
this.$.itemDescriptor.parent = event.target;
this.$.itemDescriptor.show();
}
showWorkerDescriptor(event, workerFk) {
this.selectedWorker = workerFk;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
2018-11-21 12:29:46 +00:00
}
2019-02-21 06:46:27 +00:00
showTicketDescriptor(event, ticketId) {
this.$.ticketDescriptor.ticketFk = ticketId;
this.$.ticketDescriptor.parent = event.target;
this.$.ticketDescriptor.show();
}
2018-09-05 11:47:15 +00:00
}
ngModule.component('vnClaimSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
claim: '<'
}
});