From 2cb7c605e605297b2d2364148b05eb5515064230 Mon Sep 17 00:00:00 2001 From: adonis Date: Tue, 28 Jul 2026 15:04:04 +0330 Subject: [PATCH] fix some bugs from zarin --- src/api/zarin.ts | 22 +++- .../components/ZarinCustomerSync.vue | 124 ++++++++++++++++-- .../menuPages/configuration/settingTypes.ts | 10 +- 3 files changed, 136 insertions(+), 20 deletions(-) diff --git a/src/api/zarin.ts b/src/api/zarin.ts index 4e4fbee..3a41303 100644 --- a/src/api/zarin.ts +++ b/src/api/zarin.ts @@ -54,8 +54,14 @@ export interface CustomerSyncStatus { panel_total: number panel_registered: number panel_only: number - zarin_total: number - zarin_only_count: number + zarin_total: number | null + zarin_only_count: number | null + /** اگر دریافت لیست شکست بخورد */ + zarin_fetch_error?: string | null + zarin_http_status?: number | null + /** نام گروه فیلتر (مثلاً مشتری نقدی) */ + zarin_group_filter?: string | null + include_zarin?: boolean panel_only_list: { data: PanelOnlyCustomer[] current_page: number @@ -75,7 +81,17 @@ export const getZarinCustomerSyncStatus = async (params?: { page?: number zarin_page?: number include_zarin?: number | boolean -}) => await useAxios.get('/admin/zarin/customer-sync/status', { params }) +}) => { + // روی بعضی سرورها query به PHP نمی‌رسد — لیست زرین از مسیر جدا + if (params?.include_zarin) { + const { include_zarin: _ignored, ...rest } = params + return await useAxios.get( + '/admin/zarin/customer-sync/status-with-zarin', + Object.keys(rest).length ? { params: rest } : undefined, + ) + } + return await useAxios.get('/admin/zarin/customer-sync/status', { params }) +} export interface SyncPanelResult { ok: boolean diff --git a/src/pages/menuPages/accounting/components/ZarinCustomerSync.vue b/src/pages/menuPages/accounting/components/ZarinCustomerSync.vue index 1c8cb57..2da20e5 100644 --- a/src/pages/menuPages/accounting/components/ZarinCustomerSync.vue +++ b/src/pages/menuPages/accounting/components/ZarinCustomerSync.vue @@ -18,11 +18,11 @@ -
+
- تب دوم + کلیک کنید
مشتریان زرین
@@ -38,11 +38,11 @@
پنل — بدون زرین
-
+
- تب دوم + کلیک کنید
زرین — بدون پنل
@@ -77,6 +77,7 @@ زرین ← پنل {{ status.zarin_only_count }} + بارگذاری
@@ -193,6 +194,10 @@ مشتریان زرین بدون حساب پنل
+ + + بروزرسانی از زرین +
+
+ گروه: {{ status.zarin_group_filter }} +
+ +
+ +
+
دریافت لیست از زرین ممکن نشد
+
اتصال را بررسی کنید و «بروزرسانی از زرین» را دوباره بزنید.
+
+
+