Solverd bug related to Bug #312

This commit is contained in:
gerard 2018-07-02 13:14:14 +02:00
parent df8d3078d9
commit cb34b11b99
2 changed files with 13 additions and 8 deletions

View File

@ -8,8 +8,8 @@
label="Client" label="Client"
show-field="name" show-field="name"
value-field="id" value-field="id"
field="$ctrl.ticket.clientFk" field="$ctrl.clientFk"
initial-data="$ctrl.ticket.clientFk" initial-data="$ctrl.clientFk"
on-change="$ctrl.onChange()"> on-change="$ctrl.onChange()">
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete vn-one <vn-autocomplete vn-one

View File

@ -9,17 +9,22 @@ class Controller {
this.vnApp = vnApp; this.vnApp = vnApp;
} }
set clientFk(value) {
this.ticket.clientFk = value;
this.ticket.addressFk = null;
}
get clientFk() {
if (this.ticket)
return this.ticket.clientFk;
}
$onInit() { $onInit() {
this.data.registerChild(this); this.data.registerChild(this);
} }
onChange() {
if (this.ticket)
this.ticket.addressFk = null;
}
getAddresses() { getAddresses() {
if (this.ticket) if (this.ticket && this.ticket.addressFk)
return `/api/Clients/${this.ticket.clientFk}/addresses`; return `/api/Clients/${this.ticket.clientFk}/addresses`;
} }