fix edits for borsemes

This commit is contained in:
2026-07-23 17:53:28 +03:30
parent 73feee2048
commit d505f3b5bd
12 changed files with 353 additions and 261 deletions
+36 -7
View File
@@ -10,16 +10,18 @@
<div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
<DashboardLabelWithHelp
label="مظنه"
:help="copy.hero"
:help="heroHelp"
size="xs"
text-class="text-[11px]"
label-class="text-white/80"
/>
<span class="text-[11px] text-white/80">/گرم</span>
<span class="text-[11px] text-white/80">/{{ quoteUnitLabel }}</span>
<span class="text-lg font-bold leading-none sm:text-xl">{{ usePrice(master?.price ?? 0, true, 'ریال') }}</span>
<span class="text-white/35">·</span>
<span class="text-[11px] text-white/80">مثقال</span>
<span class="text-sm font-semibold leading-none sm:text-base">{{ usePrice(master?.pricem ?? 0, true, 'ریال') }}</span>
<template v-if="showMesghalQuote">
<span class="text-white/35">·</span>
<span class="text-[11px] text-white/80">مثقال</span>
<span class="text-sm font-semibold leading-none sm:text-base">{{ usePrice(master?.pricem ?? 0, true, 'ریال') }}</span>
</template>
</div>
<p v-if="master?.update_date" class="mt-1.5 text-[10px] leading-none text-white/55">
{{ toJalali(master.update_date) }}
@@ -344,7 +346,7 @@
<th class="px-2 py-2 text-right">قیمت مشتری</th>
<th class="px-2 py-2 text-right">سود اختلاف قیمت/گرم</th>
<th class="px-2 py-2 text-right">سود کل اختلاف قیمت</th>
<th class="px-2 py-2 text-right">کارمزد (ریال)</th>
<th class="px-2 py-2 text-right">کارمزد</th>
<th class="px-2 py-2 text-right">وضعیت</th>
<th class="px-2 py-2 text-right">تاریخ</th>
</tr>
@@ -372,7 +374,15 @@
{{ usePrice(order.total_fee ?? 0, true, 'ریال') }}
</td>
<td class="px-2 py-2.5">
{{ usePrice(order.service_charge_price ?? 0, true, 'ریال') }}
<div class="leading-snug">
<div>{{ orderServiceFee(order).value }}</div>
<div
v-if="orderServiceFee(order).source"
class="dashboard-text-muted text-[11px]"
>
{{ orderServiceFee(order).source }}
</div>
</div>
</td>
<td class="px-2 py-2.5">
<span class="rounded-md px-2 py-0.5 text-xs" :class="stsClass(order.sts)">
@@ -465,6 +475,9 @@ import { DASHBOARD_RIAL_UNIT, formatDashboardAmount } from '@/pages/dashboard/da
import { useDashboardPage } from '@/pages/dashboard/composables/useDashboardPage'
import { useDashboardQuickActions } from '@/pages/dashboard/composables/useDashboardQuickActions'
import { metalBalanceTitle, metalLabel } from '@/utils/adminMetalLabels'
import { formatOrderServiceFee } from '@/utils/orderServiceFee'
import { getMainMetal } from '@/utils/metalLabels'
import { TRADE_WEIGHT_UNIT_GRAM, TRADE_WEIGHT_UNIT_KILOGRAM } from '@/utils/weightUnit'
const copy = {
hero: dashboardHero,
@@ -523,6 +536,22 @@ const {
customerStats,
} = useDashboardPage()
const orderServiceFee = formatOrderServiceFee
const isCopperMainMetal = computed(() => getMainMetal().trim() === 'مس')
const quoteUnitLabel = computed(() =>
isCopperMainMetal.value ? TRADE_WEIGHT_UNIT_KILOGRAM : TRADE_WEIGHT_UNIT_GRAM
)
const showMesghalQuote = computed(() => !isCopperMainMetal.value)
const heroHelp = computed(() =>
isCopperMainMetal.value
? {
description: 'آخرین قیمت پایه هر کیلوگرم مس در سیستم.',
formula: 'مظنه بر حسب کیلوگرم نمایش داده می‌شود؛ مثقال برای مس کاربرد ندارد.',
}
: copy.hero
)
const tradingProfitTotal = computed(() => {
const priceDiff = Number(finance.value?.fullPriceSood ?? 0)
const commission = Number(finance.value?.fullPriceKarmozd ?? finance.value?.fullPriceKaermozd ?? 0)