#853 order.new debería rellenar el consignatario por defecto del cliente
This commit is contained in:
parent
98429a95f7
commit
7ada4b7f14
|
@ -10,9 +10,8 @@ class Controller {
|
|||
}
|
||||
|
||||
set order(value) {
|
||||
if (value) {
|
||||
if (value)
|
||||
this._order = value;
|
||||
}
|
||||
}
|
||||
|
||||
get order() {
|
||||
|
@ -21,7 +20,16 @@ class Controller {
|
|||
|
||||
set clientFk(value) {
|
||||
this.order.clientFk = value;
|
||||
this.addressFk = null;
|
||||
|
||||
if (value) {
|
||||
let filter = {where: {clientFk: value, isDefaultAddress: true}};
|
||||
filter = encodeURIComponent(JSON.stringify(filter));
|
||||
let query = `/api/Addresses?filter=${filter}`;
|
||||
this.$http.get(query).then(res => {
|
||||
this.addressFk = res.data[0].id;
|
||||
});
|
||||
} else
|
||||
this.addressFk = null;
|
||||
}
|
||||
|
||||
get clientFk() {
|
||||
|
@ -74,7 +82,7 @@ class Controller {
|
|||
};
|
||||
this.$http.post(`order/api/Orders/new`, params).then(res => {
|
||||
this.vnApp.showSuccess(this.translate.instant('Data saved!'));
|
||||
this.$state.go("order.card.catalog", {id: res.data});
|
||||
this.$state.go('order.card.catalog', {id: res.data});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue