salix/modules/client/front/credit-insurance/insurance/index/index.js

39 lines
976 B
JavaScript
Raw Permalink Normal View History

2018-05-23 12:26:51 +00:00
import ngModule from '../../../module';
2020-03-17 10:17:50 +00:00
import Section from 'salix/components/section';
2020-03-17 10:17:50 +00:00
class Controller extends Section {
constructor($element, $) {
super($element, $);
2018-07-16 06:00:04 +00:00
this.isClosed = true;
this.filter = {
include: [
{relation: 'classification'}
]
};
2018-03-28 13:07:48 +00:00
}
$onInit() {
let filter = {
fields: ['finished'],
2020-03-17 10:17:50 +00:00
where: {id: this.$params.classificationId}
2018-03-28 13:07:48 +00:00
};
filter = encodeURIComponent(JSON.stringify(filter));
let query = `CreditClassifications?filter=${filter}`;
2018-03-28 13:07:48 +00:00
this.$http.get(query).then(res => {
if (res.data)
this.isClosed = res.data[0].finished != null;
});
}
}
2020-03-17 10:17:50 +00:00
Controller.$inject = ['$element', '$scope'];
ngModule.vnComponent('vnClientCreditInsuranceInsuranceIndex', {
2018-05-23 12:26:51 +00:00
template: require('./index.html'),
controller: Controller,
bindings: {
client: '<'
}
});