审核需求

dev-v2
Joe 8 months ago
parent d5f7cd723e
commit d35a19adbc

@ -90,6 +90,24 @@ export default [
}, },
], ],
}, },
{
name: '需求审核',
path: '/requirement',
icon: 'verified',
access: 'requirementQuery',
routes: [
{
path: '',
component: './RequirementAudits',
},
{
name: '详情',
path: 'detail/:id',
hideInMenu: true,
component: './RequirementAudits/detail',
},
],
},
{ {
name: '商家管理', name: '商家管理',
path: '/business', path: '/business',

@ -36,6 +36,23 @@ const Constants = {
status: 'Success' status: 'Success'
} }
}, },
/**
*
*/
pbcApprovalStatus: {
0: {
text: '待审核',
status: 'Process'
},
1: {
text: '审核通过',
status: 'Success'
},
2: {
text: '审核驳回',
status: 'Error'
}
},
/** /**
* *
*/ */

@ -1,9 +1,5 @@
import { import { approvalRequirementForAdminUsingGet, requirementDetailForAdminUsingGet } from '@/services/pop-b2b2c/pbcRequirementController';
approvalSignNUsingPost, import { ProCard } from '@ant-design/pro-components';
approvalSignYUsingGet,
getRecordByBusinessIdAdminUsingGet,
} from '@/services/pop-b2b2c/pbcBusinessApprovalController';
import { ModalForm, ProCard, ProFormTextArea } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { Access, useAccess, useParams } from '@umijs/max'; import { Access, useAccess, useParams } from '@umijs/max';
import { Button, Descriptions, Image, message } from 'antd'; import { Button, Descriptions, Image, message } from 'antd';
@ -13,12 +9,11 @@ const Detail: React.FC<any> = () => {
const params = useParams(); const params = useParams();
const access: any = useAccess(); const access: any = useAccess();
const [info, setInfo] = useState<API.PbcBusinessApproval>({}); const [info, setInfo] = useState<API.PbcRequirement_>({});
const [isModalOpen, setIsModalOpen] = useState(false);
const getInfo = () => { const getInfo = () => {
if (params.id) { if (params.id) {
getRecordByBusinessIdAdminUsingGet({ businessId: parseInt(params.id) }).then((res) => { requirementDetailForAdminUsingGet({ pbcId: parseInt(params.id) }).then((res) => {
if (res.retcode && res.data) { if (res.retcode && res.data) {
setInfo(res.data); setInfo(res.data);
} }
@ -36,7 +31,7 @@ const Detail: React.FC<any> = () => {
title: '', title: '',
}} }}
footer={ footer={
info.pbcBusinessApprovalResult === 0 info.pbcApprovalStatus === 0
? [ ? [
<Button <Button
key="back" key="back"
@ -46,23 +41,32 @@ const Detail: React.FC<any> = () => {
> >
</Button>, </Button>,
<Access key="no" accessible={access.approvalSign}> <Access key="no" accessible={access.approvalRequirement}>
<Button <Button
type="primary" type="primary"
danger danger
onClick={() => { onClick={() => {
setIsModalOpen(true); if (params.id) {
approvalRequirementForAdminUsingGet({ id: parseInt(params.id), pbcApprovalStatus: 2 }).then((res) => {
if (res.retcode) {
message.success('审核驳回');
getInfo();
} else {
message.error(res.retmsg);
}
});
}
}} }}
> >
</Button> </Button>
</Access>, </Access>,
<Access key="pass" accessible={access.approvalSign}> <Access key="pass" accessible={access.approvalRequirement}>
<Button <Button
type="primary" type="primary"
onClick={() => { onClick={() => {
if (params.id) { if (params.id) {
approvalSignYUsingGet({ pbcId: parseInt(params.id) }).then((res) => { approvalRequirementForAdminUsingGet({ id: parseInt(params.id), pbcApprovalStatus: 1 }).then((res) => {
if (res.retcode) { if (res.retcode) {
message.success('审核通过'); message.success('审核通过');
getInfo(); getInfo();
@ -90,78 +94,16 @@ const Detail: React.FC<any> = () => {
} }
> >
<ProCard style={{ marginBottom: 12 }}> <ProCard style={{ marginBottom: 12 }}>
<Descriptions bordered title="基本信息" column={2}> <Descriptions bordered title="基本信息">
<Descriptions.Item label="商户名称">{info.pbcBusinessName}</Descriptions.Item> <Descriptions.Item label="需求标题" span={2}>{info.pbcTitle}</Descriptions.Item>
<Descriptions.Item label="商户类别">{info.pbcBusinessType}</Descriptions.Item> <Descriptions.Item label="需求预算" span={2}>{info.pbcBudget}</Descriptions.Item>
<Descriptions.Item label="联系人">{info.pbcBusinessContact}</Descriptions.Item> <Descriptions.Item label="需求描述" span={3}>{info.pbcDescription}</Descriptions.Item>
<Descriptions.Item label="手机号">{info.pbcBusinessContactMobile}</Descriptions.Item> <Descriptions.Item label="需求图片" span={3}>{info.pbcImages?.split(',').map(e => <Image key={e} width={200} src={e} />)}</Descriptions.Item>
<Descriptions.Item label="负责人">{info.pbcBusinessHead}</Descriptions.Item> <Descriptions.Item label="发布时间" span={3}>{info.pbcCreateAt}</Descriptions.Item>
<Descriptions.Item label="负责人身份证号">{info.pbcBusinessHeadUserNo}</Descriptions.Item> <Descriptions.Item label="联系人" span={3}>{info.pbcCreateByUserName}</Descriptions.Item>
<Descriptions.Item label="身份证人像面"> <Descriptions.Item label="联系电话" span={3}>{info.pbcUsers?.pbcUserMobile}</Descriptions.Item>
<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> </Descriptions>
</ProCard> </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> </PageContainer>
); );
}; };

@ -1,19 +1,16 @@
import React, { useRef, useState } from 'react'; import React, { useRef, useState } from 'react';
import { Button } from 'antd';
import { PageContainer } from '@ant-design/pro-layout'; import { PageContainer } from '@ant-design/pro-layout';
import { queryAllRoleUsingPost } from '@/services/pop-b2b2c/pbcRoleController';
import Constants from '@/constants'; import Constants from '@/constants';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components'; 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'; import { Link } from '@umijs/max';
import { getRequirementPageForAdminUsingPost } from '@/services/pop-b2b2c/pbcRequirementController';
/** /**
* *
* @param param0 * @param param0
*/ */
const fetchData = async (params: API.PageVO) => { const fetchData = async (params: API.PbcRequirement_) => {
const msg = await pbcBusinessApprovalPageUsingPost(params); const msg = await getRequirementPageForAdminUsingPost(params);
return { return {
data: msg.data?.records, data: msg.data?.records,
total: msg.data?.total, total: msg.data?.total,
@ -26,41 +23,36 @@ const TableList: React.FC<{}> = () => {
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const [tabActiveKey, setTabActiveKey] = useState<string>('0') const [tabActiveKey, setTabActiveKey] = useState<string>('0')
const columns: ProColumns<API.PbcBusinessApproval>[] = [ const columns: ProColumns<API.PbcRequirement_>[] = [
{ {
title: '商户名称', title: '需求标题',
dataIndex: 'pbcBusinessName', dataIndex: 'pbcTitle',
}, },
{ {
title: '联系人', title: '需求描述',
dataIndex: 'pbcBusinessContact', dataIndex: 'pbcDescription',
}, search: false
{
title: '商户手机号',
dataIndex: 'pbcBusinessContactMobile',
}, },
{ {
title: '商户类别', title: '联系人',
dataIndex: 'pbcBusinessType', dataIndex: 'pbcCreateByUserName'
valueType: 'select',
valueEnum: Constants.pbcBusinessType
}, },
{ {
title: '主营品类', title: '联系电话',
dataIndex: 'pbcBusinessMainCategory', dataIndex: 'pbcUsers',
ellipsis: true, render: (_, record) => record.pbcUsers?.pbcUserMobile,
search: false, search: false
}, },
{ {
title: '注册日期', title: '发布时间',
dataIndex: 'pbcCreateAt', dataIndex: 'pbcCreateAt',
valueType: 'dateTimeRange', valueType: 'dateRange',
render: (text, record) => record.pbcCreateAt render: (text, record) => record.pbcCreateAt
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'pbcBusinessApprovalResult', dataIndex: 'pbcApprovalStatus',
valueEnum: Constants.pbcBusinessApprovalResult, valueEnum: Constants.pbcApprovalStatus,
search: false search: false
}, },
{ {
@ -69,7 +61,7 @@ const TableList: React.FC<{}> = () => {
valueType: 'option', valueType: 'option',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Link to={'/audits/detail/' + record.pbcId}></Link> <Link to={'/requirement/detail/' + record.pbcId}></Link>
</span> </span>
), ),
}, },
@ -97,11 +89,16 @@ const TableList: React.FC<{}> = () => {
}, },
]} ]}
> >
<ProTable<API.PbcBusinessApproval> <ProTable<API.PbcRequirement_>
columns={columns} columns={columns}
actionRef={actionRef} actionRef={actionRef}
request={(param: any) => { request={(param: any) => {
const queryParam = handlePageQuery(param); const queryParam = {
...param,
publishStartTime: param.pbcCreateAt && param.pbcCreateAt.length > 1 ? param.pbcCreateAt[0] : undefined,
publishEndTime: param.pbcCreateAt && param.pbcCreateAt.length > 1 ? param.pbcCreateAt[1] + ' 23:59:59' : undefined,
pbcCreateAt: undefined
}
return fetchData(queryParam); return fetchData(queryParam);
}} }}
rowKey="pbcId" rowKey="pbcId"
@ -111,7 +108,7 @@ const TableList: React.FC<{}> = () => {
labelWidth: 'auto', labelWidth: 'auto',
span: 6 span: 6
}} }}
params={{ pbcBusinessApprovalResult: tabActiveKey }} params={{ pbcApprovalStatus: tabActiveKey }}
pagination={{ pagination={{
defaultPageSize: 20, defaultPageSize: 20,
showSizeChanger: true, showSizeChanger: true,

Loading…
Cancel
Save