added notif 2

This commit is contained in:
2026-07-23 22:24:26 +03:30
parent d505f3b5bd
commit bd441a0e8e
31 changed files with 2105 additions and 34 deletions
@@ -62,7 +62,7 @@ const visibleProxy = computed({
function currentCodeOf(customer: Customer | null): string {
if (!customer) return ''
if (props.provider === 'pargar') return displayAccountingCode(customer.pargar_account_id)
if (props.provider === 'tahesab') return displayAccountingCode(customer.moshtari_code)
if (props.provider === 'tahesab' || props.provider === 'zarin') return displayAccountingCode(customer.moshtari_code)
return ''
}
@@ -81,7 +81,7 @@ function close() {
async function submit() {
if (!props.customer?.id) return
if (props.provider !== 'pargar' && props.provider !== 'tahesab') {
if (props.provider !== 'pargar' && props.provider !== 'tahesab' && props.provider !== 'zarin') {
message.error('حسابداری فعال نیست.')
return
}
@@ -149,14 +149,14 @@ const customerDirectSmsEnabled = customerDirectSmsEnabledSetting
const accountingCodeLabel = computed(() => {
const provider = accountingProviderSetting.value
if (provider === 'pargar' || provider === 'tahesab') return 'کد حسابداری'
if (provider === 'pargar' || provider === 'tahesab' || provider === 'zarin') return 'کد حسابداری'
return null
})
function accountingCodeOf(row: Customer) {
const provider = accountingProviderSetting.value
if (provider === 'pargar') return displayAccountingCode(row.pargar_account_id)
if (provider === 'tahesab') return displayAccountingCode(row.moshtari_code)
if (provider === 'tahesab' || provider === 'zarin') return displayAccountingCode(row.moshtari_code)
return '-'
}
@@ -73,6 +73,15 @@
<template #title><span>در ته‌حساب ثبت نشده — کلیک برای ثبت</span></template>
<Icon icon="vuesax-linear:profile-add" color="#CA8A04" />
</a-tooltip>
<a-tooltip
v-if="zarinEnabled && !isValidAccountingCode(record.moshtari_code)"
placement="bottom"
class="cursor-pointer"
@click="openZarinRegister(record)"
>
<template #title><span>در زرین ثبت نشده — کلیک برای ثبت</span></template>
<Icon icon="vuesax-linear:profile-add" color="#0284C7" />
</a-tooltip>
<a-tooltip
v-if="pargarEnabled && !isValidAccountingCode(record.pargar_account_id)"
placement="bottom"
@@ -192,6 +201,14 @@
:customer-name="tahesabCustomer?.name"
@success="fetch"
/>
<ZarinRetryModal
v-if="zarinEnabled"
v-model="zarinRegisterVisible"
mode="register-customer"
:customer-id="zarinCustomer?.id"
:customer-name="zarinCustomer?.name"
@success="fetch"
/>
<PargarRetryModal
v-if="pargarEnabled"
v-model="pargarRegisterVisible"
@@ -226,9 +243,11 @@ import type { Customer } from '@/model/customer'
import { MODAL_ABOVE_ACTION_SHEET_Z_INDEX } from '@/constants/overlayZIndex'
import { isMobile } from '@core/utils/is'
import TahesabRetryModal from '@/components/TahesabRetryModal.vue'
import ZarinRetryModal from '@/components/ZarinRetryModal.vue'
import PargarRetryModal from '@/components/PargarRetryModal.vue'
import {
tahesabEnabledSetting,
zarinEnabledSetting,
pargarEnabledSetting,
accountingProviderSetting,
customerDirectSmsEnabledSetting,
@@ -246,6 +265,9 @@ const confirmInfo = ref<Customer>()
const tahesabRegisterVisible = ref(false)
const tahesabCustomer = ref<Customer>()
const tahesabEnabled = tahesabEnabledSetting
const zarinRegisterVisible = ref(false)
const zarinCustomer = ref<Customer>()
const zarinEnabled = zarinEnabledSetting
const pargarRegisterVisible = ref(false)
const pargarCustomer = ref<Customer>()
const pargarEnabled = pargarEnabledSetting
@@ -254,13 +276,13 @@ const accountingCodeVisible = ref(false)
const accountingCodeCustomer = ref<Customer | null>(null)
const accountingEnabled = computed(() => {
const provider = accountingProviderSetting.value
return provider === 'pargar' || provider === 'tahesab'
return provider === 'pargar' || provider === 'tahesab' || provider === 'zarin'
})
function accountingCodeOf(record: Customer) {
const provider = accountingProviderSetting.value
if (provider === 'pargar') return displayAccountingCode(record.pargar_account_id)
if (provider === 'tahesab') return displayAccountingCode(record.moshtari_code)
if (provider === 'tahesab' || provider === 'zarin') return displayAccountingCode(record.moshtari_code)
return '-'
}
@@ -330,6 +352,11 @@ function openTahesabRegister(user: Customer) {
tahesabRegisterVisible.value = true
}
function openZarinRegister(user: Customer) {
zarinCustomer.value = user
zarinRegisterVisible.value = true
}
function openPargarRegister(user: Customer) {
pargarCustomer.value = user
pargarRegisterVisible.value = true
@@ -14,7 +14,7 @@ export type CustomerColumnOptions = {
}
function accountingCodeColumn(provider: AccountingProvider | undefined): BaseTableColumn | null {
if (provider === 'pargar' || provider === 'tahesab') {
if (provider === 'pargar' || provider === 'tahesab' || provider === 'zarin') {
return {
title: 'کد حسابداری',
dataIndex: provider === 'pargar' ? 'pargar_account_id' : 'moshtari_code',
+2 -2
View File
@@ -609,7 +609,7 @@ const userInfo = ref<Customer>()
const accountingCodeVisible = computed(() => {
const provider = accountingProviderSetting.value
return provider === 'pargar' || provider === 'tahesab'
return provider === 'pargar' || provider === 'tahesab' || provider === 'zarin'
})
const conditionalOrderEnabled = computed(() => conditionalOrderEnabledSetting.value)
@@ -631,7 +631,7 @@ function onConditionalOrderUpdated(payload: {
const accountingCodeValue = computed(() => {
const provider = accountingProviderSetting.value
if (provider === 'pargar') return displayAccountingCode(userInfo.value?.pargar_account_id)
if (provider === 'tahesab') return displayAccountingCode(userInfo.value?.moshtari_code)
if (provider === 'tahesab' || provider === 'zarin') return displayAccountingCode(userInfo.value?.moshtari_code)
return '-'
})