12-23-上传master
This commit is contained in:
101
src/pages/Finance/Earnest/index.tsx
Normal file
101
src/pages/Finance/Earnest/index.tsx
Normal file
@ -0,0 +1,101 @@
|
||||
import ProTable, { ProColumns } from '@ant-design/pro-table';
|
||||
import { Card, message, PageHeader, Spin, Tabs, Upload } from 'antd';
|
||||
import React, { useState, } from 'react';
|
||||
import { getEnrnest } from './service'
|
||||
|
||||
const Earnest: React.FC<{}> = () => {
|
||||
const proId = 1111111;
|
||||
const payerId = 9527;
|
||||
const { TabPane } = Tabs;
|
||||
const [spin, setSpin] = useState<boolean>(false);
|
||||
const [activeKey, setActiveKey] = useState<any>(1);
|
||||
const props = {
|
||||
name: 'file',
|
||||
action: 'https://',
|
||||
accept: ".png,.jpg,.rar,.zip",
|
||||
onChange(info: any) {
|
||||
if (info.file.status !== 'uploading') {
|
||||
console.log(info.file, info.fileList);
|
||||
}
|
||||
if (info.file.status === 'done') {
|
||||
message.success(`${info.file.name} file uploaded successfully`);
|
||||
} else if (info.file.status === 'error') {
|
||||
message.error(`${info.file.name} file upload failed.`);
|
||||
}
|
||||
},
|
||||
};
|
||||
const columns: ProColumns<any>[] = [
|
||||
{ title: '序号', valueType: 'index', width: 10, },
|
||||
{ title: '采购包编号', dataIndex: 'sectionId', width: 100, copyable: true },
|
||||
{ title: '采购包名称', dataIndex: 'sectionName', width: 100, copyable: true },
|
||||
{ title: '费用类型', dataIndex: 'commodityName', width: 100, renderText: () => "保证金", },
|
||||
{ title: '应缴金额(元)', dataIndex: 'amount', width: 80, },
|
||||
{ title: '缴纳时间', dataIndex: 'createDate', width: 100, valueType: 'dateTime', },
|
||||
{
|
||||
title: '审核状态', dataIndex: 'orderState', width: 80,
|
||||
valueEnum: {
|
||||
"0": { text: '未支付', status: 'Warning' },
|
||||
"1": { text: '支付中', status: 'Processing' },
|
||||
"2": { text: '支付成功', status: 'Success' },
|
||||
"3": { text: '待审核', status: 'Processing' },
|
||||
"-2": { text: '审核驳回', status: 'Error' },
|
||||
"-1": { text: '已失效', status: 'Error' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作', dataIndex: 'option', width: 150,
|
||||
valueType: 'option',
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<>
|
||||
{record.orderState == 0 && record.orderState == (-2) ?
|
||||
<Upload {...props}>
|
||||
<a onClick={() => {
|
||||
|
||||
}}>上传凭证</a>
|
||||
</Upload>
|
||||
: null}
|
||||
<Upload {...props}>
|
||||
<a onClick={() => {
|
||||
|
||||
}}>上传凭证</a>
|
||||
</Upload>
|
||||
</>
|
||||
)
|
||||
}
|
||||
},
|
||||
];
|
||||
//控制展示页
|
||||
const callback = (key: any) => {
|
||||
setActiveKey(key);
|
||||
setSpin(true);
|
||||
setTimeout(() => setSpin(false), 400);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<PageHeader title="缴纳保证金" style={{ backgroundColor: "white", borderBottom: "solid", borderBottomColor: 'rgb(239,242,245)', borderWidth: '1px', borderRadius: "10px", }}></PageHeader>
|
||||
<Spin spinning={spin}>
|
||||
<Card>
|
||||
<ProTable
|
||||
columns={columns}
|
||||
options={false}
|
||||
search={false}
|
||||
toolBarRender={()=>[<a>凭证大小:20M;凭证文件类型:jpg、png、pdf、rar、zip</a>]}
|
||||
request={() => getEnrnest({ projectId: proId, expensesType: 5, payerId: payerId }).then((res) => {
|
||||
console.log(res);
|
||||
const result = {
|
||||
data: res.data.payVoList,
|
||||
total: res.data.total,
|
||||
success: res.data.success,
|
||||
pageSize: res.data.pageSize,
|
||||
current: res.data.current
|
||||
};
|
||||
return result;
|
||||
})}
|
||||
/>
|
||||
</Card>
|
||||
</Spin>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default Earnest;
|
31
src/pages/Finance/Earnest/service.ts
Normal file
31
src/pages/Finance/Earnest/service.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
//保证金列表查询
|
||||
export async function getEnrnest(params?: any) {
|
||||
return request(`/api/biz-service-ebtp-expenses/v1/bizbidexpenses/getExpensesTypeList`,{
|
||||
method:'POST',
|
||||
data:{...params,},
|
||||
});
|
||||
}
|
||||
//沃支付
|
||||
export async function woPay(params?: any) {
|
||||
return request(`/api/core-service-ebtp-pay/v1/bizbidpay/woPay/${params.id}`);
|
||||
}
|
||||
//取消订单
|
||||
export async function delOrder(params?: any) {
|
||||
return request(`/api/biz-service-ebtp-expenses/v1/bizbidorder/cancelOrder/${params.id}`,{
|
||||
method:'POST',
|
||||
});
|
||||
}
|
||||
//继续支付里删除
|
||||
export async function delSection(params?: any) {
|
||||
console.log({...params});
|
||||
|
||||
return request(`/api/biz-service-ebtp-expenses/v1/bizbidshoppingcart/deleteCartById`,{
|
||||
method:'POST',
|
||||
params,
|
||||
// data:{
|
||||
// ...params,
|
||||
// }
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user