feat(react-web-next): 新增.editorconfig和.prettierrc配置文件,添加public/.gitkeep占位文件
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import { GlassCard, GradientButton, ActionBar, SearchBarPlus } from '@/components/ui';
|
||||
import React, { useState } from 'react';
|
||||
import { PageContainer, ProFormText } from '@ant-design/pro-components';
|
||||
import { Descriptions, message, Space } from 'antd';
|
||||
import { ordersApi } from '@/services/orders';
|
||||
|
||||
const ProfitSharingPage: React.FC = () => {
|
||||
const [orderNo, setOrderNo] = useState<string>('');
|
||||
const [detail, setDetail] = useState<any>();
|
||||
|
||||
const load = async (no: string) => {
|
||||
try {
|
||||
const res = await ordersApi.getProfitSharingDetail(no);
|
||||
setDetail(res?.data || res);
|
||||
} catch (e) {
|
||||
message.error('加载分账明细失败');
|
||||
}
|
||||
};
|
||||
|
||||
const exec = async (no: string) => {
|
||||
try {
|
||||
await ordersApi.executeProfitSharing(no);
|
||||
message.success('已发起分账');
|
||||
load(no);
|
||||
} catch (e) {
|
||||
message.error('分账执行失败');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContainer header={{ title: '分账管理' }}>
|
||||
<SearchBarPlus
|
||||
defaultCollapsed={false}
|
||||
split
|
||||
span={8}
|
||||
onTenantChanged={() => orderNo && load(orderNo)}
|
||||
onFinish={async (v) => { setOrderNo(v.orderNo); load(v.orderNo); }}
|
||||
>
|
||||
<ProFormText name="orderNo" label="订单号" placeholder="请输入订单号" />
|
||||
</SearchBarPlus>
|
||||
|
||||
<ActionBar
|
||||
left={
|
||||
<Space>
|
||||
<GradientButton size="middle" type="primary" disabled={!orderNo} onClick={() => exec(orderNo)}>执行分账</GradientButton>
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
|
||||
<GlassCard title="分账明细">
|
||||
{detail ? (
|
||||
<Descriptions column={2}>
|
||||
<Descriptions.Item label="订单号">{detail.orderNo}</Descriptions.Item>
|
||||
<Descriptions.Item label="总金额">{detail.totalAmount}</Descriptions.Item>
|
||||
<Descriptions.Item label="状态">{detail.status}</Descriptions.Item>
|
||||
<Descriptions.Item label="分账笔数">{detail.items?.length || 0}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
) : '请输入订单号后查询'}
|
||||
</GlassCard>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProfitSharingPage;
|
||||
|
||||
Reference in New Issue
Block a user