address field detailed (city, zip_code, state, country)

This commit is contained in:
Cihan Şentürk
2021-09-03 11:43:55 +03:00
parent 04a4e869e3
commit ebeb8df1da
91 changed files with 15509 additions and 181 deletions

View File

@ -19,7 +19,7 @@
v-html="error">
</div>
</div>
<div class="aka-select-menu" v-if="show.contact_list">
<div class="aka-select-search-container">
<span class="aka-prefixed-input aka-prefixed-input--fluid">
@ -30,11 +30,11 @@
</span>
</div>
<input
<input
type="text"
data-input="true"
class="form-control"
autocapitalize="default" autocorrect="ON"
autocapitalize="default" autocorrect="ON"
:placeholder="placeholder"
:ref="'input-contact-field-' + _uid"
v-model="search"
@ -44,7 +44,7 @@
</div>
</span>
</div>
<ul class="aka-select-menu-options">
<div class="aka-select-menu-option" v-for="(contact, index) in sortContacts" :key="index" @click="onContactSeleted(index, contact.id)">
<div>
@ -60,7 +60,7 @@
</div>
</div>
</ul>
<div class="aka-select-footer" tabindex="0" @click="onContactCreate">
<span>
<i class="fas fa-plus"></i> {{ createNewContactText }}
@ -69,7 +69,7 @@
</div>
</div>
</div>
<div v-else class="document-contact-with-contact-bill-to">
<div>
<span class="aka-text aka-text--block-label">{{ contactInfoText }}</span>
@ -83,11 +83,16 @@
<strong class="d-block">{{ contact.name }}</strong>
</th>
</tr>
<tr>
<tr v-if="contact.address">
<th class="p-0" style="text-align:left; white-space: normal;">
{{ contact.address }}
</th>
</tr>
<tr v-if="contact.locations">
<th class="p-0" style="text-align:left; white-space: normal;">
{{ contact.locations }}
</th>
</tr>
<tr v-if="contact.tax_number">
<th class="p-0" style="text-align:left;">
{{ taxNumberText }}: {{ contact.tax_number }}
@ -188,7 +193,12 @@ export default {
phone: '',
website: '',
address: '',
reference: ''
city: '',
zip_code:'',
state:'',
country:'',
country_name:'',
reference: ''
};
},
description: 'List of Contacts'
@ -198,6 +208,7 @@ export default {
default: () => [],
description: 'List of Contacts'
},
addNew: {
type: Object,
default: function () {
@ -230,6 +241,10 @@ export default {
default: 'Bill to',
description: ""
},
countryText: {
type: [Array, Object],
default: () => [],
},
taxNumberText: {
type: String,
default: 'Tax number',
@ -269,6 +284,7 @@ export default {
buttons: this.addNew.buttons,
},
add_new_html: '',
country_text_data: this.countryText,
};
},
@ -295,7 +311,12 @@ export default {
phone: '',
website: '',
address: '',
reference: ''
city: '',
zip_code: '',
state: '',
country: '',
countryname: '',
reference: ''
});
},
@ -320,7 +341,12 @@ export default {
phone: (contact.phone) ? contact.phone : '',
website: (contact.website) ? contact.website : '',
address: (contact.address) ? contact.address : '',
reference: (contact.reference) ? contact.reference : ''
city: (contact.city) ? contact.city : '',
zip_code: (contact.zip_code) ? contact.zip_code : '',
state: (contact.state) ? contact.state : '',
country: (contact.country) ? contact.country : '',
country_name: (contact.country_name) ? contact.country_name : '',
reference: (contact.reference) ? contact.reference : ''
});
}, this);
})
@ -335,6 +361,26 @@ export default {
this.contact_list.forEach(function (contact, index) {
if (contact_id == contact.id) {
this.contact = contact;
let locations = [];
if (this.contact.city) {
locations.push(this.contact.city);
}
if (this.contact.zip_code) {
locations.push(this.contact.zip_code);
}
if (this.contact.state) {
locations.push(this.contact.state);
}
if (this.contact.country) {
locations.push(this.country_text_data[this.contact.country]);
}
this.contact.locations = locations.join(', ');
}
}, this);
@ -566,7 +612,12 @@ export default {
phone: '',
website: '',
address: '',
reference: ''
city: '',
zip_code: '',
state: '',
country: '',
country_name: '',
reference: ''
});
index++;
@ -586,8 +637,34 @@ export default {
phone: (contact.phone) ? contact.phone : '',
website: (contact.website) ? contact.website : '',
address: (contact.address) ? contact.address : '',
reference: (contact.reference) ? contact.reference : ''
city: (contact.city) ? contact.city : '',
zip_code: (contact.zip_code) ? contact.zip_code : '',
state: (contact.state) ? contact.state : '',
country: (contact.country) ? contact.country : '',
country_name: (contact.country_name) ? contact.country_name : '',
reference: (contact.reference) ? contact.reference : ''
});
let locations = [];
if (contact.city) {
locations.push(contact.city);
}
if (contact.zip_code) {
locations.push(contact.zip_code);
}
if (contact.state) {
locations.push(contact.state);
}
if (contact.country) {
locations.push(this.country_text_data[contact.country])
}
this.contact.locations = locations.join(', ');
}, this);
}