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" v-model="displayedValue"
:placeholder="metadata.help" :placeholder="metadata.help"
:disabled="isDisabled" :disabled="isDisabled"
:precision="precision" :class="cssClassStyle"
:class="'display-type-amount ' + metadata.cssClassName"
readonly readonly
@blur="customFocusLost" @blur="customFocusLost"
@focus="customFocusGained" @focus="customFocusGained"

View File

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