Commit 7591115b authored by 卢均锐's avatar 卢均锐

feat: 采购竞价&在线竞价对接部分接口

parent 2368dfa9
......@@ -38,7 +38,7 @@ const ResultItem: React.FC<ResultItemPrpos> = (props: any) => {
</div>
<div className={styles.resultItemRow}>
<div className={styles.money}>¥{detail.price}<span>(含税)</span></div>
<Button type='link' onClick={checkDetailFunc}>查看报价明细</Button>
<Button type='link' onClick={() => {checkDetailFunc(detail.id)}}>查看报价明细</Button>
</div>
<Divider dashed style={{ color: '#EBECF0', margin: '6px 0' }} />
<div className={styles.resultItemRow}><div className={styles.label}>联系人姓名:</div><div className={styles.title}>{detail.contacts}</div></div>
......
.list {
display: flex;
h5 {
margin-bottom: 2em;
}
.listLable {
flex: 0 0 25%;
color: #909399;
}
}
\ No newline at end of file
import React, { useContext, useRef } from 'react';
import { Row, Col, Image, Tag, Tooltip, Switch, Typography } from 'antd';
import { StandardTable } from 'god';
import Card from '../../../card';
import { Context } from '../context';
import style from './index.less';
import { QuestionCircleOutlined } from '@ant-design/icons';
const TYPE = {
1: '发布至平台',
2: '系统匹配',
3: '邀请会员',
}
const ColStyle = {
display: 'flex',
alignItems: 'center',
border: '1px solid #1fbf87',
paddingTop: ' 6px',
paddingBottom: '6px',
margin: '5px',
borderRadius: '4px',
}
const TextStyle = {
color: '#1fbf87',
marginLeft: '10px',
}
export interface DemandLayoutIProps {
storeList?: any,
title?: string,
bidId: number,
number: string,
fetch?: () => Promise<unknown>
}
const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => {
const { storeList, title, bidId, number, fetch } = props;
const tableRef = useRef<any>({});
const context = useContext(Context);
const columns = [
{
title: '序号',
key: 'number',
dataIndex: 'number',
render: (text: any, record: any, index: number) => <>{index + 1}</>
},
{
title: '会员名称',
key: 'memberName',
dataIndex: 'memberName',
},
{
title: '会员类型',
key: 'memberTypeName',
dataIndex: 'memberTypeName',
},
{
title: '会员角色',
key: 'roleName',
dataIndex: 'roleName',
},
{
title: '会员等级',
key: 'levelTag',
dataIndex: 'levelTag',
},
{
title: '是否归属会员',
key: 'membershipOrNot',
dataIndex: 'membershipOrNot',
render: (text: any) => (<Tag color={text ? 'success' : 'error'}>{text ? '是' : '否'}</Tag>)
},
{
title: (
<>
<span>需求发送</span>
<Tooltip placement="top" title='打开开关,审核通过后,将发送需求至选择的归属会员'>
<QuestionCircleOutlined
style={{
marginLeft: '5px',
fontSize: '14px',
color: '#909399'
}}
/>
</Tooltip>
</>
),
key: 'state',
dataIndex: 'state',
render: (text: any) => (
<Switch checked={text} disabled={true} />
)
},
{
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (_text: any, _record: any) => (
<Typography.Link href={`/shop?shopId=${btoa(JSON.stringify({ roleId: _record.roleId, memberId: _record.memberId }))}`} target="_blank">
进入店铺
</Typography.Link>
)
},
]
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
fetch({ id: bidId, number: number, ...params }).then(res => {
resolve(res.data)
})
})
}
return (
<Card
id='demandLayout'
title='需求对接'
>
<div className={style.list}>
<h5 className={style.listLable} style={{ flex: '0 0 100px' }}>{title}</h5>
<h5 className={style.listContent}>{TYPE[context.type]}</h5>
</div>
{context.type === 1
&& (
<Row gutter={[16, 16]}>
{storeList.map(item => (
<Col
span={6}
key={item.id}
style={ColStyle}
>
<Image width={32} height={32} src={item.logoUrl} />
<span style={TextStyle}>{item.name}</span>
</Col>
))}
</Row>
)}
{context.type !== 1
&& (
<StandardTable
currentRef={tableRef}
columns={columns}
tableProps={{ rowKew: 'id' }}
fetchTableData={(params: any) => fetchData(params)}
/>
)}
</Card>
)
}
DemandLayout.defaultProps = {
title: '发布方式'
}
export default DemandLayout;
......@@ -60,8 +60,8 @@ interface Iprops {
effects?: string,
selectedRow?: boolean,
reload?: any,
externalStatusFetch?: any,
interiorStatusFetch?: any,
externalStatusFetch?: Promise<unknown>,
interiorStatusFetch?: Promise<unknown>,
}
const formActions = createFormActions();
const Table: React.FC<Iprops> = (props: any) => {
......
......@@ -9,7 +9,6 @@ import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
import Table from '../../components/table'
import ModalOperate from '../../components/modalOperate';
import {
BID_EXTERNALSTATE_COLOR,
......@@ -92,29 +91,15 @@ const ReadyBid = () => {
</>
}];
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
schemaType="ONLINEBIDREADYBID_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getOnlineBiddingStayBiddingList}
fetch={PublicApi.getPurchaseOnlineBiddingStayBiddingList}
reload={ref}
/>
<ModalOperate
id={id}
title="作废原因"
visible={visible}
modalType='abandon'
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
fetch={PublicApi.postPurchaseBiddingDiscard}
/>
</>
)
}
......
......@@ -9,7 +9,6 @@ import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
import Table from '../../components/table'
import ModalOperate from '../../components/modalOperate';
import {
BID_EXTERNALSTATE_COLOR,
......@@ -57,7 +56,7 @@ const ReadySignUp = () => {
</>,
width: 180
}, {
title: '竞价开始/结束时间',
title: '报名开始/结束时间',
key: 'startSignUp',
dataIndex: 'startSignUp',
render: (text: any, record: any) => <>
......@@ -92,29 +91,15 @@ const ReadySignUp = () => {
</>
}];
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
schemaType="ONLINEBIDREADYSIGN_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getOnlineBiddingStayExamineBiddingSignup}
fetch={PublicApi.getPurchaseOnlineBiddingStayExamineBiddingSignup}
reload={ref}
/>
<ModalOperate
id={id}
title="作废原因"
visible={visible}
modalType='abandon'
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
fetch={PublicApi.postPurchaseBiddingDiscard}
/>
</>
)
}
......
......@@ -9,7 +9,6 @@ import EyePreview from '@/components/EyePreview';
import { PublicApi } from '@/services/api';
import Table from '../../components/table'
import ModalOperate from '../../components/modalOperate';
import {
BID_EXTERNALSTATE_COLOR,
......@@ -20,8 +19,6 @@ const { Text } = Typography;
const Search = () => {
const ref = useRef<any>({});
const [id, setId] = useState<number>();
const [visible, setVisible] = useState<boolean>(false);
const columns: ColumnType<any>[] = [{
title: '序号',
align: 'center',
......@@ -67,7 +64,7 @@ const Search = () => {
key: 'isPrize',
dataIndex: 'isPrize',
render: (text: any, record: any) => <>
{(text !== 1 || text !== 0) ? null : <Tag color={BID_EXTERNALSTATE_COLOR[text]}>{record.externalStateName}</Tag> }
{(text !== 1 && text !== 0) ? null : <Tag color={text ? 'success' : 'warning'}>{text ? '是' : '否'}</Tag> }
</>,
width: 180
}, {
......@@ -82,29 +79,15 @@ const Search = () => {
render: (text: any, record: any) => <Badge status={BID_INTERNALSTATE_COLOR[text]} text={record.interiorStateName} />
}];
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
schemaType="ONLINEBIDORDER_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getOnlineBiddingList}
fetch={PublicApi.getPurchaseOnlineBiddingList}
reload={ref}
/>
<ModalOperate
id={id}
title="作废原因"
visible={visible}
modalType='abandon'
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
fetch={PublicApi.postPurchaseBiddingDiscard}
/>
</>
)
}
......
......@@ -16,7 +16,7 @@ const { Text } = Typography;
const formActions = createFormActions();
const QuotationDetailsDrawer = (props: any) => {
const { visible, onClose, schemaType, effects, reload } = props;
const { visible, onClose, schemaType, effects, reload, fetch, quotationDetailsId, number } = props;
const tableRef = useRef<any>({});
const columns: ColumnType<any>[] = [{
title: '序号',
......@@ -74,7 +74,7 @@ const QuotationDetailsDrawer = (props: any) => {
/** 列表数据 */
const fetchData = (params?: any) => {
return new Promise((resolve, reject) => {
fetch({ ...params }).then(res => {
fetch({ id: quotationDetailsId, number: number, ...params }).then(res => {
resolve(res.data)
})
})
......@@ -120,9 +120,9 @@ const QuotationDetailsDrawer = (props: any) => {
searchSelectGetSelectCategoryOptionEffect(actions, 'category')
})
}}
schema={
schemaType && SchemaRender()
}
// schema={
// schemaType && SchemaRender()
// }
>
</NiceForm>
}
......
......@@ -88,6 +88,11 @@ const ReadyExamineOne = () => {
setVisible(!visible);
}
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
......@@ -119,6 +124,7 @@ const ReadyExamineOne = () => {
modalType="audit"
visible={visible}
fetch={PublicApi.postPurchaseBiddingExamine1}
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
/>
</>
......
......@@ -87,6 +87,11 @@ const ReadyExamineTwo = () => {
setVisible(!visible);
}
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
......@@ -118,6 +123,7 @@ const ReadyExamineTwo = () => {
modalType="audit"
visible={visible}
fetch={PublicApi.postPurchaseBiddingExamine2}
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
/>
</>
......
import React, { Fragment, useEffect, useState } from 'react';
import React, { Fragment, useEffect, useState, useMemo } from 'react';
import { Tag, Badge, Popconfirm, Button } from 'antd';
import { history } from 'umi';
import { CheckCircleOutlined, QuestionCircleOutlined } from '@ant-design/icons';
......@@ -12,7 +12,7 @@ import PeripheralLayout from '../../components/detail';
import ProgressLayout from '../../components/detail/components/progressLayout';
import RecordLyout from '../../components/detail/components/recordLyout';
import MaterialLayout from '../../components/detail/components/materialLayout';
import DemandLayout from '../../components/detail/components/demandLayout';
import DemandLayout from '../../components/detail/components/purchaseBidDemandLayout';
import BidCommonLayout from '../../components/detail/components/bidCommonLayout';
import ModalOperate from '../../components/modalOperate';
......@@ -34,16 +34,16 @@ const transforType = {
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
{ id: 'bidResultLayout', title: '竞价结果' },
{ id: 'bidResultLayout', title: '竞价结果', include: ['search', 'readyAdd'] },
{ id: 'basicLayout', title: '基本信息' },
{ id: 'materialLayout', title: '采购物料' },
{ id: 'bidRulesLayout', title: '竞价规则' },
{ id: 'signUpLayout', title: '报名要求' },
{ id: 'signUpMsgLayout', title: '报名信息' },
{ id: 'conditionLayout', title: '交易条件' },
{ id: 'fileLayout', title: '附件' },
{ id: 'demandLayout', title: '需求对接' },
{ id: 'resultLayout', title: '授标结果' },
{ id: 'materialLayout', title: '采购物料', include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit'] },
{ id: 'bidRulesLayout', title: '竞价规则', include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit'] },
{ id: 'signUpLayout', title: '报名要求', include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit'] },
{ id: 'signUpMsgLayout', title: '报名信息', include: ['search', 'readyAdd'] },
{ id: 'conditionLayout', title: '交易条件', include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit'] },
{ id: 'fileLayout', title: '附件', include: ['search', 'readyAdd'] },
{ id: 'demandLayout', title: '需求对接', include: ['search', 'readyAdd'] },
{ id: 'resultLayout', title: '授标结果', include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit'] },
{ id: 'recordLyout', title: '流转记录' },
]
......@@ -57,7 +57,6 @@ const SearchDetail = () => {
} = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
console.log(pathPci)
const [visible, setVisible] = useState<boolean>(false);
// 确认竞价结果
const [confirmBidResultVisible, setConfirmBidResultVisible] = useState<boolean>(false);
......@@ -65,6 +64,7 @@ const SearchDetail = () => {
const [uploadBidResultVisible, setUploadBidResultVisible] = useState<boolean>(false);
// 报价明细
const [quotationDetailsVisible, setQuotationDetailsVisible] = useState<boolean>(false);
const [quotationDetailsId, setQuotationDetailsId] = useState<number>();
const [dataSource, setDataSource] = useState<any>({});
// 基本信息数据
const [basicEffect, setBasicEffect] = useState<any>([]);
......@@ -80,6 +80,19 @@ const SearchDetail = () => {
const [storeList, setStoreList] = useState<Array<any>>([]);
// 授标结果
const [awardResult, setAwardResult] = useState<any>({});
// 生成tabs
const _tabs = useMemo(() => {
let _list = [];
TABLINK.forEach((item) => {
if (!item.include || item.include.includes(pathPci)) {
_list.push(item);
}
})
return _list;
}, [pathPci])
const handleBasicEffect = (data: any) => {
setBasicEffect([
{
......@@ -241,7 +254,6 @@ const SearchDetail = () => {
const _returnTopButton = () => {
switch (pathPci) {
case 'readyAdd':
case 'readySubmit':
return (
<Popconfirm title="确定要提交审核吗?" okText="是" cancelText="否" onConfirm={fetchSubmitBatch}>
<Button type='primary'>
......@@ -254,6 +266,7 @@ const SearchDetail = () => {
case 'readyExamineSignUp':
case 'readyExamineResultOne':
case 'readyExamineResultTwo':
case 'readySubmit':
return (
<Button onClick={() => setVisible(true)} type='primary'>
<CheckCircleOutlined /> 单据审核
......@@ -279,31 +292,33 @@ const SearchDetail = () => {
const fetchLink = () => {
let fetchSoure: any = null;
switch (pathPci) {
case 'addInquiry':
fetchSoure = PublicApi.postPurchasePurchaseInquirySubmit
case 'readyExamineOne':
fetchSoure = PublicApi.postPurchaseBiddingExamine1
break;
case 'auditInquiryOne':
fetchSoure = PublicApi.postPurchasePurchaseInquiryExamine1
case 'readyExamineTwo':
fetchSoure = PublicApi.postPurchaseBiddingExamine2
break;
case 'readySubmit':
fetchSoure = PublicApi.postPurchaseBiddingSubmit
break;
case 'auditInquiryTwo':
fetchSoure = PublicApi.postPurchasePurchaseInquiryExamine2
case 'readyExamineSignUp':
fetchSoure = PublicApi.postPurchaseBiddingExaminBiddingSignup
break;
case 'submitInquiry':
case 'readyExamineResultOne':
fetchSoure = PublicApi.postPurchasePurchaseInquiryCommit
break;
case 'readyExamineResultTwo':
fetchSoure = PublicApi.postPurchasePurchaseInquiryCommit
break;
}
return fetchSoure
}
const _returnBidResultLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
return (
<Context.Provider value={dataSource}>
<PeripheralLayout
no={dataSource.biddingNo}
tabLink={TABLINK}
effect={_returnTopButton()}
components={
<Fragment>
<ProgressLayout />
<BidCommonLayout layoutId="bidResultLayout" title="竞价结果" effect={
[
{
......@@ -318,16 +333,85 @@ const SearchDetail = () => {
}
]
} />
<BidCommonLayout layoutId="basicLayout" title="基本信息" effect={basicEffect} />
)
default:
return null
}
}
const _returnMaterialLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
return (
<MaterialLayout
id={id}
number={number}
fetch={PublicApi.getPurchaseBiddingMaterielPage}
/>
<BidCommonLayout layoutId="bidRulesLayout" title="竞价规则" effect={rulesEffect} />
<BidCommonLayout layoutId="signUpLayout" title="报名要求" effect={signUpEffect} />
<BidCommonLayout layoutId="signUpMsgLayout" title="报名信息" layoutType='msg' effect={dataSource.sginUpInfos || []} />
<BidCommonLayout layoutId="conditionLayout" title="交易条件" effect={conditionEffect} />
)
default:
return null;
}
}
const _returnBidRulesLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
return (<BidCommonLayout layoutId="bidRulesLayout" title="竞价规则" effect={rulesEffect} />)
default:
return null;
}
}
const _returnSignUpLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
return (<BidCommonLayout layoutId="signUpLayout" title="报名要求" effect={signUpEffect} />)
default:
return null;
}
}
const _returnSignUpMsgLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
return (<BidCommonLayout layoutId="signUpMsgLayout" title="报名信息" layoutType='msg' effect={dataSource.sginUpInfos || []} />)
default:
return null;
}
}
const _returnConditionLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
return (<BidCommonLayout layoutId="conditionLayout" title="交易条件" effect={conditionEffect} />)
default:
return null;
}
}
const _returnFileLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
return (
<BidCommonLayout layoutId="fileLayout" title="附件" effect={
[
{
......@@ -337,14 +421,74 @@ const SearchDetail = () => {
}
]
} />
<DemandLayout storeList={storeList} title='对接方式' />
)
default:
return null;
}
}
const _returnDemandLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
return (
<DemandLayout
bidId={id}
number={number}
fetch={PublicApi.getPurchaseBiddingMemberPage}
storeList={storeList}
title='对接方式' />
)
default:
return null;
}
}
const _openQuotationDetailsDrawer = (id: number) => {
setQuotationDetailsId(id);
setQuotationDetailsVisible(true);
}
const _returnResultLayout = () => {
switch (pathPci) {
case 'search':
case 'readyAdd':
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
return (
<BidCommonLayout
layoutId="resultLayout"
title="授标结果"
layoutType='result'
checkDetailFunc={() => { setQuotationDetailsVisible(true) }}
checkDetailFunc={_openQuotationDetailsDrawer}
effect={awardResult}
extra={<Button type='link'>查看竞价过程</Button>} />
)
default:
return null;
}
}
return (
<Context.Provider value={dataSource}>
<PeripheralLayout
no={dataSource.biddingNo}
tabLink={_tabs}
effect={_returnTopButton()}
components={
<Fragment>
<ProgressLayout />
{_returnBidResultLayout()}
<BidCommonLayout layoutId="basicLayout" title="基本信息" effect={basicEffect} />
{_returnMaterialLayout()}
{_returnBidRulesLayout()}
{_returnSignUpLayout()}
{_returnSignUpMsgLayout()}
{_returnConditionLayout()}
{_returnFileLayout()}
{_returnDemandLayout()}
{_returnResultLayout()}
<RecordLyout />
</Fragment>
}
......@@ -370,6 +514,10 @@ const SearchDetail = () => {
onCancel={() => setUploadBidResultVisible(false)}
/>
<QuotationDetailsDrawer
fetch={PublicApi.getPurchaseBiddingQuotedPriceDetaild}
quotationDetailsId={quotationDetailsId}
number={number}
effects='id'
title="报价明细"
visible={quotationDetailsVisible}
onClose={() => setQuotationDetailsVisible(false)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment