1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

fix: Field number with out country and currency definition. (#521)

This commit is contained in:
Edwin Betancourt 2020-06-16 15:42:04 -04:00 committed by GitHub
parent 4bbbd3cfaa
commit ed083ba3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 7 deletions

View File

@ -31,8 +31,7 @@
v-model="displayedValue"
:placeholder="metadata.help"
:disabled="isDisabled"
:precision="precision"
:class="'display-type-amount ' + metadata.cssClassName"
:class="cssClassStyle"
readonly
@blur="customFocusLost"
@focus="customFocusGained"

View File

@ -204,10 +204,14 @@ const actions = {
responseGetInfo.defaultContextMap.get('#C_Country_ID'),
10
)
// get country and currency
dispatch('getCountryFormServer', {
countryId
})
if (isEmptyValue(countryId)) {
console.info('context session without Country ID')
} else {
// get country and currency
dispatch('getCountryFormServer', {
countryId
})
}
dispatch('getUserInfoFromSession', sessionUuid)
.catch(error => {
@ -448,7 +452,14 @@ const getters = {
return state.country
},
getCurrency: (state) => {
return state.country.currency
const currency = state.country.currency
if (isEmptyValue(currency)) {
return {
stdPrecision: 2,
iSOCode: 'USD'
}
}
return currency
},
getCountryLanguage(state) {
return state.country.language.replace('_', '-')