Files
fe_service_ebtp_frontend/src/pages/MainPage/ProjectManager/Jury.js
2023-01-31 15:22:52 +08:00

197 lines
11 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { PureComponent } from 'react';
import { Row, Col, Tooltip, Card, List, DatePicker, Button, Statistic, Modal } from 'antd';
import { history } from 'umi';
import { connect } from 'dva';
import './index.less';
import talkPng from '@/images/talk/talk.png';
import { routerRedux } from 'dva/router';
import { RightOutlined } from '@ant-design/icons';
import moment from 'moment';
import { jurySaveInfo, getRA } from '@/utils/session';
import NoticeDetail from '@/pages/notice/noticeList/components/NoticeDetail'
import ExpertEnter from '@/pages/BidEvaluation/components/ExpertEnter';
import { isInsertIdOrPhoto } from './service';
@connect(({ dashboard, loading }) => ({
...dashboard,
downlistLoading: loading.effects['dashboard/fetchDowntlist'],
projectlistLoading: loading.effects['dashboard/fetchprojectRecords'],
}))
class Jury extends PureComponent {
state = {
datevalue: moment(moment().format('YYYYMM'), 'YYYY-MM'),
datestring: moment().format('YYYYMM'),
detailId: '1', // 公告id
noticeDetail: false, // 公告弹窗
recordData: '', // 进入评审室弹窗数据
enterVisible: false, // 进入评审室弹窗
}
componentDidMount() {
this.props.dispatch({
type: "dashboard/fetchJuryUpList",
payload: { selectDate: moment().format('YYYYMM') }
})
this.props.dispatch({
type: "dashboard/fetchJuryDownlist",
payload: { pageNo: 1, pageSize: 4 }
})
this.props.dispatch({
type: "dashboard/fetchtlist",
payload: { limit: 7 }
})
// NTKF_PARAM = {
// siteid: "bl_1000",                    //企业ID,为固定值
// settingid: "bl_1000_1492484340268",           //接待组ID为固定值必填
// uid: getSessionUserData()?.userId,
// uname: getSessionUserData()?.deptName + "-" + getSessionUserData()?.fullName,            //用户名未登录可以为空但是不能给nulluname赋予的值显示到小能客户端
// isvip: "0",                              //是否为vip用户0代表非会员1代表会员取值显示到小能客户端
// userlevel: "1",                       //网站自定义会员级别1-N可根据选择判断取值显示到小能客户端
// erpparam: "abc"                          //erpparam为erp功能的扩展字段可选购买erp功能后用于erp功能集成
// }
// this.isIdOrPhoto();
}
onChange = (date, dateString) => {
this.setState({
datevalue: moment(dateString, 'YYYY-MM'),
datestring: dateString.split('-').join('')
})
}
onSearch = () => {
const { datestring } = this.state;
this.props.dispatch({
type: "dashboard/save",
payload: { staloading: true }
})
this.props.dispatch({
type: "dashboard/fetchJuryUpList",
payload: { selectDate: datestring }
})
}
lookInfo = (id) => { // 公告查看
this.setState({
detailId: id,
noticeDetail: true
})
}
noticeModel = () => { // 公告关闭消息弹窗
this.setState({
noticeDetail: false
})
}
onRateShow = async (record) => { // 进入评审室
await jurySaveInfo(record)
this.setState({
recordData: record,
enterVisible: true
})
};
onRefresh = () => { //刷新
this.props.dispatch({
type: "dashboard/fetchJuryDownlist",
payload: { pageNo: 1, pageSize: 4 }
})
}
enterModel = () => { // 公告关闭消息弹窗
this.setState({
enterVisible: false
})
}
//判断是否有身份证号或照片
isIdOrPhoto = () => {
const { warning } = Modal;
isInsertIdOrPhoto().then(res => {
if (res?.code == 200) {
if (!res?.data) {
warning({
title: '提示',
content: `您尚未维护身份证号与照片信息,请前往【我的工作台】->【专家个人信息管理】补充信息`,
centered: true,
});
}
}
})
}
render() {
const { datevalue, detailId, noticeDetail, recordData, enterVisible, } = this.state;
const { Juryuplist, Jurydownlist, staloading, tlist } = this.props;
return (
<>
{/* <a className={isFlash && !isModalVisible ? "talk text-effect":"talk"} onClick={() => this.initChatUI()}>咨询服务︵<span>8:30</span><span>|</span><span>12:30</span><span>13:00</span><span>|</span><span>17:00</span>︶<img src={talkPng} /></a> */}
<div className="dashboard" style={{ height: innerHeight - 70, overflow: "hidden" }}>
<Row className="topt">
<Col span={12}><Card title="我参与的项目数量统计" bordered={false} className="cardtreJury" style={{ marginRight: "10px" }} loading={staloading} extra={<div style={{ marginTop: "-14px" }}><DatePicker showNow={false} picker="month" style={{ marginRight: "10px" }} value={datevalue} onChange={this.onChange} allowClear={false} /><Button type="primary" onClick={() => { this.onSearch() }}>确定</Button></div>}>
{Juryuplist != "" && Juryuplist.map((item) => {
let routerPath = ''
// if (item.key == '公开招标') {
// routerPath = '/ExpertReview/Review?proTypeCode=procurement_mode_1,procurement_mode_2'
// } else if (item.key == '公开比选') {
// routerPath = '/ExpertReview/Review?proTypeCode=procurement_mode_3'
// } else if (item.key == '谈判') {
// routerPath = '/ExpertReview/Review?proTypeCode=procurement_mode_5,procurement_mode_6'
// } else if (item.key == '招募') {
// routerPath = '/ExpertReview/Review?proTypeCode=procurement_mode_4'
// } else if (item.key == '询价') {
// routerPath = '/ExpertReview/Review?proTypeCode=procurement_mode_7'
// }
if (item.key == '公开招标') {
routerPath = '/ExpertReview/Bid'
} else if (item.key == '公开比选') {
routerPath = '/ExpertReview/Comparison'
} else if (item.key == '谈判') {
routerPath = '/ExpertReview/Negotiation'
} else if (item.key == '招募') {
routerPath = '/ExpertReview/Recruit'
} else if (item.key == '询价') {
routerPath = '/ExpertReview/Inquiry'
}
return (
<div className="boxrezt" key={item.id} style={{ height: "130px", width: "27%" }}>
<div className="boxtitle" title={item.key}>
{item.key}
<div className="yue"></div></div>
<div className="boxcount" onClick={() => history.push(routerPath)}><Statistic value={item.value} /></div>
<div className="boxdescription" title={item.description}>{item.description}</div>
</div>
)
})
}</Card></Col>
<Col span={12}><Card title="系统公告" bordered={false} className="cardtreJury" extra={<div className="moret" onClick={() => history.push('/notice/noticeList')}>更多<RightOutlined /></div>}>
{tlist != [] && tlist.map((item, index) => {
return (
<div className="messagetre" onClick={() => { this.lookInfo(item.id) }} key={item.id}>
<div className="round">{index + 1}</div>
<div className="txt" title={item.noticeTitle}>{item.noticeTitle}</div>
<div className="time">{item.updateDate}</div>
</div>
)
})}</Card></Col>
</Row>
<Row className="downt">
<Col span={24}>
<Card title="正在评审的项目" className="cardtre">
<List
size="large"
bordered={false}
dataSource={Jurydownlist}
renderItem={item => <List.Item key={item.id} style={{ height: "25%" }}>
<div style={{ width: "40%" }}><div className="downround"></div><div className="downtitle" title={item.projectName} style={{ width: "80%" }}>{item.projectName}
<div className="downtime">标段名称:{item.sectionName}</div></div></div>
<div style={{ width: "20%" }}>项目负责人{item.appManagerName}</div>
<div style={{ width: "20%" }}>开始评审时间{item.openTime}</div>
<div style={{ width: "20%" }}>
<Button onClick={() => { this.onRateShow(item) }} style={{ float: "right" }} type="primary">进入评审室</Button>
</div>
</List.Item>}
/>
</Card>
</Col></Row>
</div>
{noticeDetail && <NoticeDetail detailId={detailId} onCancel={() => { this.noticeModel() }} modalVisible={noticeDetail} />}
{recordData == '' ? null :
<ExpertEnter modalVisible={enterVisible} onCancel={() => { this.enterModel() }} onRefresh={() => { this.onRefresh() }} recordData={recordData} />}
</>
)
}
}
export default Jury;