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

55 lines
1.4 KiB
JavaScript

import ngModule from '../module';
import Section from 'salix/components/section';
export default class Controller extends Section {
stateColor(claim) {
switch (claim.description) {
case 'Pendiente':
return 'warning';
case 'Gestionado':
return 'notice';
case 'Resuelto':
return 'success';
}
}
showClientDescriptor(event, clientFk) {
this.$.clientDescriptor.clientFk = clientFk;
this.$.clientDescriptor.parent = event.target;
this.$.clientDescriptor.show();
event.preventDefault();
event.stopImmediatePropagation();
}
showWorkerDescriptor(event, workerFk) {
event.preventDefault();
event.stopImmediatePropagation();
this.selectedWorker = workerFk;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
preview(event, claim) {
this.claimSelected = claim;
this.$.dialogSummaryClaim.show();
event.preventDefault();
event.stopImmediatePropagation();
}
onDescriptorLoad() {
this.$.popover.relocate();
}
onSearch(params) {
if (params)
this.$.model.applyFilter(null, params);
else
this.$.model.clear();
}
}
ngModule.component('vnClaimIndex', {
template: require('./index.html'),
controller: Controller
});