import React, { useEffect, useRef, useState } from 'react'; import { Button, Checkbox, Col, Collapse, DatePicker, Drawer, Form, Input, message, Modal, Popconfirm, Row, Select, Spin, Upload, Image, RadioChangeEvent, Radio, Typography, Popover, Tooltip } from 'antd' import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; import { getList, saveGroup, delOne, saveMember, changeEx, queryVoList, changeMember, applyFor, roomStatus, juryTem, rePassWord } from './service'; import moment from 'moment'; import { getProId, getProMethod, getDefId, getSessionProjectData, getRoomReturnURL, getSessionUserData } from '@/utils/session'; import './judgList.less'; import '@/assets/xsy_style.less'; import FileDown from '@/utils/Download'; import { DownOutlined, EllipsisOutlined, QuestionCircleOutlined, UploadOutlined } from '@ant-design/icons'; import { btnAuthority } from '@/utils/authority'; import RiskPrevention from '@/utils/RiskPrevention'; import { history } from 'umi'; import { downloadPath } from '@/utils/DownloadUtils'; import ExpertPhotoUpload from '@/components/ElecBidEvaluation/ExpertPhotoUpload'; import { getUserPhoto, unlockAccount } from '@/pages/Tender/ProjectManager/JudgingPanel/List/service'; import BidEvalAppointment from '@/components/ElecBidEvaluation/BidEvalAppointment'; import OutsourcingManage from '@/pages/Tender/ProjectManager/JudgingPanel/List/OutsourcingManage'; import { dateTimeFormatter } from '@/utils/DateUtils'; const JudgingPanel: React.FC<{}> = (props: any) => { const modalHeight = window.innerHeight * 96 / 100; const proId = getProId(); const roomType = "2"; const roomId = props.location?.state?.roomId; const sectionId = props.location?.state?.secId; const openTime = props.location?.state?.openTime;//开始评审时间 const formLayout = { labelCol: { span: 8 }, wrapperCol: { span: 16 }, }; const form24Layout = { labelCol: { span: 4 }, wrapperCol: { span: 20 }, }; const FormItem = Form.Item; const [form] = Form.useForm(); const { Option } = Select; const { Panel } = Collapse; const { TextArea } = Input; const { Paragraph, Text, Link, Title } = Typography; // const { TabPane } = Tabs; const actionRef = useRef(); const [spin, spinSet] = useState(false); const [loading, loadingSet] = useState(false); const [modalVis, setModalVis] = useState(false);//新增评委会 const [updateData, updateDataSet] = useState();//评委会modal数据 const [memberVis, setMemberVis] = useState(false); const [open, openSet] = useState(false);//评委会里是否有开启评审的评审室 true有开启的 false无 const [allEnd, allEndSet] = useState(true);//评委会关联标段的评审室是否都关闭了 // const [yushen, yushenSet] = useState(false);//是否预审 // const [readOnly, readOnlySet] = useState(true);//只读 const [disabled, disabledSet] = useState(true);//禁用 // const [manNum, manNumSet] = useState(5);//人数 const [riskVisible, setRiskVisible] = useState(false);//风控弹窗 2021.9.7 zhoujianlong const [riskData, setRiskData] = useState([]);//风控数据 2021.9.7 zhoujianlong const [selectEvalVisible, setSelectEvalVisible] = useState(false);//电子评标室-评标室预约选择 2022.8.26 zhoujianlong const [selectEvalData, setSelectEvalData] = useState();//电子评标室-评标室预约选择-数据 2022.8.26 zhoujianlong const [initEvalTime, setInitEvalTime] = useState();//电子评标室-时间输入框默认时间(跟随标段) 2022.9.27 zhoujianlong // const [userPhotoId, setUserPhotoId] = useState("");//电子评标室-录入外部专家-相片id 2022.8.29 zhoujianlong const [appoType, setAppoType] = useState("0");//电子评标室-预约框状态 2022.8.29 zhoujianlong const [isReserve, setIsReserve] = useState("0");//电子评标室-是否预约电子评标室 2022.9.23 zhoujianlong 0-不预约 1-预约 const userData = getSessionUserData();//当前登录人用户信息 const [assistVisible, setAssistVisible] = useState(false);//协办管理visible 2022.10.10 zhoujianlong //外协管理 const [assistList, setAssistList] = useState([]);//外协人员数据 assistList const [assistNumber, setAssistNumber] = useState("");//外协人员数量 assistNumber // function getShouName() { // const method = getDefId(); // let num = 3; // if (method === 'procurement_mode_1' || method === 'procurement_mode_2' || method === 'procurement_mode_3') {//招标 // num = 5; // } // manNumSet(num); // } //创建控制 // const [activeKey, activeKeySet] = useState('1'); //创建评委会小组 const saveG = async (fields: any) => { const hide = message.loading('正在配置'); try { const success = await saveGroup({ ...fields }).then((res) => { if (res?.code == 4004 && res?.success == false) { //2021.9.7 zhoujianlong 新增评委会保存增加风控 const data = res?.data?.result == undefined ? [] : res?.data?.result setRiskData(data) setRiskVisible(true) } return res.success }); hide(); if (success) { message.success('配置成功'); } return true; } catch (error) { hide(); message.error('配置失败请重试!'); return false; } }; //主页表格 const [dataSource, dataSourceSet] = useState();//主列表数据 const [btnDis, btnDisSet] = useState(true);//创建评审室按钮 const columns: ProColumns[] = [ { title: '序号', valueType: 'index', width: 50, }, // { // title: '评审小组分类', dataIndex: 'juryType', width: '10%', // valueEnum: { // '1': { text: '资格预审评审', }, // '2': { text: '招标项目评审', }, // } // }, { title: '包件名称', dataIndex: 'sectionName', }, { title: '专家数量', dataIndex: 'expertNumber', width: 80, }, { title: '采购人代表数量', dataIndex: 'representativeNumber', width: 120, }, { title: '是否预约电子评标室', dataIndex: 'reserveStatus', width: 150, valueEnum: { 1: "是", 0: "否" } }, { title: "评审地点", dataIndex: 'evalLocation', width: '18%', ellipsis: true, render: (_: any, record: any) => sectionNameValue(record.elecEvalRoomReserve, record.evalLocation, record.reserveStatus) }, { title: '预计开始时间', dataIndex: 'startTime', valueType: 'dateTime', width: '10%', }, { title: '预计结束时间', dataIndex: 'endTime', valueType: 'dateTime', width: '10%', }, { title: '操作', dataIndex: 'option', width: '16%', valueType: 'option', render: (_, record) => { if (record.status == 0 || record.status == 2) { return ( <> {returnCheck(record, false)} { spinSet(true) await del({ id: record.id }); getPage(); spinSet(false) }} okText="确定" cancelText="取消" > ) } else if (record.status == 1) {//已提交申请 return ( <>{returnCheck(record, true)} ) } else if (record.status == 3) { return ( <> {returnCheck(record, true)} {record.assistNumber != null && } {record.elecEvalRoomReserve && (record.elecEvalRoomReserve.status == -1 || record.elecEvalRoomReserve.status == 0) && } ); } else { return (<>) } } }, ]; useEffect(() => { getPage(); // getShouName();//人数判断 }, []) async function getPage() { spinSet(true); getList(roomId).then(res => { if (res?.data != undefined) { dataSourceSet([res.data]); } else { dataSourceSet([]); } btnDisSet(res.data != undefined); }) spinSet(false); } function returnCheck(record: any, check: any) {//返回操作列查看、修改按钮 return ( ) } //删除 const del = async (fields: any) => { const hide = message.loading('正在删除'); try { const success = await delOne({ ...fields }).then((res) => { return res.success }); hide(); if (success) { message.success('删除成功'); return true; } else { message.error('删除失败'); return false; } } catch (error) { hide(); message.error('删除失败请重试!'); getPage(); return false; } }; //提交申请 const apply = async (fields: any) => { const hide = message.loading('正在提交'); try { const success = await await applyFor({ ...fields }).then((res) => { return res.success }); hide(); if (success) { message.success('提交成功'); return true; } else { message.error('提交失败'); return false; } } catch (error) { hide(); message.error('提交失败请重试!'); getPage(); return false; } }; function disabledDate(current: any) {//日期选择 // Can not select days before today and today return current && current < moment().startOf('day'); } const rule = (mes: any) => {//创建修改 规则 return [ { required: true, message: `请录入${mes}`, }, ] } //评标地点 评标室更多信息 const evalLocationTitle = (detail: any, updateData: any) => { return (

详细地址:{updateData?.reserveStatus == 1 ? updateData.elecEvalRoomReserve.areaAddress : updateData?.evalLocation}

可容纳人数:{detail?.numberInMeeting}

联系人:{detail?.contactName}

联系电话:{detail?.contactTel}

) } //说明 const sectionNameValue = (detail: any, evalLocation: any, reserveStatus: any) => { const address = reserveStatus == 1 ? detail?.areaAddress : evalLocation; const content = (

