From e0e2b6daa578edf2624487511ab8791d66c2adb7 Mon Sep 17 00:00:00 2001 From: safavimohadeseh78 Date: Sun, 8 Nov 2026 13:27:23 +0330 Subject: [PATCH] feat: add deposit receipt preview, deposit identifier, and approve/reject modals with SMS --- src/api/wallet.ts | 6 + src/model/user.ts | 3 +- src/model/wallet.ts | 4 + .../components/WithdrawMobileCardList.vue | 4 + .../components/WithdrawMobileDetailSheet.vue | 64 ++++++- .../menuPages/withdraw/components/table.vue | 58 +++++- .../withdraw/hooks/withdrawColumns.tsx | 31 +++- src/pages/menuPages/withdraw/index.vue | 165 +++++++++++++++++- .../withdraw/utils/withdrawDisplay.ts | 9 + 9 files changed, 334 insertions(+), 10 deletions(-) diff --git a/src/api/wallet.ts b/src/api/wallet.ts index 685a8a1..b2cc61b 100644 --- a/src/api/wallet.ts +++ b/src/api/wallet.ts @@ -28,6 +28,12 @@ export const exportWithdrawReport = async (params: TableInput & { flow_type?: st export const completeWithdraw = async (params: Withdraw) => await useAxios.post('/admin/wallet/withdraw/complete', params) +export const approveDeposit = async (params: { id: number; tracked_number?: string }) => + await useAxios.post<{ message: string; withdraw: Withdraw }>('/admin/wallet/deposit/approve', params) + +export const rejectDeposit = async (params: { id: number; reject_reason?: string }) => + await useAxios.post<{ message: string; withdraw: Withdraw }>('/admin/wallet/deposit/reject', params) + export const updateSts = async (id: number, sts: Object) => { return await useAxios.put(`/admin/wallet/withdraw/${id}`, sts) } diff --git a/src/model/user.ts b/src/model/user.ts index 3c5596c..2d3ef0c 100644 --- a/src/model/user.ts +++ b/src/model/user.ts @@ -13,10 +13,11 @@ export interface User { lname?: string mobile?: number name?: string + n_code?: string sts?: number token_sms?: string user_type?: string - send_sms?:boolean + send_sms?: boolean settings?: Const[] sms_billing_enabled?: boolean sms_panel_access?: boolean diff --git a/src/model/wallet.ts b/src/model/wallet.ts index b721df4..3edc2d9 100644 --- a/src/model/wallet.ts +++ b/src/model/wallet.ts @@ -84,6 +84,10 @@ export interface Withdraw { date_at?: string sts?: number type?: number + receipt?: string | null + receipt_url?: string | null + deposit_identifier?: string | null + reject_reason?: string | null bank_account_id?: number | null created_at?: string updated_at?: string diff --git a/src/pages/menuPages/withdraw/components/WithdrawMobileCardList.vue b/src/pages/menuPages/withdraw/components/WithdrawMobileCardList.vue index bd4b10e..f949cd1 100644 --- a/src/pages/menuPages/withdraw/components/WithdrawMobileCardList.vue +++ b/src/pages/menuPages/withdraw/components/WithdrawMobileCardList.vue @@ -24,6 +24,8 @@ :item="selectedItem" @withdraw="(row) => emit('withdraw', row)" @weight="(row) => emit('weight', row)" + @approve-deposit="(row) => emit('approveDeposit', row)" + @reject-deposit="(row) => emit('rejectDeposit', row)" @change-status="changeStatusHandler" /> @@ -53,6 +55,8 @@ const props = withDefaults( const emit = defineEmits<{ (e: 'withdraw', item: Withdraw): void (e: 'weight', item: Withdraw): void + (e: 'approveDeposit', item: Withdraw): void + (e: 'rejectDeposit', item: Withdraw): void }>() const { sheetVisible, selectedItem, openSheet, syncSelectedItem } = useMobileDetailSheet() diff --git a/src/pages/menuPages/withdraw/components/WithdrawMobileDetailSheet.vue b/src/pages/menuPages/withdraw/components/WithdrawMobileDetailSheet.vue index ed3be19..b28d560 100644 --- a/src/pages/menuPages/withdraw/components/WithdrawMobileDetailSheet.vue +++ b/src/pages/menuPages/withdraw/components/WithdrawMobileDetailSheet.vue @@ -6,8 +6,24 @@
{{ sheetTitle }}
+ + + +
+
فیش واریزی:
+ +
+ +
+ + + تایید واریز + + + + رد واریز + +
@@ -121,6 +180,7 @@ import { status } from '@/pages/menuPages/withdraw/information/hooks/status' import { formatWithdrawAmountDisplay, isMoneyWithdraw, + isPendingDepositRequest, needsTrackingConfirmation, needsWeightAssignment, withdrawAmountValue, @@ -140,6 +200,8 @@ const emit = defineEmits<{ (e: 'update:visible', value: boolean): void (e: 'withdraw', item: Withdraw): void (e: 'weight', item: Withdraw): void + (e: 'approveDeposit', item: Withdraw): void + (e: 'rejectDeposit', item: Withdraw): void (e: 'changeStatus', item: Withdraw, statusEntry: [string, (typeof status)[keyof typeof status]]): void }>() diff --git a/src/pages/menuPages/withdraw/components/table.vue b/src/pages/menuPages/withdraw/components/table.vue index 5072346..bb14e23 100644 --- a/src/pages/menuPages/withdraw/components/table.vue +++ b/src/pages/menuPages/withdraw/components/table.vue @@ -11,15 +11,35 @@ +