更新筛选条件,增加订单统计

This commit is contained in:
PC-202306242200\Administrator
2024-09-23 18:15:22 +08:00
parent ee8c853b79
commit 480adb69af
23 changed files with 292 additions and 85 deletions

View File

@@ -1,53 +1,81 @@
import { paymentPage } from '@/services/payment';
import React, { useRef, useEffect } from 'react';
import React, { useRef, useEffect,useState } from 'react';
import { useIntl, useAccess } from '@umijs/max';
import { message, Tag, Image, Button, Select } from 'antd';
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
import { usersPage } from '@/services/user/user';
const LogTableList: React.FC = () => {
const actionRef = useRef<ActionType>();
const [shopOption, setShopOption] = useState([]);
const searchShop = async (value) => {
const { success, data } = await usersPage({
userName: value
});
data.records.map((i) => {
i.userName = i.userName + ' ' + i.phone
})
setShopOption(data.records)
}
const columns = [
{
title: '订单号',
dataIndex: 'orderNo',
title: '支付号',
dataIndex: 'paymentNo',
valueType: 'text',
search: true,
render: (_: any, record: any) => {
return <div className={'flex items-center'}>
{record.orderNo}
<Button type="link" onClick={() => {
}}></Button>
</div>
}
},
{
title: '用户信息',
dataIndex: 'ordersGoodsList',
dataIndex: 'userId',
valueType: 'text',
search: false,
render: (_: any, record: any) => {
// return record.ordersGoodsList.map((i) => {
// let _Img = i.picture ? JSON.parse(i.picture)[0] : ''
// return <div className={'flex'} key={i.id}>
// <Image src={_Img}></Image>
// <div>
// <div>
// 用户ID{i.goodsName}
// </div>
// <div>
// 用户账号:{i.salePrice}
// </div>
// </div>
// </div>
// })
}
return <div>
<div>ID:{record?.userId}</div>
<div>{record?.userName}</div>
<div>{record?.phone}</div>
</div>
},
renderFormItem: (
_,
{ type, defaultRender, formItemProps, fieldProps, ...rest },
form,
) => {
return <Select
{...fieldProps}
allowClear
showSearch
placeholder="请输入用户名"
style={{ width: "100%" }}
filterOption={false}
onSearch={
(e) => {
if (!e) {
return;
}
searchShop(e);
}
}
fieldNames={{
label: "userName",
value: "id"
}}
options={shopOption}
/>
},
},
{
title: '用户手机号',
dataIndex: 'userInfo',
valueType: 'text',
search: true,
hidden: true
},
{
title: '支付类型',