详细地址:{address}

可容纳人数:{detail?.numberInMeeting}

联系人:{detail?.contactName}

联系电话:{detail?.contactTel}

) let text = address.length > 30 ? address.slice(0, 30) + "..." : address; return ( detail != null ? ( {text} ) : ( {text} ) ) } //专家账号解锁 const unlockExportAccount = async (record: any, juryId: any, proId: any) => { try { const res = await unlockAccount(record.id, juryId, proId); if (res.success) { message.success(res.data); } } catch (error) { } } useEffect(() => {//给表单赋值 updateData && setIsReserve(String(updateData?.reserveStatus));//赋值给是否预约电子评标室 updateData && String(updateData?.reserveStatus) == "1" && getEarliestTime(openTime, String(updateData?.reserveStatus));//初始化赋值数据 form.setFieldsValue({ juryType: updateData != undefined ? updateData.juryType : null, representativeNumber: updateData != undefined ? updateData.representativeNumber : null, expertNumber: updateData != undefined ? updateData.expertNumber : null, startTime: updateData != undefined ? updateData.reserveStatus == 1 ? moment(updateData.elecEvalRoomReserve.reserveStartDate, 'yyyy-MM-DD HH:mm:ss') : moment(updateData.startTime, 'yyyy-MM-DD HH:mm:ss') : null, endTime: updateData != undefined ? updateData.reserveStatus == 1 ? moment(updateData.elecEvalRoomReserve.reserveEndDate, 'yyyy-MM-DD HH:mm:ss') : moment(updateData.endTime, 'yyyy-MM-DD HH:mm:ss') : null, evalLocation: updateData != undefined ? updateData.reserveStatus == 1 ? updateData.elecEvalRoomReserve.areaAddress : updateData.evalLocation : null, description: updateData != undefined ? updateData.description : null, reserveBy: updateData?.reserveStatus == 1 ? updateData.elecEvalRoomReserve.reserveBy : null, reserveContactNumber: updateData?.reserveStatus == 1 ? updateData.elecEvalRoomReserve.reserveContactNumber : null, assistNumber: updateData?.reserveStatus == 1 ? updateData.assistNumber : null, }) }, [updateData]); const group = () => {//评审小组modal return ( <> { setModalVis(false); updateDataSet({}); // cqDataSet([]); // updateKeySet(-1); // activeKeySet('1'); }} > {/* {tab1()} {tab2()} {cqDrawer()} */} {tab1()} ) } // function changeTabs(key: any) { // if (key == 1) { // activeKeySet(key); // } else { // nextStep() // } // } //人数校验 function checkMan(count: number, expCon: any) { let res = true; const defId = getDefId();//16 const method = getProMethod();//9 const yushenType = getSessionProjectData().openTenderForm; let manNumT = 5; if (method === 'procurement_mode_1' || method === 'procurement_mode_2') { if (false && yushenType == 'open_tender_form_2') {//资格预审 自愿招标为3 manNumT = 3; } if (expCon < count * 2 / 3) { res = false; message.error("专家人数不少于评委会总人数2/3") } } else if (method === 'procurement_mode_3') {//比选 if (expCon < count * 2 / 5) { res = false; message.error("专家人数不少于评委会总人数2/5") } } else if (method === 'procurement_mode_4') {//招募 manNumT = 1; if (count < manNumT) { res = false; message.error(`评委会总人数需大于1`) } else { return true; } } else if (method === 'procurement_mode_5') {//竞谈 if (manNumT = 5) {//最低价 manNumT = 3; } if (expCon < count * 1 / 3) { res = false; message.error("专家人数不少于评委会总人数1/3") } } else if (method === 'procurement_mode_6') {//单一 manNumT = 3; } else if (method === 'procurement_mode_9') {//单一 manNumT = 3; } else if (defId == 'inquiry') {//询价 manNumT = 3; } if (count < manNumT || count % 2 == 0) {//校验总人数 res = false; message.error(`评委会总人数需大于等于${manNumT}人且为单数`) } return res } // async function nextStep() {//下一步 // const formVals = form.getFieldsValue(); // let verify = false; // await form.validateFields().then(() => { // let juryRoomListTem: any = []; // juryRoomListTem.push({ roomId: roomId, sectionId: sectionId, roomType: roomType }); // verify = true; // juryRoomListSet(juryRoomListTem); // //采购人数需要大于5 需要取项目类型 // const count = parseInt(formVals.representativeNumber) + parseInt(formVals.expertNumber); // if (verify) { // verify = checkMan(count, parseInt(formVals.expertNumber)); // } // const st = moment(formVals.startTime).format('yyyy-MM-DD HH:mm:ss'); // const et = moment(formVals.endTime).format('yyyy-MM-DD HH:mm:ss'); // if (st > et || st == et) {//校验时间 // verify = false; // message.error("预计开始时间应早于预计结束时间") // } // if (selectEvalData?.reserveStatus == "1") {//预约了评标室 // const selectStartTime = moment(selectEvalData.reserveStartDate).format('yyyy-MM-DD HH:mm:ss'); // const selectEndTime = moment(selectEvalData.reserveEndDate).format('yyyy-MM-DD HH:mm:ss'); // if (selectStartTime != st || selectEndTime != et) { // verify = false; // message.error("预约时间需与选择评标室中的预约时间相等"); // } // } // if (verify) { // activeKeySet('2'); // } // }) // } //添加抽取drawer const formLayoutDrawer = { labelCol: { span: 8 }, wrapperCol: { span: 16 }, }; const tailLayoutDrawer = { wrapperCol: { offset: 8, span: 20 }, }; // const [juryRoomList, juryRoomListSet] = useState([]); const [cqData, cqDataSet] = useState([]);//抽取表格,提交时需要 // const [addCq, addCqSet] = useState(false);//添加抽取抽屉显示控制 // const [updateKey, updateKeySet] = useState(-1);//触发修改存key // const [formCq] = Form.useForm(); // const [display, displaySet] = useState(true); // const columnsCq: ProColumns[] = [//抽取表格 // { title: '序号', valueType: 'index', width: 50, }, // { // title: '专家分类', dataIndex: 'subCategory', // valueEnum: { // '1': { text: '技术', }, // '2': { text: '商务', }, // '3': { text: '法律', }, // '4': { text: '其它', }, // } // }, // { title: '需抽数量', dataIndex: 'extractNumber', }, // { // title: '抽取方式', dataIndex: 'extractMethod', // valueEnum: { // '1': { text: '外部录入', }, // '2': { text: '随机抽取', }, // } // }, // { title: '抽取规则要求', dataIndex: 'cqRude', }, // { // title: '操作', dataIndex: 'option', width: 100, // valueType: 'option', // render: (_, record) => { // return ( // <> // { // !disabled ? // <> // // { // let dataTem = [...cqData]; // dataTem.map((item: any, index: any) => { // if (item.key == record.key) { // dataTem.splice(index, 1) // } // }); // cqDataSet(dataTem); // }} // okText="确定" // cancelText="取消" // > // // // // : <> // } // // ); // } // }, // ]; // const cqDrawer = () => {//添加抽取条件、修改 // return ( // <> // { addCqSet(false); updateKeySet(-1); formCq.resetFields(); }} // visible={addCq} // getContainer={false} // style={{ position: 'absolute' }} // > //
// // // // // // // // // // // // // // // // // // // // // //
// {/* // // // // // // // // // // // // // // // // // // // // 中国联通 // // // // // // // 中国联通 // // // // // // // 中国联通 // // // */} //
// // // //
//
// // ) // } const tab1 = () => {//cqtab1 return ( <>

