This commit is contained in:
@@ -127,7 +127,43 @@ export default {
|
||||
//------ Addresses
|
||||
res = await window.$gz.api.get(`customer/address/${custId}`);
|
||||
if (res.data) {
|
||||
console.log("woheaderfldvalchng-address:", res.data);
|
||||
//Addresses are considered non-empty if the PostAddress or Address field is not empty
|
||||
|
||||
//Set Billing address
|
||||
if (
|
||||
!window.$gz.util.stringIsNullOrEmpty(
|
||||
res.data.headofficepost.postAddress
|
||||
)
|
||||
) {
|
||||
//Use head office bill to address
|
||||
this.value.postAddress = res.data.headofficepost.postAddress;
|
||||
this.value.postCity = res.data.headofficepost.postCity;
|
||||
this.value.postRegion = res.data.headofficepost.postRegion;
|
||||
this.value.postCountry = res.data.headofficepost.postCountry;
|
||||
this.value.postCode = res.data.headofficepost.postCode;
|
||||
} else {
|
||||
//Use customer postal address, if it's empty then it's empty
|
||||
this.value.postAddress = res.data.customerpost.postAddress;
|
||||
this.value.postCity = res.data.customerpost.postCity;
|
||||
this.value.postRegion = res.data.customerpost.postRegion;
|
||||
this.value.postCountry = res.data.customerpost.postCountry;
|
||||
this.value.postCode = res.data.customerpost.postCode;
|
||||
}
|
||||
|
||||
//Set service address
|
||||
if (
|
||||
!window.$gz.util.stringIsNullOrEmpty(
|
||||
res.data.customerphys.address
|
||||
)
|
||||
) {
|
||||
//Use head office bill to address
|
||||
this.value.address = res.data.customerphys.address;
|
||||
this.value.city = res.data.customerphys.city;
|
||||
this.value.region = res.data.customerphys.region;
|
||||
this.value.country = res.data.customerphys.country;
|
||||
this.value.latitude = res.data.customerphys.latitude;
|
||||
this.value.longitude = res.data.customerphys.longitude;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user