Commit b74e03f5 authored by leimo's avatar leimo

Merge branch 'fix-220418-ljr' into 'v2-220418'

Fix 220418 ljr See merge request linkseeks-design/pro-platform!458
parents 9c790ad5 6d04b3cf
...@@ -933,7 +933,7 @@ export default { ...@@ -933,7 +933,7 @@ export default {
'table.purchase.qingshuruzhaobiao': 'Please enter the bidding code', 'table.purchase.qingshuruzhaobiao': 'Please enter the bidding code',
'table.purchase.daoru': 'Import', 'table.purchase.daoru': 'Import',
'table.purchase.qingxuanzezhuanjia1': 'Please select expert type', 'table.purchase.qingxuanzezhuanjia1': 'Please select expert type',
'table.purchase.zhongbiaomingxi': 'Zhongbiaomingxi', 'table.purchase.zhongbiaomingxi': 'Bid winning details',
'table.purchase.toubiaowuliao': 'Bid material', 'table.purchase.toubiaowuliao': 'Bid material',
'table.purchase.toubiaoshangpin': 'Bid goods', 'table.purchase.toubiaoshangpin': 'Bid goods',
'table.purchase.qingxiangouxuandan': 'Please check the receipt first', 'table.purchase.qingxiangouxuandan': 'Please check the receipt first',
......
import React, { useRef } from 'react'; import React, { useRef, useState, useMemo } from 'react';
import StandardTable from '@/components/StandardTable'; import StandardTable from '@/components/StandardTable';
import { priceFormat } from '@/utils/numberFomat'; import { priceFormat } from '@/utils/numberFomat';
...@@ -26,6 +26,13 @@ const transforType = { ...@@ -26,6 +26,13 @@ const transforType = {
const TableCommonLayout: React.FC<TableCommonLayoutProps> = (props: any) => { const TableCommonLayout: React.FC<TableCommonLayoutProps> = (props: any) => {
const { layoutId, layoutTitle, id, number, fetch } = props; const { layoutId, layoutTitle, id, number, fetch } = props;
const currentRef = useRef({}); const currentRef = useRef({});
const [tableData, setTableData] = useState<any[]>([]);
const _totalPrice = useMemo(() => {
let _val = 0;
tableData?.forEach((item) => { return _val = _val + item.price});
return _val;
}, [tableData])
const columns = [ const columns = [
{ {
...@@ -80,19 +87,25 @@ const TableCommonLayout: React.FC<TableCommonLayoutProps> = (props: any) => { ...@@ -80,19 +87,25 @@ const TableCommonLayout: React.FC<TableCommonLayoutProps> = (props: any) => {
title: intl.formatMessage({ id: 'detail.purchase.taxUnitPrice' }), title: intl.formatMessage({ id: 'detail.purchase.taxUnitPrice' }),
key: 'unitPrice', key: 'unitPrice',
dataIndex: 'unitPrice', dataIndex: 'unitPrice',
render: (text: any, record: any) => <Text type='secondary'>{intl.formatMessage({id: 'common.money'})}{priceFormat(text)}</Text> render: (text: any, record: any) => <Text type='secondary'>{intl.formatMessage({ id: 'common.money' })}{priceFormat(text)}</Text>
}, },
{ {
title: intl.formatMessage({ id: 'detail.purchase.taxPrice' }), title: (
<>
<p>{intl.formatMessage({ id: 'detail.purchase.taxPrice' })}</p>
{_totalPrice && <p>({intl.formatMessage({ id: 'common.money' })}{priceFormat(_totalPrice)})</p>}
</>
),
key: 'price', key: 'price',
dataIndex: 'price', dataIndex: 'price',
render: (text: any, record: any) => <Text type='secondary'>{intl.formatMessage({id: 'common.money'})}{priceFormat(text)}</Text> render: (text: any, record: any) => <Text type='secondary'>{intl.formatMessage({ id: 'common.money' })}{priceFormat(text)}</Text>
}, },
]; ];
const fetchData = (params: any) => { const fetchData = (params: any) => {
return new Promise(resolve => { return new Promise(resolve => {
fetch && fetch({ id, number, ...params }).then((res: any) => { fetch && fetch({ id, number, ...params }).then((res: any) => {
setTableData(res.data.data)
resolve(res.data) resolve(res.data)
}) })
}) })
......
...@@ -33,8 +33,9 @@ const transforType = { ...@@ -33,8 +33,9 @@ const transforType = {
const TABLINK = [ const TABLINK = [
{ id: 'progressLayout', title: intl.formatMessage({ id: 'detail.purchase.progressLayout' }) }, { id: 'progressLayout', title: intl.formatMessage({ id: 'detail.purchase.progressLayout' }) },
{ id: 'winBidMsgLayout', title: intl.formatMessage({ id: 'detail.purchase.bidLayout1' }), except: ['readySignUp', 'readyBid'] },
{ id: 'winBidResultLayout', title: intl.formatMessage({ id: 'detail.purchase.winBidResultLayout' }), except: ['readySignUp', 'readyBid'] }, { id: 'winBidResultLayout', title: intl.formatMessage({ id: 'detail.purchase.winBidResultLayout' }), except: ['readySignUp', 'readyBid'] },
{ id: 'winBidMsgLayout', title: intl.formatMessage({ id: 'detail.purchase.bidLayout1' }), except: ['readySignUp', 'readyBid'] },
{ id: 'winBidDetails', title: intl.formatMessage({ id: 'table.purchase.zhongbiaomingxi' }), except: ['readySignUp', 'readyBid'] },
{ id: 'basicLayout', title: intl.formatMessage({ id: 'detail.purchase.basicLayout' }) }, { id: 'basicLayout', title: intl.formatMessage({ id: 'detail.purchase.basicLayout' }) },
{ id: 'materialLayout', title: intl.formatMessage({ id: 'detail.purchase.materialLayout' }) }, { id: 'materialLayout', title: intl.formatMessage({ id: 'detail.purchase.materialLayout' }) },
{ id: 'bidRulesLayout', title: intl.formatMessage({ id: 'detail.purchase.bidRulesLayout' }) }, { id: 'bidRulesLayout', title: intl.formatMessage({ id: 'detail.purchase.bidRulesLayout' }) },
...@@ -66,6 +67,8 @@ const SearchDetail = () => { ...@@ -66,6 +67,8 @@ const SearchDetail = () => {
const [basicEffect, setBasicEffect] = useState<any>([]); const [basicEffect, setBasicEffect] = useState<any>([]);
// 竞价结果数据 // 竞价结果数据
const [resultEffect, setResultEffect] = useState<any>([]); const [resultEffect, setResultEffect] = useState<any>([]);
// 竞价通知数据
const [msgEffect, setMsgEffect] = useState<any>([]);
// 竞价规则数据 // 竞价规则数据
const [rulesEffect, setRulesEffect] = useState<any>([]); const [rulesEffect, setRulesEffect] = useState<any>([]);
// 报名要求 // 报名要求
...@@ -125,11 +128,20 @@ const SearchDetail = () => { ...@@ -125,11 +128,20 @@ const SearchDetail = () => {
{ {
col: [ col: [
{ label: intl.formatMessage({ id: 'detail.purchase.label' }), extra: data?.sumAwardPrice ? `${intl.formatMessage({ id: 'commodity.products.directChannel.columns.currency' })} ${priceFormat(data?.sumAwardPrice)}` : '-', type: 'text' }, { label: intl.formatMessage({ id: 'detail.purchase.label' }), extra: data?.sumAwardPrice ? `${intl.formatMessage({ id: 'commodity.products.directChannel.columns.currency' })} ${priceFormat(data?.sumAwardPrice)}` : '-', type: 'text' },
{ label: intl.formatMessage({ id: 'detail.purchase.label1' }), extra: data?.signUpIdea, type: 'text' },
] ]
}, },
{ {
col: [ col: [
{ label: intl.formatMessage({ id: 'detail.purchase.label1' }), extra: data?.signUpIdea, type: 'text' },
]
}
])
}
const handleMsgEffect = (data: any) => {
setMsgEffect([
{
col: [
{ label: intl.formatMessage({ id: 'detail.purchase.awardResults' }), extra: data.awardResults, type: 'text' }, { label: intl.formatMessage({ id: 'detail.purchase.awardResults' }), extra: data.awardResults, type: 'text' },
] ]
} }
...@@ -221,6 +233,7 @@ const SearchDetail = () => { ...@@ -221,6 +233,7 @@ const SearchDetail = () => {
handleSignUpEffect(data); handleSignUpEffect(data);
handleConditionEffect(data); handleConditionEffect(data);
handleResultEffect(data); handleResultEffect(data);
handleMsgEffect(data)
if (data.externalState === 99 && data.isPrize != 1 && data.isPrize != undefined && data.isPrize != null) { if (data.externalState === 99 && data.isPrize != 1 && data.isPrize != undefined && data.isPrize != null) {
seTthankVisAble(true) seTthankVisAble(true)
} }
...@@ -238,19 +251,31 @@ const SearchDetail = () => { ...@@ -238,19 +251,31 @@ const SearchDetail = () => {
fetchDataSource(); fetchDataSource();
}, []) }, [])
const _returnWinBidMsgLayout = useMemo(() => { const _returnWinBidResultLayout = useMemo(() => {
switch (pathPci) { switch (pathPci) {
case 'readySignUp': case 'readySignUp':
case 'readyBid': case 'readyBid':
return null; return null;
default: default:
return ( return (
<BidCommonLayout layoutId="winBidMsgLayout" title={intl.formatMessage({ id: 'detail.purchase.bidLayout1' })} effect={resultEffect} /> <BidCommonLayout layoutId="winBidResultLayout" title={intl.formatMessage({ id: 'detail.purchase.winBidResultLayout' })} effect={resultEffect} />
) )
} }
}, [pathPci, resultEffect]) }, [pathPci, resultEffect])
const _returnWinBidResultLayout = useMemo(() => { const _returnWinBidMsgLayout = useMemo(() => {
switch (pathPci) {
case 'readySignUp':
case 'readyBid':
return null;
default:
return (
<BidCommonLayout layoutId="winBidMsgLayout" title={intl.formatMessage({ id: 'detail.purchase.bidLayout1' })} effect={msgEffect} />
)
}
}, [pathPci, msgEffect])
const _returnWinBidDetails = useMemo(() => {
switch (pathPci) { switch (pathPci) {
case 'readySignUp': case 'readySignUp':
case 'readyBid': case 'readyBid':
...@@ -258,8 +283,8 @@ const SearchDetail = () => { ...@@ -258,8 +283,8 @@ const SearchDetail = () => {
default: default:
return ( return (
<TableCommonLayout <TableCommonLayout
layoutId='winBidResultLayout' layoutId='winBidDetails'
layoutTitle={intl.formatMessage({ id: 'detail.purchase.winBidResultLayout' })} layoutTitle={intl.formatMessage({ id: 'table.purchase.zhongbiaomingxi' })}
id={id} id={id}
number={number} number={number}
fetch={getPurchaseOnlineBiddingAwardResultsBidding} fetch={getPurchaseOnlineBiddingAwardResultsBidding}
...@@ -328,8 +353,9 @@ const SearchDetail = () => { ...@@ -328,8 +353,9 @@ const SearchDetail = () => {
components={ components={
<Fragment> <Fragment>
<ProgressLayout effect={progressEffect} /> <ProgressLayout effect={progressEffect} />
{_returnWinBidMsgLayout}
{_returnWinBidResultLayout} {_returnWinBidResultLayout}
{_returnWinBidMsgLayout}
{_returnWinBidDetails}
<BidCommonLayout layoutId="basicLayout" title={intl.formatMessage({ id: 'detail.purchase.basicLayout' })} effect={basicEffect} /> <BidCommonLayout layoutId="basicLayout" title={intl.formatMessage({ id: 'detail.purchase.basicLayout' })} effect={basicEffect} />
{_returnMaterialLayout} {_returnMaterialLayout}
{_returnBidRulesLayout} {_returnBidRulesLayout}
......
import React, { useState, useEffect, useMemo } from 'react'; import React, { useState, useEffect, useMemo } from 'react';
import { Row, Col, Input, Drawer, Table, Space, Typography, message, Form } from 'antd'; import { Row, Col, Input, Drawer, Table, Space, Typography, message, Form,Button } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { priceFormat } from '@/utils/numberFomat'; import { priceFormat } from '@/utils/numberFomat';
...@@ -187,13 +187,13 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => { ...@@ -187,13 +187,13 @@ const DetailBottomDrawer: React.FC<DetailBottomDrawerProps> = (props: any) => {
<Drawer <Drawer
title={intl.formatMessage({ id: 'detail.purchase.modalTitle14' })} title={intl.formatMessage({ id: 'detail.purchase.modalTitle14' })}
placement={'bottom'} placement={'bottom'}
closable={true} closable={false}
onClose={onClose} onClose={onClose}
visible={visible} visible={visible}
key={'bottom'} key={'bottom'}
height={450} height={450}
className={styles.drawer} className={styles.drawer}
closeIcon={<div>{intl.formatMessage({ id: 'detail.purchase.cancelOffer' })}</div>} extra={<Button onClick={onClose}>{intl.formatMessage({ id: 'detail.purchase.cancelOffer' })}</Button>}
> >
<div style={{ width: '100%', overflowX: 'auto' }}> <div style={{ width: '100%', overflowX: 'auto' }}>
<Row gutter={[8, 8]} style={{ marginBottom: '10px' }} wrap={false}> <Row gutter={[8, 8]} style={{ marginBottom: '10px' }} wrap={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