feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -16,22 +16,24 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import TableEmpty from '../../components/common/table/TableEmpty';
|
||||
import TableToolbar from '../../components/common/table/TableToolbar';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import {
|
||||
Banner,
|
||||
Button,
|
||||
Card,
|
||||
Descriptions,
|
||||
Empty,
|
||||
Modal,
|
||||
Table,
|
||||
Tag,
|
||||
Typography,
|
||||
} from '@/components/ui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { RefreshCw } from 'lucide-react';
|
||||
import { API, showError, showSuccess } from '../../helpers';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
const { Text } = Typography;
|
||||
const uToYuan = (u) =>
|
||||
u === undefined || u === null ? '-' : (u / 1e6).toFixed(2);
|
||||
|
||||
@@ -40,10 +42,19 @@ export default function MyCommission() {
|
||||
const { t } = useTranslation();
|
||||
const [bills, setBills] = useState([]);
|
||||
const [detail, setDetail] = useState(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
const res = await API.get('/api/sales/commission/bills');
|
||||
if (res.data.success) setBills(res.data.data || []);
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await API.get('/api/sales/commission/bills');
|
||||
if (res.data.success) setBills(res.data.data || []);
|
||||
else showError(res.data.message);
|
||||
} catch (error) {
|
||||
showError(error.message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -67,9 +78,8 @@ export default function MyCommission() {
|
||||
|
||||
return (
|
||||
// mt-[60px]:顶栏 fixed 定位需自行让位(跑马灯由 PageLayout 占位补偿)
|
||||
<div className='mt-[60px] px-2 pb-4'>
|
||||
<div className='console-content'>
|
||||
<Card>
|
||||
<Title heading={4}>{t('我的提成')}</Title>
|
||||
<Banner
|
||||
type='info'
|
||||
closeIcon={null}
|
||||
@@ -78,7 +88,17 @@ export default function MyCommission() {
|
||||
'对账单于次月发出;如有异议请在 3 个工作日内联系管理员,逾期视为确认。当期发放 70%,余 30% 随回款到账释放',
|
||||
)}
|
||||
/>
|
||||
<TableToolbar title={t('提成列表')}>
|
||||
<Button
|
||||
icon={<RefreshCw size={16} />}
|
||||
onClick={load}
|
||||
loading={loading}
|
||||
>
|
||||
{t('刷新')}
|
||||
</Button>
|
||||
</TableToolbar>
|
||||
<Table
|
||||
loading={loading}
|
||||
columns={[
|
||||
{ title: t('月份'), dataIndex: 'month' },
|
||||
{ title: t('毛利(元)'), dataIndex: 'gp_uyuan', render: uToYuan },
|
||||
@@ -139,9 +159,7 @@ export default function MyCommission() {
|
||||
rowKey='id'
|
||||
pagination={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
empty={
|
||||
<Empty description={t('暂无提成账单(非销售人员或尚未出账)')} />
|
||||
}
|
||||
empty={<TableEmpty />}
|
||||
/>
|
||||
<Modal
|
||||
title={detail ? `${detail.bill.month} ${t('月提成明细')}` : ''}
|
||||
|
||||
Reference in New Issue
Block a user