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

44 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-08-24 11:16:11 +00:00
import ngModule from '../module';
2020-04-25 09:50:04 +00:00
import Descriptor from 'salix/components/descriptor';
2018-08-24 11:16:11 +00:00
2020-04-25 09:50:04 +00:00
class Controller extends Descriptor {
2018-10-03 06:00:19 +00:00
get claim() {
return this.entity;
2018-10-03 06:00:19 +00:00
}
set claim(value) {
this.entity = value;
2018-08-24 11:16:11 +00:00
}
2019-02-12 06:42:19 +00:00
showPickupOrder() {
this.showReport('claim-pickup-order', {
clientId: this.claim.clientFk,
claimId: this.claim.id
});
2019-01-25 14:08:11 +00:00
}
2019-09-06 09:06:44 +00:00
sendPickupOrder() {
return this.sendEmail('claim-pickup-order', {
recipient: this.claim.client.email,
clientId: this.claim.clientFk,
claimId: this.claim.id
});
2019-09-06 09:06:44 +00:00
}
deleteClaim() {
return this.$http.delete(`Claims/${this.claim.id}`)
.then(() => {
this.vnApp.showSuccess(this.$t('Claim deleted!'));
this.$state.go('claim.index');
});
}
2018-08-24 11:16:11 +00:00
}
2020-04-25 09:50:04 +00:00
ngModule.vnComponent('vnClaimDescriptor', {
2018-08-24 11:16:11 +00:00
template: require('./index.html'),
controller: Controller,
bindings: {
claim: '<'
2018-08-24 11:16:11 +00:00
}
});