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,
|
2020-07-23 14:07:08 +00:00
|
|
|
name: this.$t('Phone'),
|
2018-08-27 09:22:59 +00:00
|
|
|
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();
|
2020-03-18 08:41:23 +00:00
|
|
|
this.$.model.save().then(() => {
|
|
|
|
this.$.watcher.notifySaved();
|
|
|
|
this.$.watcher.updateOriginalData();
|
|
|
|
});
|
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: '<'
|
|
|
|
}
|
|
|
|
});
|