fix some pargar bugs

This commit is contained in:
2026-07-27 21:44:32 +03:30
parent 993de3a4cf
commit b1685b47d5
5 changed files with 12 additions and 48 deletions
@@ -88,7 +88,6 @@
:variant="item.variant" :variant="item.variant"
:loading="item.loading" :loading="item.loading"
:disabled="item.disabled" :disabled="item.disabled"
:to="item.to"
@click="item.onClick?.()" @click="item.onClick?.()"
> >
<template v-if="item.key === 'restore'"> <template v-if="item.key === 'restore'">
@@ -101,8 +100,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { useRouter } from 'vue-router'
import type { RouteLocationRaw } from 'vue-router'
import BasicActionSheet from '@/components/BasicActionSheet.vue' import BasicActionSheet from '@/components/BasicActionSheet.vue'
import DashboardQuickActionBtn from '@/pages/dashboard/components/DashboardQuickActionBtn.vue' import DashboardQuickActionBtn from '@/pages/dashboard/components/DashboardQuickActionBtn.vue'
import { isMobile } from '@core/utils/is' import { isMobile } from '@core/utils/is'
@@ -120,7 +117,6 @@ type ActionItem = {
danger?: boolean danger?: boolean
disabled?: boolean disabled?: boolean
loading?: boolean loading?: boolean
to?: RouteLocationRaw
onClick?: () => void onClick?: () => void
} }
@@ -156,7 +152,6 @@ const emit = defineEmits<{
syncShow: [] syncShow: []
}>() }>()
const router = useRouter()
const menuOpen = ref(false) const menuOpen = ref(false)
const actionItems = computed<ActionItem[]>(() => [ const actionItems = computed<ActionItem[]>(() => [
@@ -219,21 +214,6 @@ const actionItems = computed<ActionItem[]>(() => [
loading: props.quickActionLoading, loading: props.quickActionLoading,
onClick: () => emit('syncShow'), onClick: () => emit('syncShow'),
}, },
{
key: 'products',
label: 'مدیریت محصولات',
shortLabel: 'محصولات',
icon: 'vuesax-linear:box',
to: { name: 'productsMain_limitedOrder' },
},
{
key: 'orders',
label: 'لیست سفارشات',
shortLabel: 'سفارشات',
icon: 'vuesax-linear:receipt-2',
variant: 'primary',
to: { name: 'ordersMain' },
},
]) ])
const mobileMenuGroups = computed<MobileMenuGroup[]>(() => [ const mobileMenuGroups = computed<MobileMenuGroup[]>(() => [
@@ -286,25 +266,6 @@ const mobileMenuGroups = computed<MobileMenuGroup[]>(() => [
}, },
], ],
}, },
{
title: 'صفحات',
items: [
{
key: 'products',
label: 'مدیریت محصولات',
icon: 'vuesax-linear:box',
tone: 'slate',
nav: true,
},
{
key: 'orders',
label: 'لیست سفارشات',
icon: 'vuesax-linear:receipt-2',
tone: 'amber',
nav: true,
},
],
},
]) ])
const mobileActions: Record<string, () => void> = { const mobileActions: Record<string, () => void> = {
@@ -315,8 +276,6 @@ const mobileActions: Record<string, () => void> = {
'close-sell': () => emit('closeAllSell'), 'close-sell': () => emit('closeAllSell'),
'sync-prices': () => emit('syncPrices'), 'sync-prices': () => emit('syncPrices'),
'sync-show': () => emit('syncShow'), 'sync-show': () => emit('syncShow'),
products: () => void router.push({ name: 'productsMain_limitedOrder' }),
orders: () => void router.push({ name: 'ordersMain' }),
} }
function runAction(key: string) { function runAction(key: string) {
@@ -350,10 +309,11 @@ function runAction(key: string) {
.dashboard-quick-actions-bar { .dashboard-quick-actions-bar {
display: flex; display: flex;
max-width: 100%; max-width: 100%;
flex-wrap: wrap; flex-wrap: nowrap;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
gap: 0.375rem; gap: 0.375rem;
overflow-x: auto;
} }
@media (min-width: 768px) and (max-width: 1279px) { @media (min-width: 768px) and (max-width: 1279px) {
+3 -2
View File
@@ -692,8 +692,9 @@ const walletMetricItems = computed(() => [
.dashboard-hero__actions { .dashboard-hero__actions {
order: 2; order: 2;
width: auto; width: auto;
max-width: min(100%, 42rem); max-width: min(100%, 56rem);
flex-shrink: 0; flex-shrink: 1;
min-width: 0;
} }
} }
@@ -1,4 +1,6 @@
export function pargarStatusLabel(status?: string, pargarId?: string | null, desc?: string | null): string { export function pargarStatusLabel(status?: string, pargarId?: string | null, desc?: string | null): string {
if (desc && desc.includes('منتظر ثبت سند')) return 'منتظر سند'
if (desc && desc.includes('در حال اعمال')) return 'در حال اعمال'
if (desc && desc.includes('اختلاف مانده')) return 'اختلاف مانده' if (desc && desc.includes('اختلاف مانده')) return 'اختلاف مانده'
if (pargarId && String(pargarId).startsWith('skip:')) return 'بدون سند' if (pargarId && String(pargarId).startsWith('skip:')) return 'بدون سند'
if (pargarId) return 'موفق' if (pargarId) return 'موفق'
@@ -178,6 +178,7 @@ export function supportMessengerIdPlaceholder(messenger?: string): string {
/** کلیدهای legacy — در پنل نمایش داده نمی‌شوند */ /** کلیدهای legacy — در پنل نمایش داده نمی‌شوند */
export const HIDDEN_LEGACY_SETTING_KEYS = new Set([ export const HIDDEN_LEGACY_SETTING_KEYS = new Set([
'main_product_price', 'main_product_price',
'montzar_price',
'etehadie_api_url', 'etehadie_api_url',
'goldir_price', 'goldir_price',
'price_primary_source', 'price_primary_source',
@@ -715,7 +716,7 @@ const KEY_HELP_FALLBACK: Record<string, string> = {
chart_id: chart_id:
'شناسه نمودار در سرویس تابلو. خالی = شناسه پیش‌فرض سرویس.', 'شناسه نمودار در سرویس تابلو. خالی = شناسه پیش‌فرض سرویس.',
price_provider: price_provider:
'منبع دریافت قیمت لحظه‌ای برای اپ مشتری و همگام‌سازی محصولات.', 'منبع دریافت قیمت لحظه‌ای برای اپ مشتری و همگام‌سازی محصولات. مقدار montzar یعنی قیمت از همکار (Montzar).',
main_product: main_product:
'شناسه یا نام محصول مرجع آبشده. وقتی منبع قیمت «محصول مرجع» باشد برای محاسبه استفاده می‌شود.', 'شناسه یا نام محصول مرجع آبشده. وقتی منبع قیمت «محصول مرجع» باشد برای محاسبه استفاده می‌شود.',
zaarbox_price_key: zaarbox_price_key:
@@ -978,7 +979,7 @@ export const SETTING_EDITABLE_KEYS = new Set([
'main_product_price', 'main_product_price',
'min_first_buy', 'min_withdraw', 'min_deposit', 'minimum_sell', 'min_first_buy', 'min_withdraw', 'min_deposit', 'minimum_sell',
'montzar_mobile', 'montzar_open_buy', 'montzar_open_sell', 'montzar_mobile', 'montzar_open_buy', 'montzar_open_sell',
'montzar_password', 'montzar_price', 'montzar_product_id', 'montzar_password', 'montzar_product_id',
'open_register', 'open_register',
'referral_id', 'referral_limit', 'referral_gift_on_first_order', 'referral_id', 'referral_limit', 'referral_gift_on_first_order',
'register_jibit_verify', 'register_referral_bonus_message', 'register_referral_sms_to_referrer', 'register_jibit_verify', 'register_referral_bonus_message', 'register_referral_sms_to_referrer',
@@ -9,7 +9,7 @@
<p class="pargar-wallet-sync__hint"> <p class="pargar-wallet-sync__hint">
{{ {{
canSync canSync
? 'ریال و طلای کیف اصلی را با ماندهٔ پرگار یکی می‌کند — فقط وقتی همهٔ اسناد در پرگار ثبت شده باشند' ? 'تغییر مانده در پرگار (حتی صفر دستی حسابدار) خودکار روی کیف می‌نشیند — فقط اگر سند پنل هنوز در پرگار ثبت نشده باشد صبر می‌کند'
: 'ابتدا کد حسابداری پرگار را برای این مشتری ثبت کنید' : 'ابتدا کد حسابداری پرگار را برای این مشتری ثبت کنید'
}} }}
</p> </p>
@@ -60,7 +60,7 @@ function confirmForceSync() {
// Popconfirm داخل مودال جزئیات مشتری پشت می‌افتد؛ Modal.confirm با zIndex درست // Popconfirm داخل مودال جزئیات مشتری پشت می‌افتد؛ Modal.confirm با zIndex درست
Modal.confirm({ Modal.confirm({
title: 'اعمال اجباری مانده', title: 'اعمال اجباری مانده',
content: 'ماندهٔ پرگار بدون بررسی اعتبار روی کیف مشتری نوشته شود؟', content: 'ماندهٔ پرگار حتی اگر سند پنل هنوز ثبت نشده باشد، بدون بررسی روی کیف نوشته شود؟',
okText: 'بله، اعمال کن', okText: 'بله، اعمال کن',
cancelText: 'انصراف', cancelText: 'انصراف',
okType: 'danger', okType: 'danger',