fix pdf & installation issue

This commit is contained in:
raishvaria
2019-12-14 13:54:35 +05:30
parent bce1b4bb3e
commit c88eb24265
22 changed files with 91 additions and 65 deletions

View File

@ -162,7 +162,7 @@
:options="billingCountries"
:searchable="true"
:show-labels="false"
:allow-empty="false"
:allow-empty="true"
:tabindex="8"
:placeholder="$t('general.select_country')"
label="name"
@ -265,7 +265,7 @@
:searchable="true"
:show-labels="false"
:tabindex="16"
:allow-empty="false"
:allow-empty="true"
:placeholder="$t('general.select_country')"
label="name"
track-by="id"
@ -411,6 +411,36 @@ export default {
return true
}
return false
},
hasBillingAdd () {
let billing = this.billing
if (
billing.name ||
billing.country_id ||
billing.state ||
billing.city ||
billing.phone ||
billing.zip ||
billing.address_street_1 ||
billing.address_street_2) {
return true
}
return false
},
hasShippingAdd () {
let shipping = this.shipping
if (
shipping.name ||
shipping.country_id ||
shipping.state ||
shipping.city ||
shipping.phone ||
shipping.zip ||
shipping.address_street_1 ||
shipping.address_street_2) {
return true
}
return false
}
},
watch: {
@ -418,12 +448,16 @@ export default {
if (newCountry) {
this.billing.country_id = newCountry.id
this.isDisabledBillingState = false
} else {
this.billing.country_id = null
}
},
shipping_country (newCountry) {
if (newCountry) {
this.shipping.country_id = newCountry.id
return true
} else {
this.shipping.country_id = null
}
}
},
@ -446,7 +480,14 @@ export default {
]),
async loadCustomer () {
let { data: { customer, currencies, currency } } = await this.fetchCustomer(this.$route.params.id)
this.formData = customer
this.formData.id = customer.id
this.formData.name = customer.name
this.formData.contact_name = customer.contact_name
this.formData.email = customer.email
this.formData.phone = customer.phone
this.formData.currency_id = customer.currency_id
this.formData.website = customer.website
if (customer.billing_address) {
this.billing = customer.billing_address
@ -495,7 +536,16 @@ export default {
if (this.$v.$invalid) {
return true
}
this.formData.addresses = [{...this.billing}, {...this.shipping}]
if (this.hasBillingAdd && this.hasShippingAdd) {
this.formData.addresses = [{...this.billing}, {...this.shipping}]
} else {
if (this.hasBillingAdd) {
this.formData.addresses = [{...this.billing}]
}
if (this.hasShippingAdd) {
this.formData.addresses = [{...this.shipping}]
}
}
if (this.isEdit) {
if (this.currency) {

View File

@ -32,8 +32,8 @@
class="show-customer"
>
<div class="row px-2 mt-1">
<div class="col col-6">
<div v-if="selectedCustomer.billing_address != null" class="row address-menu">
<div v-if="selectedCustomer.billing_address" class="col col-6">
<div class="row address-menu">
<label class="col-sm-4 px-2 title">{{ $t('general.bill_to') }}</label>
<div class="col-sm p-0 px-2 content">
<label v-if="selectedCustomer.billing_address.name">
@ -57,8 +57,8 @@
</div>
</div>
</div>
<div class="col col-6">
<div v-if="selectedCustomer.shipping_address != null" class="row address-menu">
<div v-if="selectedCustomer.shipping_address" class="col col-6">
<div class="row address-menu">
<label class="col-sm-4 px-2 title">{{ $t('general.ship_to') }}</label>
<div class="col-sm p-0 px-2 content">
<label v-if="selectedCustomer.shipping_address.name">
@ -84,7 +84,7 @@
</div>
</div>
<div class="customer-content mb-1">
<label class="email">{{ selectedCustomer.email ? selectedCustomer.email : selectedCustomer.name }}</label>
<label class="email">{{ selectedCustomer.name }}</label>
<label class="action" @click="removeCustomer">{{ $t('general.remove') }}</label>
</div>
</div>

View File

@ -30,8 +30,8 @@
<div
v-if="selectedCustomer" class="show-customer">
<div class="row px-2 mt-1">
<div class="col col-6">
<div v-if="selectedCustomer.billing_address" class="row address-menu">
<div v-if="selectedCustomer.billing_address" class="col col-6">
<div class="row address-menu">
<label class="col-sm-4 px-2 title">{{ $t('general.bill_to') }}</label>
<div class="col-sm p-0 px-2 content">
<label v-if="selectedCustomer.billing_address.name">
@ -55,8 +55,8 @@
</div>
</div>
</div>
<div class="col col-6">
<div v-if="selectedCustomer.shipping_address" class="row address-menu">
<div v-if="selectedCustomer.shipping_address" class="col col-6">
<div class="row address-menu">
<label class="col-sm-4 px-2 title">{{ $t('general.ship_to') }}</label>
<div class="col-sm p-0 px-2 content">
<label v-if="selectedCustomer.shipping_address.name">