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

feat: 采购竞价 报价报名排名tab更新

parent 7c7914e1
......@@ -14,11 +14,12 @@ import styles from './index.less';
const { TabPane } = Tabs;
interface RankItemProps {
onTabChange: Function,
detail?: any
}
const RankItem: React.FC<RankItemProps> = (props: any) => {
const { detail } = props;
const { onTabChange, detail } = props;
const { queryPriceDynamics = [], signupMembers = [], dynamic = {} } = detail;
const [showMoreQuery, setShowMoreQuery] = useState<boolean>(false);
const [showMoreSign, setShowMoreSign] = useState<boolean>(false);
......@@ -44,7 +45,7 @@ const RankItem: React.FC<RankItemProps> = (props: any) => {
</div>
</div>
</div>
<Tabs defaultActiveKey="1">
<Tabs defaultActiveKey="1" onChange={onTabChange}>
<TabPane tab="报价排名" key="1">
{queryPriceDynamicsData?.map((item) => <RankRow detail={item} key={`queryPriceDynamicsData_${item.id}`} />)}
{queryPriceDynamics.length > 10 && !showMoreQuery && <Button type="link" block onClick={() => { setShowMoreQuery(true) }}>显示更多</Button>}
......
......@@ -120,6 +120,34 @@ const Management = () => {
})
}
const rankItemOnChange = (key: string) => {
const _params = {
id,
number,
current: '1',
pageSize: '1'
}
if (key === '1') {
PublicApi.getPurchaseBiddingRankingBidding({ ..._params }).then(res => {
if (res.code !== 1000) {
history.goBack();
return;
}
const { data } = res;
setQueryPriceDynamics(data);
})
} else {
PublicApi.getPurchaseBiddingSignupMember({ ..._params }).then(res => {
if (res.code !== 1000) {
history.goBack();
return;
}
const { data } = res;
setSignupMembers(data);
})
}
}
useEffect(() => {
fetchDataSource();
}, [])
......@@ -133,7 +161,7 @@ const Management = () => {
<div className={styles.layout}>
<Row gutter={[8, 8]}>
<Col span={6}>
<RankItem detail={{ dynamic, queryPriceDynamics, signupMembers }} />
<RankItem onTabChange={rankItemOnChange} detail={{ dynamic, queryPriceDynamics, signupMembers }} />
</Col>
<Col span={18}>
<Row gutter={[8, 8]} style={{ marginBottom: '8px' }}>
......
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