预约电子评标室

注:若选择预约电子评标室,请提前做好相关准备,并按预约时间进入评标场所,系统将下发相关人员名单并获取相关数据} > {isReserve == "1" && !disabled ? (//预约电子评标室 ) : ( )} {isReserve == "1" && (//预约电子评标室 )} {isReserve == "1" && (//预约电子评标室 <> )}

专家申请基本信息

{/* { display ? : } */}
) } // const tab2 = () => {//cqtab2 // return ( // <> //
//

抽取条件

//
// //
//
// //
//

回避单位信息

//
// //
//
//
//

回避专家信息

//
// //
//
// // ) // } const renderFooter = () => {//评审小组footer // if (activeKey === '1') { // return ( // <> // // // // ); // } // if (activeKey === '2') { // return ( // <> // // // // // ); // } else { // return (<>) // } return ( <> ) }; //成员管理 const [add, setAdd] = useState(false);//录入外部专家Drawer显隐 const [changeMan, changeManSet] = useState(false);//更换Drawer显隐 const [juryId, juryIdSet] = useState('');//更换专家所需评委会id const [reason, reasonSet] = useState('');//更换专家原因 const [category, categorySet] = useState([]);//类别 juryCategoryVOList const [daibiao, daibiaoSet] = useState({});//代表 const [jishu, jishuSet] = useState({});//技术 const [shangwu, shangwuSet] = useState({});//商务 const [falv, falvSet] = useState({});//法律 const [qita, qitaSet] = useState({});//其它 const [luru, luruSet] = useState(0);//录入外部传类别 const [updateKeyMem, updateKeyMemSet] = useState(-1);//触发修改存key const [memberCount, memberCountSet] = useState(0);//刷新成员管理页面 const [checkBoxs, checkBoxsSet] = useState([]);//更换专家按钮组 const [checkBoxsStatus, checkBoxsStatusSet] = useState({});//更换专家按钮组 const [changeMemberId, changeMemberIdSet] = useState('');//更换专家id const [changeBtn, changeBtnSet] = useState(true);//更换按钮显隐 const [formMem] = Form.useForm(); function reset() {//重置 categorySet([]); // daibiaoSet({}); // shangwuSet({}); // falvSet({}); // qitaSet({}); luruSet(0); updateKeyMemSet(-1); checkBoxsSet([]); changeMemberIdSet(''); form.resetFields(); } const columnsMember: ProColumns[] = [//成员管理页面表格 { title: '序号', valueType: 'index', width: 50, }, { title: '专家姓名', dataIndex: 'name', }, { title: '手机号码', dataIndex: 'mobile', }, { title: '证件号码', dataIndex: 'certificate', }, { title: '工作单位', dataIndex: 'workunit', }, { title: '通知状态', dataIndex: 'status', }, { title: '通知结果备注', dataIndex: 'remark', }, { title: '照片', dataIndex: 'faceId', render: (_, record) => { if (record.faceId) { // return downloadFile({ uid: record.faceId })}>{record.name} return { return ( <> { confirmMem(record); }} okText="确定" cancelText="取消" > ); } }, ]; function returnType(inId: any) {//修改时根据record.categoryId判断类别 category != undefined ? category.map((item: any,) => { if (item.id == inId) { if (item.category == 1) { luruSet(1); } else if (item.category == 2 && item.subCategory == 1) { luruSet(2); } else if (item.category == 2 && item.subCategory == 2) { luruSet(3); } else if (item.category == 2 && item.subCategory == 3) { luruSet(4); } else if (item.category == 2 && item.subCategory == 4) { luruSet(5); } } }) : null; } function returnCate(luru: any) {//取data switch (luru) { case 1: return daibiao; case 2: return jishu; case 3: return shangwu; case 4: return falv; case 5: return qita; default: break; } } function dataSet(data: any, luru: any) {//塞data let dataT = []; switch (luru) { case 1: dataT = daibiao; dataT.juryMemberList = data; daibiaoSet(dataT); break; case 2: dataT = jishu; dataT.juryMemberList = data; jishuSet(dataT); break; case 3: dataT = shangwu; dataT.juryMemberList = data; shangwuSet(dataT); break; case 4: dataT = falv; dataT.juryMemberList = data; falvSet(dataT); break; case 5: dataT = qita; dataT.juryMemberList = data; qitaSet(dataT); break; default: break; } } function returnHeader(name: any) { return (

