部分修改
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -14,6 +14,8 @@ import { exportLink } from '@/utils/func';
|
||||
|
||||
import AuthConsumer from '@/components/Authority';
|
||||
|
||||
import { activity10CarUserList } from '@/services/activity/index';
|
||||
|
||||
// import services from '@/services/admin';
|
||||
|
||||
// const { shopActivityItems, shopDeleteItems } = services.ShopActivityController;
|
||||
@@ -100,9 +102,9 @@ export default () => {
|
||||
dataIndex: 'shop_id',
|
||||
render: (_, record) => {
|
||||
return <>
|
||||
<div>用户名:{record?.shop?.username}</div>
|
||||
<div>手机号:{record?.shop?.mobile}</div>
|
||||
<div>等级:{record?.vip}</div>
|
||||
<div>用户名:{record?.usersInfo?.userName}</div>
|
||||
<div>手机号:{record?.usersInfo?.phone}</div>
|
||||
<div>等级:{record?.usersInfo?.level}</div>
|
||||
</>
|
||||
},
|
||||
renderFormItem: (
|
||||
@@ -143,11 +145,8 @@ export default () => {
|
||||
},
|
||||
{
|
||||
title: '有效期',
|
||||
dataIndex: 'type',
|
||||
dataIndex: 'expirationDate',
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return record?.valid_time ? dayjs(record?.valid_time * 1000).format('YYYY-MM-DD') : ''
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '客户资料',
|
||||
@@ -226,13 +225,13 @@ export default () => {
|
||||
]}
|
||||
request={async (params, sorter, filter) => {
|
||||
setSearchParams({ token: '', ...params });
|
||||
const { data, success } = await shopActivityItems({
|
||||
const { data, success } = await activity10CarUserList({
|
||||
...params,
|
||||
sorter,
|
||||
filter,
|
||||
});
|
||||
return {
|
||||
data: data?.items || [],
|
||||
data: data?.records || [],
|
||||
total: data?.total,
|
||||
success,
|
||||
};
|
||||
|
||||
@@ -4,6 +4,8 @@ import {
|
||||
PageContainer,
|
||||
ProTable,
|
||||
} from '@ant-design/pro-components';
|
||||
import { activity10s1UserList } from '@/services/activity/index';
|
||||
|
||||
|
||||
export default () => {
|
||||
|
||||
@@ -152,13 +154,13 @@ export default () => {
|
||||
]}
|
||||
request={async (params, sorter, filter) => {
|
||||
setSearchParams({ token: '', ...params });
|
||||
const { data, success } = await shopActivityItems813({
|
||||
const { data, success } = await activity10s1UserList({
|
||||
...params,
|
||||
sorter,
|
||||
filter,
|
||||
});
|
||||
return {
|
||||
data: data?.items || [],
|
||||
data: data?.records || [],
|
||||
total: data?.total,
|
||||
success,
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ const LogTableList: React.FC = () => {
|
||||
|
||||
const searchShop = async (value) => {
|
||||
const { success, data } = await usersPage({
|
||||
userName: value
|
||||
userId: value
|
||||
});
|
||||
data.records.map((i) => {
|
||||
i.userName = i.userName + ' ' + i.phone
|
||||
@@ -56,7 +56,7 @@ const LogTableList: React.FC = () => {
|
||||
{...fieldProps}
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder="请输入用户名"
|
||||
placeholder="请输入用户名或手机号"
|
||||
style={{ width: "100%" }}
|
||||
filterOption={false}
|
||||
onSearch={
|
||||
@@ -81,18 +81,27 @@ 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',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'pointType',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
return _ == 1 ? '收益' : '余额'
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '来源',
|
||||
dataIndex: 'sourceType',
|
||||
@@ -160,6 +169,12 @@ const LogTableList: React.FC = () => {
|
||||
/>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'remarks',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
|
||||
@@ -6,13 +6,16 @@
|
||||
|
||||
import { Divider, Modal, Upload, Button, UploadProps, UploadFile } from 'antd';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { DownloadOutlined,UploadOutlined } from '@ant-design/icons';
|
||||
import { DownloadOutlined, UploadOutlined } from '@ant-design/icons';
|
||||
|
||||
|
||||
export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
|
||||
const [fileList, setFileList] = useState<UploadFile[]>([]);
|
||||
const [fileList, setFileList] = useState([]);
|
||||
const [uploading, setUploading] = useState(false);
|
||||
|
||||
|
||||
|
||||
const props: UploadProps = {
|
||||
onRemove: (file) => {
|
||||
const index = fileList.indexOf(file);
|
||||
@@ -22,16 +25,27 @@ export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
},
|
||||
beforeUpload: (file) => {
|
||||
setFileList([...fileList, file]);
|
||||
|
||||
return false;
|
||||
},
|
||||
fileList,
|
||||
};
|
||||
|
||||
const handleUpload = () => {
|
||||
const formData = new FormData();
|
||||
fileList.forEach((file) => {
|
||||
formData.append('file', file);
|
||||
});
|
||||
onSubmit(formData)
|
||||
setFileList([])
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal title="导入提现结果" open={modalOpenState} onOk={onSubmit} footer={(_, { OkBtn, CancelBtn }) => (
|
||||
<Modal title="导入提现结果" open={modalOpenState} onCancel={() => {
|
||||
onModalOpenState(false)
|
||||
}} onOk={handleUpload} footer={(_, { OkBtn, CancelBtn }) => (
|
||||
<>
|
||||
<CancelBtn />
|
||||
<OkBtn />
|
||||
</>
|
||||
)}>
|
||||
@@ -39,7 +53,9 @@ export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
<Upload className='mr-6' {...props}>
|
||||
<Button icon={<UploadOutlined />}>选择文件</Button>
|
||||
</Upload>
|
||||
<Button icon={<DownloadOutlined />}>下载模板</Button>
|
||||
<Button icon={<DownloadOutlined />} onClick={() => {
|
||||
window.open('https://zhongshuai-test.oss-cn-beijing.aliyuncs.com/upload/20240911/11ecca80-3f06-43c9-9c63-e9a9e4ef0173.xlsx');
|
||||
}}>下载模板</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { withdrawPage, withdrawExtract } from '@/services/finance/index';
|
||||
import { withdrawPage, withdrawExtract, importUsersPointsExtract } from '@/services/finance/index';
|
||||
import { usersPage } from '@/services/user/user';
|
||||
import { exportData } from '@/utils/func';
|
||||
|
||||
@@ -32,8 +32,9 @@ const LogTableList: React.FC = () => {
|
||||
|
||||
|
||||
const handleTemp = async (fields) => {
|
||||
return
|
||||
const { success } = await userTransferHanging(fields);
|
||||
console.log(fields);
|
||||
|
||||
const { success } = await importUsersPointsExtract(fields);
|
||||
if (success) {
|
||||
message.success('导入成功');
|
||||
actionRef.current?.reload();
|
||||
|
||||
@@ -32,8 +32,8 @@ export default ({ values, modalOpenState, onModalOpenState }) => {
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '账单号',
|
||||
dataIndex: 'orderNo',
|
||||
title: 'id',
|
||||
dataIndex: 'id',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
@@ -42,7 +42,7 @@ export default ({ values, modalOpenState, onModalOpenState }) => {
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return <>
|
||||
<div>用户名:{record?.username}</div>
|
||||
<div>用户名:{record?.userName}</div>
|
||||
<div>手机号:{record?.phone}</div>
|
||||
<div>等级:{record?.level}</div>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { orderPage, orderExport, orderRefund } from '@/services/order';
|
||||
import { orderPage, orderExport, orderRefund, getWeiXinCollect, getCollect, getBalance,getZhiFuBaoCollect } from '@/services/order';
|
||||
import { exportData } from '@/utils/func';
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
import { useIntl, useAccess } from '@umijs/max';
|
||||
@@ -17,10 +17,19 @@ const LogTableList: React.FC = () => {
|
||||
const [row, setRow] = useState();
|
||||
const [selectedRowsState, setSelectedRows] = useState([]);
|
||||
const [escFormModal, setEscFormModal] = useState(false);
|
||||
const [count1, setCount1] = useState({});
|
||||
const [count2, setCount2] = useState({});
|
||||
const [count3, setCount3] = useState({});
|
||||
const [count4, setCount4] = useState({});
|
||||
|
||||
|
||||
|
||||
const access = useAccess()
|
||||
const count = useState({})
|
||||
|
||||
|
||||
|
||||
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
const searchShop = async (value) => {
|
||||
const { success, data } = await usersPage({
|
||||
@@ -80,7 +89,7 @@ const LogTableList: React.FC = () => {
|
||||
{...fieldProps}
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder="请输入用户名"
|
||||
placeholder="请输入用户名或手机号"
|
||||
style={{ width: "100%" }}
|
||||
filterOption={false}
|
||||
onSearch={
|
||||
@@ -243,44 +252,44 @@ const LogTableList: React.FC = () => {
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<div>汇总</div>
|
||||
<div>金额: {count?.all0?.money}</div>
|
||||
<div>金额: {count3?.amountCount}</div>
|
||||
<div className='flex '>
|
||||
<div>订单数:{count?.all0?.order_num}</div>
|
||||
<div>订单数:{count3?.orderCount}</div>
|
||||
<div className='w-6'></div>
|
||||
<div>商品数:{count?.all0?.goods_num}</div>
|
||||
<div>商品数:{count3?.goodsCount}</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<div>微信支付</div>
|
||||
<div>金额: {count?.all1?.money}</div>
|
||||
<div>金额: {count1?.amountCount}</div>
|
||||
<div className='flex '>
|
||||
<div>订单数:{count?.all1?.order_num}</div>
|
||||
<div>订单数:{count1?.orderCount}</div>
|
||||
<div className='w-6'></div>
|
||||
<div>商品数:{count?.all1?.goods_num}</div>
|
||||
<div>商品数:{count1?.goodsCount}</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<div>余额支付</div>
|
||||
<div>金额: {count?.all3?.money}</div>
|
||||
<div>金额: {count2?.amountCount}</div>
|
||||
<div className='flex '>
|
||||
<div>订单数:{count?.all3?.order_num}</div>
|
||||
<div>订单数:{count2?.orderCount}</div>
|
||||
<div className='w-6'></div>
|
||||
<div>商品数:{count?.all3?.goods_num}</div>
|
||||
<div>商品数:{count2?.goodsCount}</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<Card>
|
||||
<div>线下支付</div>
|
||||
<div>金额: {count?.all4?.money}</div>
|
||||
<div>支付宝支付</div>
|
||||
<div>金额: {count4?.amountCount}</div>
|
||||
<div className='flex '>
|
||||
<div>订单数:{count?.all4?.order_num}</div>
|
||||
<div>订单数:{count4?.orderCount}</div>
|
||||
<div className='w-6'></div>
|
||||
<div>商品数:{count?.all4?.goods_num}</div>
|
||||
<div>商品数:{count4?.goodsCount}</div>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
@@ -323,6 +332,20 @@ const LogTableList: React.FC = () => {
|
||||
request={async (params, sorter, filter) => {
|
||||
setSearchParams({ ...params });
|
||||
let { data } = await orderPage(params)
|
||||
let _count1 = await getWeiXinCollect()
|
||||
let _count2 = await getBalance()
|
||||
let _count3 = await getCollect()
|
||||
let _count4 = await getZhiFuBaoCollect()
|
||||
|
||||
|
||||
// let _count4 = await getWeiXinCollect()
|
||||
setCount1(_count1.data);
|
||||
setCount2(_count2.data);
|
||||
setCount3(_count3.data);
|
||||
setCount4(_count4.data);
|
||||
|
||||
|
||||
|
||||
return {
|
||||
data: data?.records || [],
|
||||
total: data?.total,
|
||||
|
||||
@@ -16,7 +16,7 @@ const LogTableList: React.FC = () => {
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
const searchShop = async (value) => {
|
||||
const { success, data } = await usersPage({
|
||||
userName: value
|
||||
userId: value
|
||||
});
|
||||
data.records.map((i) => {
|
||||
i.userName = i.userName + ' ' + i.phone
|
||||
@@ -40,6 +40,7 @@ const LogTableList: React.FC = () => {
|
||||
<div>用户ID:{record?.userId}</div>
|
||||
<div>用户名:{record?.userName}</div>
|
||||
<div>手机号:{record?.phone}</div>
|
||||
<div>用户等级:{record?.level}</div>
|
||||
</div>
|
||||
},
|
||||
renderFormItem: (
|
||||
@@ -51,7 +52,7 @@ const LogTableList: React.FC = () => {
|
||||
{...fieldProps}
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder="请输入用户名"
|
||||
placeholder="请输入用户名或手机号"
|
||||
style={{ width: "100%" }}
|
||||
filterOption={false}
|
||||
onSearch={
|
||||
@@ -70,21 +71,14 @@ const LogTableList: React.FC = () => {
|
||||
/>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '用户手机号',
|
||||
dataIndex: 'userInfo',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
title: '支付类型',
|
||||
dataIndex: 'orderPlatform',
|
||||
dataIndex: 'payType',
|
||||
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 == 1 ? '钱包' : record.orderPlatform == 2 ? '钱包' : record.orderPlatform == 3 ? '支付宝' : '-'}</Tag>
|
||||
let color = record.payType == 1 ? 'volcano' : record.payType == 2 ? 'orange' : 'red'
|
||||
return <Tag color={color}>{record.payType == 1 ? '支付宝' : record.payType == 2 ? '微信' : '-'}</Tag>
|
||||
},
|
||||
renderFormItem: (
|
||||
_,
|
||||
@@ -108,6 +102,16 @@ const LogTableList: React.FC = () => {
|
||||
/>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '业务类型',
|
||||
dataIndex: 'businessType',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
let color = record.businessType == 1 ? 'volcano' : record.businessType == 2 ? 'orange' : 'red'
|
||||
return <Tag color={color}>{record.businessType == 1 ? '钱包充值' : record.businessType == 2 ? '购买商品' : '-'}</Tag>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '支付通道',
|
||||
dataIndex: 'platform',
|
||||
@@ -115,7 +119,7 @@ const LogTableList: React.FC = () => {
|
||||
search: true,
|
||||
render: (_: any, record: any) => {
|
||||
let color = record.platform == 1 ? 'volcano' : record.platform == 2 ? 'orange' : 'red'
|
||||
return <Tag color={color}>{record.platform == 1 ? '上海汇付' : record.platform == 2 ? '支付宝' : '微信'}</Tag>
|
||||
return <Tag color={color}>{record.platform == 1 ? '上海汇付' : record.platform == 2 ? '京东支付' : record.platform == 3 ? '微信' : record.platform == 4 ? '金钱吧' : ''}</Tag>
|
||||
},
|
||||
renderFormItem: (
|
||||
_,
|
||||
@@ -126,6 +130,7 @@ const LogTableList: React.FC = () => {
|
||||
{ label: '上海汇付', value: 1 },
|
||||
{ label: '支付宝', value: 2 },
|
||||
{ label: '微信', value: 3 },
|
||||
{ label: '金钱吧', value: 4 },
|
||||
]
|
||||
return <Select
|
||||
{...fieldProps}
|
||||
@@ -147,7 +152,7 @@ const LogTableList: React.FC = () => {
|
||||
search: true,
|
||||
render: (_: any, record: any) => {
|
||||
let colors = ['gold', 'green', 'volcano', 'red', 'magenta']
|
||||
return <Tag color={colors[record.status]}>{record.status == 0 ? '待支付' : record.status == 1 ? '支付成功' : record.status == -1 ? '取消' : record.status == -2 ? '退款' : ''}</Tag>
|
||||
return <Tag color={colors[record.status]}>{record.status == 0 ? '待支付' : record.status == 1 ? '处理中' : record.status == 2 ? '支付完成' : record.status == -1 ? '支付失败' : ''}</Tag>
|
||||
},
|
||||
renderFormItem: (
|
||||
_,
|
||||
@@ -156,9 +161,9 @@ const LogTableList: React.FC = () => {
|
||||
) => {
|
||||
const statusMap = [
|
||||
{ label: '待支付', value: 0 },
|
||||
{ label: '支付成功', value: 1 },
|
||||
{ label: '取消', value: -1 },
|
||||
{ label: '退款中', value: -2 },
|
||||
{ label: '处理中', value: 1 },
|
||||
{ label: '支付完成', value: 2 },
|
||||
{ label: '支付失败', value: -1 },
|
||||
]
|
||||
return <Select
|
||||
{...fieldProps}
|
||||
|
||||
@@ -19,6 +19,7 @@ const LogTableList: React.FC = () => {
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
|
||||
const handleTemp = async (fields) => {
|
||||
|
||||
const { success } = await importDeviceData(fields);
|
||||
if (success) {
|
||||
message.success('导入成功');
|
||||
@@ -29,7 +30,7 @@ const LogTableList: React.FC = () => {
|
||||
|
||||
const searchShop = async (value) => {
|
||||
const { success, data } = await usersPage({
|
||||
userName: value
|
||||
userId: value
|
||||
});
|
||||
data.records.map((i) => {
|
||||
i.userName = i.userName + ' ' + i.phone
|
||||
@@ -54,8 +55,8 @@ const LogTableList: React.FC = () => {
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '订单ID',
|
||||
dataIndex: 'orderId',
|
||||
title: '订单号',
|
||||
dataIndex: 'orderNo',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
},
|
||||
@@ -65,9 +66,9 @@ const LogTableList: React.FC = () => {
|
||||
valueType: 'text',
|
||||
render: (_: any, record: any) => {
|
||||
return <div>
|
||||
<div>用户ID:{record?.userId}</div>
|
||||
<div>用户名:{record?.userName}</div>
|
||||
<div>手机号:{record?.phone}</div>
|
||||
<div>等级:{record?.level}</div>
|
||||
</div>
|
||||
},
|
||||
renderFormItem: (
|
||||
@@ -79,7 +80,7 @@ const LogTableList: React.FC = () => {
|
||||
{...fieldProps}
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder="请输入用户名"
|
||||
placeholder="请输入用户名或手机号"
|
||||
style={{ width: "100%" }}
|
||||
filterOption={false}
|
||||
onSearch={
|
||||
@@ -99,11 +100,10 @@ const LogTableList: React.FC = () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '用户手机号',
|
||||
dataIndex: 'userInfo',
|
||||
title: '设备添加天数',
|
||||
dataIndex: 'addDate',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
hidden: true
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '设备类型',
|
||||
@@ -125,12 +125,6 @@ const LogTableList: React.FC = () => {
|
||||
return <Tag color={color}>{record.deviceStatus == 1 ? '已安装' : record.deviceStatus == 2 ? '已运营' : '未安装'}</Tag>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '设备总收益',
|
||||
dataIndex: 'income',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '安装站点名称',
|
||||
dataIndex: 'stationName',
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from 'antd';
|
||||
|
||||
|
||||
import { pageUpAndDownLevel } from '@/services/user/user';
|
||||
import { pageUpAndDownLevel,findFormUserId } from '@/services/user/user';
|
||||
|
||||
export default ({ values, modalOpenState, onModalOpenState }) => {
|
||||
|
||||
@@ -22,10 +22,10 @@ export default ({ values, modalOpenState, onModalOpenState }) => {
|
||||
if (!values?.id) {
|
||||
return
|
||||
}
|
||||
pageUpAndDownLevel(values?.id).then(({ data, success }) => {
|
||||
findFormUserId(values?.id).then(({ data, success }) => {
|
||||
if (success) {
|
||||
setItems(data?.upLevel || []);
|
||||
setitems2(data?.downLevel)
|
||||
setItems(data?.userUp || []);
|
||||
setitems2(data?.userDown)
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
|
||||
96
src/pages/user/user/components/UpPem.tsx
Normal file
96
src/pages/user/user/components/UpPem.tsx
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* @Note:
|
||||
* @Author: 2058827620@qq.com
|
||||
* @Date: 2022-04-03 17:02:15
|
||||
*/
|
||||
|
||||
import { ProForm, ModalForm, ProFormRadio, ProFormText, ProFormTextArea, ProFormMoney, ProFormCaptcha, ProFormInstance } from '@ant-design/pro-components';
|
||||
import { Button } from 'antd';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { smsCode } from '@/services/user/user'
|
||||
|
||||
|
||||
|
||||
export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
const restFormRef = useRef<ProFormInstance>();
|
||||
const [pemType, setmenuType] = useState<any>('');
|
||||
|
||||
|
||||
const handleFinish = async (formValues) => {
|
||||
await onSubmit({ ...formValues, pemType });
|
||||
restFormRef.current?.resetFields();
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<ModalForm
|
||||
title="用户-角色"
|
||||
formRef={restFormRef}
|
||||
submitter={{
|
||||
searchConfig: {
|
||||
resetText: '重置',
|
||||
},
|
||||
resetButtonProps: {
|
||||
onClick: () => {
|
||||
restFormRef.current?.resetFields();
|
||||
},
|
||||
},
|
||||
}}
|
||||
onFinish={handleFinish}
|
||||
open={modalOpenState}
|
||||
onOpenChange={onModalOpenState}
|
||||
>
|
||||
<ProFormText hidden={true} width="md" name="id" />
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
width="md"
|
||||
name="userName"
|
||||
label="用户名"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
<ProFormText
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
width="md"
|
||||
name="phone"
|
||||
label="手机号"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProFormRadio.Group
|
||||
name="pemType"
|
||||
options={[
|
||||
{
|
||||
label: '不能推广',
|
||||
value: '0',
|
||||
},
|
||||
{
|
||||
label: '可以推广',
|
||||
value: '1',
|
||||
},
|
||||
]}
|
||||
label={'推广权限'}
|
||||
rules={[
|
||||
{
|
||||
required: false,
|
||||
message: '请选择推广权限',
|
||||
},
|
||||
]}
|
||||
fieldProps={{
|
||||
onChange: (e) => {
|
||||
setmenuType(e.target.value);
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<ProFormTextArea
|
||||
rules={[{ required: true, message: '请输入' }]}
|
||||
width="md"
|
||||
name="remark"
|
||||
label="备注"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</ModalForm>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
96
src/pages/user/user/components/UpRole.tsx
Normal file
96
src/pages/user/user/components/UpRole.tsx
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* @Note:
|
||||
* @Author: 2058827620@qq.com
|
||||
* @Date: 2022-04-03 17:02:15
|
||||
*/
|
||||
|
||||
import { ProForm, ModalForm, ProFormRadio, ProFormText, ProFormTextArea, ProFormMoney, ProFormCaptcha, ProFormInstance } from '@ant-design/pro-components';
|
||||
import { Button } from 'antd';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { smsCode } from '@/services/user/user'
|
||||
|
||||
|
||||
|
||||
export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
const restFormRef = useRef<ProFormInstance>();
|
||||
const [roleType, setmenuType] = useState<any>('');
|
||||
|
||||
|
||||
const handleFinish = async (formValues) => {
|
||||
await onSubmit({ ...formValues, roleType });
|
||||
restFormRef.current?.resetFields();
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<ModalForm
|
||||
title="用户-角色"
|
||||
formRef={restFormRef}
|
||||
submitter={{
|
||||
searchConfig: {
|
||||
resetText: '重置',
|
||||
},
|
||||
resetButtonProps: {
|
||||
onClick: () => {
|
||||
restFormRef.current?.resetFields();
|
||||
},
|
||||
},
|
||||
}}
|
||||
onFinish={handleFinish}
|
||||
open={modalOpenState}
|
||||
onOpenChange={onModalOpenState}
|
||||
>
|
||||
<ProFormText hidden={true} width="md" name="id" />
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
width="md"
|
||||
name="userName"
|
||||
label="用户名"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
<ProFormText
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
width="md"
|
||||
name="phone"
|
||||
label="手机号"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProFormRadio.Group
|
||||
name="roleType"
|
||||
options={[
|
||||
{
|
||||
label: '普通用户',
|
||||
value: '0',
|
||||
},
|
||||
{
|
||||
label: '公司用户',
|
||||
value: '1',
|
||||
},
|
||||
]}
|
||||
label={'用户角色'}
|
||||
rules={[
|
||||
{
|
||||
required: false,
|
||||
message: '请选择用户角色',
|
||||
},
|
||||
]}
|
||||
fieldProps={{
|
||||
onChange: (e) => {
|
||||
setmenuType(e.target.value);
|
||||
},
|
||||
}}
|
||||
/>
|
||||
<ProFormTextArea
|
||||
rules={[{ required: true, message: '请输入' }]}
|
||||
width="md"
|
||||
name="remark"
|
||||
label="备注"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</ModalForm>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { usersPage, usersAdd, usersDelete, usersUpdate, updateUserLevel, userTransferHanging, exportUser, userRecharge, accountChange } from '@/services/user/user';
|
||||
import { usersPage, usersAdd, usersDelete, usersUpdate, updateUserLevel, userTransferHanging, exportUser, userRecharge, accountChange, updateUserRoleType, updateUserPemType } from '@/services/user/user';
|
||||
|
||||
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
@@ -13,6 +13,8 @@ import TempFormModal from './components/TempFormModal';
|
||||
import ShopModal from './components/ShopModal';
|
||||
import MoneyFormModal from './components/MoneyFormModal';
|
||||
import TradeFormModal from './components/TradeFormModal';
|
||||
import UpRole from './components/UpRole';
|
||||
import UpPem from './components/UpPem';
|
||||
|
||||
|
||||
|
||||
@@ -83,8 +85,27 @@ const LogTableList: React.FC = () => {
|
||||
const [row, setRow] = useState();
|
||||
const [moneyFormModal, setMoneyFormModal] = useState(false);
|
||||
const [tradeFormModal, setTradeFormModal] = useState(false);
|
||||
const [upRoleDatd, setUpRoleDatd] = useState(false);
|
||||
const [upPemData, setUpPemData] = useState(false);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const access = useAccess()
|
||||
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
const searchShop = async (value) => {
|
||||
const { success, data } = await usersPage({
|
||||
userId: value
|
||||
});
|
||||
data.records.map((i) => {
|
||||
i.userName = i.userName + ' ' + i.phone
|
||||
})
|
||||
setShopOption(data.records)
|
||||
}
|
||||
|
||||
// 更改等级
|
||||
const handleLevel = async (fields) => {
|
||||
const { success } = await updateUserLevel({ ...fields });
|
||||
@@ -113,6 +134,25 @@ const LogTableList: React.FC = () => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const handleUpRole = async (fields) => {
|
||||
const { success } = await updateUserRoleType(fields);
|
||||
if (success) {
|
||||
message.success('角色修改成功');
|
||||
actionRef.current?.reload();
|
||||
setUpRoleDatd(false);
|
||||
}
|
||||
}
|
||||
|
||||
const handleUpPem = async (fields) => {
|
||||
const { success } = await updateUserPemType(fields);
|
||||
if (success) {
|
||||
message.success('推广权限修改成功');
|
||||
actionRef.current?.reload();
|
||||
setUpPemData(false);
|
||||
}
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
@@ -136,22 +176,86 @@ const LogTableList: React.FC = () => {
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'userName',
|
||||
title: '用户信息',
|
||||
dataIndex: 'userId',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
render: (_: any, record: any) => {
|
||||
return <div>
|
||||
<div>用户昵称:{record?.nickName}</div>
|
||||
<div>用户名:{record?.userName}</div>
|
||||
<div>手机号:{record?.phone}</div>
|
||||
<div>等级:{record?.level}</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: 'nickName',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
title: '邀请人信息',
|
||||
dataIndex: 'formUserId',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
render: (_: any, record: any) => {
|
||||
return <div>
|
||||
<div>邀请人昵称:{record?.formUser?.nickName}</div>
|
||||
<div>邀请人用户名:{record?.formUser?.userName}</div>
|
||||
<div>邀请人手机号:{record?.formUser?.phone}</div>
|
||||
<div>邀请人等级:{record?.formUser?.level}</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: '钱包',
|
||||
@@ -165,18 +269,30 @@ const LogTableList: React.FC = () => {
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '等级',
|
||||
dataIndex: 'level',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '邀请码',
|
||||
dataIndex: 'shareCode',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
},
|
||||
{
|
||||
title: '角色类型',
|
||||
dataIndex: 'userRole',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return _ == 0 ? '普通用户' : '公司用户'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '推广权限',
|
||||
dataIndex: 'pemType',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return _ == 0 ? '不能邀请' : '可以邀请'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
@@ -195,6 +311,12 @@ const LogTableList: React.FC = () => {
|
||||
return record.qrCode ? <Image src={record.qrCode} width={60} height={60}></Image> : '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'remark',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
@@ -288,6 +410,19 @@ const LogTableList: React.FC = () => {
|
||||
onSubmit={handleMoney}
|
||||
/>
|
||||
|
||||
<UpRole
|
||||
modalOpenState={upRoleDatd}
|
||||
onModalOpenState={setUpRoleDatd}
|
||||
onSubmit={handleUpRole}
|
||||
/>
|
||||
|
||||
<UpPem
|
||||
modalOpenState={upPemData}
|
||||
onModalOpenState={setUpPemData}
|
||||
onSubmit={handleUpPem}
|
||||
/>
|
||||
|
||||
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
@@ -297,6 +432,24 @@ const LogTableList: React.FC = () => {
|
||||
defaultCollapsed: false,
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
danger
|
||||
hidden={!access.hasPerms('/api/users/updateUserPemType')}
|
||||
onClick={() => {
|
||||
setUpPemData(true)
|
||||
}}
|
||||
>
|
||||
推广权限
|
||||
</Button>,
|
||||
<Button
|
||||
danger
|
||||
hidden={!access.hasPerms('/api/users/updateUserRoleType')}
|
||||
onClick={() => {
|
||||
setUpRoleDatd(true)
|
||||
}}
|
||||
>
|
||||
修改用户角色
|
||||
</Button>,
|
||||
<Button
|
||||
danger
|
||||
hidden={!access.hasPerms('/api/users/userRecharge')}
|
||||
|
||||
@@ -40,4 +40,22 @@ export async function deleteBatchByIds(body) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function activity10s1UserList(body) {
|
||||
return request('/api/activity/activity10s1UserList', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'contentcategory-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
export async function activity10CarUserList(body) {
|
||||
return request('/api/activity/activity10CarUserList', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'contentcategory-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -62,4 +62,13 @@ export async function recordExtract(body) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function importUsersPointsExtract(body) {
|
||||
return request('/api/userspoints/importUsersPointsExtract', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -41,3 +41,39 @@ export async function orderRefund(bodys) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export async function getWeiXinCollect() {
|
||||
return request('/api/orders/getWeiXinCollect', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function getCollect() {
|
||||
return request('/api/orders/getCollect', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function getBalance() {
|
||||
return request('/api/orders/getBalance', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function getZhiFuBaoCollect() {
|
||||
return request('/api/orders/getZhiFuBaoCollect', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -80,6 +80,16 @@ export async function pageUpAndDownLevel(id) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function findFormUserId(id) {
|
||||
return request(`/api/users/findFormUserId?id=${id}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export async function userRecharge(body) {
|
||||
return request('/api/users/userRecharge', {
|
||||
method: 'POST',
|
||||
@@ -111,3 +121,23 @@ export async function accountChange(body) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export async function updateUserRoleType(body) {
|
||||
return request(`/api/users/updateUserRoleType`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateUserPemType(body) {
|
||||
return request(`/api/users/updateUserPemType`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user