Commit d2b27c0d authored by 卢均锐's avatar 卢均锐

feat: 采购竞价&在线竞价 接入接口,添加部分逻辑

parent 4ab0ac71
......@@ -33,7 +33,7 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
<Steps
progressDot
>
{logStatesItem && logStatesItem.logs.map(item => (
{logStatesItem && logStatesItem.logs?.map(item => (
<Steps.Step
key={item.state}
title={item.roleName}
......
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import { history,Link } from 'umi';
import { Button, Tag, Badge, Typography, Space } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
......@@ -44,7 +44,7 @@ const ReadyBid = () => {
dataIndex: 'createMemberName',
render: (text: any, record: any) => (
<EyePreview
url={`/memberCenter/procurementAbility/onlineBid/search/detail?id=${record.id}&number=${record.biddingNo}`}>{text}</EyePreview>
url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
)
}, {
title: '竞价开始/结束时间',
......@@ -79,16 +79,7 @@ const ReadyBid = () => {
key: 'operate',
dataIndex: 'operate',
align: 'center',
render: (text: any, record: any) => <>
{
<>
<Button
onClick={() => history.push(`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`)}
type='link'
>开始竞价</Button>
</>
}
</>
render: (text: any, record: any) => <Link to={`/memberCenter/procurementAbility/onlineBid/readyBid/detail?id=${record.id}&number=${record.biddingNo}`}>开始竞价</Link>
}];
return (
......
import React, { useRef, useState } from 'react';
import { history } from 'umi';
import { history,Link } from 'umi';
import { Button, Tag, Badge, Typography, Space } from 'antd';
import { ColumnType } from 'antd/lib/table/interface';
import { PlayCircleOutlined, PoweroffOutlined } from '@ant-design/icons'
......@@ -43,8 +43,7 @@ const ReadySignUp = () => {
key: 'createMemberName',
dataIndex: 'createMemberName',
render: (text: any, record: any) => (
<EyePreview
url={`/memberCenter/procurementAbility/onlineBid/search/detail?id=${record.id}&number=${record.biddingNo}`}>{text}</EyePreview>
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
)
}, {
title: '竞价开始/结束时间',
......@@ -79,16 +78,12 @@ const ReadySignUp = () => {
key: 'operate',
dataIndex: 'operate',
align: 'center',
render: (text: any, record: any) => <>
{
<>
<Button
onClick={() => history.push(`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`)}
type='link'
>报名</Button>
</>
}
</>
render: (text: any, record: any) => <Button
onClick={() => {history.push(`/memberCenter/procurementAbility/onlineBid/readySignUp/signUp?id=${record.id}&number=${record.biddingNo}`)}}
type='link'
>
报名
</Button>
}];
return (
......
......@@ -86,6 +86,8 @@ const Search = () => {
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseOnlineBiddingList}
externalStatusFetch={PublicApi.getPurchaseBiddingExternalStatus}
interiorStatusFetch={PublicApi.getPurchaseOnlineBiddingInteriorStatus}
reload={ref}
/>
</>
......
......@@ -229,6 +229,7 @@ const AddForm = () => {
currentRef={currentRules}
fetchdata={rules}
onBadge={getError}
exRef={currentRequirement}
/>
</TabPane>
{/* 报名要求 */}
......@@ -237,6 +238,7 @@ const AddForm = () => {
currentRef={currentRequirement}
fetchdata={requirement}
onBadge={getError}
exRef={currentRules}
/>
</TabPane>
{/* 交易条件 */}
......
......@@ -32,11 +32,12 @@ const layout: any = {
interface Iprops {
currentRef: any,
fetchdata: GetPurchasePurchaseInquiryDetailsResponse,
onBadge?: Function
onBadge?: Function,
exRef: any
}
const BidRequirement: React.FC<Iprops> = (props: any) => {
const { currentRef, fetchdata, onBadge } = props;
const { currentRef, fetchdata, onBadge, exRef } = props;
const [files, setFiles] = useState<any>([]);
const [loading, setloading] = useState(false);
const [form] = Form.useForm();
......@@ -62,18 +63,19 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
onBadge(error.errorFields.length, 3)
}
})
})
}),
signUpTime: () => form.getFieldValue('signUpTime')
}
})
useEffect(() => {
fetchdata.demandUrls && setFiles([...fetchdata.demandUrls])
form.setFieldsValue({
signUpTime : [fetchdata.startSignUp ? moment(fetchdata.startSignUp) : '',fetchdata.endSignUp ? moment(fetchdata.endSignUp) : ''],
demand : fetchdata.demand,
demandUrls : fetchdata.demandUrls
signUpTime: [fetchdata.startSignUp ? moment(fetchdata.startSignUp) : '', fetchdata.endSignUp ? moment(fetchdata.endSignUp) : ''],
demand: fetchdata.demand,
demandUrls: fetchdata.demandUrls
})
},[fetchdata])
}, [fetchdata])
/**判断文件类型和大小 */
const beforeDocUpload = (file: any) => {
......@@ -97,7 +99,7 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
}
}
setFiles([...arr])
form.setFieldsValue({demandUrls : [...arr]})
form.setFieldsValue({ demandUrls: [...arr] })
}
// 删除附件
......@@ -105,9 +107,9 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
const arr = [...files];
arr.splice(index, 1);
setFiles(arr);
form.setFieldsValue({demandUrls : [...arr]})
form.setFieldsValue({ demandUrls: [...arr] })
}
return (
<>
......@@ -121,7 +123,11 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
name='signUpTime'
rules={[
{ required: true, message: '请选择报名要求时间' }, () => ({
validator(_, value) {
async validator(_, value) {
let _exVal = await exRef.current.biddingTime();
if (_exVal[0] && moment(value[1]).isAfter(_exVal[0])) {
return Promise.reject(new Error('报名结束需要早于竞价开始时间'));
}
if (!value[0] || !value[1]) {
return Promise.reject(new Error('请选择报名要求时间'));
} else {
......@@ -131,9 +137,9 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
})
]}
>
<DatePicker.RangePicker
showTime
format="YYYY-MM-DD HH:mm:ss"
<DatePicker.RangePicker
showTime
format="YYYY-MM-DD HH:mm:ss"
placeholder={['开始时间', '结束时间']}
disabledDate={(current) => {
return current && current < moment().startOf('second')
......
......@@ -30,11 +30,12 @@ const layout: any = {
interface Iprops {
currentRef: any,
fetchdata: GetPurchasePurchaseInquiryDetailsResponse,
onBadge?: Function
onBadge?: Function,
exRef: any
}
const BidRules: React.FC<Iprops> = (props: any) => {
const { currentRef, fetchdata, onBadge } = props;
const { currentRef, fetchdata, onBadge, exRef } = props;
const [isStartingPrice, setIsStartingPrice] = useState<boolean>(true)
const [isTargetPrice, setIsTargetPrice] = useState<boolean>(true)
const [isMinPrice, setIsMinPrice] = useState<boolean>(true)
......@@ -69,7 +70,8 @@ const BidRules: React.FC<Iprops> = (props: any) => {
onBadge(error.errorFields.length, 2)
}
})
})
}),
biddingTime: () => form.getFieldValue('biddingTime')
}
})
......@@ -111,8 +113,12 @@ const BidRules: React.FC<Iprops> = (props: any) => {
label='竞价时间'
name='biddingTime'
rules={[
{ required: true, message: '请选择竞价时间' }, () => ({
validator(_, value) {
{ required: true, message: '请选择竞价时间' }, () => ({
async validator(_, value) {
let _exVal = await exRef.current.signUpTime();
if (_exVal[1] && moment(value[0]).isBefore(_exVal[1])) {
return Promise.reject(new Error('竞价开始时间需要晚于报名截止时间'));
}
if (!value[0] || !value[1]) {
return Promise.reject(new Error('请选择竞价时间'));
} else {
......
......@@ -92,7 +92,7 @@ const ReadyConfirm = () => {
schemaType="PURCHASEBIDOSIGNUP_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseQuotedPriceAddList}
fetch={PublicApi.getPurchaseBiddingStayConfirmBiddingList}
/>
<ConfirmBidResultModal
record={confirmRecord}
......
......@@ -102,7 +102,7 @@ const ReadyExamineResultOne = () => {
schemaType="PURCHASEBIDREADYADD_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseBiddingStayExamineList2}
fetch={PublicApi.getPurchaseBiddingStaySubmitBiddingList1}
controllerBtns={
<Row>
<Col span={24}>
......
......@@ -103,7 +103,7 @@ const ReadyExamineResultTwo = () => {
schemaType="PURCHASEBIDREADYADD_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseQuotedPriceAddList}
fetch={PublicApi.getPurchaseBiddingStaySubmitBiddingList2}
controllerBtns={
<Row>
<Col span={24}>
......
......@@ -35,7 +35,7 @@ const ReadyExamineSignUp = () => {
dataIndex: 'biddingNo',
render: (text: any, record: any) => (
<Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/purchaseBid/readyExamineSignUp/detail?id=${record.id}&number=${text}`}>{text}</EyePreview>
<EyePreview url={`/memberCenter/procurementAbility/purchaseBid/readyExamineSignUp/detail?id=${record.biddingId}&number=${text}&signUpId=${record.id}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text>
</Space>
)
......@@ -87,6 +87,11 @@ const ReadyExamineSignUp = () => {
setVisible(!visible);
}
const handleSubmit = () => {
setVisible(false);
ref.current.reload();
}
return (
<>
<Table
......@@ -102,6 +107,7 @@ const ReadyExamineSignUp = () => {
modalType="audit"
visible={visible}
fetch={PublicApi.postPurchaseBiddingExaminBiddingSignup}
onOk={() => handleSubmit()}
onCancel={() => setVisible(false)}
/>
</>
......
......@@ -105,7 +105,7 @@ const ReadySubmitExamineResult = () => {
schemaType="PURCHASEBIDREADYADD_SCHEMA"
columns={columns}
effects="biddingNo"
fetch={PublicApi.getPurchaseQuotedPriceAddList}
fetch={PublicApi.getPurchaseBiddingStaySubmitBiddingList}
controllerBtns={
<Row>
<Col span={24}>
......@@ -115,7 +115,7 @@ const ReadySubmitExamineResult = () => {
disabled={rowkeys.length === 0}
>
批量提交
</Button>
</Button>
</Space>
</Col>
</Row>
......
......@@ -36,8 +36,9 @@ const TABLINK = [
{ id: 'basicLayout', 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: 'signUpLayout', title: '报名要求', include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit', 'readyExamineSignUp'] },
{ id: 'signUpMsgLayout', title: '报名信息', include: ['search', 'readyAdd', 'readyExamineSignUp'] },
{ id: 'signUpFileLayout', title: '报名文件', include: ['readyExamineSignUp'] },
{ id: 'conditionLayout', title: '交易条件', include: ['search', 'readyAdd', 'readyExamineOne', 'readyExamineTwo', 'readySubmit'] },
{ id: 'fileLayout', title: '附件', include: ['search', 'readyAdd'] },
{ id: 'demandLayout', title: '需求对接', include: ['search', 'readyAdd'] },
......@@ -49,7 +50,8 @@ const SearchDetail = () => {
const {
query: {
id,
number
number,
signUpId //报名ID
},
pathname,
} = history.location;
......@@ -95,10 +97,10 @@ const SearchDetail = () => {
const handleProgressEffect = (data: any) => {
let _list = [{ title: '外部流转', state: 1, logs: data.externalLogStates }];
if(pathPci !== 'readyExamineSignUp'){
if (pathPci !== 'readyExamineSignUp') {
_list.push({ title: '内部流转', state: 2, logs: data.interiorLogStates });
}
if(pathPci === 'search'){
if (pathPci === 'search') {
_list.push({ title: '竞价结果内部流转', state: 3, logs: data.examineInteriorLogStates });
}
setProgressEffect(_list);
......@@ -390,6 +392,7 @@ const SearchDetail = () => {
case 'readyExamineOne':
case 'readyExamineTwo':
case 'readySubmit':
case 'readyExamineSignUp':
return (<BidCommonLayout layoutId="signUpLayout" title="报名要求" effect={signUpEffect} />)
default:
return null;
......@@ -401,6 +404,43 @@ const SearchDetail = () => {
case 'search':
case 'readyAdd':
return (<BidCommonLayout layoutId="signUpMsgLayout" title="报名信息" layoutType='msg' effect={dataSource.sginUpInfos || []} />)
case 'readyExamineSignUp':
let _data : any = {};
for(let key in dataSource.sginUpInfos){
if(dataSource.sginUpInfos[key].id = signUpId){
_data = dataSource.sginUpInfos[key];
}
}
return (
<>
<BidCommonLayout layoutId="signUpMsgLayout" title="报名信息" effect={[
{
col: [
{ label: '报名会员', extra: _data.memberName, type: 'text' },
{ label: '联系人姓名', extra: _data.contacts, type: 'text' },
]
},
{
col: [
{ label: '联系人手机', extra: `+${_data.telPrefix} ${_data.tel}`, type: 'text' },
{ label: '电子邮箱', extra: _data.mail, type: 'text' },
]
},
{
col: [
{ label: '单位地址', extra: _data.address, type: 'text' },
]
}
]} />
<BidCommonLayout layoutId="signUpFileLayout" title="报名文件" effect={[
{
col: [
{ label: '报名文件', extra: _data.enclosureUrls, type: 'files' },
]
}
]} />
</>
)
default:
return null;
}
......
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