changes of giftCard page
This commit is contained in:
@@ -4,12 +4,14 @@
|
||||
<div class="flex min-w-0 flex-1 items-center gap-2">
|
||||
<BaseIcon icon="vuesax-linear:user" size="20" color="#6b7280" />
|
||||
<button
|
||||
v-if="can('info')"
|
||||
type="button"
|
||||
class="truncate border-none bg-transparent p-0 text-right text-sm font-700 text-gray-900 cursor-pointer"
|
||||
@click.stop="$emit('info', item)"
|
||||
>
|
||||
{{ item.name || '-' }}
|
||||
</button>
|
||||
<span v-else class="truncate text-sm font-700 text-gray-900">{{ item.name || '-' }}</span>
|
||||
</div>
|
||||
|
||||
<div class="shrink-0 text-sm text-gray-600">{{ item.mobile || '-' }}</div>
|
||||
@@ -19,6 +21,7 @@
|
||||
{{ item.type_str || 'کاربر' }}
|
||||
</span>
|
||||
<MobileIconButton
|
||||
v-if="can('restore')"
|
||||
icon="vuesax-linear:archive-slash"
|
||||
color="#e3bf00"
|
||||
:size="20"
|
||||
@@ -34,6 +37,9 @@
|
||||
import type { Customer } from '@/model/customer'
|
||||
import MobileCard from '@/components/mobile/MobileCard.vue'
|
||||
import MobileIconButton from '@/components/mobile/MobileIconButton.vue'
|
||||
import { usePageActionAccess } from '@/composables/usePageActionAccess'
|
||||
|
||||
const { can } = usePageActionAccess()
|
||||
|
||||
const props = defineProps<{
|
||||
item: Customer
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<BaseTable v-if="!isMobile" class="h-full min-h-0 min-w-0" v-bind="tblProps" @register="submit" ref="tbl">
|
||||
<template #action="{ record }">
|
||||
<div class="flex justify-center gap-2">
|
||||
<a-tooltip :key="record.is_archive" placement="bottom" class="cursor-pointer">
|
||||
<a-tooltip v-if="can('restore')" :key="record.is_archive" placement="bottom" class="cursor-pointer">
|
||||
<template #title>
|
||||
<span>{{ record.is_archive ? 'بیرون بردن از بایگانی' : 'بایگانی کردن' }}</span>
|
||||
</template>
|
||||
@@ -20,7 +20,7 @@
|
||||
</a-popconfirm>
|
||||
</a-tooltip>
|
||||
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('info', record)">
|
||||
<a-tooltip v-if="can('info')" placement="bottom" class="cursor-pointer" @click="emits('info', record)">
|
||||
<template #title><span>مشخصات</span></template>
|
||||
<Icon icon="vuesax-linear:stickynote" color="#10913A" />
|
||||
</a-tooltip>
|
||||
@@ -52,6 +52,9 @@ import useBaseTable from '@core/components/BaseTable/hooks/useBaseTable'
|
||||
import type { TableInput } from '@core/type/baseTable'
|
||||
import { isMobile } from '@core/utils/is'
|
||||
import { customersArchivePageIntro } from '@/utils/adminHelpCopy'
|
||||
import { usePageActionAccess } from '@/composables/usePageActionAccess'
|
||||
|
||||
const { can } = usePageActionAccess()
|
||||
|
||||
const [submit, reload] = useBaseTable()
|
||||
const emits = defineEmits(['delete', 'edit', 'add', 'info', 'charge'])
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
</section>
|
||||
|
||||
<BaseButton
|
||||
v-if="can('charge')"
|
||||
class="customer-mobile-sheet__charge-btn"
|
||||
size="middle"
|
||||
type="primary"
|
||||
@@ -39,7 +40,7 @@
|
||||
|
||||
<div class="customer-mobile-sheet__actions">
|
||||
<BaseButton
|
||||
v-if="accountingCodeLabel"
|
||||
v-if="can('accountingCode') && accountingCodeLabel"
|
||||
size="small"
|
||||
type="default"
|
||||
icon="vuesax-linear:card-edit"
|
||||
@@ -47,14 +48,14 @@
|
||||
>
|
||||
کد حسابداری
|
||||
</BaseButton>
|
||||
<BaseButton size="small" type="default" icon="vuesax-linear:stickynote" @click="closeAndEmit('info', row)">
|
||||
<BaseButton v-if="can('info')" size="small" type="default" icon="vuesax-linear:stickynote" @click="closeAndEmit('info', row)">
|
||||
مشخصات
|
||||
</BaseButton>
|
||||
<BaseButton size="small" type="default" icon="vuesax-linear:edit" @click="closeAndEmit('edit', row)">
|
||||
<BaseButton v-if="can('edit')" size="small" type="default" icon="vuesax-linear:edit" @click="closeAndEmit('edit', row)">
|
||||
ویرایش
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
v-if="customerLevelProfitEnabled"
|
||||
v-if="can('referral') && customerLevelProfitEnabled"
|
||||
size="small"
|
||||
type="default"
|
||||
icon="vuesax-linear:hierarchy-2"
|
||||
@@ -62,11 +63,11 @@
|
||||
>
|
||||
سود چندسطحی
|
||||
</BaseButton>
|
||||
<BaseButton size="small" type="default" icon="vuesax-linear:archive-tick" @click="closeAndEmit('archive', row)">
|
||||
<BaseButton v-if="can('archive')" size="small" type="default" icon="vuesax-linear:archive-tick" @click="closeAndEmit('archive', row)">
|
||||
بایگانی
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
v-if="customerDirectSmsEnabled"
|
||||
v-if="can('sms') && customerDirectSmsEnabled"
|
||||
size="small"
|
||||
type="default"
|
||||
icon="vuesax-linear:sms"
|
||||
@@ -75,7 +76,7 @@
|
||||
پیامک
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
v-if="!row.is_legal"
|
||||
v-if="can('approve') && !row.is_legal"
|
||||
size="small"
|
||||
type="default"
|
||||
icon="vuesax-linear:user-search"
|
||||
@@ -84,6 +85,7 @@
|
||||
تایید
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
v-if="can('active')"
|
||||
size="small"
|
||||
:type="row.active ? 'default' : 'primary'"
|
||||
:icon="row.active ? 'vuesax-linear:user-remove' : 'vuesax-linear:user-tick'"
|
||||
@@ -92,6 +94,7 @@
|
||||
{{ row.active ? 'غیرفعال' : 'فعال' }}
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
v-if="can('trade')"
|
||||
size="small"
|
||||
:type="row.trade_active === 1 ? 'default' : 'primary'"
|
||||
:icon="row.trade_active === 1 ? 'vuesax-linear:box-remove' : 'vuesax-linear:box-tick'"
|
||||
@@ -135,6 +138,9 @@ import {
|
||||
} from '@/utils/config'
|
||||
import { displayAccountingCode } from '@/utils/accountingCode'
|
||||
import CustomerPresenceBadge from '@/pages/menuPages/customers/base/components/CustomerPresenceBadge.vue'
|
||||
import { usePageActionAccess } from '@/composables/usePageActionAccess'
|
||||
|
||||
const { can } = usePageActionAccess()
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
<div class="min-w-0 flex-1 space-y-1.5">
|
||||
<div class="flex items-center gap-2">
|
||||
<button
|
||||
v-if="can('info')"
|
||||
type="button"
|
||||
class="min-w-0 flex-1 truncate border-none bg-transparent p-0 text-right text-sm font-700 text-gray-900"
|
||||
@click.stop="$emit('info', item)"
|
||||
>
|
||||
{{ item.name || '-' }}
|
||||
</button>
|
||||
<span v-else class="min-w-0 flex-1 truncate text-sm font-700 text-gray-900">{{ item.name || '-' }}</span>
|
||||
<span
|
||||
class="inline-block h-2.5 w-2.5 shrink-0 rounded-full"
|
||||
:class="item.active ? 'bg-green-500' : 'bg-red-500'"
|
||||
@@ -41,6 +43,7 @@
|
||||
عملیات
|
||||
</BaseButton>
|
||||
<BaseButton
|
||||
v-if="can('edit')"
|
||||
type="default"
|
||||
size="small"
|
||||
class="min-w-[4.5rem]"
|
||||
@@ -57,6 +60,9 @@
|
||||
<script setup lang="ts">
|
||||
import type { Customer } from '@/model/customer'
|
||||
import MobileCard from '@/components/mobile/MobileCard.vue'
|
||||
import { usePageActionAccess } from '@/composables/usePageActionAccess'
|
||||
|
||||
const { can } = usePageActionAccess()
|
||||
|
||||
const props = defineProps<{
|
||||
item: Customer
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
</template>
|
||||
<template #accountingCode="{ record }">
|
||||
<button
|
||||
v-if="can('accountingCode')"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1.5 border-none bg-transparent p-0 text-sm cursor-pointer"
|
||||
style="color: var(--admin-text)"
|
||||
@@ -29,10 +30,11 @@
|
||||
<span dir="ltr">{{ accountingCodeOf(record) }}</span>
|
||||
<Icon icon="vuesax-linear:edit-2" size="16" color="#4572E9" />
|
||||
</button>
|
||||
<span v-else dir="ltr">{{ accountingCodeOf(record) }}</span>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<div class="gap-2 hidden md:flex justify-center">
|
||||
<a-tooltip :key="record.is_archive" placement="bottom" class="cursor-pointer">
|
||||
<a-tooltip v-if="can('archive')" :key="record.is_archive" placement="bottom" class="cursor-pointer">
|
||||
<template #title>
|
||||
<span>{{ record.is_archive ? 'بیرون بردن از بایگانی' : 'بایگانی کردن' }}</span>
|
||||
</template>
|
||||
@@ -47,6 +49,7 @@
|
||||
</a-popconfirm>
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="can('active')"
|
||||
:key="record.active"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@@ -60,12 +63,12 @@
|
||||
:color="record.active ? '#54AD06' : '#ad0627'"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('chargeWallet', record)">
|
||||
<a-tooltip v-if="can('charge')" placement="bottom" class="cursor-pointer" @click="emits('chargeWallet', record)">
|
||||
<template #title><span>شارژ کیف پول</span></template>
|
||||
<Icon icon="vuesax-linear:wallet-add" color="#9333ea" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="tahesabEnabled && !isValidAccountingCode(record.moshtari_code)"
|
||||
v-if="can('tahesab') && tahesabEnabled && !isValidAccountingCode(record.moshtari_code)"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openTahesabRegister(record)"
|
||||
@@ -74,7 +77,7 @@
|
||||
<Icon icon="vuesax-linear:profile-add" color="#CA8A04" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="zarinEnabled && !isValidAccountingCode(record.moshtari_code)"
|
||||
v-if="can('zarin') && zarinEnabled && !isValidAccountingCode(record.moshtari_code)"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openZarinRegister(record)"
|
||||
@@ -83,7 +86,7 @@
|
||||
<Icon icon="vuesax-linear:profile-add" color="#0284C7" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="pargarEnabled && !isValidAccountingCode(record.pargar_account_id)"
|
||||
v-if="can('pargar') && pargarEnabled && !isValidAccountingCode(record.pargar_account_id)"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openPargarRegister(record)"
|
||||
@@ -92,7 +95,7 @@
|
||||
<Icon icon="vuesax-linear:profile-add" color="#7C3AED" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="accountingEnabled"
|
||||
v-if="can('accountingCode') && accountingEnabled"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openAccountingCodeEdit(record)"
|
||||
@@ -100,16 +103,16 @@
|
||||
<template #title><span>ویرایش کد حسابداری</span></template>
|
||||
<Icon icon="vuesax-linear:card-edit" color="#0d9488" />
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('info', record)">
|
||||
<a-tooltip v-if="can('info')" placement="bottom" class="cursor-pointer" @click="emits('info', record)">
|
||||
<template #title><span>مشخصات</span></template>
|
||||
<Icon icon="vuesax-linear:stickynote" color="#10913A" />
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('edit', record)">
|
||||
<a-tooltip v-if="can('edit')" placement="bottom" class="cursor-pointer" @click="emits('edit', record)">
|
||||
<template #title><span>ویرایش</span></template>
|
||||
<Icon icon="vuesax-linear:edit" color="#4572E9" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="customerLevelProfitEnabled"
|
||||
v-if="can('referral') && customerLevelProfitEnabled"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openLevelProfit(record)"
|
||||
@@ -118,6 +121,7 @@
|
||||
<Icon icon="vuesax-linear:hierarchy-2" color="#ca8a04" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="can('trade')"
|
||||
:key="record.trade_active"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@@ -132,7 +136,7 @@
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="customerDirectSmsEnabled"
|
||||
v-if="can('sms') && customerDirectSmsEnabled"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openDirectSms(record)"
|
||||
@@ -141,7 +145,7 @@
|
||||
<Icon icon="vuesax-linear:sms" color="#0ea5e9" />
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-if="!record.is_legal"
|
||||
v-if="can('approve') && !record.is_legal"
|
||||
placement="bottom"
|
||||
class="cursor-pointer"
|
||||
@click="openConfirmUser(record)"
|
||||
@@ -274,6 +278,9 @@ import {
|
||||
} from '@/utils/config'
|
||||
import { displayAccountingCode, isValidAccountingCode } from '@/utils/accountingCode'
|
||||
import { customersPageIntro } from '@/utils/adminHelpCopy'
|
||||
import { usePageActionAccess } from '@/composables/usePageActionAccess'
|
||||
|
||||
const { can } = usePageActionAccess()
|
||||
|
||||
const [submit, reload] = useBaseTable()
|
||||
const emits = defineEmits(['delete', 'edit', 'add', 'info', 'chargeWallet'])
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<div class="flex gap-3 justify-center items-center">
|
||||
<a-tooltip placement="top">
|
||||
<a-tooltip v-if="can('detail')" placement="top">
|
||||
<template #title>جزئیات</template>
|
||||
<Icon
|
||||
icon="vuesax-linear:eye"
|
||||
@@ -24,7 +24,7 @@
|
||||
@click.stop="openDetails(record)"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip v-if="record.status === 'active'" placement="top">
|
||||
<a-tooltip v-if="can('edit') && record.status === 'active'" placement="top">
|
||||
<template #title>ویرایش</template>
|
||||
<Icon
|
||||
icon="vuesax-linear:edit"
|
||||
@@ -86,6 +86,9 @@ import Icon from '@core/components/BaseIcon/src/Icon.vue'
|
||||
import { getCustomersList } from '@/api/customer'
|
||||
import { message } from 'ant-design-vue'
|
||||
import type { Item } from '@/model/Item'
|
||||
import { usePageActionAccess } from '@/composables/usePageActionAccess'
|
||||
|
||||
const { can } = usePageActionAccess()
|
||||
|
||||
const [submit, reload] = useBaseTable()
|
||||
const modalVisible = ref(false)
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<BaseTable v-bind="tblProps" @register="registerTable" ref="tbl">
|
||||
<template #action="{ record }">
|
||||
<div v-if="record.status === 'pending'" class="flex gap-2 justify-center">
|
||||
<BaseButton type="primary" size="small" @click.stop="openApprove(record)">
|
||||
<BaseButton v-if="can('approve')" type="primary" size="small" @click.stop="openApprove(record)">
|
||||
تأیید
|
||||
</BaseButton>
|
||||
<BaseButton size="small" danger @click.stop="openReject(record)">رد</BaseButton>
|
||||
<BaseButton v-if="can('reject')" size="small" danger @click.stop="openReject(record)">رد</BaseButton>
|
||||
</div>
|
||||
<span v-else class="text-gray-400 text-xs">—</span>
|
||||
</template>
|
||||
@@ -46,6 +46,9 @@ import {
|
||||
} from '@/api/goldCredit'
|
||||
import GoldCreditModal from '@/pages/menuPages/customers/base/components/goldCreditModal.vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
import { usePageActionAccess } from '@/composables/usePageActionAccess'
|
||||
|
||||
const { can } = usePageActionAccess()
|
||||
|
||||
const [registerTable, reload] = useBaseTable()
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<div class="flex items-center justify-center gap-2">
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('edit', record)">
|
||||
<a-tooltip v-if="can('edit')" placement="bottom" class="cursor-pointer" @click="emits('edit', record)">
|
||||
<template #title><span>ویرایش</span></template>
|
||||
<Icon icon="vuesax-linear:edit-2" color="#4572E9" />
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="bottom" class="cursor-pointer" @click="emits('toggle', record)">
|
||||
<a-tooltip v-if="can('toggle')" placement="bottom" class="cursor-pointer" @click="emits('toggle', record)">
|
||||
<template #title>
|
||||
<span>{{ record.is_active ? 'غیرفعال کردن' : 'فعال کردن' }}</span>
|
||||
</template>
|
||||
@@ -29,6 +29,7 @@
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-popconfirm
|
||||
v-if="can('delete')"
|
||||
title="پکیج حذف شود؟"
|
||||
ok-text="تایید"
|
||||
cancel-text="انصراف"
|
||||
@@ -56,6 +57,9 @@ import { getSpecialPricePackageColumns } from '../hooks/specialPriceColumns'
|
||||
import { isMobile } from '@core/utils/is'
|
||||
import { ref } from 'vue'
|
||||
import { specialPricePageIntro } from '@/utils/adminHelpCopy'
|
||||
import { usePageActionAccess } from '@/composables/usePageActionAccess'
|
||||
|
||||
const { can } = usePageActionAccess()
|
||||
|
||||
const emits = defineEmits<{
|
||||
(e: 'add'): void
|
||||
|
||||
Reference in New Issue
Block a user