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-03-14 10:36:57 +00:00
|
|
|
this.insurance = {
|
2020-03-17 10:17:50 +00:00
|
|
|
created: this.$filter('date')(new Date(), 'yyyy-MM-dd HH:mm:ss')
|
2018-03-14 10:36:57 +00:00
|
|
|
};
|
|
|
|
}
|
2018-07-10 06:23:32 +00:00
|
|
|
|
|
|
|
onSubmit() {
|
2020-03-17 10:17:50 +00:00
|
|
|
let params = {classificationId: this.$params.classificationId};
|
2018-07-10 06:23:32 +00:00
|
|
|
let state = 'client.card.creditInsurance.insurance.index';
|
|
|
|
|
2020-03-17 10:17:50 +00:00
|
|
|
this.$.watcher.submitGo(state, params).then(() => {
|
2018-07-10 06:23:32 +00:00
|
|
|
this.card.reload();
|
|
|
|
});
|
|
|
|
}
|
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('vnClientCreditInsuranceInsuranceCreate', {
|
|
|
|
template: require('./index.html'),
|
2018-03-14 10:36:57 +00:00
|
|
|
controller: Controller,
|
2018-07-10 06:23:32 +00:00
|
|
|
require: {
|
|
|
|
card: '^vnClientCard'
|
|
|
|
},
|
2018-03-14 10:36:57 +00:00
|
|
|
bindings: {
|
|
|
|
client: '<'
|
|
|
|
}
|
|
|
|
});
|