diff --git a/components.d.ts b/components.d.ts index 4683b97..a530ff2 100644 --- a/components.d.ts +++ b/components.d.ts @@ -92,6 +92,7 @@ declare module '@vue/runtime-core' { PargarRetryModal: typeof import('./src/components/PargarRetryModal.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + ShayeganCustomerRegisterModal: typeof import('./src/components/ShayeganCustomerRegisterModal.vue')['default'] SmsCreditWidget: typeof import('./src/components/SmsCreditWidget.vue')['default'] SmsNegativeBalanceHost: typeof import('./src/components/SmsNegativeBalanceHost.vue')['default'] SmsNegativeBalanceModal: typeof import('./src/components/SmsNegativeBalanceModal.vue')['default'] diff --git a/src/api/shayegan.ts b/src/api/shayegan.ts index 2c206f0..e37c316 100644 --- a/src/api/shayegan.ts +++ b/src/api/shayegan.ts @@ -41,3 +41,8 @@ export const shayeganRetry = async (id: number | string, force = false) => `/admin/shayegan/${id}/retry`, { force } ) + +export const registerCustomerInShayegan = async (customerId: number) => + await useAxios.post<{ ok: boolean; message: string; moshtari_code?: string }>( + `/admin/customer/${customerId}/shayegan/register` + ) diff --git a/src/components/ShayeganCustomerRegisterModal.vue b/src/components/ShayeganCustomerRegisterModal.vue new file mode 100644 index 0000000..78d47d9 --- /dev/null +++ b/src/components/ShayeganCustomerRegisterModal.vue @@ -0,0 +1,70 @@ + + + + + {{ item.label }} + {{ item.value ?? '-' }} + + + با تأیید، حساب تفصیلی با معین تنظیمشده در «حسابداری شایگان» ساخته میشود و کد در پروفایل مشتری ذخیره میگردد. + + + + + + diff --git a/src/pages/menuPages/customers/base/components/table.vue b/src/pages/menuPages/customers/base/components/table.vue index db47a24..ebfc50f 100644 --- a/src/pages/menuPages/customers/base/components/table.vue +++ b/src/pages/menuPages/customers/base/components/table.vue @@ -85,6 +85,15 @@ در زرین ثبت نشده — کلیک برای ثبت + + در شایگان ثبت نشده — کلیک برای ثبت + + + @@ -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() const pargarEnabled = pargarEnabledSetting +const shayeganRegisterVisible = ref(false) +const shayeganCustomer = ref() +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(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: 'آیا مشتری را بایگانی می کنید؟', diff --git a/src/pages/menuPages/customers/base/hooks/customerColumns.tsx b/src/pages/menuPages/customers/base/hooks/customerColumns.tsx index 0535872..3544da6 100644 --- a/src/pages/menuPages/customers/base/hooks/customerColumns.tsx +++ b/src/pages/menuPages/customers/base/hooks/customerColumns.tsx @@ -14,7 +14,7 @@ export type CustomerColumnOptions = { } function accountingCodeColumn(provider: AccountingProvider | undefined): BaseTableColumn | null { - if (provider === 'pargar' || provider === 'tahesab' || provider === 'zarin') { + if (provider === 'pargar' || provider === 'tahesab' || provider === 'zarin' || provider === 'shayegan') { const field = provider === 'pargar' ? 'pargar_account_id' : 'moshtari_code' return { title: 'کد حسابداری', diff --git a/src/pages/menuPages/customers/base/index.vue b/src/pages/menuPages/customers/base/index.vue index fc59c92..7595c61 100644 --- a/src/pages/menuPages/customers/base/index.vue +++ b/src/pages/menuPages/customers/base/index.vue @@ -775,7 +775,7 @@ const userInfo = ref() const accountingCodeVisible = computed(() => { const provider = accountingProviderSetting.value - return provider === 'pargar' || provider === 'tahesab' || provider === 'zarin' + return provider === 'pargar' || provider === 'tahesab' || provider === 'zarin' || provider === 'shayegan' }) const conditionalOrderEnabled = computed(() => conditionalOrderEnabledSetting.value) @@ -797,7 +797,7 @@ function onConditionalOrderUpdated(payload: { const accountingCodeValue = computed(() => { const provider = accountingProviderSetting.value if (provider === 'pargar') return displayAccountingCode(userInfo.value?.pargar_account_id) - if (provider === 'tahesab' || provider === 'zarin') return displayAccountingCode(userInfo.value?.moshtari_code) + if (provider === 'tahesab' || provider === 'zarin' || provider === 'shayegan') return displayAccountingCode(userInfo.value?.moshtari_code) return '-' }) diff --git a/src/pages/menuPages/products/base/components/ProductEditorFormBody.vue b/src/pages/menuPages/products/base/components/ProductEditorFormBody.vue index 0029d62..03661ff 100644 --- a/src/pages/menuPages/products/base/components/ProductEditorFormBody.vue +++ b/src/pages/menuPages/products/base/components/ProductEditorFormBody.vue @@ -481,6 +481,16 @@ + + + + + + () const isStore = ref(Boolean(props.isStore)) +const shayeganEnabled = shayeganEnabledSetting const tradeWeightUnit = ref('گرم') /** دسته آبشده/کاتد — ساختار فرم ثابت است */ diff --git a/src/pages/menuPages/products/base/index.vue b/src/pages/menuPages/products/base/index.vue index 0bf5d14..d6e1910 100644 --- a/src/pages/menuPages/products/base/index.vue +++ b/src/pages/menuPages/products/base/index.vue @@ -456,6 +456,7 @@ function resetData() { has_physical_delivery: false, min_physical_delivery_quantity: undefined, inventory: 0, + shayegan_item_number: '', description: '', karat: '', min_order_cash: undefined, @@ -490,6 +491,7 @@ const DETAILS_FIELDS = new Set([ 'unit', 'direct_price', 'inventory', + 'shayegan_item_number', 'trade_by_quantity', 'show_in_assets', 'show_on_tv',
+ با تأیید، حساب تفصیلی با معین تنظیمشده در «حسابداری شایگان» ساخته میشود و کد در پروفایل مشتری ذخیره میگردد. +