2018-06-26 07:41:27 +00:00
|
|
|
import ngModule from '../module';
|
2020-03-17 10:17:50 +00:00
|
|
|
import Section from 'salix/components/section';
|
2018-06-26 07:41:27 +00:00
|
|
|
|
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.$translate.instant('Phone'),
|
|
|
|
phone: null
|
2018-08-30 06:50:03 +00:00
|
|
|
});
|
2018-06-26 07:41:27 +00:00
|
|
|
}
|
|
|
|
|
2018-08-27 09:22:59 +00:00
|
|
|
onSubmit() {
|
2020-03-17 10:17:50 +00:00
|
|
|
this.$.watcher.check();
|
|
|
|
this.$.model.save().then(() =>
|
|
|
|
this.$.watcher.notifySaved()
|
|
|
|
);
|
2018-06-26 07:41:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-31 09:08:22 +00:00
|
|
|
ngModule.component('vnClientContact', {
|
2018-06-26 07:41:27 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
|
|
|
client: '<'
|
|
|
|
}
|
|
|
|
});
|