Merge pull request #2170 from brkcvn/currency-default
Default currency edited for conversion
This commit is contained in:
commit
7fdc1d9762
@ -9,7 +9,7 @@
|
|||||||
precision: parseInt(this.currencySymbol.precision),
|
precision: parseInt(this.currencySymbol.precision),
|
||||||
masked: true
|
masked: true
|
||||||
}" :value="price" disabled size="5" masked class="disabled-money text-right mr-2 js-conversion-input"></money>
|
}" :value="price" disabled size="5" masked class="disabled-money text-right mr-2 js-conversion-input"></money>
|
||||||
<span class="mr-2">{{ currecyCode }} {{ texts[2] }}</span>
|
<span class="mr-2">{{ texts[1] }}</span>
|
||||||
<input name="currency_rate" v-model="rate" @input="onChange" class="form-control text-right mwpx-100 h-auto js-conversion-input" />
|
<input name="currency_rate" v-model="rate" @input="onChange" class="form-control text-right mwpx-100 h-auto js-conversion-input" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -48,16 +48,16 @@ export default {
|
|||||||
return {
|
return {
|
||||||
conversion: '',
|
conversion: '',
|
||||||
rate: this.currencyRate,
|
rate: this.currencyRate,
|
||||||
texts: []
|
texts: [],
|
||||||
|
texts_split: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
let conver = this.currencyConversionText.split(':price');
|
let conver = this.currencyConversionText.split(':price');
|
||||||
|
|
||||||
this.texts.push(conver[0]);
|
this.texts.push(conver[0]);
|
||||||
this.texts.push(conver[1].replace(':currency_code', this.currecyCode).replace(':currency_rate', this.currencyRate));
|
this.texts.push(conver[1].replace(':currency_code', this.currecyCode).replace(':currency_rate', ''));
|
||||||
this.texts.push(this.texts[1].split(" ")[2])
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -72,19 +72,19 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
price: function (price) {
|
price: function (price) {
|
||||||
this.conversion = this.currencyConversionText.replace(':price', price).replace(':currency_code', this.currecyCode).replace(':currency_rate', '');
|
this.conversion = this.currencyConversionText.replace(':price', price).replace(':currency_code', this.currecyCode).replace();
|
||||||
},
|
},
|
||||||
|
|
||||||
currecyCode: function (currecyCode) {
|
currecyCode: function (currecyCode) {
|
||||||
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', '');
|
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace();
|
||||||
},
|
},
|
||||||
|
|
||||||
currencyRate: function (currencyRate) {
|
currencyRate: function (currencyRate) {
|
||||||
this.rate = currencyRate;
|
this.rate = currencyRate;
|
||||||
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', '');
|
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace();
|
||||||
},
|
},
|
||||||
currencySymbol: function (currencySymbol) {
|
currencySymbol: function (currencySymbol) {
|
||||||
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', '');
|
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -553,10 +553,13 @@
|
|||||||
|
|
||||||
this.form.currency_code = currency.code;
|
this.form.currency_code = currency.code;
|
||||||
this.form.currency_rate = currency.rate;
|
this.form.currency_rate = currency.rate;
|
||||||
this.currency_symbol = currency;
|
|
||||||
|
|
||||||
this.currencyConversion();
|
this.currencyConversion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (document_default_currency == currency.code) {
|
||||||
|
this.currency_symbol = currency;
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user