Commit aa18fd06 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

🐞 fix(需求报价管理): 修改报价详情展示

parent 27bd58d7
......@@ -41,7 +41,7 @@ export interface ShopInfo {
describe: string;
state: number;
url: string;
isDefault: number;
isDefault?: any;
}
export interface OrderMode {
......@@ -60,7 +60,7 @@ export interface SiteInfo {
name: string;
logo: string;
siteUrl: string;
symbol: string;
symbol?: any;
}
export interface Site {
......
......@@ -9,6 +9,8 @@ import { CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons';
export interface BidInfoProps {
fetch?: () => Promise<unknown>,
effect?: any,
/** 获取报价轮次 */
getKey?: (e) => void,
}
const chNum: { [key: number]: string } = {
......@@ -24,7 +26,7 @@ const chNum: { [key: number]: string } = {
}
const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
const { effect, fetch } = props
const { effect, fetch, getKey } = props
const context = useContext(Context);
const [dataSource, setDataSource] = useState<any>([]);
const [turn, setTurn] = useState<Array<number>>([]);
......@@ -110,6 +112,18 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
})
}
const handleOnChange = async (key: any) => {
fetchDataSource({
id: effect.id,
turn: key,
current: '1',
pageSize: '10',
})
/** 返回给兄弟 */
getKey(key)
}
/** 物料信息 */
useEffect(() => {
if (effect.turn) {
......@@ -128,9 +142,9 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
id='bidInfoLayout'
title='报价信息'
>
<Tabs defaultActiveKey="1">
<Tabs defaultActiveKey="1" onChange={handleOnChange}>
{turn.map((item) => (
<Tabs.TabPane key={`trun${item}`} tab={`第${chNum[item]}轮`}>
<Tabs.TabPane key={item} tab={`第${chNum[item]}轮`}>
<Table
className={style.tableStyle}
columns={columns}
......@@ -172,6 +186,7 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
</Row>
</div>
),
rowExpandable: record => !!record.productId,
expandIcon: ({ expanded, onExpand, record }) =>
expanded ? (
<CaretDownOutlined onClick={e => onExpand(record, e)} />
......
......@@ -78,7 +78,7 @@ const RowLayout: React.FC<IProps> = (props: any) => {
<div className={style['card-badge']}>
{item.isDecrypt === PRICECONTRAST_TYPE.UNENCRYPTED ? (priceContrast === 1 ? '已解密' : '未加密') : '未解密'}
</div>
{item.isDecrypt === PRICECONTRAST_TYPE.UNENCRYPTED && <Typography.Link href={`/memberCenter/procurementAbility/confirmOffer/quote/detail?id=${item.id}&number=${item.quotedPriceNo}&turn=${item.turn}`} className={style['card-link']}>查看报价详情</Typography.Link>}
{item.isDecrypt === PRICECONTRAST_TYPE.UNENCRYPTED && <Typography.Link href={`/purchase/demandBidMgt/offer/quote/detail?id=${item.id}&number=${item.quotedPriceNo}&turn=${item.turn}`} className={style['card-link']}>查看报价详情</Typography.Link>}
{item.isDecrypt === PRICECONTRAST_TYPE.UNDECRYPTED && <Tooltip placement="topLeft" title='当前报价为密封报价,请先解密报价单'><Typography.Text className={style['card-link']} type='success'>查看报价详情</Typography.Text></Tooltip>}
</div>
</Col>
......
......@@ -2,7 +2,7 @@ import React, { useState, useEffect, Fragment, useCallback } from 'react';
import { PublicApi } from '@/services/api';
import { history } from 'umi';
import moment from 'moment';
import { Tag } from 'antd';
import { Tag, Typography } from 'antd';
import { Context } from '../../components/detail/components/context';
import PeripheralLayout from '../../components/detail';
import BasicLayout from '../../components/detail/components/basicLayout';
......@@ -13,6 +13,7 @@ import {
OFFTER_EXTERNALSTATE,
OFFTER_EXTERNALSTATE_COLOR,
} from '../../constants';
import { LinkOutlined } from '@ant-design/icons';
const TABLINK = [
......@@ -25,11 +26,21 @@ const QuoteDetails = () => {
const format = (text) => {
return <>{moment(text).format("YYYY-MM-DD HH:mm:ss")}</>
}
const { query: { id, number }, pathname }: any = history.location;
const { query: { id, number, turn }, pathname }: any = history.location;
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const [otherEffect, setOtherEffect] = useState<any>([]);
const forEachQuotedPriceTurnList = (data: any, key: number) => {
let params: any = {}
data.forEach(item => {
if (Number(item.turn) === Number(key)) {
params = { ...item }
}
})
return params
}
const handleBasicEffect = (data: any) => {
setBasicEffect([
{
......@@ -60,7 +71,7 @@ const QuoteDetails = () => {
setOtherEffect([
{
col: [
{ label: '交付说明', extra: '缺少字段' },
{ label: '交付说明', extra: data.deliveryDetails },
{ label: '付款说明', extra: data.payDetails },
{ label: '税费说明', extra: data.taxes },
]
......@@ -74,21 +85,40 @@ const QuoteDetails = () => {
},
{
col: [
{ label: '附件', extra: '缺少字段' },
{
label: '附件',
extra: <>
{data.enclosureUrls && data.enclosureUrls.map((item: any, index: number) => (
<Typography.Link
style={{ display: 'block', paddingBottom: '8px' }}
key={`link_${index + 1}`}
href={`/api/contract/contractTemplate/downloadContract?contractName=${item.name}&contractUrl=${item.url}`}
target="_blank"
>
<LinkOutlined style={{ marginRight: '5px' }} />
{item.name}
</Typography.Link>
))}
</>
},
]
},
])
}
const fetchDataSource = useCallback(async() => {
await PublicApi.getPurchaseQuotedPricePlatformDetails({id, number, current: '1', pageSize: '1' }).then(res => {
const handleOtherCallBack = useCallback((data: any, key: number) => {
handleOtherEffect(forEachQuotedPriceTurnList(data, key))
}, [])
const fetchDataSource = useCallback(async () => {
await PublicApi.getPurchaseQuotedPricePlatformDetails({ id, number, current: '1', pageSize: '1' }).then((res: any) => {
if (res.code !== 1000) {
return;
}
const { data } = res;
setDataSource(data);
handleBasicEffect(data);
handleOtherEffect(data)
handleOtherCallBack(data.quotedPriceTurnList || [], turn)
})
}, [])
......@@ -96,22 +126,28 @@ const QuoteDetails = () => {
fetchDataSource()
}, [])
/** 获取报价信息当前点击的轮次 */
const handleGetKey = (count: number) => {
handleOtherCallBack(dataSource.quotedPriceTurnList || [], count)
}
return (
<Context.Provider value={dataSource}>
<PeripheralLayout
no={dataSource.quotedPriceNo}
detail={dataSource.quotedDetails}
tabLink={TABLINK}
components={
<Fragment>
<BasicLayout effect={basicEffect} />
<BidInfoLayout
no={dataSource.quotedPriceNo}
detail={dataSource.quotedDetails}
tabLink={TABLINK}
components={
<Fragment>
<BasicLayout effect={basicEffect} />
<BidInfoLayout
getKey={handleGetKey}
fetch={PublicApi.getPurchaseConfirmQuotedPriceMaterielDetailed}
effect={{turn: dataSource.count, id }}
effect={{ turn, id }}
/>
<OtherLayout effect={otherEffect} />
</Fragment>
}
<OtherLayout effect={otherEffect} />
</Fragment>
}
/>
</Context.Provider>
)
......
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