fix bug of input
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
addon-text-color="white"
|
addon-text-color="white"
|
||||||
place-holder="ارزش کل"
|
place-holder="ارزش کل"
|
||||||
size="large"
|
size="large"
|
||||||
type="price" @onchange="calculateCash" />
|
type="price" @onchange="calculateGold" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :rules="[justNumber()]">
|
<a-form-item :rules="[justNumber()]">
|
||||||
<BasicInput v-model:value="form.goldValue" addon-before="گرم" :addon-bg-color="useConfigStore().config.color"
|
<BasicInput v-model:value="form.goldValue" addon-before="گرم" :addon-bg-color="useConfigStore().config.color"
|
||||||
@@ -479,10 +479,8 @@ const limitedPrice = computed(() => {
|
|||||||
}*/
|
}*/
|
||||||
function calculateCash(val: number) {
|
function calculateCash(val: number) {
|
||||||
priceErrorVisible.value = false
|
priceErrorVisible.value = false
|
||||||
|
|
||||||
if (price.value) {
|
if (price.value) {
|
||||||
form.value.goldVazn = parseFloat((val * (( props?.ProductItem?.price) + (props?.ProductItem?.cash_fee_buy)))/lastPrice.value?.buy).toFixed(1)
|
form.value.goldVazn = parseFloat((val * (( props?.ProductItem?.price) + (props?.ProductItem?.cash_fee_buy)))/lastPrice.value?.buy).toFixed(1)
|
||||||
// console.log(val,props?.ProductItem?.price,props?.ProductItem?.cash_fee_buy,lastPrice.value?.buy)
|
|
||||||
if (isBuy.value) {
|
if (isBuy.value) {
|
||||||
if (val) {
|
if (val) {
|
||||||
form.value.goldCash = parseFloat(val * (( props?.ProductItem?.price) + (props?.ProductItem?.cash_fee_buy))).toFixed(0)
|
form.value.goldCash = parseFloat(val * (( props?.ProductItem?.price) + (props?.ProductItem?.cash_fee_buy))).toFixed(0)
|
||||||
@@ -490,7 +488,6 @@ function calculateCash(val: number) {
|
|||||||
else {
|
else {
|
||||||
form.value.goldCash = 0
|
form.value.goldCash = 0
|
||||||
form.value.goldVazn = 0
|
form.value.goldVazn = 0
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -506,7 +503,6 @@ function calculateCash(val: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function calculateGold(val: number) {
|
function calculateGold(val: number) {
|
||||||
// form.value.goldCash = usePriceWithoutType(form.value.goldCash)
|
|
||||||
if (price.value) {
|
if (price.value) {
|
||||||
if (isBuy.value) {
|
if (isBuy.value) {
|
||||||
if (val) {
|
if (val) {
|
||||||
@@ -526,7 +522,6 @@ function calculateGold(val: number) {
|
|||||||
if (parseInt(finalPrice.value) > 0) priceErrorVisible.value = true
|
if (parseInt(finalPrice.value) > 0) priceErrorVisible.value = true
|
||||||
if (parseInt(finalPrice.value) === 0) priceErrorVisible.value = false
|
if (parseInt(finalPrice.value) === 0) priceErrorVisible.value = false
|
||||||
} else if (val.toString() === '') {
|
} else if (val.toString() === '') {
|
||||||
// console.log('sasasasasasa')
|
|
||||||
form.value.goldValue = undefined
|
form.value.goldValue = undefined
|
||||||
priceErrorVisible.value = false
|
priceErrorVisible.value = false
|
||||||
} else {
|
} else {
|
||||||
@@ -537,10 +532,6 @@ function calculateGold(val: number) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*watch(form.value?.goldValue, (n)=>{
|
|
||||||
console.log('salammmm', n)
|
|
||||||
})*/
|
|
||||||
|
|
||||||
const bganim = ref(null)
|
const bganim = ref(null)
|
||||||
|
|
||||||
function useStyle() {
|
function useStyle() {
|
||||||
|
|||||||
Reference in New Issue
Block a user