add silver & copper to inventory

This commit is contained in:
2026-02-17 15:21:30 +03:30
parent 5f49bf88f6
commit 22a5b26607
4 changed files with 50 additions and 8 deletions
+3
View File
@@ -31,7 +31,10 @@ export interface Wallet {
count_gold: number count_gold: number
count_gold_wallet: number count_gold_wallet: number
count_gold_wallets: number count_gold_wallets: number
count_silver: number
count_copper: number
count_product: number count_product: number
count_cash_total: number
} }
export interface Wallets { export interface Wallets {
cash : number cash : number
+6 -3
View File
@@ -509,14 +509,17 @@ function calculateGold(val: number) {
form.value.goldValue = toFixedDownThreeChar(parseFloat(val / price?.value?.buy)) form.value.goldValue = toFixedDownThreeChar(parseFloat(val / price?.value?.buy))
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() === '') {
form.value.goldValue = undefined form.value.goldValue = undefined
priceErrorVisible.value = false priceErrorVisible.value = false
} else { }
else {
form.value.goldValue = 0 form.value.goldValue = 0
priceErrorVisible.value = false priceErrorVisible.value = false
} }
} else { }
else {
if (val) { if (val) {
form.value.goldValue = toFixedDownThreeChar(parseFloat((val / price?.value?.sell))) form.value.goldValue = toFixedDownThreeChar(parseFloat((val / price?.value?.sell)))
if (parseInt(finalPrice.value) > 0) priceErrorVisible.value = true if (parseInt(finalPrice.value) > 0) priceErrorVisible.value = true
+14 -2
View File
@@ -13,6 +13,14 @@
محصولات: محصولات:
<div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_product ?? 0}}عدد</div> <div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_product ?? 0}}عدد</div>
</div> </div>
<div v-if="nameProject === 'goldsun'" class="flex justify-center mt-2 w-full z-20">
دارایی نقره:
<div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_silver ?? 0}}گرم</div>
</div>
<div v-if="nameProject === 'goldsun'" class="flex justify-center mt-2 w-full z-20">
دارایی مس:
<div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_copper ?? 0}}گرم</div>
</div>
<div class="flex justify-center mt-2 w-full z-20"> <div class="flex justify-center mt-2 w-full z-20">
دارایی طلایی: دارایی طلایی:
<div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_gold ?? 0}}گرم</div> <div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_gold ?? 0}}گرم</div>
@@ -21,6 +29,10 @@
دارایی ریالی: دارایی ریالی:
<div class="text-l mr-4 font-bold">{{ usePriceWithoutType(walletStore.walletInfo?.count_cash ?? 0) }}ریال</div> <div class="text-l mr-4 font-bold">{{ usePriceWithoutType(walletStore.walletInfo?.count_cash ?? 0) }}ریال</div>
</div> </div>
<div class="flex justify-center mt-2 w-full z-20">
معادل ریالی مجموع دارایی ها:
<div class="text-l mr-4 font-bold">{{ usePriceWithoutType(walletStore.walletInfo?.count_cash_total ?? 0) }}ریال</div>
</div>
<!-- <div class="flex items-baseline justify-center mt-2 w-full z-20"> <!-- <div class="flex items-baseline justify-center mt-2 w-full z-20">
<div class="text-3xl font-bold">{{ inventory }}</div> <div class="text-3xl font-bold">{{ inventory }}</div>
/عدد /عدد
@@ -76,8 +88,8 @@ import { getMe } from '@/api/me'
import type { User } from '@/models/login' import type { User } from '@/models/login'
import {usePriceWithoutType} from "../../../utils/usePrice"; import {usePriceWithoutType} from "../../../utils/usePrice";
import {useWalletStore} from "@/store/walletStore"; import {useWalletStore} from "@/store/walletStore";
const openModal = ref<boolean>(false) import {useConfigStore} from "@/store/configStore";
const nameProject = useConfigStore().config.name
const items = ref<Fund[]>([]) const items = ref<Fund[]>([])
const tableOutput = ref<TableOutput<Fund> | null>(null) const tableOutput = ref<TableOutput<Fund> | null>(null)
+27 -3
View File
@@ -390,10 +390,34 @@
:value="(walletStore.walletInfo?.count_gold_wallet ?? 0) + ' گرم'" :value="(walletStore.walletInfo?.count_gold_wallet ?? 0) + ' گرم'"
/> />
<a-divider class="!my-1" /> <a-divider class="!my-1" />
<BasicInfoItem
v-if="nameProject === 'goldsun'"
class="flex justify-between"
title="دارایی کیف پول نقره"
is-line
:value="(walletStore.walletInfo?.count_silver ?? 0) + ' گرم'"
/>
<a-divider v-if="nameProject === 'goldsun'" class="!my-1" />
<BasicInfoItem
v-if="nameProject === 'goldsun'"
class="flex justify-between"
title="دارایی کیف پول مس"
is-line
:value="(walletStore.walletInfo?.count_copper ?? 0) + ' گرم'"
/>
<a-divider v-if="nameProject === 'goldsun'" class="!my-1" />
<BasicInfoItem
class="flex justify-between"
title="معادل ریالی مجموع دارایی ها"
is-line
:value="usePrice(walletStore.walletInfo?.count_cash_total ?? 0)"
/>
<a-divider class="!my-1" />
<!-- <BasicInfoItem class="flex justify-between" title="دارایی کیف پول(به گرم)" is-line <!-- <BasicInfoItem class="flex justify-between" title="دارایی کیف پول(به گرم)" is-line
:value="((walletStore.walletInfo?.cash?? 0) / (goldVal?? 0)).toFixed(2)+ ' گرم'" /> :value="((walletStore.walletInfo?.cash?? 0) / (goldVal?? 0)).toFixed(2)+ ' گرم'" />
<a-divider class="!my-1" />--> <a-divider class="!my-1" />-->
<BasicInfoItem <!-- <BasicInfoItem
class="flex justify-between" class="flex justify-between"
title="ارزش کل دارایی شما" title="ارزش کل دارایی شما"
is-line is-line
@@ -405,7 +429,7 @@
).toFixed(0) ).toFixed(0)
) )
" "
/> />-->
</div> </div>
</div> </div>
</div> </div>
@@ -465,7 +489,7 @@ import {Modal} from "ant-design-vue";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue"; import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
import {message} from "ant-design-vue/es"; import {message} from "ant-design-vue/es";
import {useConfigStore} from "@/store/configStore"; import {useConfigStore} from "@/store/configStore";
const nameProject = useConfigStore().config.name
const userStore = useUserStore() const userStore = useUserStore()
const walletStore = useWalletStore() const walletStore = useWalletStore()
const chartLoading = ref<boolean>(false) const chartLoading = ref<boolean>(false)