fix some bugs
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<BaseIcon icon="vuesax-linear:empty-wallet" size="18" color="#15803d" />
|
||||
</template>
|
||||
</MobileStatCard>
|
||||
<MobileStatCard bordered variant="success" label="موجودی طلایی" :value="`${row.balance_gold ?? 0} گرم`">
|
||||
<MobileStatCard bordered variant="success" :label="metalLabel.goldInventory()" :value="`${row.balance_gold ?? 0} گرم`">
|
||||
<template #prefix>
|
||||
<BaseIcon icon="vuesax-linear:coin" size="18" color="#15803d" />
|
||||
</template>
|
||||
@@ -26,7 +26,7 @@
|
||||
<MobileDetailRow label="نام مشتری دعوت شده" :value="row.customer?.name || '-'" />
|
||||
<MobileDetailRow label="زمان ثبت" :value="row.created_at ? toJalali(row.created_at) : '-'" />
|
||||
<MobileDetailRow label="نقد (ریال)" :value="usePrice(row.cash ?? 0, true, '')" />
|
||||
<MobileDetailRow label="طلا (گرم)" :value="`${row.gold ?? 0}`" />
|
||||
<MobileDetailRow :label="m('طلا (گرم)')" :value="`${row.gold ?? 0}`" />
|
||||
<MobileDetailRow label="توضیحات" full-width :value="row.note || '-'" />
|
||||
</MobileInfoGrid>
|
||||
</template>
|
||||
@@ -44,6 +44,8 @@ import MobileSheetHeader from '@/components/mobile/MobileSheetHeader.vue'
|
||||
import { isMobile } from '@core/utils/is'
|
||||
import { toJalali } from '@core/utils/useDataTime'
|
||||
import { usePrice } from '@core/utils/usePrice'
|
||||
import { metalLabel } from '@/utils/adminMetalLabels'
|
||||
import { m } from '@/utils/metalLabels'
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="text-xs text-gray-400">{{ createdAtLabel }}</div>
|
||||
</div>
|
||||
<span class="text-xs text-gray-600">نقد: <span class="font-600 text-gray-900">{{ cashLabel }}</span></span>
|
||||
<span class="text-xs text-gray-600">طلا: <span class="font-600 text-gray-900">{{ goldLabel }}</span></span>
|
||||
<span class="text-xs text-gray-600">{{ metalLabel.goldUnit() }}: <span class="font-600 text-gray-900">{{ goldLabel }}</span></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -21,6 +21,7 @@ import type { TotalAccounting } from '@/model/accounting'
|
||||
import MobileCard from '@/components/mobile/MobileCard.vue'
|
||||
import { toJalali } from '@core/utils/useDataTime'
|
||||
import { usePrice } from '@core/utils/usePrice'
|
||||
import { metalLabel } from '@/utils/adminMetalLabels'
|
||||
|
||||
const props = defineProps<{
|
||||
item: TotalAccounting
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { getTotalAccountingTable } from '@/api/accounting'
|
||||
import { cols } from '@/pages/menuPages/accounting/hooks/accountingColumns'
|
||||
import { getAccountingColumns } from '@/pages/menuPages/accounting/hooks/accountingColumns'
|
||||
import AccountingMobileCardList from '@/pages/menuPages/accounting/components/AccountingMobileCardList.vue'
|
||||
import Icon from '@core/components/BaseIcon/src/Icon.vue'
|
||||
import useBaseTable from '@core/components/BaseTable/hooks/useBaseTable'
|
||||
@@ -51,7 +51,7 @@ const [submit, reload] = useBaseTable()
|
||||
const mobileListRef = ref<null | { fetch: () => Promise<void> }>(null)
|
||||
|
||||
const tblProps = ref({
|
||||
columns: cols,
|
||||
columns: getAccountingColumns(),
|
||||
api: (params: TableInput) => getTotalAccountingTable(params)
|
||||
})
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { BaseTableColumn } from '@core/type/baseTable'
|
||||
import { toJalali, toJalaliNoTime, toTime } from '@core/utils/useDataTime'
|
||||
import CustomTag from '@/components/CustomTag.vue'
|
||||
import { usePrice } from '@core/utils/usePrice'
|
||||
import { metalLabel } from '@/utils/adminMetalLabels'
|
||||
/*import BudgetSelect from '@/components/BudgetSelect.vue'
|
||||
import { useStaticApiListsStore } from '@/store/staticApisStore'
|
||||
import type { FilterSelect } from '@/model/filterSelect'
|
||||
@@ -21,7 +22,8 @@ const filteredDocTypes: FilterSelect = docTypes?.map((x: DocItem) => {
|
||||
}
|
||||
})*/
|
||||
|
||||
export const cols: BaseTableColumn[] = [
|
||||
export function getAccountingColumns(): BaseTableColumn[] {
|
||||
return [
|
||||
{
|
||||
title: 'ردیف',
|
||||
dataIndex: 'id',
|
||||
@@ -63,7 +65,7 @@ export const cols: BaseTableColumn[] = [
|
||||
// }
|
||||
},
|
||||
{
|
||||
title: 'طلا',
|
||||
title: metalLabel.goldUnit(),
|
||||
dataIndex: 'gold',
|
||||
key: 'gold',
|
||||
type: 'Number',
|
||||
@@ -81,4 +83,5 @@ export const cols: BaseTableColumn[] = [
|
||||
slot: 'action',
|
||||
filterable: false
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<a-form :model="form" ref="formRef" autocomplete="off">
|
||||
<div class="grid md:grid-cols-1 gap-4">
|
||||
<div class="bg-gray-50 px-10 py-3 flex justify-center gap-4">
|
||||
<div>قیمت {{ form.direction === 1 ? 'خرید' : 'فروش' }} طلا:</div>
|
||||
<div>{{ metalLabel.goldTradeBuySell(form.direction) }}</div>
|
||||
<div class="font-bold">
|
||||
{{ usePrice(form.direction === 1 ? dataLast?.buy ?? 0 : dataLast?.sell ?? 0) }}
|
||||
</div>
|
||||
@@ -65,7 +65,7 @@
|
||||
</a-form-item>
|
||||
<BasicInfoItem
|
||||
is-line
|
||||
title="کیف پول طلا"
|
||||
:title="metalLabel.goldWalletTitle()"
|
||||
class="mt-2"
|
||||
:value="getGoldBalance(selectedCustomer?.wallet) || '_'"
|
||||
/>
|
||||
@@ -95,7 +95,7 @@
|
||||
addon-before="گرم"
|
||||
addon-bg-color="#0A1B37"
|
||||
addon-text-color="white"
|
||||
place-holder="مقدار طلا"
|
||||
:place-holder="metalLabel.goldPlaceholder()"
|
||||
type="tel"
|
||||
@onchange="calculateCash"
|
||||
/>
|
||||
@@ -143,6 +143,7 @@ import { getLastPrice } from '@/api/price'
|
||||
import type { last } from '@/model/price'
|
||||
import { createOrder } from '@/api/order'
|
||||
import { getCashBalance, getGoldBalance } from '@/components/mobile/utils/wallet'
|
||||
import { metalLabel } from '@/utils/adminMetalLabels'
|
||||
|
||||
//loading
|
||||
const loading = ref<boolean>(false)
|
||||
@@ -248,7 +249,7 @@ function info(val: Order) {
|
||||
value: val.amount ?? '-'
|
||||
},
|
||||
{
|
||||
key: 'قیمت هر گرم طلا برای مشتری (ریال)',
|
||||
key: metalLabel.goldGramPriceCustomer(),
|
||||
value: usePrice(val.price ?? 0) ?? '-'
|
||||
},
|
||||
{
|
||||
@@ -256,7 +257,7 @@ function info(val: Order) {
|
||||
value: usePrice(val.total_price ?? 0) ?? '-'
|
||||
},
|
||||
{
|
||||
key: 'قیمت هر گرم طلا بدون سود (ریال)',
|
||||
key: metalLabel.goldGramPriceOriginal(),
|
||||
value: usePrice(val.price_original ?? 0) ?? '-'
|
||||
},
|
||||
{
|
||||
@@ -284,7 +285,7 @@ function info(val: Order) {
|
||||
value: usePrice(val.service_charge_price ?? 0)
|
||||
},*/
|
||||
{
|
||||
key: 'کارمزد طلایی',
|
||||
key: metalLabel.goldCommission(),
|
||||
value: val.service_charge ?? '-' + ' گرم'
|
||||
},
|
||||
/* {
|
||||
|
||||
Reference in New Issue
Block a user