add silver & copper to inventory
This commit is contained in:
@@ -31,7 +31,10 @@ export interface Wallet {
|
||||
count_gold: number
|
||||
count_gold_wallet: number
|
||||
count_gold_wallets: number
|
||||
count_silver: number
|
||||
count_copper: number
|
||||
count_product: number
|
||||
count_cash_total: number
|
||||
}
|
||||
export interface Wallets {
|
||||
cash : number
|
||||
|
||||
@@ -509,14 +509,17 @@ function calculateGold(val: number) {
|
||||
form.value.goldValue = toFixedDownThreeChar(parseFloat(val / price?.value?.buy))
|
||||
if (parseInt(finalPrice.value) > 0) priceErrorVisible.value = true
|
||||
if (parseInt(finalPrice.value) === 0) priceErrorVisible.value = false
|
||||
} else if (val.toString() === '') {
|
||||
}
|
||||
else if (val.toString() === '') {
|
||||
form.value.goldValue = undefined
|
||||
priceErrorVisible.value = false
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
form.value.goldValue = 0
|
||||
priceErrorVisible.value = false
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (val) {
|
||||
form.value.goldValue = toFixedDownThreeChar(parseFloat((val / price?.value?.sell)))
|
||||
if (parseInt(finalPrice.value) > 0) priceErrorVisible.value = true
|
||||
|
||||
@@ -13,6 +13,14 @@
|
||||
محصولات:
|
||||
<div class="text-l mr-4 font-bold">{{ walletStore.walletInfo?.count_product ?? 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_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="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>
|
||||
<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="text-3xl font-bold">{{ inventory }}</div>
|
||||
/عدد
|
||||
@@ -76,8 +88,8 @@ import { getMe } from '@/api/me'
|
||||
import type { User } from '@/models/login'
|
||||
import {usePriceWithoutType} from "../../../utils/usePrice";
|
||||
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 tableOutput = ref<TableOutput<Fund> | null>(null)
|
||||
|
||||
@@ -390,10 +390,34 @@
|
||||
:value="(walletStore.walletInfo?.count_gold_wallet ?? 0) + ' گرم'"
|
||||
/>
|
||||
<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
|
||||
:value="((walletStore.walletInfo?.cash?? 0) / (goldVal?? 0)).toFixed(2)+ ' گرم'" />
|
||||
<a-divider class="!my-1" />-->
|
||||
<BasicInfoItem
|
||||
<!-- <BasicInfoItem
|
||||
class="flex justify-between"
|
||||
title="ارزش کل دارایی شما"
|
||||
is-line
|
||||
@@ -405,7 +429,7 @@
|
||||
).toFixed(0)
|
||||
)
|
||||
"
|
||||
/>
|
||||
/>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -465,7 +489,7 @@ import {Modal} from "ant-design-vue";
|
||||
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
|
||||
import {message} from "ant-design-vue/es";
|
||||
import {useConfigStore} from "@/store/configStore";
|
||||
|
||||
const nameProject = useConfigStore().config.name
|
||||
const userStore = useUserStore()
|
||||
const walletStore = useWalletStore()
|
||||
const chartLoading = ref<boolean>(false)
|
||||
|
||||
Reference in New Issue
Block a user