dev-v2
parent
07878f88d8
commit
d5f7cd723e
@ -0,0 +1,169 @@
|
||||
import {
|
||||
approvalSignNUsingPost,
|
||||
approvalSignYUsingGet,
|
||||
getRecordByBusinessIdAdminUsingGet,
|
||||
} from '@/services/pop-b2b2c/pbcBusinessApprovalController';
|
||||
import { ModalForm, ProCard, ProFormTextArea } from '@ant-design/pro-components';
|
||||
import { PageContainer } from '@ant-design/pro-layout';
|
||||
import { Access, useAccess, useParams } from '@umijs/max';
|
||||
import { Button, Descriptions, Image, message } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
const Detail: React.FC<any> = () => {
|
||||
const params = useParams();
|
||||
const access: any = useAccess();
|
||||
|
||||
const [info, setInfo] = useState<API.PbcBusinessApproval>({});
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
|
||||
const getInfo = () => {
|
||||
if (params.id) {
|
||||
getRecordByBusinessIdAdminUsingGet({ businessId: parseInt(params.id) }).then((res) => {
|
||||
if (res.retcode && res.data) {
|
||||
setInfo(res.data);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getInfo();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<PageContainer
|
||||
header={{
|
||||
title: '',
|
||||
}}
|
||||
footer={
|
||||
info.pbcBusinessApprovalResult === 0
|
||||
? [
|
||||
<Button
|
||||
key="back"
|
||||
onClick={() => {
|
||||
history.back();
|
||||
}}
|
||||
>
|
||||
返回
|
||||
</Button>,
|
||||
<Access key="no" accessible={access.approvalSign}>
|
||||
<Button
|
||||
type="primary"
|
||||
danger
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
}}
|
||||
>
|
||||
审核驳回
|
||||
</Button>
|
||||
</Access>,
|
||||
<Access key="pass" accessible={access.approvalSign}>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
if (params.id) {
|
||||
approvalSignYUsingGet({ pbcId: parseInt(params.id) }).then((res) => {
|
||||
if (res.retcode) {
|
||||
message.success('审核通过');
|
||||
getInfo();
|
||||
} else {
|
||||
message.error(res.retmsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
审核通过
|
||||
</Button>
|
||||
</Access>,
|
||||
]
|
||||
: [
|
||||
<Button
|
||||
key="back"
|
||||
onClick={() => {
|
||||
history.back();
|
||||
}}
|
||||
>
|
||||
返回
|
||||
</Button>,
|
||||
]
|
||||
}
|
||||
>
|
||||
<ProCard style={{ marginBottom: 12 }}>
|
||||
<Descriptions bordered title="基本信息" column={2}>
|
||||
<Descriptions.Item label="商户名称">{info.pbcBusinessName}</Descriptions.Item>
|
||||
<Descriptions.Item label="商户类别">{info.pbcBusinessType}</Descriptions.Item>
|
||||
<Descriptions.Item label="联系人">{info.pbcBusinessContact}</Descriptions.Item>
|
||||
<Descriptions.Item label="手机号">{info.pbcBusinessContactMobile}</Descriptions.Item>
|
||||
<Descriptions.Item label="负责人">{info.pbcBusinessHead}</Descriptions.Item>
|
||||
<Descriptions.Item label="负责人身份证号">{info.pbcBusinessHeadUserNo}</Descriptions.Item>
|
||||
<Descriptions.Item label="身份证人像面">
|
||||
<Image width={200} src={info.pbcBusinessHeadUserNoBackUrl} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="身份证国徽面">
|
||||
<Image width={200} src={info.pbcBusinessHeadUserNoFrontUrl} />
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</ProCard>
|
||||
<ProCard style={{ marginBottom: 12 }}>
|
||||
<Descriptions bordered title="工商信息">
|
||||
<Descriptions.Item label="法人">{info.pbcBusinessHead}</Descriptions.Item>
|
||||
<Descriptions.Item label="法人身份证号">{info.pbcBusinessHeadUserNo}</Descriptions.Item>
|
||||
<Descriptions.Item label="公司成立时间">{info.pbcBusinessStartDate}</Descriptions.Item>
|
||||
<Descriptions.Item label="开户行">{info.pbcBusinessBank}</Descriptions.Item>
|
||||
<Descriptions.Item label="收款账号" span={2}>
|
||||
{info.pbcBusinessAccount}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="经营范围" span={3}>
|
||||
{info.pbcBusinessMainCategory}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="营业执照" span={3}>
|
||||
<Image width={200} src={info.pbcBusinessLicenseUrl} />
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</ProCard>
|
||||
<ModalForm
|
||||
title="填写驳回理由"
|
||||
open={isModalOpen}
|
||||
modalProps={{
|
||||
destroyOnClose: true,
|
||||
onCancel: () => setIsModalOpen(false),
|
||||
}}
|
||||
requiredMark={false}
|
||||
width={500}
|
||||
onFinish={async (value: any) => {
|
||||
console.log(value);
|
||||
if (params.id) {
|
||||
await approvalSignNUsingPost({
|
||||
pbcId: parseInt(params.id),
|
||||
pbcBusinessApprovalRefusedReason: value.pbcBusinessApprovalRefusedReason,
|
||||
}).then((res) => {
|
||||
if (res.retcode) {
|
||||
message.success('成功驳回');
|
||||
getInfo();
|
||||
setIsModalOpen(false);
|
||||
} else {
|
||||
message.error(res.retmsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ProFormTextArea
|
||||
placeholder={'请输入驳回理由'}
|
||||
label="驳回理由"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '驳回理由为必填项',
|
||||
},
|
||||
]}
|
||||
width="lg"
|
||||
name="pbcBusinessApprovalRefusedReason"
|
||||
/>
|
||||
</ModalForm>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default Detail;
|
@ -0,0 +1,130 @@
|
||||
import React, { useRef, useState } from 'react';
|
||||
import { Button } from 'antd';
|
||||
import { PageContainer } from '@ant-design/pro-layout';
|
||||
import { queryAllRoleUsingPost } from '@/services/pop-b2b2c/pbcRoleController';
|
||||
import Constants from '@/constants';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { handlePageQuery } from '@/utils/utils';
|
||||
import { pbcBusinessApprovalPageUsingPost } from '@/services/pop-b2b2c/pbcBusinessApprovalController';
|
||||
import { Link } from '@umijs/max';
|
||||
|
||||
/**
|
||||
* 查询表格
|
||||
* @param param0
|
||||
*/
|
||||
const fetchData = async (params: API.PageVO) => {
|
||||
const msg = await pbcBusinessApprovalPageUsingPost(params);
|
||||
return {
|
||||
data: msg.data?.records,
|
||||
total: msg.data?.total,
|
||||
success: msg.retcode,
|
||||
} as any;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
const TableList: React.FC<{}> = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [tabActiveKey, setTabActiveKey] = useState<string>('0')
|
||||
|
||||
const columns: ProColumns<API.PbcBusinessApproval>[] = [
|
||||
{
|
||||
title: '商户名称',
|
||||
dataIndex: 'pbcBusinessName',
|
||||
},
|
||||
{
|
||||
title: '联系人',
|
||||
dataIndex: 'pbcBusinessContact',
|
||||
},
|
||||
{
|
||||
title: '商户手机号',
|
||||
dataIndex: 'pbcBusinessContactMobile',
|
||||
},
|
||||
{
|
||||
title: '商户类别',
|
||||
dataIndex: 'pbcBusinessType',
|
||||
valueType: 'select',
|
||||
valueEnum: Constants.pbcBusinessType
|
||||
},
|
||||
{
|
||||
title: '主营品类',
|
||||
dataIndex: 'pbcBusinessMainCategory',
|
||||
ellipsis: true,
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '注册日期',
|
||||
dataIndex: 'pbcCreateAt',
|
||||
valueType: 'dateTimeRange',
|
||||
render: (text, record) => record.pbcCreateAt
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'pbcBusinessApprovalResult',
|
||||
valueEnum: Constants.pbcBusinessApprovalResult,
|
||||
search: false
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
valueType: 'option',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Link to={'/audits/detail/' + record.pbcId}>详情</Link>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<PageContainer
|
||||
header={{
|
||||
title: '',
|
||||
breadcrumb: {},
|
||||
}}
|
||||
tabActiveKey={tabActiveKey}
|
||||
onTabChange={(key) => setTabActiveKey(key)}
|
||||
tabList={[
|
||||
{
|
||||
tab: "待审核",
|
||||
key: "0"
|
||||
},
|
||||
{
|
||||
tab: "审核通过",
|
||||
key: "1"
|
||||
},
|
||||
{
|
||||
tab: "审核驳回",
|
||||
key: "2"
|
||||
},
|
||||
]}
|
||||
>
|
||||
<ProTable<API.PbcBusinessApproval>
|
||||
columns={columns}
|
||||
actionRef={actionRef}
|
||||
request={(param: any) => {
|
||||
const queryParam = handlePageQuery(param);
|
||||
return fetchData(queryParam);
|
||||
}}
|
||||
rowKey="pbcId"
|
||||
size="small"
|
||||
bordered
|
||||
search={{
|
||||
labelWidth: 'auto',
|
||||
span: 6
|
||||
}}
|
||||
params={{ pbcBusinessApprovalResult: tabActiveKey }}
|
||||
pagination={{
|
||||
defaultPageSize: 20,
|
||||
showSizeChanger: true,
|
||||
}}
|
||||
scroll={{
|
||||
y: 'calc(100vh - 320px)',
|
||||
}}
|
||||
dateFormatter="string"
|
||||
options={false}
|
||||
toolBarRender={() => []}
|
||||
/>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default TableList;
|
Loading…
Reference in New Issue