This commit is contained in:
2025-10-26 16:36:57 +03:30
parent 6b51c52b74
commit 6f8971e94b
@@ -52,7 +52,7 @@
<div class="border-gray-200 border-1 rounded-xl p-5 relative">
<bg_main />
<div class="z-100 relative">
<a-form-item name="method" :rules="[required()]">
<!-- <a-form-item name="method" :rules="[required()]">
<BasicSelect v-model:value="form.method" :items="typeDeal"
key-name="key"
:show-search="false"
@@ -61,7 +61,7 @@
:placeholder="isBuy?'نحوه خرید را انتخاب کنید':' نحوه فروش را انتخاب کنید'"
size="large"
:has-tooltip="false" />
</a-form-item>
</a-form-item>-->
<a-form-item v-if="isBuy" name="goldValue"
:rules="[justNumber2(props?.ProductItem?.price , form.method , props?.ProductItem?.amount, true)]">
@@ -90,14 +90,9 @@
<!-- {{walletStore?.walletInfo?.gold}}-->
<Transition mode="out-in" name="fade" class="mt-2">
<div v-if="isBuy&&form.method=='gold'" class="font-bold text-xs">
<div class="font-bold text-xs">
<div> {{ `موجودی کیف طلا: ${walletStore?.walletInfo?.gold ?? 0} گرم` }}</div>
</div>
<div v-else-if="isBuy" class="font-bold text-xs">
{{ `موجودی کیف پول: ${usePriceWithoutType(walletStore?.walletInfo?.cash ?? 0)} ریال` }}
</div>
<div class="font-bold text-xs" v-else>{{ `موجودی محصول: ${getInventoryById(props?.ProductItem?.id)}` }}
</div>
</Transition>
<Transition mode="out-in" name="fade">
<div v-if="priceErrorVisible" class="flex gap-1 items-center text-xs mt-[-15px] text-orange-600">
@@ -648,14 +643,14 @@ async function ok() {
await createOrder({
direction: isBuy.value ? 1 : 2,
product_id: props.ProductItem.id,
method: form.value.method,
method: "gold_withdraw",
number: form.value.goldValue ?? 0
})
await physicalReceiveApi({
/*await physicalReceiveApi({
product_id: props.ProductItem.id,
value: form.value.goldValue ?? 0
}
)
)*/
await walletStore.getMyWallet()
await router.push({ name: 'transactions' })
form.value = {