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"
show-field="name"
value-field="id"
field="$ctrl.ticket.clientFk"
initial-data="$ctrl.ticket.clientFk"
field="$ctrl.clientFk"
initial-data="$ctrl.clientFk"
on-change="$ctrl.onChange()">
</vn-autocomplete>
<vn-autocomplete vn-one

View File

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