salix/modules/client/front/contact/index.js

29 lines
634 B
JavaScript
Raw Permalink Normal View History

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 {
2018-08-27 09:22:59 +00:00
add() {
2020-03-17 10:17:50 +00:00
this.$.model.insert({
2018-08-27 09:22:59 +00:00
clientFk: this.client.id,
name: this.$t('Phone'),
2018-08-27 09:22:59 +00:00
phone: null
});
}
2018-08-27 09:22:59 +00:00
onSubmit() {
2020-03-17 10:17:50 +00:00
this.$.watcher.check();
2020-03-18 08:41:23 +00:00
this.$.model.save().then(() => {
this.$.watcher.notifySaved();
this.$.watcher.updateOriginalData();
});
}
}
ngModule.vnComponent('vnClientContact', {
template: require('./index.html'),
controller: Controller,
bindings: {
client: '<'
}
});