{name}

) } function returnCheckBox(type: any) {//更改选人 return ( <> {type != undefined ? type.map((item: any) => { return ( { let data = [...checkBoxs]; let status = { ...checkBoxsStatus }; if (e.target.checked) { data.push({ memberId: item.id }); status[item.id] = true; } else { data.map((item: any, index: any) => { item.memberId == e.target.value ? data.splice(index, 1) : null; }) status[item.id] = false; } checkBoxsStatusSet(status); checkBoxsSet(data); }}>{item.name} ) }) : null } ) } useEffect(() => {//拆类别 daibiaoSet({}); jishuSet({}); shangwuSet({}); falvSet({}); qitaSet({}); category.map((item: any) => { if (item.category == 1) { daibiaoSet(item); } else { if (item.subCategory == 1) { jishuSet(item); } else if (item.subCategory == 2) { shangwuSet(item); } else if (item.subCategory == 3) { falvSet(item); } else if (item.subCategory == 4) { qitaSet(item); } } }); }, [memberCount]); async function queryOpenStatus(id: any) {//查是否开启评审 id:评委会id await roomStatus(id).then((res) => { if (res.data) { openSet(res.data.anyOpenRoom); allEndSet(res.data.allEndRoom); } }) } const returnPanel = () => {//返回手风琴 return ( <> {daibiao.juryMemberList != undefined ? [ ]} /> : null} {jishu.juryMemberList != undefined ? [ ]} /> : null} {shangwu.juryMemberList != undefined ? [ ]} /> : null} {falv.juryMemberList != undefined ? [ ]} /> : null} {qita.juryMemberList != undefined ? [ ]} /> : null} ) } function checkRe(data: any) {//查重 let pass = true; !checkReRoot(daibiao, data, 1) ? pass = false : null; !checkReRoot(jishu, data, 2) ? pass = false : null; !checkReRoot(shangwu, data, 3) ? pass = false : null; !checkReRoot(falv, data, 4) ? pass = false : null; !checkReRoot(qita, data, 5) ? pass = false : null; return pass; } function checkReRoot(type: any, data: any, updateType: any) {//查重 const { certificate, mobile, name } = data; let pass = true; if (certificate == '' || mobile == '' || name == '' || certificate == undefined || mobile == undefined || name == undefined) { pass = false; } else { if (type.juryMemberList != undefined && updateType != luru) { for (const item of type.juryMemberList) { if (item.certificate == certificate) {//身份证号重复 pass = false; message.error('身份证号重复'); break; } if (item.mobile == mobile) {//手机号重复 pass = false; message.error('手机号重复'); break; } } } else if (type.juryMemberList != undefined && updateType == luru) { for (const item of type.juryMemberList) { if (item.certificate == certificate && item.key != updateKeyMem) {//身份证号重复 pass = false; message.error('身份证号重复'); break; } if (item.mobile == mobile && item.key != updateKeyMem) {//手机号重复 pass = false; message.error('手机号重复'); break; } } } } return pass; } const returnDrawerMem = () => {//成员管理抽屉(专家信息)添加、修改 return ( <> { setAdd(false); changeBtnSet(true); // formMem.resetFields(); }} visible={add} getContainer={false} style={{ position: 'absolute' }} >
评审专家照片为专家进入电子评标室报道及人脸识别认证使用,若预约了电子评标室,请维护专家照片。} > {/* */} {/* */}
) } const returnDrawerChange = () => {//更换专家抽屉 return ( <> changeManSet(false)} visible={changeMan} getContainer={false} style={{ position: 'absolute' }} footer={
  
} > {daibiao.juryMemberList != undefined ? <> {returnHeader('采购人代表')} {returnCheckBox(daibiao.juryMemberList)} : null} {jishu.juryMemberList != undefined ? <> {returnHeader('技术类专家')} {returnCheckBox(jishu.juryMemberList)} : null} {shangwu.juryMemberList != undefined ? <> {returnHeader('商务类专家')} {returnCheckBox(shangwu.juryMemberList)} : null} {falv.juryMemberList != undefined ? <> {returnHeader('法律类专家')} {returnCheckBox(falv.juryMemberList)} : null} {qita.juryMemberList != undefined ? <> {returnHeader('其它类专家')} {returnCheckBox(qita.juryMemberList)} : null}

取消原因: