From 69da63524713a9b870d4fdbb034350f6a6882f82 Mon Sep 17 00:00:00 2001 From: adonis Date: Tue, 23 Jun 2026 22:31:21 +0330 Subject: [PATCH] fix some bugs --- src/api/wallet.ts | 11 +- src/model/wallet.ts | 16 -- .../components/DashboardQuickWalletModal.vue | 62 ++++---- .../components/CustomerMobileCardList.vue | 9 +- .../components/CustomerMobileDetailSheet.vue | 22 ++- .../base/components/WalletChargeForm.vue | 76 ++------- .../customers/base/components/table.vue | 14 +- src/pages/menuPages/customers/base/index.vue | 145 ++++++++++-------- .../customers/base/utils/walletChargeForm.ts | 40 +---- 9 files changed, 156 insertions(+), 239 deletions(-) diff --git a/src/api/wallet.ts b/src/api/wallet.ts index aeda732..b1146dd 100644 --- a/src/api/wallet.ts +++ b/src/api/wallet.ts @@ -1,19 +1,10 @@ import type { TableInput } from '@core/type/baseTable' import useAxios from '@core/utils/useAxios' -// import { Customer } from '@/model/customer' -import type { Charge, SendWeight, Wallet, WalletChargeTarget, Withdraw } from '@/model/wallet' +import type { Charge, SendWeight, Wallet, Withdraw } from '@/model/wallet' export const getWalletTable = async (params?: TableInput) => await useAxios.post>('/admin/wallet/table', params) -export const getWalletChargeTargets = async () => - await useAxios.get<{ targets: WalletChargeTarget[] }>('/admin/wallet/charge-targets') - -/** شارژ یکپارچه — نقدی یا محصول (product_id=null یعنی ریالی) */ -export const chargeWalletUnified = async (params: Charge) => - await useAxios.post('/admin/wallet/charge_wallet', params) - -/** @deprecated از chargeWalletUnified استفاده کنید */ export const chargeWallet = async (params: Charge, type: 'gold' | 'money') => type === 'money' ? await useAxios.post('/admin/wallet/charge', params) diff --git a/src/model/wallet.ts b/src/model/wallet.ts index fbad0e8..aa7b9b2 100644 --- a/src/model/wallet.ts +++ b/src/model/wallet.ts @@ -54,20 +54,6 @@ export interface Withdraw { export type WalletChargeDirection = 'charge' | 'discharge' -export type WalletChargeTargetKind = 'money' | 'metal' - -export interface WalletChargeTarget { - key: string - kind: WalletChargeTargetKind - label: string - unit: string - product_id?: number | null - metal_id?: number - uses_main_wallet?: boolean - trade_by_quantity?: boolean - group_type?: string -} - export interface Charge { value?: number note?: string @@ -75,8 +61,6 @@ export interface Charge { talabBedehi?: boolean direction?: WalletChargeDirection amountAbs?: number | string - chargeTargetKey?: string | null - product_id?: number | null } export interface WithdrawStatus { diff --git a/src/pages/dashboard/components/DashboardQuickWalletModal.vue b/src/pages/dashboard/components/DashboardQuickWalletModal.vue index 713a3c2..db31175 100644 --- a/src/pages/dashboard/components/DashboardQuickWalletModal.vue +++ b/src/pages/dashboard/components/DashboardQuickWalletModal.vue @@ -2,7 +2,7 @@ -
+
+
+ {{ metalLabel.goldWalletShort() }} +

{{ formatGold(selectedCustomer) }}

+
ریالی

{{ formatCash(selectedCustomer) }}

+
+ + + ریالی + {{ metalLabel.goldWalletShort() }} + +
+