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

feat: 采购竞价&在线竞价 整理代码 修改字段

parent c36aa1fb
...@@ -20,7 +20,7 @@ const MsgItem: React.FC<MsgItemPrpos> = (props: any) => { ...@@ -20,7 +20,7 @@ const MsgItem: React.FC<MsgItemPrpos> = (props: any) => {
<div className={styles.title}>{data.memberName}</div> <div className={styles.title}>{data.memberName}</div>
</div> </div>
<div className={styles.msgItemRow}><div className={styles.label}>联系人姓名:</div><div className={styles.title}>{data.contacts}</div></div> <div className={styles.msgItemRow}><div className={styles.label}>联系人姓名:</div><div className={styles.title}>{data.contacts}</div></div>
<div className={styles.msgItemRow}><div className={styles.label}>联系人手机:</div><div className={styles.title}>{data.tel}</div></div> <div className={styles.msgItemRow}><div className={styles.label}>联系人手机:</div><div className={styles.title}>{data.tel.replace(/^(.{3})(.*)(.{4})$/, '$1 $2 $3')}</div></div>
<div className={styles.msgItemRow}><div className={styles.label}>电子邮箱:</div><div className={styles.title}>{data.mail}</div></div> <div className={styles.msgItemRow}><div className={styles.label}>电子邮箱:</div><div className={styles.title}>{data.mail}</div></div>
<div className={styles.msgItemRow}><div className={styles.label}>联系地址:</div>{<Tooltip placement="top" title={data.address}> <div className={styles.msgItemRow}><div className={styles.label}>联系地址:</div>{<Tooltip placement="top" title={data.address}>
<div className={styles.title}>{data.address}</div> <div className={styles.title}>{data.address}</div>
......
...@@ -42,7 +42,7 @@ const ResultItem: React.FC<ResultItemPrpos> = (props: any) => { ...@@ -42,7 +42,7 @@ const ResultItem: React.FC<ResultItemPrpos> = (props: any) => {
</div> </div>
<Divider dashed style={{ color: '#EBECF0', margin: '6px 0' }} /> <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> <div className={styles.resultItemRow}><div className={styles.label}>联系人姓名:</div><div className={styles.title}>{detail.contacts}</div></div>
<div className={styles.resultItemRow}><div className={styles.label}>联系人手机:</div><div className={styles.title}>{detail.tel}</div></div> <div className={styles.resultItemRow}><div className={styles.label}>联系人手机:</div><div className={styles.title}>{detail.tel.replace(/^(.{3})(.*)(.{4})$/, '$1 $2 $3')}</div></div>
</div> </div>
) )
} }
......
...@@ -47,7 +47,7 @@ const BtnItem: React.FC<BtnItemProps> = (props: any) => { ...@@ -47,7 +47,7 @@ const BtnItem: React.FC<BtnItemProps> = (props: any) => {
</div> </div>
<div className={styles.time}> <div className={styles.time}>
<span>{formatTimeString(detail?.peportTime, 'HH:mm:ss')}</span> <span>{formatTimeString(detail?.peportTime, 'HH:mm:ss')}</span>
<TrendTag /> <TrendTag ratio={detail.ratio} />
</div> </div>
</div> </div>
</div> </div>
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Row, Col, Table, Button, Typography, Space } from 'antd'; import { Row, Col, Table, Button, Typography, Space } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { priceFormat } from '@/utils/numberFomat';
import Card from '../../../card'; import Card from '../../../card';
import BtnItem from '../bidDetailBtnItem'; import BtnItem from '../bidDetailBtnItem';
...@@ -69,12 +71,12 @@ const BidDetailLayout: React.FC<BidDetailLayoutProps> = (props: any) => { ...@@ -69,12 +71,12 @@ const BidDetailLayout: React.FC<BidDetailLayoutProps> = (props: any) => {
{ {
title: '单价(含税)', title: '单价(含税)',
dataIndex: 'price', dataIndex: 'price',
render: (text: any, record: any) => <Text type='secondary'>¥{text}</Text> render: (text: any, record: any) => <Text type='secondary'>¥{priceFormat(text)}</Text>
}, },
{ {
title: '金额(含税)', title: '金额(含税)',
dataIndex: 'price', dataIndex: 'price',
render: (text: any, record: any) => <Text type='secondary'>¥{text}</Text> render: (text: any, record: any) => <Text type='secondary'>¥{priceFormat(text)}</Text>
}, },
] ]
...@@ -94,10 +96,15 @@ const BidDetailLayout: React.FC<BidDetailLayoutProps> = (props: any) => { ...@@ -94,10 +96,15 @@ const BidDetailLayout: React.FC<BidDetailLayoutProps> = (props: any) => {
title={'竞价详情'} title={'竞价详情'}
> >
<Row gutter={[8, 8]} style={{ marginBottom: '10px' }}> <Row gutter={[8, 8]} style={{ marginBottom: '10px' }}>
{awardProcess?.map((item, index) => { {awardProcess?.map((item, index, arr) => {
let _ratio = 0;
let _arrLength = arr.length;
if (index != _arrLength - 1 && _arrLength > 2) {
_ratio = Number(((item.sumPice - arr[index + 1].sumPice) / arr[index + 1].sumPice * 100).toFixed(2))
}
return ( return (
<Col span={7} key={`${item.id}_${item.peportTime}`} onClick={() => { chooseItem(item, index) }}> <Col span={7} key={`${item.id}_${item.peportTime}`} onClick={() => { chooseItem(item, index) }}>
<BtnItem btnType={btnType} detail={{ ...item, isOpenPurchase, isOpenRanking }} active={index === activeIndex} /> <BtnItem btnType={btnType} detail={{ ...item, isOpenPurchase, isOpenRanking, ratio: _ratio }} active={index === activeIndex} />
</Col> </Col>
) )
})} })}
......
...@@ -20,7 +20,7 @@ const HistoryItem: React.FC<HistoryItemProps> = (props: any) => { ...@@ -20,7 +20,7 @@ const HistoryItem: React.FC<HistoryItemProps> = (props: any) => {
const { detail } = props; const { detail } = props;
const mapData = detail.offerLogs ? [...detail.offerLogs].splice(0, 3) : []; const mapData = detail.offerLogs ? [...detail.offerLogs].splice(0, 3) : [];
const _returnBadge = () => { const _returnBadge = () => {
if (detail.isOpenRanking) { if (!detail.isOpenRanking) {
return null; return null;
} else { } else {
const _number = Number(detail?.ranking ?? 0); const _number = Number(detail?.ranking ?? 0);
...@@ -49,7 +49,7 @@ const HistoryItem: React.FC<HistoryItemProps> = (props: any) => { ...@@ -49,7 +49,7 @@ const HistoryItem: React.FC<HistoryItemProps> = (props: any) => {
<p>本次报价金额</p> <p>本次报价金额</p>
<p className={styles.currentPrice}><span>¥</span>{detail?.offerPrice ? priceFormat(detail?.offerPrice) : '-'}</p> <p className={styles.currentPrice}><span>¥</span>{detail?.offerPrice ? priceFormat(detail?.offerPrice) : '-'}</p>
<div className={styles.row}> <div className={styles.row}>
<div className={styles.col} style={{ borderRight: '1px solid #EBECF0' }}>当前最低价:<span>{detail?.minLowPrice ? priceFormat(detail?.minLowPrice) : '-'}</span></div> <div className={styles.col} style={{ borderRight: '1px solid #EBECF0' }}>当前最低价:<span>{detail.isOpenPurchase ? (detail?.minLowPrice ? `¥${priceFormat(detail?.minLowPrice)}` : '-') : '不公开'}</span></div>
<div className={styles.col}>报价次数:<span>{detail?.offerCount ? detail?.offerCount : '-'}</span></div> <div className={styles.col}>报价次数:<span>{detail?.offerCount ? detail?.offerCount : '-'}</span></div>
</div> </div>
</div> </div>
......
...@@ -4,6 +4,7 @@ import { Row, Col } from 'antd'; ...@@ -4,6 +4,7 @@ import { Row, Col } from 'antd';
import { ArrowLeftOutlined } from '@ant-design/icons'; import { ArrowLeftOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { priceFormat } from '@/utils/numberFomat';
import { formatTimeString } from '@/utils' import { formatTimeString } from '@/utils'
import StatusBox from '../../../purchaseBid/readyBid/management/components/statusBox'; import StatusBox from '../../../purchaseBid/readyBid/management/components/statusBox';
...@@ -49,12 +50,12 @@ const Detail = () => { ...@@ -49,12 +50,12 @@ const Detail = () => {
let _minList = []; let _minList = [];
let _offerLogs = data?.offerLogs ? [...data.offerLogs].reverse() : []; let _offerLogs = data?.offerLogs ? [...data.offerLogs].reverse() : [];
_offerLogs.forEach((item) => { _offerLogs.forEach((item) => {
_offerList.push({ type: 'offer', time: formatTimeString(item.offerTime, 'HH:mm:ss'), value: item.offerPrice }); _offerList.push({ type: 'offer', time: formatTimeString(item.offerTime, 'HH:mm:ss'), value: priceFormat(item.offerPrice,0) });
}) })
_list.push({ title: '报价金额', type: 'offer', list: _offerList }); _list.push({ title: '报价金额', type: 'offer', list: _offerList });
if (data.isOpenPurchase) { if (data.isOpenPurchase) {
_offerLogs.forEach((item) => { _offerLogs.forEach((item) => {
_minList.push({ type: 'min', time: formatTimeString(item.offerTime, 'HH:mm:ss'), value: item.minPrice }); _minList.push({ type: 'min', time: formatTimeString(item.offerTime, 'HH:mm:ss'), value: priceFormat(item.minPrice,0) });
}) })
_list.push({ title: '最低价', type: 'min', list: _minList }); _list.push({ title: '最低价', type: 'min', list: _minList });
} }
......
...@@ -57,8 +57,8 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any) ...@@ -57,8 +57,8 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any)
} }
const _returnDefaultAwardResults = useMemo(() => { const _returnDefaultAwardResults = useMemo(() => {
return record ? `${record?.purchaseMamberName ?? record?.createMemberName}${record.details}》竞价工作已经结束,中标人已经确定。现将中标结果公布如下: return record ? `${record?.purchaseMemberName ?? record?.createMemberName}${record.details}》竞价工作已经结束,中标人已经确定。现将中标结果公布如下:
中标供应商:${record.mamberName || record.memberName}(中标总金额(含税):${priceFormat(record.sumAwardPrice)})。 中标供应商:${record.memberName}(中标总金额(含税):${priceFormat(record.sumAwardPrice)})。
中标理由:价格最低` : ''; 中标理由:价格最低` : '';
}, [record]) }, [record])
......
...@@ -428,7 +428,7 @@ const SearchDetail = () => { ...@@ -428,7 +428,7 @@ const SearchDetail = () => {
case 'readyExamineSignUp': case 'readyExamineSignUp':
let _data: any = {}; let _data: any = {};
for (let key in dataSource.sginUpInfos) { for (let key in dataSource.sginUpInfos) {
if (dataSource.sginUpInfos[key].id = signUpId) { if (dataSource.sginUpInfos[key].id == signUpId) {
_data = dataSource.sginUpInfos[key]; _data = dataSource.sginUpInfos[key];
} }
} }
......
...@@ -61,7 +61,7 @@ const RankRow: React.FC<RankRowProps> = (props: any) => { ...@@ -61,7 +61,7 @@ const RankRow: React.FC<RankRowProps> = (props: any) => {
<div className={`${styles.rankRow}`}> <div className={`${styles.rankRow}`}>
<div className={styles.rankRowLeft}> <div className={styles.rankRowLeft}>
<div className={styles.rankRowLeftTop}>{detail.memberName}</div> <div className={styles.rankRowLeftTop}>{detail.memberName}</div>
<div className={styles.rankRowLeftBottomPhone}>{detail.tel}</div> <div className={styles.rankRowLeftBottomPhone}>{detail.tel.replace(/^(.{3})(.*)(.{4})$/, '$1 $2 $3')}</div>
</div> </div>
<div className={styles.rankRowRight}> <div className={styles.rankRowRight}>
{detail.contacts} {detail.contacts}
......
...@@ -116,7 +116,7 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => { ...@@ -116,7 +116,7 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => {
const bidOk = () => { const bidOk = () => {
const _price = dataSource2.reduce((total: any, cur: any) => total + Number(cur.price), 0); const _price = dataSource2.reduce((total: any, cur: any) => total + Number(cur.price), 0);
if (Number(detail.minLowPrice) - _price < detail.minPrice) { if (detail?.minLowPrice && Number(detail.minLowPrice) - _price < detail.minPrice) {
message.error('当前报价金额不满足最小价差要求,请修改后再报价!'); message.error('当前报价金额不满足最小价差要求,请修改后再报价!');
return; return;
} }
...@@ -154,10 +154,15 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => { ...@@ -154,10 +154,15 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => {
<Col span={7} key={'BtnItem_0'} onClick={() => { chooseItem() }}> <Col span={7} key={'BtnItem_0'} onClick={() => { chooseItem() }}>
<BtnItem btnType={3} detail={{ sumPice: _calcCurrentTotal, peportPriceSum: offerCount + 1 }} active={!activeItem} onOk={bidOk} onCancle={onClose} /> <BtnItem btnType={3} detail={{ sumPice: _calcCurrentTotal, peportPriceSum: offerCount + 1 }} active={!activeItem} onOk={bidOk} onCancle={onClose} />
</Col> </Col>
{awardProcess?.map((item, index) => { {awardProcess?.map((item, index, arr) => {
let _ratio = 0;
let _arrLength = arr.length;
if (index != _arrLength - 1 && _arrLength > 2) {
_ratio = Number(((item.sumPice - arr[index + 1].sumPice) / arr[index + 1].sumPice * 100).toFixed(2))
}
return ( return (
<Col span={7} key={`${item.id}_${item.peportTime}`} onClick={() => { chooseItem(item, index) }}> <Col span={7} key={`${item.id}_${item.peportTime}`} onClick={() => { chooseItem(item, index) }}>
<BtnItem btnType={2} detail={{ ...item, isOpenPurchase, isOpenRanking }} active={index === activeIndex} /> <BtnItem btnType={2} detail={{ ...item, isOpenPurchase, isOpenRanking, ratio: _ratio }} active={index === activeIndex} />
</Col> </Col>
) )
})} })}
......
...@@ -5,7 +5,7 @@ import { ArrowLeftOutlined } from '@ant-design/icons'; ...@@ -5,7 +5,7 @@ import { ArrowLeftOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { formatTimeString } from '@/utils' import { formatTimeString } from '@/utils'
import { priceFormat } from '@/utils/numberFomat';
import QuotationDeskLayout from '../../../components/detail/components/quotationDeskLayout'; import QuotationDeskLayout from '../../../components/detail/components/quotationDeskLayout';
import BidDetailLayout from '../../../components/detail/components/bidDetailLayout'; import BidDetailLayout from '../../../components/detail/components/bidDetailLayout';
...@@ -89,7 +89,7 @@ const Management = () => { ...@@ -89,7 +89,7 @@ const Management = () => {
setLowestList({ setLowestList({
type: 'min', type: 'min',
title: '最低价', title: '最低价',
list: data ? data.map((item) => { return { type: 'min', time: formatTimeString(item.peportTime, 'HH:mm:ss'), value: item.sumPice } }) : [] list: data ? data.map((item) => { return { type: 'min', time: formatTimeString(item.peportTime, 'HH:mm:ss'), value: priceFormat(item.sumPice,0) } }) : []
}) })
}) })
} }
......
...@@ -35,14 +35,14 @@ const ReadyConfirm = () => { ...@@ -35,14 +35,14 @@ const ReadyConfirm = () => {
dataIndex: 'biddingNo', dataIndex: 'biddingNo',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space direction='vertical'> <Space direction='vertical'>
<EyePreview url={`/memberCenter/procurementAbility/purchaseBid/readyConfirm/detail?id=${record.id}&number=${text}&memberName=${record.mamberName}`}>{text}</EyePreview> <EyePreview url={`/memberCenter/procurementAbility/purchaseBid/readyConfirm/detail?id=${record.id}&number=${text}&memberName=${record.memberName}`}>{text}</EyePreview>
<Text type='secondary'>{record.details}</Text> <Text type='secondary'>{record.details}</Text>
</Space> </Space>
) )
}, { }, {
title: '授标会员', title: '授标会员',
key: 'mamberName', key: 'memberName',
dataIndex: 'mamberName', dataIndex: 'memberName',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview> <EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
) )
......
...@@ -35,8 +35,8 @@ const ReadyExamineResultOne = () => { ...@@ -35,8 +35,8 @@ const ReadyExamineResultOne = () => {
) )
}, { }, {
title: '授标会员', title: '授标会员',
key: 'mamberName', key: 'memberName',
dataIndex: 'mamberName', dataIndex: 'memberName',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview> <EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
) )
......
...@@ -36,8 +36,8 @@ const ReadyExamineResultTwo = () => { ...@@ -36,8 +36,8 @@ const ReadyExamineResultTwo = () => {
) )
}, { }, {
title: '授标会员', title: '授标会员',
key: 'mamberName', key: 'memberName',
dataIndex: 'mamberName', dataIndex: 'memberName',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview> <EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
) )
......
...@@ -37,8 +37,8 @@ const ReadySubmitExamineResult = () => { ...@@ -37,8 +37,8 @@ const ReadySubmitExamineResult = () => {
) )
}, { }, {
title: '授标会员', title: '授标会员',
key: 'mamberName', key: 'memberName',
dataIndex: 'mamberName', dataIndex: 'memberName',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview> <EyePreview url={`/shop?shopId=${btoa(JSON.stringify({ shopId: record.memberShopId, memberId: record.memberId }))}`}>{text}</EyePreview>
) )
......
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