added notif 2
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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 '-'
|
||||
})
|
||||
|
||||
|
||||
@@ -81,6 +81,15 @@
|
||||
<template #title><span>در تهحساب ثبت نشده — کلیک برای ثبت</span></template>
|
||||
<Icon icon="vuesax-linear:profile-add" color="#CA8A04" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="zarinEnabled && !isValidAccountingCode(row.moshtari_code)"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openZarinRegister(row)"
|
||||
>
|
||||
<template #title><span>در زرین ثبت نشده — کلیک برای ثبت</span></template>
|
||||
<Icon icon="vuesax-linear:profile-add" color="#0284C7" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="pargarEnabled && !isValidAccountingCode(row.pargar_account_id)"
|
||||
placement="bottom"
|
||||
@@ -250,6 +259,14 @@
|
||||
:customer-name="tahesabCustomer?.name"
|
||||
@success="load"
|
||||
/>
|
||||
<ZarinRetryModal
|
||||
v-if="zarinEnabled"
|
||||
v-model="zarinRegisterVisible"
|
||||
mode="register-customer"
|
||||
:customer-id="zarinCustomer?.id"
|
||||
:customer-name="zarinCustomer?.name"
|
||||
@success="load"
|
||||
/>
|
||||
<PargarRetryModal
|
||||
v-if="pargarEnabled"
|
||||
v-model="pargarRegisterVisible"
|
||||
@@ -287,6 +304,7 @@ import WalletChargeModal from '@/pages/menuPages/customers/base/components/Walle
|
||||
import CustomerDirectSmsModal from '@/pages/menuPages/customers/base/components/CustomerDirectSmsModal.vue'
|
||||
import CustomerAccountingCodeModal from '@/pages/menuPages/customers/base/components/CustomerAccountingCodeModal.vue'
|
||||
import TahesabRetryModal from '@/components/TahesabRetryModal.vue'
|
||||
import ZarinRetryModal from '@/components/ZarinRetryModal.vue'
|
||||
import PargarRetryModal from '@/components/PargarRetryModal.vue'
|
||||
import {
|
||||
accountingProviderSetting,
|
||||
@@ -294,7 +312,8 @@ import {
|
||||
initAccountingSettingsFromApi,
|
||||
initWalletSettingsFromApi,
|
||||
pargarEnabledSetting,
|
||||
tahesabEnabledSetting
|
||||
tahesabEnabledSetting,
|
||||
zarinEnabledSetting
|
||||
} from '@/utils/config'
|
||||
import { isValidAccountingCode } from '@/utils/accountingCode'
|
||||
|
||||
@@ -323,6 +342,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
|
||||
@@ -330,7 +352,7 @@ const customerDirectSmsEnabled = customerDirectSmsEnabledSetting
|
||||
|
||||
const accountingEnabled = computed(() => {
|
||||
const provider = accountingProviderSetting.value
|
||||
return provider === 'pargar' || provider === 'tahesab'
|
||||
return provider === 'pargar' || provider === 'tahesab' || provider === 'zarin'
|
||||
})
|
||||
|
||||
const editVisible = ref(false)
|
||||
@@ -404,6 +426,11 @@ function openTahesabRegister(row: Customer) {
|
||||
tahesabRegisterVisible.value = true
|
||||
}
|
||||
|
||||
function openZarinRegister(row: Customer) {
|
||||
zarinCustomer.value = row
|
||||
zarinRegisterVisible.value = true
|
||||
}
|
||||
|
||||
function openPargarRegister(row: Customer) {
|
||||
pargarCustomer.value = row
|
||||
pargarRegisterVisible.value = true
|
||||
|
||||
Reference in New Issue
Block a user