This commit is contained in:
@@ -294,10 +294,13 @@ CURRENTLY DOING: front end full in
|
|||||||
|
|
||||||
Address
|
Address
|
||||||
- add get route customer/billing-address
|
- add get route customer/billing-address
|
||||||
returns mailto address of customer or of head office if it has a head office and bill head office is checked
|
returns mailto address of customer AND of head office if it has a head office and bill head office is checked
|
||||||
|
{client:{addressfields},headoffice:{addressfields}}
|
||||||
- add get route customer/service-address
|
- add get route customer/service-address
|
||||||
returns physical address of customer
|
returns physical address of customer
|
||||||
|
{client:{addressfields}}
|
||||||
- add get route unit/service-address
|
- add get route unit/service-address
|
||||||
|
{unit:{addressfields}}
|
||||||
|
|
||||||
UI
|
UI
|
||||||
wo address control
|
wo address control
|
||||||
|
|||||||
@@ -33,11 +33,8 @@ export default {
|
|||||||
return window.$gz.form;
|
return window.$gz.form;
|
||||||
},
|
},
|
||||||
fieldValueChanged(ref) {
|
fieldValueChanged(ref) {
|
||||||
if (
|
if (!this.pvm.formState.loading && !this.pvm.formState.readonly) {
|
||||||
!this.parentVM.formState.loading &&
|
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||||
!this.parentVM.formState.readonly
|
|
||||||
) {
|
|
||||||
window.$gz.form.fieldValueChanged(this.parentVM, ref);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
147
ayanova/src/components/work-order-address.vue
Normal file
147
ayanova/src/components/work-order-address.vue
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="mb-n2 ml-10">
|
||||||
|
<span class="text-caption">{{ $ay.t("Address") }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="mb-6 mb-sm-0">
|
||||||
|
<v-btn icon class="ml-n1 mr-2" @click="openDialog = true">
|
||||||
|
<v-icon>$ayiEdit</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
|
||||||
|
<p class="text-caption">{{ displayServiceAddress }}</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/* XXXeslint-disable */
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return { openDialog: false };
|
||||||
|
},
|
||||||
|
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
default: null,
|
||||||
|
type: Object
|
||||||
|
},
|
||||||
|
pvm: {
|
||||||
|
default: null,
|
||||||
|
type: Object
|
||||||
|
},
|
||||||
|
|
||||||
|
formKey: { type: String, default: "" }, //used to grab template from store
|
||||||
|
readonly: Boolean,
|
||||||
|
disabled: Boolean
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
form() {
|
||||||
|
return window.$gz.form;
|
||||||
|
},
|
||||||
|
fieldValueChanged(ref) {
|
||||||
|
if (!this.pvm.formState.loading && !this.pvm.formState.readonly) {
|
||||||
|
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
displayServiceAddress() {
|
||||||
|
//Address as displayed on workorder form
|
||||||
|
//as compact as possible
|
||||||
|
let ret = "";
|
||||||
|
if (!window.$gz.util.stringIsNullOrEmpty(this.value.address)) {
|
||||||
|
ret += this.value.address + " ";
|
||||||
|
}
|
||||||
|
if (!window.$gz.util.stringIsNullOrEmpty(this.value.city)) {
|
||||||
|
ret += this.value.city + " ";
|
||||||
|
}
|
||||||
|
if (!window.$gz.util.stringIsNullOrEmpty(this.value.region)) {
|
||||||
|
ret += this.value.region + " ";
|
||||||
|
}
|
||||||
|
if (!window.$gz.util.stringIsNullOrEmpty(this.value.country)) {
|
||||||
|
ret += this.value.country + " ";
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
postAddress: null,
|
||||||
|
postCity: null,
|
||||||
|
postRegion: null,
|
||||||
|
postCountry: null,
|
||||||
|
postCode: null,
|
||||||
|
address: null,
|
||||||
|
city: null,
|
||||||
|
region: null,
|
||||||
|
country: null,
|
||||||
|
latitude: null,
|
||||||
|
longitude: null,
|
||||||
|
/// <summary>
|
||||||
|
/// Get complete address as single string for display
|
||||||
|
/// following US / Canadian postal regulations recommendations:
|
||||||
|
/// DELIVERY ADDRESS
|
||||||
|
/// CITY/STATE/ZIP
|
||||||
|
/// COUNTRY
|
||||||
|
/// </summary>
|
||||||
|
public string FullAddress
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||||
|
if(mDeliveryAddress!=null && mDeliveryAddress.Length>0)
|
||||||
|
{
|
||||||
|
sb.Append(mDeliveryAddress);
|
||||||
|
sb.Append(" \r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mCity!=null && mCity.Length>0)
|
||||||
|
{
|
||||||
|
sb.Append(mCity);
|
||||||
|
sb.Append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mStateProv!=null && mStateProv.Length>0)
|
||||||
|
{
|
||||||
|
sb.Append(mStateProv);
|
||||||
|
sb.Append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mPostal!=null && mPostal.Length>0)
|
||||||
|
{
|
||||||
|
//Postal codes should have two spaces before them according to regs.
|
||||||
|
sb.Append(" ");
|
||||||
|
sb.Append(mPostal);
|
||||||
|
sb.Append(" \r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mCountry!=null && mCountry.Length>0)
|
||||||
|
{
|
||||||
|
sb.Append(mCountry);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
</script>
|
||||||
@@ -37,13 +37,7 @@
|
|||||||
@input="fieldValueChanged('customerId')"
|
@input="fieldValueChanged('customerId')"
|
||||||
></gz-pick-list>
|
></gz-pick-list>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
v-if="form().showMe(this, 'ProjectAccountNumber')"
|
|
||||||
cols="12"
|
|
||||||
sm="6"
|
|
||||||
lg="4"
|
|
||||||
xl="3"
|
|
||||||
>
|
|
||||||
<GzWoState
|
<GzWoState
|
||||||
v-if="pvm.subRights.states.visible"
|
v-if="pvm.subRights.states.visible"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
@@ -55,6 +49,17 @@
|
|||||||
:allowed-states="pvm.selectLists.allowedwostatus"
|
:allowed-states="pvm.selectLists.allowedwostatus"
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||||
|
<GzWoAddress
|
||||||
|
v-model="value"
|
||||||
|
:form-key="formCustomTemplateKey"
|
||||||
|
:readonly="formState.readOnly"
|
||||||
|
:pvm="pvm"
|
||||||
|
data-cy="woAddress"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
|
||||||
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
<v-col v-if="form().showMe(this, 'Notes')" cols="12">
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="value.notes"
|
v-model="value.notes"
|
||||||
@@ -75,9 +80,11 @@
|
|||||||
/* XXXeslint-disable */
|
/* XXXeslint-disable */
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
import GzWoState from "./work-order-state.vue";
|
import GzWoState from "./work-order-state.vue";
|
||||||
|
import GzWoAddress from "./work-order-address.vue";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
GzWoState
|
GzWoState,
|
||||||
|
GzWoAddress
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user