增加信息
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
@@ -148,7 +148,6 @@ const BasicForm: FC<Record<string, any>> = () => {
|
||||
name={'ageMan'}
|
||||
>
|
||||
<InputNumber
|
||||
max={65}
|
||||
addonAfter="岁"
|
||||
/>
|
||||
</ProForm.Item>
|
||||
@@ -336,6 +335,7 @@ const BasicForm: FC<Record<string, any>> = () => {
|
||||
>
|
||||
<InputNumber
|
||||
min={0}
|
||||
max={100}
|
||||
addonAfter="%"
|
||||
/>
|
||||
</ProForm.Item>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { variationPage } from '@/services/finance/index';
|
||||
import { variationPage, recordExtract } from '@/services/finance/index';
|
||||
import { exportData } from '@/utils/func';
|
||||
|
||||
|
||||
import React, { useRef, useEffect,useState } from 'react';
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
import { useIntl, useAccess } from '@umijs/max';
|
||||
import { message, Tag, Select } from 'antd';
|
||||
import { message, Tag, Select, Button } from 'antd';
|
||||
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||
import moneyType from '@/assets/json/moneyType.json'
|
||||
import { usersPage } from '@/services/user/user';
|
||||
@@ -11,7 +11,7 @@ import { usersPage } from '@/services/user/user';
|
||||
|
||||
const LogTableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const [searchParams, setSearchParams] = useState(null);
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
|
||||
const searchShop = async (value) => {
|
||||
@@ -143,9 +143,15 @@ const LogTableList: React.FC = () => {
|
||||
labelWidth: 120,
|
||||
defaultCollapsed: false,
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button type="primary" onClick={async () => {
|
||||
let _res = await recordExtract(searchParams)
|
||||
exportData(_res, '积分变动记录')
|
||||
}}>导出</Button>,
|
||||
]}
|
||||
request={async (params, sorter, filter) => {
|
||||
params.pointType = 1
|
||||
|
||||
setSearchParams(params)
|
||||
let { data } = await variationPage(params)
|
||||
return {
|
||||
data: data?.records || [],
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { variationPage } from '@/services/finance/index';
|
||||
|
||||
import { variationPage,recordExtract } from '@/services/finance/index';
|
||||
import { exportData } from '@/utils/func';
|
||||
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
import { useIntl, useAccess } from '@umijs/max';
|
||||
import { message, Tag, Select } from 'antd';
|
||||
import { message, Tag, Select,Button } from 'antd';
|
||||
import { ActionType, PageContainer, ProTable, ProFormSelect } from '@ant-design/pro-components';
|
||||
import moneyType from '@/assets/json/moneyType.json'
|
||||
import { usersPage } from '@/services/user/user';
|
||||
@@ -14,6 +14,10 @@ import { usersPage } from '@/services/user/user';
|
||||
const LogTableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
const [searchParams, setSearchParams] = useState(null);
|
||||
|
||||
|
||||
|
||||
|
||||
const searchShop = async (value) => {
|
||||
const { success, data } = await usersPage({
|
||||
@@ -144,8 +148,15 @@ const LogTableList: React.FC = () => {
|
||||
labelWidth: 120,
|
||||
defaultCollapsed: false,
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button type="primary" onClick={async () => {
|
||||
let _res = await recordExtract(searchParams)
|
||||
exportData(_res, '积分记录')
|
||||
}}>导出</Button>,
|
||||
]}
|
||||
request={async (params, sorter, filter) => {
|
||||
params.pointType = 2
|
||||
setSearchParams(params)
|
||||
let { data } = await variationPage(params)
|
||||
return {
|
||||
data: data?.records || [],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { withdrawPage } from '@/services/finance/index';
|
||||
import { withdrawPage, withdrawExtract } from '@/services/finance/index';
|
||||
import { usersPage } from '@/services/user/user';
|
||||
|
||||
import { exportData } from '@/utils/func';
|
||||
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
import { useIntl, useAccess } from '@umijs/max';
|
||||
@@ -13,8 +13,11 @@ import TempFormModal from './components/TempFormModal';
|
||||
const LogTableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [tempFormModal, setTempFormModal] = useState(false);
|
||||
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
const [searchParams, setSearchParams] = useState(null);
|
||||
|
||||
|
||||
|
||||
|
||||
const searchShop = async (value) => {
|
||||
const { success, data } = await usersPage({
|
||||
@@ -225,14 +228,16 @@ const LogTableList: React.FC = () => {
|
||||
defaultCollapsed: false,
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button type="primary" onClick={() => {
|
||||
window.location.href = exportLink(searchParams, '/admin/withdraw/export1');
|
||||
<Button type="primary" onClick={async () => {
|
||||
let _res = await withdrawExtract(searchParams)
|
||||
exportData(_res, '提现记录')
|
||||
}}>导出提现申请</Button>,
|
||||
<Button icon={<UploadOutlined />} onClick={() => {
|
||||
<Button icon={<UploadOutlined />} onClick={async () => {
|
||||
setTempFormModal(true)
|
||||
}}>导入提现结果</Button>
|
||||
]}
|
||||
request={async (params, sorter, filter) => {
|
||||
setSearchParams(params)
|
||||
let { data } = await withdrawPage(params)
|
||||
return {
|
||||
data: data?.records || [],
|
||||
|
||||
86
src/pages/order/components/BonusFormModal.tsx
Normal file
86
src/pages/order/components/BonusFormModal.tsx
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* @Note:
|
||||
* @Author: 2058827620@qq.com
|
||||
* @Date: 2022-04-03 10:53:25
|
||||
*/
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
Table
|
||||
} from 'antd';
|
||||
|
||||
import { orderList } from '@/services/order';
|
||||
|
||||
|
||||
|
||||
export default ({ values, modalOpenState, onModalOpenState }) => {
|
||||
|
||||
const [config, setConfig] = useState(null);
|
||||
const [items, setItems] = useState(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!values?.id) {
|
||||
return
|
||||
}
|
||||
orderList(values?.id).then(({ data }) => {
|
||||
setItems(data || []);
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
}, [values]);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '账单号',
|
||||
dataIndex: 'orderNo',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '投资人',
|
||||
dataIndex: 'shop',
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return <>
|
||||
<div>用户名:{record?.username}</div>
|
||||
<div>手机号:{record?.phone}</div>
|
||||
<div>等级:{record?.level}</div>
|
||||
</>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'typeValue',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '金额',
|
||||
dataIndex: 'points',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
search: false,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal width="800px" title="分红" open={modalOpenState} onOk={() => {
|
||||
onModalOpenState(false);
|
||||
}} onCancel={() => {
|
||||
onModalOpenState(false)
|
||||
}}>
|
||||
<>
|
||||
<Table
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={items}
|
||||
pagination={false}
|
||||
/>
|
||||
</>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
103
src/pages/order/components/EscFormModal.tsx
Normal file
103
src/pages/order/components/EscFormModal.tsx
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* @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 } from 'react';
|
||||
import { smsCode } from '@/services/user/user'
|
||||
|
||||
|
||||
|
||||
export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
const restFormRef = useRef<ProFormInstance>();
|
||||
|
||||
|
||||
|
||||
const handleFinish = async (formValues) => {
|
||||
await onSubmit(formValues);
|
||||
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>
|
||||
|
||||
<ProForm.Group>
|
||||
<ProFormCaptcha
|
||||
placeholder={'请输入验证码'}
|
||||
captchaTextRender={(timing, count) => {
|
||||
if (timing) {
|
||||
return `${count} ${'获取验证码'}`;
|
||||
}
|
||||
return '获取验证码';
|
||||
}}
|
||||
label="验证码"
|
||||
name="smsCode"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入验证码!',
|
||||
},
|
||||
]}
|
||||
onGetCaptcha={async () => {
|
||||
const { data } = await smsCode();
|
||||
}}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormText
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
width="md"
|
||||
name="orderNo"
|
||||
label="订单号"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProFormTextArea
|
||||
rules={[{ required: true, message: '请输入' }]}
|
||||
width="md"
|
||||
name="remarks"
|
||||
label="退款原因"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</ModalForm>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
import { orderPage, orderExport } from '@/services/order';
|
||||
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 { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||
|
||||
|
||||
import BonusFormModal from './components/BonusFormModal';
|
||||
import EscFormModal from './components/EscFormModal';
|
||||
|
||||
|
||||
const LogTableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [searchParams, setSearchParams] = useState(null);
|
||||
const [bonusFormModal, setBonusFormModal] = useState(false);
|
||||
const [row, setRow] = useState();
|
||||
const [selectedRowsState, setSelectedRows] = useState([]);
|
||||
const [escFormModal, setEscFormModal] = useState(false);
|
||||
|
||||
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '订单号',
|
||||
@@ -21,7 +28,8 @@ const LogTableList: React.FC = () => {
|
||||
return <div className={'flex items-center'}>
|
||||
{record.orderNo}
|
||||
<Button type="link" onClick={() => {
|
||||
|
||||
setRow(record);
|
||||
setBonusFormModal(true);
|
||||
}}>查看</Button>
|
||||
</div>
|
||||
}
|
||||
@@ -161,9 +169,28 @@ const LogTableList: React.FC = () => {
|
||||
},
|
||||
];
|
||||
|
||||
const escSubmit = async (fields) => {
|
||||
const { success } = await orderRefund(fields);
|
||||
if (success) {
|
||||
message.success('退单成功');
|
||||
actionRef.current?.reload();
|
||||
setEscFormModal(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<EscFormModal
|
||||
modalOpenState={escFormModal}
|
||||
onModalOpenState={setEscFormModal}
|
||||
onSubmit={escSubmit}
|
||||
/>
|
||||
<BonusFormModal
|
||||
values={row}
|
||||
modalOpenState={bonusFormModal}
|
||||
onModalOpenState={setBonusFormModal}
|
||||
/>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
@@ -175,7 +202,7 @@ const LogTableList: React.FC = () => {
|
||||
<Button
|
||||
danger
|
||||
onClick={() => {
|
||||
// setRefundFormModal(true);
|
||||
setEscFormModal(true);
|
||||
}}
|
||||
>
|
||||
退单
|
||||
@@ -193,6 +220,11 @@ const LogTableList: React.FC = () => {
|
||||
total: data?.total,
|
||||
};
|
||||
}}
|
||||
rowSelection={{
|
||||
onChange: (_, selectedRows) => {
|
||||
setSelectedRows(selectedRows)
|
||||
},
|
||||
}}
|
||||
columns={columns}
|
||||
/>
|
||||
</div>
|
||||
|
||||
112
src/pages/piles/components/BonusFormModal.tsx
Normal file
112
src/pages/piles/components/BonusFormModal.tsx
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* @Note:
|
||||
* @Author: 2058827620@qq.com
|
||||
* @Date: 2022-04-03 10:53:25
|
||||
*/
|
||||
|
||||
import { incomedayPage } from '@/services/piles';
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
Table
|
||||
} from 'antd';
|
||||
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||
|
||||
|
||||
import { orderList } from '@/services/order';
|
||||
|
||||
|
||||
|
||||
export default ({ values, modalOpenState, onModalOpenState }) => {
|
||||
|
||||
const [config, setConfig] = useState(null);
|
||||
const [items, setItems] = useState(null);
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
useEffect(() => {
|
||||
if (actionRef.current) {
|
||||
actionRef.current.reload();
|
||||
}
|
||||
}, [values]);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '用户ID',
|
||||
dataIndex: 'userId',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '设备ID',
|
||||
dataIndex: 'deviceId',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '分账日期',
|
||||
dataIndex: 'incomeDate',
|
||||
search: false,
|
||||
},
|
||||
// {
|
||||
// title: '服务费金额',
|
||||
// dataIndex: 'serviceAmount',
|
||||
// search: false,
|
||||
// },
|
||||
// {
|
||||
// title: '用户分成金额',
|
||||
// dataIndex: 'userAmount',
|
||||
// search: false,
|
||||
// },
|
||||
// {
|
||||
// title: '平台分成金额',
|
||||
// dataIndex: 'platformAmount',
|
||||
// search: false,
|
||||
// },
|
||||
// {
|
||||
// title: '奖金金额',
|
||||
// dataIndex: 'bonusAmount',
|
||||
// search: false,
|
||||
// },
|
||||
|
||||
// {
|
||||
// title: '平台分成配置',
|
||||
// dataIndex: 'setConfig',
|
||||
// search: false,
|
||||
// },
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
search: false,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal width="800px" title="收益列表" open={modalOpenState} onOk={() => {
|
||||
onModalOpenState(false);
|
||||
}} onCancel={() => {
|
||||
onModalOpenState(false)
|
||||
}}>
|
||||
<>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
key="logList"
|
||||
search={{
|
||||
labelWidth: 120,
|
||||
}}
|
||||
request={async (params, sorter, filter) => {
|
||||
params.deviceNo = values?.deviceNo
|
||||
params.orderId = values?.orderId
|
||||
params.userId = values?.userId
|
||||
let { data } = await incomedayPage(params)
|
||||
return {
|
||||
data: data?.records || [],
|
||||
total: data?.total,
|
||||
};
|
||||
}}
|
||||
columns={columns}
|
||||
/>
|
||||
</>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
140
src/pages/piles/index.tsx
Normal file
140
src/pages/piles/index.tsx
Normal file
@@ -0,0 +1,140 @@
|
||||
import { devicePage } from '@/services/piles';
|
||||
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 { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||
import BonusFormModal from './components/BonusFormModal';
|
||||
|
||||
|
||||
const LogTableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [searchParams, setSearchParams] = useState(null);
|
||||
const [bonusFormModal, setBonusFormModal] = useState(false);
|
||||
const [row, setRow] = useState();
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '设备号',
|
||||
dataIndex: 'deviceNo',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
return <div className={'flex items-center'}>
|
||||
{record.deviceNo || '-'}
|
||||
<Button type="link" onClick={() => {
|
||||
setRow(record);
|
||||
setBonusFormModal(true);
|
||||
}}>查看</Button>
|
||||
</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'orderId',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '设备类型',
|
||||
dataIndex: 'deviceType',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
|
||||
{
|
||||
title: '设备状态',
|
||||
dataIndex: 'deviceStatus',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
let color = record.deviceStatus == 1 ? 'volcano' : record.deviceStatus == 2 ? 'orange' : 'red'
|
||||
return <Tag color={color}>{record.deviceStatus == 1 ? '已安装' : record.deviceStatus == 2 ? '已运营' : '未安装'}</Tag>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '设备总收益',
|
||||
dataIndex: 'income',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '安装站点名称',
|
||||
dataIndex: 'stationName',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '安装站点地址',
|
||||
dataIndex: 'stationAddress',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '安装时间',
|
||||
dataIndex: 'installTime',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '交付时间',
|
||||
dataIndex: 'deliverDate',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '分账有效期',
|
||||
dataIndex: 'paymentValidity',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '分账类型',
|
||||
dataIndex: 'paymentType',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
let color = record.paymentType == 1 ? 'volcano' : 'red'
|
||||
return <Tag color={color}>{record.paymentType == 1 ? '普通分账' : '不分账'}</Tag>
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<BonusFormModal
|
||||
values={row}
|
||||
modalOpenState={bonusFormModal}
|
||||
onModalOpenState={setBonusFormModal}
|
||||
/>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
key="logList"
|
||||
search={{
|
||||
labelWidth: 120,
|
||||
}}
|
||||
request={async (params, sorter, filter) => {
|
||||
setSearchParams({ ...params });
|
||||
let { data } = await devicePage(params)
|
||||
return {
|
||||
data: data?.records || [],
|
||||
total: data?.total,
|
||||
};
|
||||
}}
|
||||
columns={columns}
|
||||
/>
|
||||
</div>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default LogTableList;
|
||||
119
src/pages/user/user/components/MoneyFormModal.tsx
Normal file
119
src/pages/user/user/components/MoneyFormModal.tsx
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* @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 } from 'react';
|
||||
import { smsCode } from '@/services/user/user'
|
||||
|
||||
|
||||
|
||||
export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
const restFormRef = useRef<ProFormInstance>();
|
||||
|
||||
|
||||
|
||||
const handleFinish = async (formValues) => {
|
||||
await onSubmit(formValues);
|
||||
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>
|
||||
|
||||
<ProForm.Group>
|
||||
<ProFormCaptcha
|
||||
placeholder={'请输入验证码'}
|
||||
captchaTextRender={(timing, count) => {
|
||||
if (timing) {
|
||||
return `${count} ${'获取验证码'}`;
|
||||
}
|
||||
return '获取验证码';
|
||||
}}
|
||||
label="验证码"
|
||||
name="smsCode"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入验证码!',
|
||||
},
|
||||
]}
|
||||
onGetCaptcha={async () => {
|
||||
const { data } = await smsCode();
|
||||
}}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
{/* <ProFormRadio.Group
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
name="type"
|
||||
label="类型"
|
||||
radioType="button"
|
||||
options={[
|
||||
{
|
||||
label: '线下充值',
|
||||
value: '51',
|
||||
},
|
||||
{
|
||||
label: '余额划扣',
|
||||
value: '52',
|
||||
},
|
||||
]}
|
||||
/> */}
|
||||
<ProFormMoney
|
||||
rules={[{ required: true, message: '请输入!' }]}
|
||||
label="金额"
|
||||
name="rechargeAmount"
|
||||
customSymbol="¥"
|
||||
/>
|
||||
|
||||
</ProForm.Group>
|
||||
<ProFormTextArea
|
||||
rules={[{ required: true, message: '请输入' }]}
|
||||
width="md"
|
||||
name="remark"
|
||||
label="备注"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
</ModalForm>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
98
src/pages/user/user/components/ShopModal.tsx
Normal file
98
src/pages/user/user/components/ShopModal.tsx
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* @Note:
|
||||
* @Author: 2058827620@qq.com
|
||||
* @Date: 2022-04-03 10:53:25
|
||||
*/
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
Table
|
||||
} from 'antd';
|
||||
|
||||
|
||||
import { pageUpAndDownLevel } from '@/services/user/user';
|
||||
|
||||
export default ({ values, modalOpenState, onModalOpenState }) => {
|
||||
|
||||
const [items2, setitems2] = useState(null);
|
||||
const [items, setItems] = useState(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (!values?.id) {
|
||||
return
|
||||
}
|
||||
pageUpAndDownLevel(values?.id).then(({ data, success }) => {
|
||||
if (success) {
|
||||
setItems(data?.upLevel || []);
|
||||
setitems2(data?.downLevel)
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
}, [values]);
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '用户',
|
||||
dataIndex: 'shop',
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return <>
|
||||
<div>用户名:{record?.userName}</div>
|
||||
<div>手机号:{record?.phone}</div>
|
||||
<div>等级:{record?.level}</div>
|
||||
</>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '余额',
|
||||
dataIndex: 'points2',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '收益',
|
||||
dataIndex: 'points1',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
search: false,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal width="800px" title="" open={modalOpenState} onOk={() => {
|
||||
onModalOpenState(false);
|
||||
}} onCancel={() => {
|
||||
onModalOpenState(false)
|
||||
}}>
|
||||
<>
|
||||
<div style={{ margin: '15px 0' }}>上级</div>
|
||||
<Table
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={items}
|
||||
pagination={false}
|
||||
/>
|
||||
<div style={{ margin: '15px 0' }}>
|
||||
下级
|
||||
</div>
|
||||
<Table
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={items2}
|
||||
pagination={false}
|
||||
/>
|
||||
</>
|
||||
</Modal >
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -9,7 +9,7 @@ import { Divider } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import FilesManager from '@/components/FilesManage/index';
|
||||
|
||||
export default ({ values, modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
export default ({ modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
const restFormRef = useRef<ProFormInstance>();
|
||||
|
||||
return (
|
||||
@@ -27,7 +27,6 @@ export default ({ values, modalOpenState, onModalOpenState, onSubmit }) => {
|
||||
},
|
||||
},
|
||||
}}
|
||||
initialValues={values}
|
||||
onFinish={async (e) => {
|
||||
await onSubmit(e)
|
||||
restFormRef.current?.resetFields();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { usersPage, usersAdd, usersDelete, usersUpdate, updateUserLevel, userTransferHanging, exportUser } from '@/services/user/user';
|
||||
import { usersPage, usersAdd, usersDelete, usersUpdate, updateUserLevel, userTransferHanging, exportUser, userRecharge } from '@/services/user/user';
|
||||
|
||||
|
||||
import React, { useRef, useEffect, useState } from 'react';
|
||||
@@ -10,6 +10,12 @@ import { PlusOutlined, LineChartOutlined } from '@ant-design/icons';
|
||||
import { exportData } from '@/utils/func';
|
||||
import LevelFormModal from './components/LevelFormModal';
|
||||
import TempFormModal from './components/TempFormModal';
|
||||
import ShopModal from './components/ShopModal';
|
||||
import MoneyFormModal from './components/MoneyFormModal';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加节点
|
||||
*
|
||||
@@ -76,6 +82,10 @@ const LogTableList: React.FC = () => {
|
||||
const [levelFormModal, setLevelFormModal] = useState(false);
|
||||
const [tempFormModal, setTempFormModal] = useState(false);
|
||||
const [searchParams, setSearchParams] = useState(null);
|
||||
const [shopModal, setBonusFormModal] = useState(false);
|
||||
const [row, setRow] = useState();
|
||||
const [moneyFormModal, setMoneyFormModal] = useState(false);
|
||||
|
||||
|
||||
|
||||
// 更改等级
|
||||
@@ -97,12 +107,30 @@ const LogTableList: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleMoney = async (fields) => {
|
||||
const { success } = await userRecharge(fields);
|
||||
if (success) {
|
||||
message.success('余额变更成功');
|
||||
actionRef.current?.reload();
|
||||
setMoneyFormModal(false);
|
||||
}
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
return <div className={'flex items-center'}>
|
||||
{record.id}
|
||||
<Button type="link" onClick={() => {
|
||||
setRow(record);
|
||||
setBonusFormModal(true);
|
||||
}}>查看</Button>
|
||||
</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '头像',
|
||||
@@ -136,7 +164,7 @@ const LogTableList: React.FC = () => {
|
||||
},
|
||||
{
|
||||
title: '收益',
|
||||
dataIndex: 'points2',
|
||||
dataIndex: 'points1',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
},
|
||||
@@ -224,6 +252,11 @@ const LogTableList: React.FC = () => {
|
||||
return (
|
||||
<PageContainer>
|
||||
<div style={{ width: '100%', float: 'right' }}>
|
||||
<ShopModal
|
||||
values={row}
|
||||
modalOpenState={shopModal}
|
||||
onModalOpenState={setBonusFormModal}
|
||||
/>
|
||||
<LevelFormModal
|
||||
modalOpenState={levelFormModal}
|
||||
onModalOpenState={setLevelFormModal}
|
||||
@@ -234,6 +267,11 @@ const LogTableList: React.FC = () => {
|
||||
onModalOpenState={setTempFormModal}
|
||||
onSubmit={handleTemp}
|
||||
/>
|
||||
<MoneyFormModal
|
||||
modalOpenState={moneyFormModal}
|
||||
onModalOpenState={setMoneyFormModal}
|
||||
onSubmit={handleMoney}
|
||||
/>
|
||||
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
@@ -246,7 +284,7 @@ const LogTableList: React.FC = () => {
|
||||
<Button
|
||||
danger
|
||||
onClick={() => {
|
||||
setTradeFormModal(true)
|
||||
setMoneyFormModal(true)
|
||||
}}
|
||||
>
|
||||
余额变更
|
||||
|
||||
@@ -127,7 +127,8 @@ export const errorConfig: RequestConfig = {
|
||||
// 拦截请求配置,进行个性化处理。
|
||||
const Authorization = localStorage.getItem('token') || ''
|
||||
const headers = { Authorization };
|
||||
config.url.includes('https://');
|
||||
// let url = config.url;
|
||||
// const url = config?.url;
|
||||
let url = `https://iadminapi.zhongshuai2023.com` + config.url;
|
||||
if (config.url.includes('https://')) {
|
||||
url = config.url;
|
||||
|
||||
@@ -28,4 +28,38 @@ export async function variationPage(body) {
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
}
|
||||
export async function withdrawExtract(body) {
|
||||
return request('/api/userspoints/points/extract/export', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
export async function pointsExtract(body) {
|
||||
return request('/api/userspoints/points/export', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
export async function recordExtract(body) {
|
||||
return request('/api/userspoints/points/record/export', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,5 +17,27 @@ export async function orderExport(body) {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
export async function orderList(id) {
|
||||
return request(`/api/orders/orderIncomeList?id=${id}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 退单
|
||||
export async function orderRefund(bodys) {
|
||||
return request('/api/orders/orderRefund', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: bodys || {},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
22
src/services/piles/index.ts
Normal file
22
src/services/piles/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
export async function devicePage(body) {
|
||||
return request('/api/device/page', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
export async function incomedayPage(body) {
|
||||
return request('/api/device/incomeday/page', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,3 +71,33 @@ export async function exportUser(body) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function pageUpAndDownLevel(id) {
|
||||
return request(`/api/users/upAndDownLevel?id=${id}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function userRecharge(body) {
|
||||
return request('/api/users/userRecharge', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
data: body || {},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 获取短信
|
||||
export async function smsCode() {
|
||||
return request(`/api/sms/sensitiveSendSms`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ export function exportLink(searchParams, api) {
|
||||
};
|
||||
|
||||
export function exportData(_res,name) {
|
||||
console.log(_res);
|
||||
// 获取文件的二进制数据
|
||||
const blob = new Blob([_res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||
// 创建下载链接
|
||||
|
||||
Reference in New Issue
Block a user