salix/modules/supplier/front/agency-term/index/index.js

37 lines
817 B
JavaScript
Raw Normal View History

2022-03-15 08:36:48 +00:00
import ngModule from '../../module';
2022-03-09 22:54:23 +00:00
import Section from 'salix/components/section';
class Controller extends Section {
2022-03-17 13:27:55 +00:00
constructor($element, $) {
super($element, $);
this.filter = {
include:
{relation: 'agency',
scope: {
fields: ['id', 'name']
}
}
};
}
2022-03-09 22:54:23 +00:00
add() {
this.$.model.insert({});
}
onSubmit() {
this.$.watcher.check();
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
});
}
}
2022-03-15 08:36:48 +00:00
ngModule.vnComponent('vnSupplierAgencyTermIndex', {
2022-03-09 22:54:23 +00:00
template: require('./index.html'),
controller: Controller,
bindings: {
supplier: '<'
}
});