Files
fe_service_ebtp_frontend/src/pages/BidEvaluation/supplier.js

118 lines
3.4 KiB
JavaScript
Raw Normal View History

2020-12-23 11:14:35 +08:00
import React, {PureComponent} from 'react';
import {Divider,Button,Form,Card,Tabs,Table,Tooltip,Input,Select,Row,Col,message} from 'antd';
import './index.less';
import { connect } from "dva";
2021-01-16 11:29:42 +08:00
import { getProId } from '@/utils/session';
2020-12-23 11:14:35 +08:00
@connect(({ bidev,loading }) => ({
...bidev,
supplierlistLoading:loading.effects['bidev/fetchSupplierList'],
}))
class supplier extends PureComponent {
state={
pageNo:1,
pageSize:10,
2021-01-16 11:29:42 +08:00
tpId: getProId() 
2020-12-23 11:14:35 +08:00
}
componentDidMount(){
this.setState({
2021-01-16 11:29:42 +08:00
tpId: getProId()
2020-12-23 11:14:35 +08:00
})
const { dispatch }=this.props;
// const {pageNo,pageSize}=this.state;
const params={
pageNo:1,
pageSize:10,
2021-01-16 11:29:42 +08:00
roomType:this.props.match.params.roomType,
tpId:getProId()//项目id
2020-12-23 11:14:35 +08:00
}
dispatch({
type:"bidev/fetchSupplierList",
payload:{...params}
})
}
columns=[
{ title: '序号', dataIndex: 'id', width: '10%',
render:(text, record, index)=>{
return (index+1)
}},
{ title: '标段名称', dataIndex: 'sectionName', width: '10%'},
{ title: '标段编号', dataIndex: 'sectionNum', width: '10%'},
{ title: '评标次数', dataIndex: 'roomSort', width: '10%',
render:(text, record, index)=>{
return <>{text}次评标</>
}},
{ title: '评标开始时间', dataIndex: 'openTime', width: '10%'},
{ title: '状态', dataIndex: 'status', width: '10%',
render:(text, record, index)=>{
let txt="准备评标"
switch(text){
case '2': txt="正在评标"
case '3': txt="评标结束"
}
return txt
}},
{ title: '操作', dataIndex: 'operation', width: '10%',
render:(text, record, index)=>{
return <><a className="buttont" onClick={()=>{this.handleRedirect()}}>进入评审室</a></>
}}
]
handleRedirect=()=>{
2021-01-16 11:29:42 +08:00
sessionStorage.setItem("roomId",record.id)
this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom'))
2020-12-23 11:14:35 +08:00
}
render(){
const { supplierList,supplierlistLoading}=this.props;
const { pageNo,pageSize,tpId }=this.state;
const pagination = {
current: pageNo,
total: supplierList && supplierList.total ,
// showSizeChanger: true,
showQuickJumper:true,
showTotal: (total,range) => `${total} 条记录,第${range.slice(',')[0]}-${range.slice(',')[1]}`,
onChange:(page, pageSize)=>{
this.setState({
pageNo:page,
pageSize:pageSize,
});
const params={
pageNo:page,
pageSize:pageSize,
2021-01-16 11:29:42 +08:00
roomType:this.props.match.params.roomType,
2020-12-23 11:14:35 +08:00
tpId:tpId//项目id
}
this.props.dispatch({
type:"bidev/fetchSupplierList",
payload:{...params}
})
},
onShowSizeChange: (current, pageSize) => {
this.setState({
pageNo:1,
pageSize:pageSize,
});
const params={
pageNo:1,
pageSize:pageSize,
2021-01-16 11:29:42 +08:00
roomType:this.props.match.params.roomType,
2020-12-23 11:14:35 +08:00
tpId:tpId//项目id
}
this.props.dispatch({
type:"bidev/fetchSupplierList",
payload:{...params}
})
}
}
return <>
<Card title="评审室">
<Table
loading={supplierlistLoading}
columns={this.columns}
dataSource={supplierList!="" && supplierList.records}
pagination={pagination}
bordered
/>
</Card>
</>
}
}
export default supplier;