fix pargar mande

This commit is contained in:
2026-07-25 16:47:12 +03:30
parent 5b11dccbb8
commit 017e375c4d
21 changed files with 148 additions and 43 deletions
+2 -2
View File
@@ -81,8 +81,8 @@ export const dashboardDateMetrics = {
'جمع = fullPriceSood + fullPriceKarmozd'
),
gifts: help(
'طلایی که ادمین به مشتریان هدیه داده در همین بازه.',
'گرم هدیه = جمع طلای ثبت‌شده در تراکنش‌های ادمین'
'طلای پاداشی که در این بازه به مشتریان داده شده: پاداش معرفی، پاداش ثبت‌نام و سود زیرمجموعه. شارژ دستی طلا و معاملات اینجا شمرده نمی‌شوند.',
'گرم هدیه = جمع طلای تراکنش‌های پاداش معرفی/ثبت‌نام و سود زیرمجموعه'
),
} as const satisfies Record<string, DashboardHelp>
@@ -1,5 +1,5 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
/*import BudgetSelect from '@/components/BudgetSelect.vue'
import { useStaticApiListsStore } from '@/store/staticApisStore'
@@ -138,7 +138,7 @@ export const cols: BaseTableColumn[] = [
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalaliNoTime(record.record.created_at)
return toJalali(record.record.created_at)
}
},*/
{
@@ -9,7 +9,7 @@
<p class="pargar-wallet-sync__hint">
{{
canSync
? 'موجودی را با ماندهٔ پرگار یکی می‌کند — تاریخچهٔ اسناد روی کیف replay نمی‌شود'
? 'ریال و طلای کیف اصلی را با ماندهٔ پرگار یکی می‌کند — فقط وقتی همهٔ اسناد در پرگار ثبت شده باشند'
: 'ابتدا کد حسابداری پرگار را برای این مشتری ثبت کنید'
}}
</p>
@@ -22,10 +22,28 @@
class="pargar-wallet-sync__btn"
:loading="loading"
:disabled="!canSync || loading"
@click="$emit('sync')"
@click="$emit('sync', false)"
>
همگام‌سازی مانده از پرگار
</a-button>
<a-popconfirm
title="ماندهٔ پرگار بدون بررسی اعتبار روی کیف مشتری نوشته شود؟"
ok-text="بله، اعمال کن"
cancel-text="انصراف"
:disabled="!canSync || loading"
@confirm="$emit('sync', true)"
>
<a-button
type="link"
size="small"
block
danger
class="pargar-wallet-sync__force"
:disabled="!canSync || loading"
>
اعمال اجباری مانده
</a-button>
</a-popconfirm>
</div>
</template>
@@ -38,7 +56,7 @@ defineProps<{
}>()
defineEmits<{
(e: 'sync'): void
(e: 'sync', force: boolean): void
}>()
</script>
@@ -69,4 +87,8 @@ defineEmits<{
.pargar-wallet-sync__btn {
@apply font-600;
}
.pargar-wallet-sync__force {
@apply mt-1 text-xs;
}
</style>
@@ -1,5 +1,5 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
import { usePrice } from '@core/utils/usePrice'
/*import BudgetSelect from '@/components/BudgetSelect.vue'
@@ -157,7 +157,7 @@ export const cols: BaseTableColumn[] = [
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalaliNoTime(record.record.created_at)
return toJalali(record.record.created_at)
}
},*/
]
+2 -2
View File
@@ -659,11 +659,11 @@ async function refreshWalletPanels() {
])
}
async function syncPargarWallet() {
async function syncPargarWallet(force = false) {
if (!userInfo.value?.id || !pargarWalletCanSync.value || pargarSyncLoading.value) return
pargarSyncLoading.value = true
try {
const res = await syncCustomerWalletFromPargar(userInfo.value.id)
const res = await syncCustomerWalletFromPargar(userInfo.value.id, force)
const applied =
res.ok ||
(res.result?.documents?.acknowledged ?? 0) > 0 ||
@@ -1,5 +1,5 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalali, toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
import { usePrice } from '@core/utils/usePrice'
import { metalLabel } from '@/utils/adminMetalLabels'
@@ -227,7 +227,7 @@ export function getGiftCardColumns(): BaseTableColumn[] {
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalaliNoTime(record.record.created_at)
return toJalali(record.record.created_at)
}
},*/
{
@@ -25,7 +25,7 @@
<span v-if="order.id" class="order-detail__dot">·</span>
<span v-if="order.id">کد {{ order.id }}</span>
<span class="order-detail__dot">·</span>
<span class="order-detail__muted">{{ dateLabel }} {{ timeLabel }}</span>
<span class="order-detail__muted">{{ dateLabel }}</span>
</p>
<p class="order-detail__product-line m-0">
<span class="order-detail__field-label">محصول</span>
@@ -193,7 +193,7 @@
<script setup lang="ts">
import type { Order } from '@/model/order'
import { isMobile } from '@core/utils/is'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import { formatAmountWithUnit } from '@/utils/weightUnit'
import {
formatOrderRial,
@@ -241,10 +241,8 @@ const directionClass = computed(() =>
)
const dateLabel = computed(() =>
order.value?.created_at ? toJalaliNoTime(order.value.created_at) : '—'
order.value?.created_at ? toJalali(order.value.created_at) : '—'
)
const timeLabel = computed(() => (order.value?.created_at ? toTime(order.value.created_at) : ''))
const paymentLabel = computed(() =>
order.value?.direction === 2 ? 'مبلغ دریافتی مشتری' : 'مبلغ پرداختی مشتری'
)
@@ -1,5 +1,5 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import {toJalali, toJalaliNoTime, toTime} from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
/*import BudgetSelect from '@/components/BudgetSelect.vue'
import { useStaticApiListsStore } from '@/store/staticApisStore'
@@ -207,7 +207,7 @@ export const cols: BaseTableColumn[] = [
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalaliNoTime(record.record.created_at)
return toJalali(record.record.created_at)
}
},*/
{
@@ -30,7 +30,7 @@ import MobileInfoGrid from '@/components/mobile/MobileInfoGrid.vue'
import MobileSheetHeader from '@/components/mobile/MobileSheetHeader.vue'
import MobileStatCard from '@/components/mobile/MobileStatCard.vue'
import { isMobile } from '@core/utils/is'
import { toJalaliNoTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import { usePrice } from '@core/utils/usePrice'
import { metalLabel } from '@/utils/adminMetalLabels'
@@ -51,7 +51,7 @@ const visibleProxy = computed({
const sheetTitle = computed(() => props.item?.user?.name || `قیمت #${props.item?.id ?? '-'}`)
function dateLabel(row: Price) {
return row.created_at ? toJalaliNoTime(row.created_at) : '-'
return row.created_at ? toJalali(row.created_at) : '-'
}
function dateTimeLabel(row: Price) {
@@ -17,7 +17,7 @@
<script setup lang="ts">
import type { PriceSyncLog } from '@/model/priceSyncLog'
import MobileCard from '@/components/mobile/MobileCard.vue'
import { toJalaliNoTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import { usePrice } from '@core/utils/usePrice'
const SOURCE_LABELS: Record<string, string> = {
@@ -34,7 +34,7 @@ defineEmits<{
}>()
const sourceLabel = computed(() => SOURCE_LABELS[props.item.source] ?? props.item.source)
const dateLabel = computed(() => (props.item.created_at ? toJalaliNoTime(props.item.created_at) : '-'))
const dateLabel = computed(() => (props.item.created_at ? toJalali(props.item.created_at) : '-'))
const priceLabel = computed(() =>
props.item.liquid_gold_price > 0 ? usePrice(props.item.liquid_gold_price, true, '') : '—'
)
@@ -1,5 +1,5 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
import { usePrice } from '@core/utils/usePrice'
import { metalLabel } from '@/utils/adminMetalLabels'
@@ -142,7 +142,7 @@ export function getPriceColumns(): BaseTableColumn[] {
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalaliNoTime(record.record.created_at)
return toJalali(record.record.created_at)
}
},
{
@@ -1,5 +1,5 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import { usePrice } from '@core/utils/usePrice'
const SOURCE_LABELS: Record<string, string> = {
@@ -46,7 +46,7 @@ export const storePriceColumns: BaseTableColumn[] = [
dataIndex: 'created_at',
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => toJalaliNoTime(record.record.created_at)
customRender: (record: any) => toJalali(record.record.created_at)
},
{
title: 'زمان',
@@ -64,7 +64,7 @@ import MobileInfoGrid from '@/components/mobile/MobileInfoGrid.vue'
import MobileSheetHeader from '@/components/mobile/MobileSheetHeader.vue'
import MobileStatCard from '@/components/mobile/MobileStatCard.vue'
import { isMobile } from '@core/utils/is'
import { toJalaliNoTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import { usePrice } from '@core/utils/usePrice'
import { metalLabel, transactionMetalAmountTitle } from '@/utils/adminMetalLabels'
import { formatMetalDisplayValue, metalCellValue } from '@/utils/metalWeight'
@@ -102,7 +102,7 @@ function typeTagClass(row: Transaction) {
}
function dateLabel(row: Transaction) {
return row.created_at ? toJalaliNoTime(row.created_at) : '-'
return row.created_at ? toJalali(row.created_at) : '-'
}
function noteLabel(row: Transaction) {
@@ -25,7 +25,7 @@
<script setup lang="ts">
import type { Transaction } from '@/model/transaction'
import MobileCard from '@/components/mobile/MobileCard.vue'
import { toJalaliNoTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
const props = defineProps<{
item: Transaction
@@ -45,5 +45,5 @@ const typeTagClass = computed(() =>
)
const customerName = computed(() => props.item.customer?.name || '-')
const dateLabel = computed(() => (props.item.created_at ? toJalaliNoTime(props.item.created_at) : '-'))
const dateLabel = computed(() => (props.item.created_at ? toJalali(props.item.created_at) : '-'))
</script>
@@ -1,5 +1,5 @@
import type { BaseTableColumn } from '@core/type/baseTable'
import { toJalaliNoTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import CustomTag from '@/components/CustomTag.vue'
import { usePrice } from '@core/utils/usePrice'
import { metalLabel, transactionMetalAmountTitle } from '@/utils/adminMetalLabels'
@@ -169,7 +169,7 @@ export function buildTransactionsColumns(metals: TransactionMetalColumn[] = []):
key: 'created_at',
type: 'DateTime',
customRender: (record: any) => {
return toJalaliNoTime(record.record.created_at)
return toJalali(record.record.created_at)
}
}
]
+2 -2
View File
@@ -86,7 +86,7 @@ import type { FormInstance } from 'ant-design-vue'
import BasicInfoModal from '@/components/BasicInfoModal/index.vue'
import { message } from 'ant-design-vue/es'
import type { Info } from '@/components/BasicInfoModal/model/Info'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { toJalali, toTime } from '@core/utils/useDataTime'
import { confirmDeleteItem } from '@/utils/confirmModal'
import { cloneDeep } from 'lodash'
import type { Item } from '@/model/Item'
@@ -129,7 +129,7 @@ let infoParams = reactive<Info>({})
function info(val: Transaction) {
infoParams.name = val.customer.name
infoParams.type = val.transaction_type === '1' ? 'نقدی' : metalLabel.goldUnit()
infoParams.date = toJalaliNoTime(val.created_at)
infoParams.date = toJalali(val.created_at)
infoParams.time = toTime(val.created_at)
infoParams.itemsTitle = 'اطلاعات کاربری'
infoParams.items = [
@@ -17,7 +17,7 @@
<script setup lang="ts">
import type { Withdraw } from '@/model/wallet'
import MobileCard from '@/components/mobile/MobileCard.vue'
import { toJalaliNoTime } from '@core/utils/useDataTime'
import { toJalali } from '@core/utils/useDataTime'
import {
formatWithdrawAmountDisplay,
withdrawAmountValue
@@ -37,7 +37,7 @@ const noteLabel = computed(() => {
})
const customerName = computed(() => props.item.customer?.name || '-')
const dateLabel = computed(() => (props.item.created_at ? toJalaliNoTime(props.item.created_at) : '-'))
const dateLabel = computed(() => (props.item.created_at ? toJalali(props.item.created_at) : '-'))
const amountLabel = computed(() => formatWithdrawAmountDisplay(props.item))
const amountClass = computed(() => {
const value = withdrawAmountValue(props.item)
@@ -18,7 +18,7 @@
</div>-->
<div class="flex items-center justify-between">
<span class="text-gray-500 text-xs font-medium">تاریخ سفارش :</span>
<span class="text-gray-700 text-sm font-medium">{{ toJalaliNoTime(withdraw?.created_at) }}</span>
<span class="text-gray-700 text-sm font-medium">{{ toJalali(withdraw?.created_at) }}</span>
</div>
<div class="flex items-center justify-between">
<span class="text-gray-500 text-xs font-medium">شماره سفارش :</span>
@@ -120,7 +120,7 @@ import { getWithdrawById , getWithdrawTable } from '@/api/wallet'
import { onMounted } from 'vue'
import { usePrice } from '@core/utils/usePrice'
import Icon from '@core/components/BaseIcon/src/Icon.vue'
import {toJalaliNoTime} from "../../../../core/utils/useDataTime";
import {toJalali} from "../../../../core/utils/useDataTime";
import {forEach} from "lodash";
import {getConfigApp} from "@/utils/config";
+2 -2
View File
@@ -106,7 +106,7 @@ import type { FormInstance } from 'ant-design-vue'
import BasicInfoModal from '@/components/BasicInfoModal/index.vue'
import { message } from 'ant-design-vue/es'
import type { Info } from '@/components/BasicInfoModal/model/Info'
import { toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { toJalali, toJalaliNoTime, toTime } from '@core/utils/useDataTime'
import { confirmDeleteItem } from '@/utils/confirmModal'
import { cloneDeep } from 'lodash'
import type { Item } from '@/model/Item'
@@ -164,7 +164,7 @@ let infoParams = reactive<Info>({})
function info(val: Order) {
infoParams.name = val.customer.name
infoParams.type = val.customer.mobile
infoParams.date = toJalaliNoTime(val.created_at)
infoParams.date = toJalali(val.created_at)
infoParams.time = toTime(val.created_at)
infoParams.itemsTitle = 'اطلاعات کاربری'
infoParams.items = [