增加信息
This commit is contained in:
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>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user