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

266 lines
7.8 KiB
JavaScript
Raw Normal View History

2020-12-23 11:14:35 +08:00
import React, {PureComponent} from 'react';
2021-01-16 11:29:42 +08:00
import {Divider,Button,Form,Card,Tabs,Table,Tooltip,Input,Select,Row,Col,message,Modal,Popconfirm} from 'antd';
import { getRoomId} from '@/utils/session';
import { saveLeaderId,getJuryData } from './components/service';
2020-12-23 11:14:35 +08:00
import './index.less';
import { connect } from "dva";
import { routerRedux } from 'dva/router';
2021-01-16 11:29:42 +08:00
import { getProId } from '@/utils/session';
import ReviewDevided from '@/pages/BidEvaluation/components/ReviewDevided';
//import SetLeader from '@/pages/BidEvaluation/components/SetLeader';
2020-12-23 11:14:35 +08:00
// @Form.create()
2021-01-16 11:29:42 +08:00
const InfId = getRoomId();
2020-12-23 11:14:35 +08:00
@connect(({ bidev,loading }) => ({
...bidev,
managerlistLoading:loading.effects['bidev/fetchManagerList'],
}))
class manager extends PureComponent {
state={
pageNo:1,
pageSize:10,
2021-01-16 11:29:42 +08:00
tpId: getProId(),
ratevisible:false,
record:undefined,
visible: false,
data: '',
roomStatus: 1,
2020-12-23 11:14:35 +08:00
}
2021-01-16 11:29:42 +08:00
showModal = (record) => {
getJuryData( record.id ).then(res=>{
if(res.code == 200) {
if(res.data == undefined) {} else {
this.setState({
visible: true,
data:res.data
});
}
}
})
};
hideModal = () => {
this.setState({
visible: false
})
};
handleOk = e => {
console.log(e);
this.setState({
visible: false,
});
};
handleCancel = e => {
console.log(e);
this.setState({
visible: false,
});
};
2020-12-23 11:14:35 +08:00
componentDidMount(){
2021-01-16 11:29:42 +08:00
console.log(this.props.match.params.roomType)
2020-12-23 11:14:35 +08:00
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/fetchManagerList",
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: 'juryMember', width: '10%'},
{ title: '评标开始时间', dataIndex: 'openTime', width: '10%'},
{ title: '校验码', dataIndex: 'verificationCode', width: '10%'
// render:(text, record, index)=>{
// let t="verificationCode"+record.id;
// this.props.dispatch({
// type:"bidev/save",
// payload:{[t]:text}
// })
// if(this.props[t]){
// return this.props[t]
// }else{
// return text
// }
// }
},
{ title: '状态', dataIndex: 'status', width: '10%',
render:(text, record, index)=>{
2021-01-16 11:29:42 +08:00
let txt = record.status
return txt == 0 || txt == 1 ? '准备评标' : (txt == 2 ? '正在评标' : (txt == 3 ? '评标结束': null))
2020-12-23 11:14:35 +08:00
}},
{ title: '操作', dataIndex: 'operation', width: '10%',
render:(text, record, index)=>{
let status=record.status;
return <>
2021-01-16 11:29:42 +08:00
{status==0 || status==1 ?<Button type="link" block><a className="buttont" onClick={()=>{this.onOpenBizassessroom(record)}}>开启评标</a></Button>:<Button type="link" block><a className="buttont" onClick={()=>{this.handleRedirect(record)}}></a></Button>}
{record.reviewMark == 0 ? null : (<a style={{textAlign: 'center',width: '100%'}} className="buttont" onClick={()=>{this.onRedirectRate()}}>组建评委会</a>)}
<Button type="link" block><a style={{textAlign: 'center',width: '100%'}} className="buttont" onClick={()=>{this.onRateShow(record)}}>评审分工</a></Button>
<Button type="link" block><a style={{textAlign: 'center',width: '100%'}} className="buttont" onClick={()=>{this.onResetVerificationCode(record)}}>重置校验码</a></Button>
{status==0 || status==1 ? <Button type="link" block onClick={() => this.showModal(record)}><a style={{textAlign: 'center',width: '100%'}} className="buttont" >设置组长</a></Button>: null}
</>
2020-12-23 11:14:35 +08:00
}}
]
2021-01-16 11:29:42 +08:00
handleRedirect=(record)=>{
sessionStorage.setItem("roomId",record.id)
this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom'))
2020-12-23 11:14:35 +08:00
}
onOpenBizassessroom=(record)=>{
const params={
id:record.id
}
this.props.dispatch({
type:"bidev/openBizassessroom",
payload:{...params}
})
}
onResetVerificationCode=(record)=>{
const { pageNo,pageSize,tpId }=this.state;
const params={
id:record.id,
pageNo:pageNo,
pageSize:pageSize,
tpId:tpId
}
this.props.dispatch({
type:"bidev/resetVerificationCode",
payload:{...params}
})
}
// 跳转组建评委会
onRedirectRate=()=>{
this.props.dispatch(routerRedux.push('/JudgingPanel/list'))
}
// 弹出评审分工页面
2021-01-16 11:29:42 +08:00
onRateShow=(record)=>{
2020-12-23 11:14:35 +08:00
this.setState({
2021-01-16 11:29:42 +08:00
record: {...record},
2020-12-23 11:14:35 +08:00
ratevisible:true
})
// this.props.dispatch(routerRedux.push('/JudgingPanel/list'))
}
onRateOut(){
this.setState({
2021-01-16 11:29:42 +08:00
ratevisible:false,
record:undefined
2020-12-23 11:14:35 +08:00
})
}
render(){
const { managerList,managerlistLoading}=this.props;
2021-01-16 11:29:42 +08:00
const { pageNo,pageSize,tpId,ratevisible, data }=this.state;
2020-12-23 11:14:35 +08:00
const pagination = {
current: pageNo,
total: managerList && managerList.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:2,
tpId:tpId//项目id
}
this.props.dispatch({
type:"bidev/fetchManagerList",
payload:{...params}
})
},
onShowSizeChange: (current, pageSize) => {
this.setState({
pageNo:1,
pageSize:pageSize,
});
const params={
pageNo:1,
pageSize:pageSize,
roomType:2,
tpId:tpId//项目id
}
this.props.dispatch({
type:"bidev/fetchManagerList",
payload:{...params}
})
}
}
2021-01-16 11:29:42 +08:00
const confirm =(values)=> {
this.setState({
visible: false
})
saveLeaderId(values.id).then(res=>{
})
}
const columns = [
{
title: '评委会成员',
dataIndex: 'name',
},
{
title: '状态',
dataIndex: 'status',
},
{
title: '身份',
dataIndex: 'duty',
},
{
title: '操作',
render: (record, index) => {
return record.duty == 1?(
<Popconfirm title="确认设为组长?" okText="是" cancelText="否" onConfirm={()=>confirm(record)}>
<Button type="link">设为组长</Button>
</Popconfirm>
):null
}
}
]
const renderSetLeader = ()=>{
return <Table pagination={false} columns={columns} dataSource={data}/>
}
2020-12-23 11:14:35 +08:00
return <>
<Card title="评审室">
<Table
loading={managerlistLoading}
columns={this.columns}
dataSource={managerList!="" && managerList.records}
pagination={pagination}
bordered
/>
</Card>
2021-01-16 11:29:42 +08:00
<ReviewDevided title="评审分工" modalVisible={ratevisible} onCancel={() => {this.onRateOut()}} values={this.state.record}/>
<Modal
title="设置组长"
visible= {this.state.visible}
footer= {null}
onCancel={this.handleCancel}
width={600}
>
{renderSetLeader()}
</Modal>
2020-12-23 11:14:35 +08:00
</>
}
}
export default manager;