1405/03/21-fix bug in ghatreh

This commit is contained in:
2026-06-11 11:02:50 +03:30
parent 9ba2d3ec96
commit a9922b33ef
6 changed files with 202 additions and 110 deletions
+59 -14
View File
@@ -16,7 +16,7 @@
class="text-gray-500 text-xs number-ltr">{{ item.gold }}
<div>{{item.unit}}</div>
</div>
<div class="text-gray-500 flex gap-1 text-xs items-center number-ltr">
<div v-if="!isShopProduct" class="text-gray-500 flex gap-1 text-xs items-center number-ltr">
<div :class="item.cash > 0 ? 'text-green-600':'text-red-600'" class="text-base">
{{ usePriceWithoutType(item.cash?? 0) }}
</div>
@@ -25,7 +25,27 @@
</div>
</div>
</div>
<div v-if="isGold" class="flex w-full justify-between mt-2">
<template v-if="isShopProduct">
<div class="flex w-full justify-between mt-2">
<div class="text-gray-500">تعداد:</div>
<div class="text-gray-500 text-xs number-ltr">{{ item?.gold ?? 0 }}</div>
</div>
<div class="flex w-full justify-between mt-2">
<div class="text-gray-500">قیمت کل:</div>
<div class="text-gray-500 flex gap-1 text-xs items-center number-ltr">
<div class="text-base">{{ usePriceWithoutType(item.order?.total_price ?? 0) }}</div>
ریال
</div>
</div>
<div class="flex w-full justify-between mt-2">
<div class="text-gray-500">قیمت واحد:</div>
<div class="text-gray-500 flex gap-1 text-xs items-center number-ltr">
<div class="text-base">{{ usePriceWithoutType(item.order?.price ?? 0) }}</div>
ریال
</div>
</div>
</template>
<div v-else-if="isGold" class="flex w-full justify-between mt-2">
<div class="text-gray-500">قیمت معامله:</div>
<div class="text-gray-500 flex gap-1 text-xs items-center">
<!-- <div class="text-base">{{ typeof parseInt((Math.abs(item.cash) / Math.abs(item.gold)).toFixed(0)) }}</div>-->
@@ -60,20 +80,44 @@
ریال
</div>
</div>
<div v-if="item.order" class="flex justify-between mb-3">
<div class="text-primary">قیمت هر گرم طلا حین معامله:</div>
<div class="flex text-xs items-center number-ltr">
<div class="text-base ml-1">{{ usePriceWithoutType(item.order?.price?? 0) }}</div>
ریال
<template v-if="isShopProduct">
<div class="flex justify-between mb-3">
<div class="text-primary">تعداد:</div>
<div class="flex text-xs items-center number-ltr">
<div class="text-base ml-1">{{ item.order?.number ?? 0 }}</div>
</div>
</div>
</div>
<div class="flex justify-between mb-3">
<div class="text-primary">مقدار {{item.wallet?.product? item.wallet.product.title: 'آبشده' }} مبادله شده:</div>
<div :class="item.gold >= 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center number-ltr">
<div class="text-base ml-1">{{ item.gold }}</div>
{{item.unit}}
<div class="flex justify-between mb-3">
<div class="text-primary">قیمت کل:</div>
<div class="flex text-xs items-center number-ltr">
<div class="text-base ml-1">{{ usePriceWithoutType(item.order?.total_price ?? 0) }}</div>
ریال
</div>
</div>
</div>
<div class="flex justify-between mb-3">
<div class="text-primary">قیمت واحد:</div>
<div class="flex text-xs items-center number-ltr">
<div class="text-base ml-1">{{ usePriceWithoutType(item.order?.price ?? 0) }}</div>
ریال
</div>
</div>
</template>
<template v-else>
<div v-if="item.order" class="flex justify-between mb-3">
<div class="text-primary">قیمت هر گرم طلا حین معامله:</div>
<div class="flex text-xs items-center number-ltr">
<div class="text-base ml-1">{{ usePriceWithoutType(item.order?.price?? 0) }}</div>
ریال
</div>
</div>
<div class="flex justify-between mb-3">
<div class="text-primary">مقدار {{item.wallet?.product? item.wallet.product.title: 'آبشده' }} مبادله شده:</div>
<div :class="item.gold >= 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center number-ltr">
<div class="text-base ml-1">{{ item.gold }}</div>
{{item.unit}}
</div>
</div>
</template>
<div class="flex justify-between mb-3">
<div class="text-primary">موجودی کیف پول:</div>
<div :class="item.cash > 0? 'text-green-600' : 'text-red-600'" class="flex text-xs items-center number-ltr">
@@ -156,6 +200,7 @@ interface Prop {
const props = withDefaults(defineProps<Prop>(), {})
const isUp = computed(() => props.item.type === 3 || props.item.type === 1 || props.item.type === 8 || props.item.type === 9)
const isGold = computed(() => props.item.type === 1 || props.item.type === 2 || props.item.type === 10)
const isShopProduct = computed(() => !!props.item?.product_id)
/*const title = computed(() => {
if (isUp.value) {
if (isGold.value) {