优化客服权限
This commit is contained in:
@@ -20,7 +20,7 @@ import {
|
||||
Tag,
|
||||
Typography,
|
||||
} from 'antd'
|
||||
import type { TableColumnsType } from 'antd'
|
||||
import type { TableColumnsType, TabsProps } from 'antd'
|
||||
import dayjs from 'dayjs'
|
||||
import type { Dayjs } from 'dayjs'
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
@@ -47,6 +47,7 @@ import type {
|
||||
AdminKuaishouIndustryVoucher,
|
||||
AdminKuaishouIndustryVoucherToolPayload,
|
||||
} from '@/types/admin'
|
||||
import { hasAdminRole } from '@/utils/admin-auth'
|
||||
import { formatAdminDateTime } from '@/utils/admin-time'
|
||||
import { stringifyDisplayJson } from '@/utils/date-time'
|
||||
|
||||
@@ -78,6 +79,7 @@ const DEFAULT_ETICKET_TYPE = 'DINING_OPEN_TICKET'
|
||||
|
||||
export default function AdminKuaishouIndustryPage() {
|
||||
const [activeTab, setActiveTab] = useState<IndustryTab>('vouchers')
|
||||
const canManageRefund = hasAdminRole('operator')
|
||||
const [voucherLoading, setVoucherLoading] = useState(false)
|
||||
const [actionLoading, setActionLoading] = useState('')
|
||||
const [vouchers, setVouchers] = useState<AdminKuaishouIndustryVoucher[]>([])
|
||||
@@ -475,30 +477,39 @@ export default function AdminKuaishouIndustryPage() {
|
||||
showSuccess('已填入退款操作区')
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="page-stack kuaishou-industry-page">
|
||||
<PageHeader title="快手电子凭证" description="行业电子凭证接口工具与售后处理" />
|
||||
|
||||
<Tabs
|
||||
activeKey={activeTab}
|
||||
onChange={(key) => setActiveTab(key as IndustryTab)}
|
||||
items={[
|
||||
{
|
||||
key: 'vouchers',
|
||||
label: '券码操作',
|
||||
children: renderVoucherTab(),
|
||||
},
|
||||
const tabItems: TabsProps['items'] = [
|
||||
{
|
||||
key: 'vouchers',
|
||||
label: '券码操作',
|
||||
children: renderVoucherTab(),
|
||||
},
|
||||
...(canManageRefund
|
||||
? [
|
||||
{
|
||||
key: 'refunds',
|
||||
label: '售后退款',
|
||||
children: renderRefundTab(),
|
||||
},
|
||||
{
|
||||
key: 'result',
|
||||
label: '接口结果',
|
||||
children: renderResultTab(),
|
||||
},
|
||||
]}
|
||||
]
|
||||
: []),
|
||||
{
|
||||
key: 'result',
|
||||
label: '接口结果',
|
||||
children: renderResultTab(),
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<div className="page-stack kuaishou-industry-page">
|
||||
<PageHeader
|
||||
title="快手电子凭证"
|
||||
description={canManageRefund ? '行业电子凭证接口工具与售后处理' : '行业电子凭证接口工具'}
|
||||
/>
|
||||
|
||||
<Tabs
|
||||
activeKey={activeTab}
|
||||
onChange={(key) => setActiveTab(key as IndustryTab)}
|
||||
items={tabItems}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user