审核需求

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: '商家管理',
path: '/business',

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

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

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

Loading…
Cancel
Save