451 lines
16 KiB
JavaScript
451 lines
16 KiB
JavaScript
import { Divider, Button, Form, Card, Tabs, Table, Tooltip, Input, Select, Row, Col, message, Modal, Avatar, Tag, } from 'antd';
|
||
import { Link, history } from 'umi';
|
||
import './index.less';
|
||
import styles from './index.less';
|
||
import { connect } from "dva";
|
||
import { routerRedux } from 'dva/router';
|
||
import React, { useState, useEffect, useReducer } from 'react';
|
||
import { getSessionUserData, getRoomId, getRoomStatus, getProMethod, getSessionRoleData, getIPassDecode, getDefId, getProId, getOfflineStatusById } from '@/utils/session';
|
||
import { getURLInformation } from '@/utils/CommonUtils';
|
||
import { getLeader, isShowResult, isShowCount, getErrorStatus, getRiskStatus, isShowRiskModal, saveConfirm, isLeaderConfirm } from './service';
|
||
import logo from '@/images/opening/logo.svg'
|
||
import InstantMessage from './components/InstantMessage'
|
||
import { DownOutlined, UserOutlined, UserSwitchOutlined, CarryOutOutlined, HomeOutlined } from '@ant-design/icons';
|
||
import moment from 'moment'
|
||
import {
|
||
CheckCircleOutlined,
|
||
ExclamationCircleOutlined
|
||
} from '@ant-design/icons';
|
||
import { getRoomDataById } from '@/services/common';
|
||
import RiskModal from '../RiskModal';
|
||
|
||
const BiddingRoom = (props) => {
|
||
//获取采购方式
|
||
const MethodDict = getProMethod();
|
||
//获取业务id
|
||
const defId = getDefId();
|
||
//获取项目id
|
||
const tpId = getProId();
|
||
//获取角色
|
||
const role = getSessionRoleData().roleCode;
|
||
//是否使用ipass解密
|
||
const IPassDecode = getIPassDecode();
|
||
//获取用户数据
|
||
let data = getSessionUserData();
|
||
//获取比选一阶段二次项目,自定义流程,当前供应商
|
||
const isBxOneSecondCustom = sessionStorage.getItem("isBxOneSecondCustom");
|
||
//评审方式:状态:0-默认,1-已确认配置分工及组长
|
||
const roomJuryConfigStatus = sessionStorage.getItem("roomJuryConfigStatus");
|
||
//评审方式:0-线上、1-线下
|
||
const roomReviewMethod = sessionStorage.getItem("roomReviewMethod");
|
||
//获取评审室id
|
||
const roomId = getRoomId();
|
||
const roomStatus = getRoomStatus();
|
||
const [list, setList] = useState();
|
||
//风险提示文字弹窗控制
|
||
const [riskVisible, setRiskVisible] = useState(false);
|
||
//评审结果提示文字还是进入评审室提示文字
|
||
const [isResult, setIsResult] = useState(false);
|
||
const [selectedPath, setSelectedPath] = useState(window.location.pathname.replace('ReviewResults/Jury', 'ReviewResults').replace('ReviewResults/GroupLeader', 'ReviewResults'));
|
||
// const [risky, riskySet] = useState();
|
||
//字段类型(两种) 评标,评审
|
||
let sectionTypeTwo = MethodDict == "procurement_mode_1" || MethodDict == "procurement_mode_2" ? "评标" : "评审"
|
||
//字段类型(三种) 评标,评审,谈判
|
||
let sectionTypeThree = MethodDict == "procurement_mode_1" || MethodDict == "procurement_mode_2" ? "评标" : MethodDict == "procurement_mode_5" || MethodDict == "procurement_mode_6" ? "谈判" : "评审"
|
||
//应答字段类型 评标,应答
|
||
let responseType = MethodDict == "procurement_mode_1" || MethodDict == "procurement_mode_2" ? "投标" : "应答"
|
||
//项目经理-澄清说明不显示的流程
|
||
const NoClarification = ['bid_prequalification', 'bid_qualification', 'bid_centralized_prequalification', 'bid_centralized_prequalification_bid', 'bid_invitation', 'comparison_one_prequalification', 'comparison_one', 'recruit', 'recruit_multi']
|
||
//项目经理-招标类流程 公开招标资格预审 公开招标资格后审 邀请招标 公开比选一阶段资格预审 公开比选一阶段资格后审
|
||
const isBidProcess = defId == 'bid_prequalification' || defId == 'bid_qualification' || defId == 'bid_invitation' || defId == 'comparison_one_prequalification' || defId == 'comparison_one'
|
||
let className = styles.right;
|
||
//项目经理角色
|
||
let managerList = [
|
||
{
|
||
id: 1,
|
||
path: "/EvaRoom",
|
||
text: "基本信息"
|
||
},
|
||
{
|
||
id: 2,
|
||
path: "/EvaRoom/Eva/",
|
||
text: `${sectionTypeThree}进展`
|
||
},
|
||
{
|
||
id: 3,
|
||
path: "/EvaRoom/Evaluation/BidControl/BidControlManager",
|
||
text: "风险点展示"
|
||
},
|
||
{
|
||
id: 4,
|
||
path: "/EvaRoom/BiddingDocumentsDecrypt",
|
||
text: `${responseType}文件查看`
|
||
},
|
||
{
|
||
id: 5,
|
||
path: "/EvaRoom/BidAbnormal",
|
||
text: `${sectionTypeThree}异常`
|
||
},
|
||
{
|
||
id: 6,
|
||
path: "/EvaRoom/Clarify/Evaluation/projectManager/ClarificationOfTheBid",
|
||
text: "澄清说明"
|
||
},
|
||
{
|
||
id: 7,
|
||
path: "/EvaRoom/ReportPrint",
|
||
text: "报表打印"
|
||
},
|
||
{
|
||
id: 8,
|
||
path: "/EvaRoom/Evaluation/projectManager/ReviewResults/Manager",
|
||
text: "评审结果"
|
||
}]
|
||
//项目经理角色
|
||
let managerOffList = [
|
||
{
|
||
id: 1,
|
||
path: "/EvaRoom",
|
||
text: "基本信息"
|
||
},
|
||
{
|
||
id: 2,
|
||
path: "/EvaRoom/BiddingDocumentsDecrypt",
|
||
text: `${responseType}文件查看`
|
||
},
|
||
{
|
||
id: 3,
|
||
path: "/EvaRoom/Evaluation/BidControl/BidControlManager",
|
||
text: "风险点展示"
|
||
},
|
||
{
|
||
id: 8,
|
||
path: "/EvaRoom/Evaluation/projectManager/ReviewResults/ManagerEntry",
|
||
text: "评审结果录入"
|
||
}]
|
||
let JuryList = [
|
||
{
|
||
id: 1,
|
||
path: "/EvaRoom",
|
||
text: "基本信息"
|
||
},
|
||
{
|
||
id: 2,
|
||
path: "/EvaRoom/Eva/",
|
||
text: sectionTypeTwo
|
||
},
|
||
{
|
||
id: 3,
|
||
path: "/EvaRoom/BiddingDocumentsDecrypt",
|
||
text: `${responseType}文件查看`
|
||
},
|
||
{
|
||
id: 4,
|
||
path: "/EvaRoom/Evaluation/BidControl/Jury",
|
||
text: "风险点展示"
|
||
},
|
||
// {
|
||
// id: 5,
|
||
// path: "",
|
||
// text: `辅助${sectionTypeTwo}`
|
||
// },
|
||
{
|
||
id: 6,
|
||
path: "/EvaRoom/Clarify/Evaluation/expert/ClarificationOfTheBid",
|
||
text: "澄清说明"
|
||
},
|
||
{
|
||
id: 7,
|
||
path: "/EvaRoom/Evaluation/BidEnd/BidEndAdjust",
|
||
text: "算数错误调整"
|
||
},
|
||
{
|
||
id: 8,
|
||
path: '/EvaRoom/Evaluation/expert/ReviewResults',
|
||
text: "评审结果",
|
||
}]
|
||
let supplierList = [{
|
||
id: 1,
|
||
path: "/EvaRoom",
|
||
text: "基本信息"
|
||
},
|
||
{
|
||
id: 2,
|
||
path: "/EvaRoom/Eva/",
|
||
text: "项目评审"
|
||
},
|
||
{
|
||
id: 3,
|
||
path: "/EvaRoom/FileDecode",
|
||
text: `${responseType}文件解密`
|
||
},
|
||
{
|
||
id: 4,
|
||
path: "/EvaRoom/Clarify/Evaluation/supplier/ChallengeListInTheIndex",
|
||
text: "澄清说明"
|
||
}]
|
||
|
||
useEffect(() => {
|
||
listRender();
|
||
}, [])
|
||
|
||
//风险点展示获取是否有风险
|
||
// async function isRisky() {
|
||
// await getRiskStatus({ assessRoomId: roomId, tpId: tpId }).then((res) => {
|
||
// if (res.code == 200) {
|
||
// if (res?.data) {
|
||
// riskySet(
|
||
// <Tooltip title="当前存在风险项">
|
||
// <ExclamationCircleOutlined style={{ color: 'rgb(250,173,20)', position: 'absolute', fontSize: 26, top: 12 }} />
|
||
// </Tooltip>
|
||
// )
|
||
// }
|
||
// }
|
||
// })
|
||
// }
|
||
|
||
//评审结果页签点击事件
|
||
const onclick = async (path, id) => {
|
||
await getOfflineStatusById(roomId)
|
||
if ((role == 'ebtp-agency-project-manager' || role == 'ebtp-purchase') && id == 8) { //代理&采购经理进入评审结果
|
||
if (roomReviewMethod == 0){
|
||
const success = await isClickResult();
|
||
if (success) {
|
||
history.push({ pathname: path });
|
||
setSelectedPath(path);
|
||
} else {
|
||
message.info("未到评审结果环节,无法进入评审结果")
|
||
}
|
||
} else {
|
||
console.log("roomJuryConfigStatus", roomJuryConfigStatus)
|
||
|
||
if (roomJuryConfigStatus == 1) {
|
||
history.push({ pathname: path });
|
||
setSelectedPath(path);
|
||
} else {
|
||
message.info("未到评审结果环节,无法进入评审结果")
|
||
}
|
||
}
|
||
} else if (role == 'ebtp-expert' && id == 8) {//专家进入评审结果
|
||
const success = await isClickResult();
|
||
if (success) {
|
||
const resultPath = await expertClickResult();
|
||
if (resultPath) {
|
||
history.push({ pathname: resultPath });
|
||
setSelectedPath(path);
|
||
}
|
||
} else {
|
||
message.info("未到评审结果环节,无法进入评审结果")
|
||
}
|
||
} else if ((role == 'ebtp-agency-project-manager' || role == 'ebtp-purchase' || role == 'ebtp-expert') && id == 2) {//代理&采购经理进入评审进展 专家进入评审
|
||
const success = await isClickProgress();
|
||
if (success) {
|
||
history.push({ pathname: path });
|
||
setSelectedPath(path);
|
||
} else {
|
||
if (role == 'ebtp-expert') {
|
||
message.info(`未开始${sectionTypeTwo}`)
|
||
} else {
|
||
message.info(`请开始${sectionTypeTwo}`)
|
||
}
|
||
}
|
||
} else if (role == 'ebtp-expert' && id == 7) {//专家进入算术错误调整
|
||
const process = await isClickProgress();
|
||
if (process) {
|
||
const success = await isClickCount();
|
||
if (success) {
|
||
history.push({ pathname: path });
|
||
setSelectedPath(path);
|
||
} else {
|
||
message.info("无操作权限")
|
||
}
|
||
} else {
|
||
message.info(`未开始${sectionTypeTwo}`)
|
||
}
|
||
} else {
|
||
history.push({ pathname: path });
|
||
setSelectedPath(path);
|
||
}
|
||
}
|
||
|
||
//调用接口判断评审结果是否可以点击
|
||
const isClickResult = async () => {
|
||
return await isShowResult(roomId).then(res => {
|
||
if (res?.code == 200) {
|
||
const data = res?.data
|
||
return data?.flowFinish
|
||
}
|
||
})
|
||
}
|
||
|
||
//专家角色评审结果路由确定
|
||
const expertClickResult = async () => {
|
||
return await getLeader(roomId).then(async res => {
|
||
if (res?.code == 200) {
|
||
if (res?.data == "Review") {
|
||
return "/EvaRoom/Evaluation/expert/ReviewResults/Jury"
|
||
} else {
|
||
//TODO zyx暂时不需要const result = await isLeaderConfirm({ assessRoomId: roomId });//供应商股权关系-专家组长是否确认风险
|
||
//TODO zyx暂时不需要if (result?.success && result?.data) {
|
||
return "/EvaRoom/Evaluation/expert/ReviewResults/GroupLeader"
|
||
//TODO zyx暂时不需要} else {
|
||
//TODO zyx暂时不需要 setIsResult(true)
|
||
//TODO zyx暂时不需要 setRiskVisible(true)
|
||
//TODO zyx暂时不需要 return false;
|
||
//TODO zyx暂时不需要}
|
||
}
|
||
} else {
|
||
return false
|
||
}
|
||
})
|
||
}
|
||
|
||
//调用接口判断评审进展(代理&采购经理)是否可以进入
|
||
//true-可以进入 false-不可以
|
||
const isClickProgress = async () => {
|
||
return await getRoomDataById(roomId).then(res => {
|
||
if (res?.code == 200) {
|
||
const data = res?.data
|
||
return data?.juryConfigStatus == 1
|
||
}
|
||
})
|
||
}
|
||
|
||
//调用接口判断算术错误调整(专家&专家组长)是否可以进入
|
||
//true-可以进入 false-不可以
|
||
const isClickCount = async () => {
|
||
return await isShowCount(roomId).then(res => {
|
||
if (res?.code == 200) {
|
||
const data = res?.data
|
||
return res?.data
|
||
}
|
||
})
|
||
}
|
||
|
||
//判断是否显示算数错误调整
|
||
const isShowCountFC = async () => {
|
||
//公开招标资格预审 公开招标资格后审 邀请招标 公开比选一阶段资格预审 公开比选一阶段资格后审
|
||
if (isBidProcess) {
|
||
//根据评审配置的是否显示算数错误调整判定
|
||
return await getErrorStatus(roomId).then(res => {
|
||
if (res?.code == 200 && res?.success == true) {
|
||
return res?.data == 1 || res?.data == 2
|
||
}
|
||
})
|
||
}
|
||
return true //默认显示算术错误调整
|
||
}
|
||
|
||
//判断当前登录人是否弹出供应商关联风险信息
|
||
const showRiskModal = async (resultClick) => {
|
||
if (role == "ebtp-agency-project-manager" || role == "ebtp-purchase" || role == "ebtp-expert") {
|
||
return await isShowRiskModal({ assessRoomId: roomId }).then(res => {
|
||
if (res?.code == 200 && res?.success) {
|
||
if (!res?.data) {
|
||
setIsResult(resultClick)
|
||
setRiskVisible(true)
|
||
}
|
||
return res?.data;
|
||
}
|
||
return true;
|
||
})
|
||
}
|
||
return true;
|
||
}
|
||
//确认风险
|
||
const confirmRisk = async () => {
|
||
return await saveConfirm({ assessRoomId: roomId }).then(res => {
|
||
if (res?.code == 200) {
|
||
return res?.data;
|
||
} else {
|
||
return false;
|
||
}
|
||
})
|
||
}
|
||
|
||
//初始化数据
|
||
const listRender = async () => {
|
||
// await isRisky();
|
||
//供应商是否用ipass解密判断
|
||
IPassDecode == 0 ? null : supplierList.splice(2, 1)
|
||
//供应商是否显示评审进展判断(招标类不显示)
|
||
isBidProcess && (isBxOneSecondCustom != "1") ? supplierList.splice(1, 1) : null
|
||
//项目经理澄清说明判断
|
||
NoClarification.findIndex(item => item == defId) == -1 ? null : managerList.splice(5, 1)
|
||
//专家算数错误调整判断
|
||
let roomType = '2'
|
||
getURLInformation('roomType') == undefined ? roomType = '2' : roomType = getURLInformation('roomType')
|
||
sessionStorage.setItem("roomType", roomType)//roomType存入session
|
||
if (MethodDict == "procurement_mode_7" || MethodDict == "procurement_mode_4") {//询价,招募不显示算术错误调整
|
||
JuryList.splice(5, 1)
|
||
} else {
|
||
const success = await isShowCountFC()
|
||
if (success) { } else {
|
||
JuryList.splice(5, 1)
|
||
}
|
||
}
|
||
//代理&项目经理
|
||
if (role == "ebtp-agency-project-manager" || role == "ebtp-purchase") {//代理和采购经理
|
||
if(true){
|
||
setList(managerOffList);
|
||
}else {
|
||
setList(managerList);
|
||
}
|
||
} else if (role == "ebtp-expert") {//专家
|
||
setList(JuryList)
|
||
} else if (role == "ebtp-supplier") {//供应商
|
||
setList(supplierList);
|
||
} else { //其他未分配的角色
|
||
setList(managerList);
|
||
}
|
||
return await showRiskModal(false) //弹出供应商关联风险信息
|
||
}
|
||
|
||
return (
|
||
<div>
|
||
<div className={styles.header}>
|
||
<div className={styles.headerAlign} style={{ position: "absolute", left: "0", fontSize: "16px", fontWeight: "600" }}>
|
||
<img src={logo} style={{ height: "30px", marginRight: "10px", position: 'relative', top: '-2px' }} />招标采购中心 | 电子{sectionTypeThree}室
|
||
</div>
|
||
<ul className={styles.rightBtns}>
|
||
<li><CarryOutOutlined />{moment().format("YYYY-MM-DD")}</li>
|
||
{data?.organizationName == null ? null : (<li><UserSwitchOutlined />{data.organizationName}</li>)}
|
||
<li>
|
||
<Avatar size="small" src="https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png" style={{ width: '30px' }} />
|
||
<a className="antd-dropdown-link" style={{ color: "#fff", marginRight: "36px" }}>
|
||
{data.fullName}
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div className="myselfBar">
|
||
<div className="tablist">
|
||
{list?.map(item => {
|
||
return (
|
||
<div
|
||
className="tab"
|
||
key={item.id}
|
||
style={{
|
||
width: '100000px',
|
||
color: selectedPath == item.path || (item.path === '/EvaRoom/Eva/' && selectedPath.includes('/EvaRoom/Eva/')) ? "#FFFFFF" : "#b30000",
|
||
background: selectedPath == item.path || (item.path === '/EvaRoom/Eva/' && selectedPath.includes('/EvaRoom/Eva/')) ? "#b30000" : "#FFFFFF"
|
||
}}
|
||
onClick={() => { onclick(item.path, item.id) }}
|
||
>
|
||
{item.text}
|
||
{/* {
|
||
(item.path === '/EvaRoom/Evaluation/BidControl/Jury' || item.path === '/EvaRoom/Evaluation/BidControl/BidControlManager') && risky &&
|
||
<> {risky}</>
|
||
} */}
|
||
</div>
|
||
)
|
||
})}
|
||
</div>
|
||
</div>
|
||
{riskVisible && <RiskModal modalVisible={riskVisible} onCancel={() => { setRiskVisible(false); setSelectedPath(window.location.pathname) }} onSubmit={confirmRisk} isResult={isResult} role={role} />}
|
||
{(MethodDict != "procurement_mode_5" && MethodDict != "procurement_mode_6") && role == "ebtp-supplier" ? null : <InstantMessage />}
|
||
</div>
|
||
);
|
||
}
|
||
export default BiddingRoom;
|