HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -351,20 +351,15 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
openDialog: false,
|
||||
openSelectDialog: false,
|
||||
selectType: 1, //1==service / physical, 2==billing / postal
|
||||
alternateAddresses: [] //{objectName:"NAME-Type",addressViz:"summary",addressFields:{address:aaa,city:aaa,region:aaa,country:ccc, code:ccc, lat:lll, long:lll}}
|
||||
selectType: 1,
|
||||
alternateAddresses: []
|
||||
};
|
||||
},
|
||||
|
||||
props: {
|
||||
value: {
|
||||
default: null,
|
||||
@@ -374,7 +369,6 @@ export default {
|
||||
default: null,
|
||||
type: Object
|
||||
},
|
||||
|
||||
formKey: { type: String, default: "" }, //used to grab template from store
|
||||
readonly: Boolean,
|
||||
disabled: Boolean
|
||||
@@ -471,17 +465,17 @@ export default {
|
||||
window.$gz.util.copyToClipboard(ret);
|
||||
/* todo maybe down the road if asked for?
|
||||
|
||||
if(mAddressType==AddressTypes.Physical)
|
||||
{
|
||||
if(mLatitude!=0 || mLongitude!=0)
|
||||
{
|
||||
sb.Append(" \r\n");
|
||||
sb.Append(LongitudeToString(mLongitude));
|
||||
sb.Append(" ");
|
||||
sb.Append(LatitudeToString(mLatitude));
|
||||
sb.Append(" \r\n");
|
||||
}
|
||||
} */
|
||||
if(mAddressType==AddressTypes.Physical)
|
||||
{
|
||||
if(mLatitude!=0 || mLongitude!=0)
|
||||
{
|
||||
sb.Append(" \r\n");
|
||||
sb.Append(LongitudeToString(mLongitude));
|
||||
sb.Append(" ");
|
||||
sb.Append(LatitudeToString(mLatitude));
|
||||
sb.Append(" \r\n");
|
||||
}
|
||||
} */
|
||||
},
|
||||
AddressCopyPostalToClipBoard() {
|
||||
let ret = "";
|
||||
@@ -512,14 +506,13 @@ export default {
|
||||
},
|
||||
async GeoCapture() {
|
||||
try {
|
||||
//window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||
let loc = await window.$gz.util.getGeoLocation();
|
||||
const loc = await window.$gz.util.getGeoLocation();
|
||||
this.value.latitude = loc.latitude;
|
||||
this.fieldValueChanged("latitude");
|
||||
this.value.longitude = loc.longitude;
|
||||
this.fieldValueChanged("longitude");
|
||||
} catch (ex) {
|
||||
//window.$gz.errorHandler.handleFormError(ex, vm);
|
||||
//could fail on some platforms
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -547,7 +540,7 @@ async function populateAlternateAddresses(vm) {
|
||||
const ispostal = vm.selectType == 2;
|
||||
const wo = vm.value;
|
||||
if (wo.customerId != null) {
|
||||
let res = await window.$gz.api.get(`customer/address/${wo.customerId}`);
|
||||
const res = await window.$gz.api.get(`customer/address/${wo.customerId}`);
|
||||
if (res.data) {
|
||||
//customer first
|
||||
if (ispostal) {
|
||||
@@ -579,13 +572,13 @@ async function populateAlternateAddresses(vm) {
|
||||
//Unit addresses
|
||||
//Units only have physical addresses
|
||||
if (!ispostal) {
|
||||
let unitIdList = [];
|
||||
const unitIdList = [];
|
||||
vm.value.items.forEach(i => {
|
||||
i.units.forEach(async u => {
|
||||
if (u.unitId != null && !unitIdList.includes(u.unitId)) {
|
||||
unitIdList.push(u.unitId);
|
||||
//get address
|
||||
let res = await window.$gz.api.get(`unit/address/${u.unitId}`);
|
||||
const res = await window.$gz.api.get(`unit/address/${u.unitId}`);
|
||||
if (res.data) {
|
||||
vm.alternateAddresses.push({
|
||||
name: res.data.unit.name,
|
||||
@@ -605,7 +598,7 @@ async function populateAlternateAddresses(vm) {
|
||||
//
|
||||
function formatAddress(o) {
|
||||
//Format address(es) as compact as possible
|
||||
let ret = { physical: "", postal: "" };
|
||||
const ret = { physical: "", postal: "" };
|
||||
|
||||
//Physical
|
||||
if (!window.$gz.util.stringIsNullOrEmpty(o.address)) {
|
||||
|
||||
Reference in New Issue
Block a user