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";
import { getProId } from '@/utils/session';
@connect(({ bidev,loading }) => ({
...bidev,
supplierlistLoading:loading.effects['bidev/fetchSupplierList'],
}))
class supplier extends PureComponent {
state={
pageNo:1,
pageSize:10,
tpId: getProId()
}
componentDidMount(){
this.setState({
tpId: getProId()
})
const { dispatch }=this.props;
// const {pageNo,pageSize}=this.state;
const params={
pageNo:1,
pageSize:10,
roomType:this.props.match.params.roomType,
tpId:getProId()//项目id
}
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 <>{this.handleRedirect()}}>进入评审室>
}}
]
handleRedirect=()=>{
sessionStorage.setItem("roomId",record.id)
this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom'))
}
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,
roomType:this.props.match.params.roomType,
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,
roomType:this.props.match.params.roomType,
tpId:tpId//项目id
}
this.props.dispatch({
type:"bidev/fetchSupplierList",
payload:{...params}
})
}
}
return <>
>
}
}
export default supplier;