feat(shayegan): product item field and customer register in admin
This commit is contained in:
@@ -85,6 +85,15 @@
|
||||
<template #title><span>در زرین ثبت نشده — کلیک برای ثبت</span></template>
|
||||
<Icon icon="vuesax-linear:profile-add" color="#0284C7" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="shayeganEnabled && accountingProvider === 'shayegan' && !isValidAccountingCode(record.moshtari_code)"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openShayeganRegister(record)"
|
||||
>
|
||||
<template #title><span>در شایگان ثبت نشده — کلیک برای ثبت</span></template>
|
||||
<Icon icon="vuesax-linear:profile-add" color="#0D9488" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="can('pargar') && pargarEnabled && !isValidAccountingCode(record.pargar_account_id)"
|
||||
placement="bottom"
|
||||
@@ -237,6 +246,13 @@
|
||||
:customer-name="pargarCustomer?.name"
|
||||
@success="fetch"
|
||||
/>
|
||||
<ShayeganCustomerRegisterModal
|
||||
v-if="shayeganEnabled && accountingProvider === 'shayegan'"
|
||||
v-model="shayeganRegisterVisible"
|
||||
:customer-id="shayeganCustomer?.id"
|
||||
:customer-name="shayeganCustomer?.name"
|
||||
@success="fetch"
|
||||
/>
|
||||
</BasicShowContext>
|
||||
</div>
|
||||
</template>
|
||||
@@ -266,10 +282,12 @@ 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 ShayeganCustomerRegisterModal from '@/components/ShayeganCustomerRegisterModal.vue'
|
||||
import {
|
||||
tahesabEnabledSetting,
|
||||
zarinEnabledSetting,
|
||||
pargarEnabledSetting,
|
||||
shayeganEnabledSetting,
|
||||
accountingProviderSetting,
|
||||
customerDirectSmsEnabledSetting,
|
||||
customerLevelProfitEnabledSetting,
|
||||
@@ -297,6 +315,10 @@ const zarinEnabled = zarinEnabledSetting
|
||||
const pargarRegisterVisible = ref(false)
|
||||
const pargarCustomer = ref<Customer>()
|
||||
const pargarEnabled = pargarEnabledSetting
|
||||
const shayeganRegisterVisible = ref(false)
|
||||
const shayeganCustomer = ref<Customer>()
|
||||
const shayeganEnabled = shayeganEnabledSetting
|
||||
const accountingProvider = accountingProviderSetting
|
||||
const customerDirectSmsEnabled = customerDirectSmsEnabledSetting
|
||||
const customerLevelProfitEnabled = customerLevelProfitEnabledSetting
|
||||
const levelProfitVisible = ref(false)
|
||||
@@ -305,13 +327,13 @@ const accountingCodeVisible = ref(false)
|
||||
const accountingCodeCustomer = ref<Customer | null>(null)
|
||||
const accountingEnabled = computed(() => {
|
||||
const provider = accountingProviderSetting.value
|
||||
return provider === 'pargar' || provider === 'tahesab' || provider === 'zarin'
|
||||
return provider === 'pargar' || provider === 'tahesab' || provider === 'zarin' || provider === 'shayegan'
|
||||
})
|
||||
|
||||
function accountingCodeOf(record: Customer) {
|
||||
const provider = accountingProviderSetting.value
|
||||
if (provider === 'pargar') return displayAccountingCode(record.pargar_account_id)
|
||||
if (provider === 'tahesab' || provider === 'zarin') return displayAccountingCode(record.moshtari_code)
|
||||
if (provider === 'tahesab' || provider === 'zarin' || provider === 'shayegan') return displayAccountingCode(record.moshtari_code)
|
||||
return '-'
|
||||
}
|
||||
|
||||
@@ -404,6 +426,11 @@ function openPargarRegister(user: Customer) {
|
||||
pargarRegisterVisible.value = true
|
||||
}
|
||||
|
||||
function openShayeganRegister(user: Customer) {
|
||||
shayeganCustomer.value = user
|
||||
shayeganRegisterVisible.value = true
|
||||
}
|
||||
|
||||
function handleArchive(customer: Customer) {
|
||||
Modal.confirm({
|
||||
title: 'آیا مشتری را بایگانی می کنید؟',
|
||||
|
||||
Reference in New Issue
Block a user