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, getProMethod, getSessionRoleData, getIPassDecode, getDefId, getProId } from '@/utils/session'; import { getURLInformation } from '@/utils/CommonUtils'; import { getLeader, isShowResult, isShowCount, getErrorStatus, getRiskStatus } 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'; 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(); //获取评审室id const roomId = getRoomId(); const [list, setList] = useState(); 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 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( // // // // ) // } // } // }) // } //评审结果页签点击事件 const onclick = async (path, id) => { if ((role == 'ebtp-agency-project-manager' || role == 'ebtp-purchase') && id == 8) { //代理&采购经理进入评审结果 const success = await isClickResult(); if (success) { 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(res => { if (res?.code == 200) { if (res?.data == "Review") { return "/EvaRoom/Evaluation/expert/ReviewResults/Jury" } else { return "/EvaRoom/Evaluation/expert/ReviewResults/GroupLeader" } } 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 listRender = async () => { // await isRisky(); //供应商是否用ipass解密判断 IPassDecode == 0 ? null : supplierList.splice(2, 1) //供应商是否显示评审进展判断(招标类不显示) isBidProcess ? 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") {//代理和采购经理 setList(managerList); } else if (role == "ebtp-expert") {//专家 setList(JuryList) } else if (role == "ebtp-supplier") {//供应商 setList(supplierList); } else { //其他未分配的角色 setList(managerList); } } return (
招标采购中心 | 电子{sectionTypeThree}室
{list?.map(item => { return (
{ onclick(item.path, item.id) }} > {item.text} {/* { (item.path === '/EvaRoom/Evaluation/BidControl/Jury' || item.path === '/EvaRoom/Evaluation/BidControl/BidControlManager') && risky && <>  {risky} } */}
) })}
{(MethodDict != "procurement_mode_5" && MethodDict != "procurement_mode_6") && role == "ebtp-supplier" ? null : }
); } export default BiddingRoom;