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

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

@@ -256,6 +256,10 @@
width: 13rem
}
.w-6 {
width: 1.5rem
}
.max-w-\[712px\] {
max-width: 712px
}

View File

@@ -43,8 +43,8 @@ const LogTableList: React.FC = () => {
render: (_: any, record: any) => {
return <div>
<div>ID:{record?.userId}</div>
{/* <div>用户名:{record?.userName}</div> */}
{/* <div>手机号:{record?.phone}</div> */}
<div>{record?.userName}</div>
<div>{record?.phone}</div>
</div>
},
renderFormItem: (
@@ -81,12 +81,12 @@ const LogTableList: React.FC = () => {
valueType: 'text',
search: false,
},
{
title: '当前余额',
dataIndex: 'curPoints',
valueType: 'text',
search: false,
},
// {
// title: '当前余额',
// dataIndex: 'curPoints',
// valueType: 'text',
// search: false,
// },
{
title: '余额变动',
dataIndex: 'points',
@@ -196,7 +196,7 @@ const LogTableList: React.FC = () => {
}}></Button>,
]}
request={async (params, sorter, filter) => {
params.pointType = 2
// params.pointType = 2
setSearchParams(params)
let { data } = await variationPage(params)
return {

View File

@@ -11,24 +11,29 @@ export default () => {
const [deviceData, setDeviceData] = useState([]);
const [profit, setProfit] = useState([]);
const [shop, setShop] = useState([]);
const deviceConfig = {
data: deviceData,
xField: 'name',
yField: 'value',
seriesField: 'type',
xAxis: {
type: 'time',
const config = {
title: {
visible: true,
text: '商城(商品数量/金额)-折线图',
},
padding: 'auto',
forceFit: true,
data:deviceData,
xField: 'date',
yField: 'value',
yAxis: { label: { formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`) } },
legend: { position: 'right-top' },
yAxis: {
label: {
// 数值格式化为千分位
formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`),
},
seriesField: 'type',
color: (d) => {
return d === 'register' ? '#93D072' : '#2D71E7';
},
responsive: true,
};
useEffect(() => {
statMallStatistics().then((res) => {
setProfit(res.data)
@@ -37,20 +42,17 @@ export default () => {
let list = []
res.data.map((item, index) => {
list.push({
"name": item.createTime,
"category": "商品数量",
"value": item.goodsCount,
"type": 1
"date": item.createTime,
"type": "shop",
"value": Number(item.goodsCount),
})
list.push({
"name": item.createTime,
"category": "金额",
"value": item.amountCount,
"type": 2
"date": item.createTime,
"type": "money",
"value": Number(item.amountCount),
})
})
console.log(list);
setDeviceData(list)
})
}, []);
@@ -144,7 +146,9 @@ export default () => {
</Col>
</Row>
<Divider>(/)-线</Divider>
<Line {...deviceConfig} />
{
deviceData.length != 0 ? <Line {...config} /> : <></>
}
</>
);
};

View File

@@ -2,10 +2,12 @@ import { orderPage, orderExport, orderRefund } from '@/services/order';
import { exportData } from '@/utils/func';
import React, { useRef, useEffect, useState } from 'react';
import { useIntl, useAccess } from '@umijs/max';
import { message, Tag, Image, Button, Select } from 'antd';
import { message, Tag, Col, Row, Card, Image, Button, Select } from 'antd';
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
import BonusFormModal from './components/BonusFormModal';
import EscFormModal from './components/EscFormModal';
import { usersPage } from '@/services/user/user';
const LogTableList: React.FC = () => {
@@ -16,6 +18,19 @@ const LogTableList: React.FC = () => {
const [selectedRowsState, setSelectedRows] = useState([]);
const [escFormModal, setEscFormModal] = useState(false);
const access = useAccess()
const count = useState({})
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 = [
@@ -36,9 +51,8 @@ const LogTableList: React.FC = () => {
},
{
title: '用户信息',
dataIndex: 'ordersGoodsList',
dataIndex: 'usersId',
valueType: 'text',
search: false,
render: (_: any, record: any) => {
return <div className={'flex'}>
<div>
@@ -51,9 +65,39 @@ const LogTableList: React.FC = () => {
<div>
{record?.usersDto?.userName}
</div>
<div>
{record?.usersDto?.phone || '-'}
</div>
</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: '商品信息',
@@ -101,8 +145,8 @@ const LogTableList: React.FC = () => {
valueType: 'text',
search: true,
render: (_: any, record: any) => {
let color = record.orderPlatform == 1 ? 'volcano' : record.orderPlatform == 2 ? 'orange' : 'red'
return <Tag color={color}>{record.orderPlatform == 2 ? '微信' : record.orderPlatform == 3 ? '支付宝' : record.orderPlatform == 1 ? '钱包' : '-'}</Tag>
let color = record.payType == 1 ? 'volcano' : record.payType == 2 ? 'orange' : 'red'
return <Tag color={color}>{record.payType == 1 ? '支付宝' : '微信'}</Tag>
},
renderFormItem: (
_,
@@ -169,8 +213,18 @@ const LogTableList: React.FC = () => {
{
title: '创建时间',
dataIndex: 'createTime',
valueType: 'text',
search: false,
valueType: 'dateRange',
search: {
transform: (value) => {
return {
createTimeBegin: value[0],
createTimeEnd: value[1],
};
},
},
render: (_, record) => {
return record?.createTime
},
},
];
@@ -185,7 +239,54 @@ const LogTableList: React.FC = () => {
return (
<PageContainer>
<div style={{ width: '100%', float: 'right' }}>
<Row gutter={10} className='mb-30'>
<Col span={6}>
<Card>
<div></div>
<div>: {count?.all0?.money}</div>
<div className='flex '>
<div>{count?.all0?.order_num}</div>
<div className='w-6'></div>
<div>{count?.all0?.goods_num}</div>
</div>
</Card>
</Col>
<Col span={6}>
<Card>
<div></div>
<div>: {count?.all1?.money}</div>
<div className='flex '>
<div>{count?.all1?.order_num}</div>
<div className='w-6'></div>
<div>{count?.all1?.goods_num}</div>
</div>
</Card>
</Col>
<Col span={6}>
<Card>
<div></div>
<div>: {count?.all3?.money}</div>
<div className='flex '>
<div>{count?.all3?.order_num}</div>
<div className='w-6'></div>
<div>{count?.all3?.goods_num}</div>
</div>
</Card>
</Col>
<Col span={6}>
<Card>
<div>线</div>
<div>: {count?.all4?.money}</div>
<div className='flex '>
<div>{count?.all4?.order_num}</div>
<div className='w-6'></div>
<div>{count?.all4?.goods_num}</div>
</div>
</Card>
</Col>
</Row>
<div style={{ width: '100%', float: 'right', marginTop: "20px" }}>
<EscFormModal
modalOpenState={escFormModal}
onModalOpenState={setEscFormModal}

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: '支付类型',

View File

@@ -1,4 +1,4 @@
import { devicePage,importDeviceData } from '@/services/piles';
import { devicePage, importDeviceData } from '@/services/piles';
import { exportData } from '@/utils/func';
import React, { useRef, useEffect, useState } from 'react';
import { useIntl, useAccess } from '@umijs/max';
@@ -6,6 +6,8 @@ import { message, Tag, Image, Button, Select } from 'antd';
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
import BonusFormModal from './components/BonusFormModal';
import TempFormModal from './components/TempFormModal';
import { usersPage } from '@/services/user/user';
const LogTableList: React.FC = () => {
const actionRef = useRef<ActionType>();
@@ -14,7 +16,7 @@ const LogTableList: React.FC = () => {
const [row, setRow] = useState();
const [tempFormModal, setTempFormModal] = useState(false);
const access = useAccess()
const [shopOption, setShopOption] = useState([]);
const handleTemp = async (fields) => {
const { success } = await importDeviceData(fields);
@@ -25,6 +27,16 @@ const LogTableList: React.FC = () => {
}
};
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: '设备号',
@@ -47,6 +59,52 @@ const LogTableList: React.FC = () => {
valueType: 'text',
search: true,
},
{
title: '用户信息',
dataIndex: 'userId',
valueType: 'text',
render: (_: any, record: any) => {
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: '设备类型',
dataIndex: 'deviceType',
@@ -144,6 +202,7 @@ const LogTableList: React.FC = () => {
key="logList"
search={{
labelWidth: 120,
defaultCollapsed: false,
}}
toolBarRender={() => [
<Button hidden={!access.hasPerms('/api/device/importDeviceData')} onClick={async () => {

View File

@@ -41,7 +41,7 @@ const MenuForm: React.FC<MenuFormProps> = (props) => {
form.resetFields();
setMenuIconName(props.values.icon);
setmenuType(props.values.menuType)
setmenuType(props.values.isFrame)
setIsFrame(props.values.isFrame)
form.setFieldsValue({
id: props.values.id,
name: props.values.name,