提交 fae478c5 作者: 龚洪江

功能:提现列表,提现审批

上级 c9a81776
......@@ -15,6 +15,7 @@ import { ForumManageAPI } from './modules/forumManageAPI';
import { PilotTrainAPI } from './modules/pilotTrainAPI';
import { FlyerCenterAPI } from './modules/flyerCenterAPI';
import { RentManageAPI } from './modules/rentManageAPI';
import { DepleteManageTypeAPI } from './modules/depleteManageTypeAPI';
export {
CommonAPI,
......@@ -34,4 +35,5 @@ export {
PilotTrainAPI,
FlyerCenterAPI,
RentManageAPI,
DepleteManageTypeAPI,
};
import { InterFunction, InterListFunction } from '~/api/interface';
// 提现列表
export type listPageWithdrawalApplyType = InterListFunction<
{
/**
* 状态: 0提现申请中 1提现成功 2提现失败
*/
applyStatus?: number;
/**
* 结束时间
*/
endTime?: string;
/**
* 关键字
*/
keyword?: string;
/**
* 通道标识-微信(wechat)-支付宝(alipay)-银行卡(bank_card)
*/
settleType?: string;
/**
* 开始时间
*/
startTime?: string;
},
{
/**
* 申请金额
*/
applyAmt?: number;
/**
* 状态: 0平台处理中 1提现成功 2提现失败
*/
applyStatus?: number;
/**
* 开户银行-支行名称
*/
bankName?: string;
/**
* 创建时间
*/
createTime?: Date;
/**
* 开户人
*/
empName?: string;
/**
* id
*/
id: number;
/**
* 流水编号
*/
outerTradeNo?: string;
/**
* 收款账号
*/
payAccount?: string;
/**
* 手机号
*/
phoneNum?: string;
/**
* 备注
*/
remark?: string;
/**
* 提现方式-微信(wechat)-支付宝(alipay)-银行卡(bank_card)
*/
settleType: string;
/**
* 处理信息
*/
tradeResult?: string;
/**
* 申请人的用户ID
*/
userAccountId?: number;
}
>;
//提现审批
export type approveWithdrawalApplyType = InterFunction<
{
/**
* 状态: 0提现申请中 1审批通过 2审批未通过
*/
applyStatus: number;
/**
* 申请单ID
*/
id: number;
/**
* 备注
*/
remark?: string;
},
any
>;
import {
approveWithdrawalApplyType,
listPageWithdrawalApplyType,
} from '~/api/interface/depleteManageType';
import axios from '~/api/request';
export class DepleteManageTypeAPI {
// 提现列表
static getListPageWithdrawalApply: listPageWithdrawalApplyType = (data) =>
axios.post('/userapp/withdrawal/listPageWithdrawalApply', data);
//提现审批
static approveWithdrawalApply: approveWithdrawalApplyType = (params) =>
axios.get('/userapp/withdrawal/approveWithdrawalApply', { params });
}
import { Form, Input, message, Modal, ModalProps, Radio } from 'antd';
import { FC } from 'react';
import { DepleteManageTypeAPI } from '~/api';
import { listPageWithdrawalApplyType } from '~/api/interface/depleteManageType';
import { InterListType } from '~/api/interface';
// 提现列表返回类型
type withdrawalApplyType = InterListType<listPageWithdrawalApplyType>;
interface selfProps {
onOk: () => void;
onCancel: () => void;
currentWithDrawItem: withdrawalApplyType[0] | undefined;
}
const ApplyStatusModal: FC<ModalProps & selfProps> = ({
open,
onOk,
onCancel,
currentWithDrawItem,
}) => {
const [form] = Form.useForm<{ applyStatus: number; remark?: string }>();
const handleOk = () => {
if (currentWithDrawItem) {
form.validateFields().then((values) => {
DepleteManageTypeAPI.approveWithdrawalApply({ ...values, id: currentWithDrawItem.id }).then(
({ code }) => {
if (code === '200') {
message.success('审批成功');
form.resetFields();
onOk();
}
},
);
});
}
};
const handleCancel = () => {
form.resetFields();
onCancel();
};
return (
<Modal title='审批' open={open} onOk={handleOk} onCancel={handleCancel}>
<Form
form={form}
initialValues={{ applyStatus: 1 }}
wrapperCol={{ span: 22 }}
labelCol={{ span: 2 }}
>
<Form.Item label='状态' name='applyStatus'>
<Radio.Group>
<Radio value={1}>提现成功</Radio>
<Radio value={2}>提现失败</Radio>
</Radio.Group>
</Form.Item>
<Form.Item label='备注' name='remark'>
<Input.TextArea placeholder='请输入备注' maxLength={70} rows={4} showCount />
</Form.Item>
</Form>
</Modal>
);
};
export default ApplyStatusModal;
import SearchBox from '~/components/search-box';
import { searchColumns as searchColumnsType } from '~/components/search-box';
import { Table } from 'antd';
import { Button, Table } from 'antd';
import { ColumnsType } from 'antd/es/table/InternalTable';
import { DepleteManageTypeAPI } from '~/api';
import { useEffect, useState } from 'react';
import { InterListType, PaginationProps } from '~/api/interface';
import { listPageWithdrawalApplyType } from '~/api/interface/depleteManageType';
import { filterObjAttr } from '~/utils';
import ApplyStatusModal from '~/pages/depleteManage/withDrawList/components/applyStatusModal';
const withDrawManage = () => {
// 提现列表返回类型
type withdrawalApplyType = InterListType<listPageWithdrawalApplyType>;
// 提现列表请求类型
type withdrawalApplyParameterType = InterListType<listPageWithdrawalApplyType>;
// 状态字典
const applyStatusDic = [
{
label: '提现申请中',
value: 0,
},
{
label: '提现成功',
value: 1,
},
{
label: '提现失败',
value: 2,
},
];
// 提现方式字典
const settleTypeDic = [
{
label: '微信',
value: 'wechat',
},
{
label: '支付宝',
value: 'alipay',
},
{
label: '银行卡',
value: 'bankcard',
},
];
const WithDrawManage = () => {
const searchColumns: searchColumnsType[] = [
{
label: '账号',
placeholder: '请输入账号',
name: '',
name: 'keyword',
type: 'input',
},
{
label: '状态',
placeholder: '请选择状态',
name: '',
name: 'applyStatus',
type: 'Select',
options: [],
options: applyStatusDic,
},
{
label: '提现方式',
placeholder: '请选择提现方式',
name: '',
name: 'settleType',
type: 'Select',
options: [],
options: settleTypeDic,
},
{
label: '时间',
name: '',
name: 'time',
type: 'rangePicker',
placeholder: '',
},
];
const tableColumns: ColumnsType<any> = [
const tableColumns: ColumnsType<withdrawalApplyType[0]> = [
{
title: '流水编号',
align: 'center',
dataIndex: 'outerTradeNo',
},
{
title: '账户名称',
align: 'center',
dataIndex: 'empName',
},
{
title: '金额',
align: 'center',
dataIndex: 'applyAmt',
},
{
title: '提现方式',
align: 'center',
dataIndex: 'settleType',
render: (text: string) => settleTypeDic.find((v) => v.value === text)?.label || '',
},
{
title: '手机号',
align: 'center',
dataIndex: 'phoneNum',
},
{
title: '收款账号',
align: 'center',
dataIndex: 'payAccount',
},
{
title: '状态',
align: 'center',
dataIndex: 'applyStatus',
render: (text: number) => applyStatusDic.find((v) => v.value === text)?.label || '',
},
{
title: '处理信息',
align: 'center',
dataIndex: 'tradeResult',
},
{
title: '时间',
align: 'center',
dataIndex: 'createTime',
},
{
title: '备注',
align: 'center',
dataIndex: 'remark',
},
{
title: '操作',
align: 'center',
render: (_: any, record) => (
<Button type='link' onClick={() => applyStatusEvent(record)}>
审批
</Button>
),
},
];
const [tableData, setTableData] = useState<withdrawalApplyType>([]);
const [pagination, setPagination] = useState<PaginationProps & { totalCount: number }>({
pageNo: 1,
pageSize: 10,
totalCount: 0,
});
const [query, setQuery] = useState<withdrawalApplyParameterType>();
// 审批弹窗
const [applyStatusModalShow, setApplyStatusModalShow] = useState<boolean>(false);
// 当前审批对象
const [currentWithDrawItem, setCurrentWithDrawItem] = useState<withdrawalApplyType[0]>();
// 获取提现列表
const getListPageWithdrawalApply = (query?: withdrawalApplyParameterType) => {
DepleteManageTypeAPI.getListPageWithdrawalApply({
pageNo: pagination.pageNo,
pageSize: pagination.pageSize,
...query,
}).then(({ result }) => {
pagination.totalCount = result.totalCount;
setPagination({ ...pagination });
setTableData(result.list || []);
});
};
// 分页
const paginationChange = (pageNo: number, pageSize: number) => {
pagination.pageNo = pageNo;
pagination.pageSize = pageSize;
getListPageWithdrawalApply(query);
};
// 筛选成功
const searchSuccess = (value: any) => {
pagination.pageNo = 1;
pagination.pageSize = 10;
const filterQuery = filterObjAttr(value, ['time']);
setQuery(filterQuery);
getListPageWithdrawalApply(filterQuery);
};
// 审批弹窗事件
const applyStatusEvent = (record: withdrawalApplyType[0]) => {
setCurrentWithDrawItem(record);
setApplyStatusModalShow(true);
};
const applyStatusModalCancel = () => {
setApplyStatusModalShow(false);
};
const applyStatusModalOk = () => {
setApplyStatusModalShow(false);
getListPageWithdrawalApply(query);
};
useEffect(() => {
getListPageWithdrawalApply();
}, []);
return (
<div className='with-draw-manage'>
<SearchBox search={searchColumns} />
<Table bordered columns={tableColumns} />
<SearchBox search={searchColumns} searchData={searchSuccess} />
<Table
bordered
columns={tableColumns}
rowKey='id'
dataSource={tableData}
pagination={{
total: pagination.totalCount,
pageSize: pagination.pageSize,
current: pagination.pageNo,
showSizeChanger: true,
showQuickJumper: true,
onChange: (page: number, pageSize: number) => paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
/>
{/*审批*/}
<ApplyStatusModal
open={applyStatusModalShow}
onCancel={applyStatusModalCancel}
onOk={applyStatusModalOk}
currentWithDrawItem={currentWithDrawItem}
/>
</div>
);
};
export default withDrawManage;
export default WithDrawManage;
......@@ -81,7 +81,7 @@ const DemandOrderDetail = () => {
})
.map((v) => {
return {
title: demandDetail?.orderStatus >= v.orderStatus ? v.doing : v.waiting,
title: demandDetail?.orderStatus > v.orderStatus ? v.doing : v.waiting,
orderStatus: v.orderStatus,
description: v.key
? flowDictionaryAndTimeRes.result[v.key]?.createTime || ''
......@@ -136,6 +136,9 @@ const DemandOrderDetail = () => {
{demandDetail?.taskStartTime}~{demandDetail?.taskEndTime}
</Descriptions.Item>
<Descriptions.Item label='任务地址'>{demandDetail?.taskAddress}</Descriptions.Item>
<Descriptions.Item label='平台收益'>
{demandDetail?.orderEarnings.toFixed(2).toLocaleString()}
</Descriptions.Item>
</Descriptions>
<Descriptions title='发单方' bordered style={{ marginTop: '10px' }}>
<Descriptions.Item label='冻结云享金'>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论