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';
|
2018-03-14 10:36:57 +00:00
|
|
|
|
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));
|
|
|
|
|
2019-10-24 22:53:53 +00:00
|
|
|
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;
|
|
|
|
});
|
2018-03-14 10:36:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-17 10:17:50 +00:00
|
|
|
Controller.$inject = ['$element', '$scope'];
|
2018-03-14 10:36:57 +00:00
|
|
|
|
2018-05-23 12:26:51 +00:00
|
|
|
ngModule.component('vnClientCreditInsuranceInsuranceIndex', {
|
|
|
|
template: require('./index.html'),
|
2018-03-14 10:36:57 +00:00
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
client: '<'
|
|
|
|
}
|
|
|
|
});
|