diff --git a/config/ZhaoBiao/router_menudTender.config.ts b/config/ZhaoBiao/router_menudTender.config.ts index f9fcfa1..cd18154 100644 --- a/config/ZhaoBiao/router_menudTender.config.ts +++ b/config/ZhaoBiao/router_menudTender.config.ts @@ -46,6 +46,11 @@ export default [//投标 path: '/ProjectLayout/Tender/ProjectManager/JudgingPanel', component: './Tender/ProjectManager/JudgingPanel/List' }, + // 评委会设置-专家入库 + { + path: '/ProjectLayout/Tender/ProjectManager/JudgingPanelStoreIn', + component: './Tender/ProjectManager/JudgingPanelStoreIn/List' + }, // 保证金 { path: '/ProjectLayout/Tender/supplier/EarnestMoney', diff --git a/src/pages/Tender/ProjectManager/JudgingPanelStoreIn/List/OutsourcingManage.tsx b/src/pages/Tender/ProjectManager/JudgingPanelStoreIn/List/OutsourcingManage.tsx new file mode 100644 index 0000000..4308ec5 --- /dev/null +++ b/src/pages/Tender/ProjectManager/JudgingPanelStoreIn/List/OutsourcingManage.tsx @@ -0,0 +1,337 @@ +import ExpertPhotoUpload from "@/components/ElecBidEvaluation/ExpertPhotoUpload"; +import { btnAuthority } from "@/utils/authority"; +import { downloadPath } from "@/utils/DownloadUtils"; +import ProTable, { ProColumns } from "@ant-design/pro-table"; +import { Button, Collapse, Modal, Spin, Image, Popconfirm, Drawer, Form, Input, Row, Col, Select, message } from "antd"; +import React, { useEffect, useState } from "react"; +import './judgList.less'; +import '@/assets/xsy_style.less'; +import { saveAssistPeople } from "./service"; +import { isEmpty } from "@/utils/CommonUtils"; + +interface OutsourcingManageProps { + modalVisible: boolean, + onCancel: () => void, + onSubmit: () => void,//保存回调 + open: boolean,//评委会里是否有开启评标的评审室 true有开启的 false无 + assistData: any[],//外协人数据 + assistNumber: string,//外协人数量 + juryId: string,//评委会id +} +const formLayoutDrawer = { labelCol: { span: 8 }, wrapperCol: { span: 16 }, }; +const tailLayoutDrawer = { wrapperCol: { offset: 8, span: 20 }, }; + +/** + * 外协管理 + * @param props + * @returns + */ +const OutsourcingManage: React.FC = (props) => { + const modalHeight = window.innerHeight * 96 / 100; + const { Panel } = Collapse; + const { Option } = Select; + const [formMem] = Form.useForm(); + const { modalVisible, onCancel, onSubmit, open, assistData = [], assistNumber = "0", juryId } = props; + + //loading + const [loading, setLoading] = useState(false); + //录入外协人员 drawerVisible + const [add, setAdd] = useState(false); + //外协人员数据 + const [dataSource, setDataSource] = useState([]); + //外协人员-修改存key + const [updateKeyMem, updateKeyMemSet] = useState(-1); + //删除回调 + const confirmMem = async (record: any) => { + const dataTem = [...dataSource]; + dataTem.map((item: any, index: any) => { + if (item.key == record.key) { + dataTem.splice(index, 1); + } + }); + setDataSource(dataTem); + } + + const columnsMember: ProColumns[] = [//成员管理页面表格 + { title: '序号', valueType: 'index', width: 50, }, + { title: '姓名', dataIndex: 'name', }, + { title: '手机号码', dataIndex: 'mobile', }, + { title: '证件号码', dataIndex: 'certificate', }, + { title: '工作单位', dataIndex: 'workunit', }, + { + title: '照片', + dataIndex: 'faceId', + render: (_, record) => { + if (record.faceId) { + // return downloadFile({ uid: record.faceId })}>{record.name} + return { + return ( + <> + + { confirmMem(record); }} + okText="确定" + cancelText="取消" + > + + + + ); + } + }, + ]; + + useEffect(() => { + setDataSource(assistData); + return () => { + updateKeyMemSet(-1); + setDataSource([]); + setLoading(false); + setAdd(false); + } + }, [assistData]); + + return ( + <> + { + // setMemberVis(false); + // reset(); + // }} + onOk={() => { + if (Number(assistNumber) == dataSource.length) { + let count = 0 + for (let i = 0, length = dataSource.length; i < length; i++) { + const item = dataSource[i]; + if (isEmpty(item.faceId)) { + count += 1; + } + } + if (count > 0) { + message.error(`请上传专家照片`); + return; + } + const params = { + juryId, + assistList: [...dataSource], + } + setLoading(true); + saveAssistPeople(params).then(res => { + if (res?.code == 200) { + message.success('保存成功!'); + onSubmit(); + } + }).finally(() => { + setLoading(false); + }) + } else { + message.error('外协人数不符合规定!'); + } + }} + onCancel={onCancel} + > + +
+

外协人员管理

+
+
+ 外协人员为在合规情况下可临时进入电子评标室人员,如视察领导等,请提前维护相关信息,避免无法进入电子评标室。 +
+ + + [ + + ]} + /> + + +
+ { setAdd(false) }} + visible={add} + getContainer={false} + style={{ position: 'absolute' }} + > +
+ + + + + + + + + + + + + + + + + + + + 要求本人清晰、免冠、正面彩色2寸头像照片,无逆光、无ps、无美颜,面部五官无遮挡,头像部约占照片高度的三分之二,照片保存格式为JPG格式,大小400k以下} + > + + + {/* + */} + + + + +
+
+
+ + ) +} + +export default OutsourcingManage; \ No newline at end of file diff --git a/src/pages/Tender/ProjectManager/JudgingPanelStoreIn/List/index.tsx b/src/pages/Tender/ProjectManager/JudgingPanelStoreIn/List/index.tsx new file mode 100644 index 0000000..68600de --- /dev/null +++ b/src/pages/Tender/ProjectManager/JudgingPanelStoreIn/List/index.tsx @@ -0,0 +1,1615 @@ +import React, { useEffect, useRef, useState } from 'react'; +import { Button, Checkbox, Col, Collapse, DatePicker, Drawer, Form, Input, message, Modal, Popconfirm, Row, Select, Spin, Upload, Image, InputNumber } from 'antd' +import ProTable, { ActionType, EditableProTable, ProColumns } from '@ant-design/pro-table'; +import tableProps from '@/utils/tableProps'; +import { getList, saveGroup, delOne, saveMember, changeEx, queryVoList, changeMember, applyFor, roomStatus, juryTem, rePassWord, getUserPhoto, unlockAccount, getCrotchListUsingGET, getSecs } from './service'; +import moment from 'moment'; +import { getDefId, getProId, getProMethod, getProOpenTenderForm, getSessionUserData } from '@/utils/session'; +import { getURLInformation, isEmpty } from '@/utils/CommonUtils'; +import './judgList.less'; +import '@/assets/xsy_style.less'; +import FileDown from '@/utils/Download'; +import { UploadOutlined } from '@ant-design/icons'; +import { btnAuthority } from '@/utils/authority'; +import RiskPrevention from '@/utils/RiskPrevention'; +import { sortBy } from 'lodash'; +const JudgingPanel: React.FC<{}> = () => { + const modalHeight = window.innerHeight * 96 / 100; + const proId = getProId(); + const roomType = getURLInformation('roomType'); + // const tailLayout = { wrapperCol: { offset: 8, span: 20 }, }; + 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 CheckboxGroup = Checkbox.Group; + // const { TabPane } = Tabs; + const actionRef = useRef(); + const [spin, spinSet] = useState(false); + const [loading, loadingSet] = useState(false); + const [sections, setSections] = useState([]); + const [sectionsVal, setSectionsVal] = useState([]); + const [modalVis, setModalVis] = useState(false);//新增评委会 + const [updateData, updateDataSet] = useState();//评委会modal数据 + const [memberVis, setMemberVis] = useState(false); + const [open, openSet] = useState(true);//评委会里是否有开启评标的评审室 true有开启的 false无 + const [allEnd, allEndSet] = useState(true);//评委会关联标段的评审室是否都关闭了 + const [disabled, disabledSet] = useState(true);//禁用 + const [checkSectionName, checkSectionNameSet] = useState('');//查看 关联标包显示 + const [showName, showNameSet] = useState({ zbr: '', bb: '', pb: '', });//字段名 + // const [manNum, manNumSet] = useState(5);//人数 + const [riskVisible, setRiskVisible] = useState(false);//风控弹窗 2021.9.7 zhoujianlong + const [riskData, setRiskData] = useState([]);//风控数据 2021.9.7 zhoujianlong + // const [userPhotoId, setUserPhotoId] = useState("");//电子评标室-录入外部专家-相片id 2022.8.29 zhoujianlong + const userData = getSessionUserData();//当前登录人用户信息 + + const [professionalMap, setProfessionalMap] = useState(); + //当前可编辑的行 + const [editableKeys, setEditableRowKeys] = useState([]); + const [tableData, setTableData] = useState([]); + function getShouName() { + const method = getProMethod(); + let showNameT: any = { zbr: '', bb: '', pb: '', }//相关标段 标书费 保证金 服务费 + // let num = 3; + if (method === 'procurement_mode_1' || method === 'procurement_mode_2') {//招标 + showNameT = { zbr: '招标人', bb: '标段', pb: '评标', }; + // num = 5; + } else if (method === 'procurement_mode_4') {//招募类 + showNameT = { zbr: '采购人', bb: '包件', pb: '评审', } + } else {//谈判类 + showNameT = { zbr: '采购人', bb: '采购包', pb: '评审', } + } + showNameSet(showNameT); + } + + //多选控制 + const [indeterminate, setIndeterminate] = useState(false); + const [checkAll, setCheckAll] = useState(false); + const [checkedList, setCheckedList] = useState(); + const [sectionCount, sectionCountSet] = useState(0);//控制获取标包 + + //创建评委会小组 + 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 columns: ProColumns[] = [ + { title: '序号', valueType: 'index', width: 50, }, + { title: `${showName.bb}名称`, dataIndex: 'sectionName', }, + { title: `直接录入数量`, dataIndex: 'representativeNumber', width: 120 }, + { 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 }); + actionRef.current?.reload(); + spinSet(false) + }} + okText="确定" + cancelText="取消" + > + + + + + ) + } else if (record.status == 1) {//已提交申请 + return ( + <>{returnCheck(record, true)} + ) + } else if (record.status == 3) { + return ( + <> + {returnCheck(record, true)} + + + ); + } else { + return (<>) + } + } + }, + ]; + function returnCheck(record: any, check: any) {//返回操作列查看、修改按钮 + return ( + + ) + } + const handleUpdate = async (record: any) => { + form.resetFields(); + const res = await queryVoList({ id: record.id }); + + + // 提取专业抽取列表 + const extractSpecialityList = res.data.extractSpecialityList || []; + // 设置表格数据 + let specList = extractSpecialityList.map((item: any, index: number) => ({ + ...item, + uid: item.id || String(index + Date.now()) // 确保每个条目有唯一 key + })) + res.data.extractSpecialityList = specList; + setTableData(specList); + // 设置 editableKeys,确保每一行都能编辑 + setEditableRowKeys(specList.map((item: any, index: number) => item.uid)); + // setEditableRowKeys(specList.map(item => item.uid)); + updateDataSet(res.data); + + //剔除代表 + let list = [...res.data.juryCategoryVOList]; + list.map((item: any, index: any) => { + if (item.category == 1) { + list.splice(index, 1); + } + }); + cqDataSet(list); + setModalVis(true); + sectionCountSet(sectionCount + 1); + // readOnlySet(check); + checkSectionNameSet(res.data.sectionName); + + }; + const handleMember = async (record: any) => { + form.resetFields(); + const res = await queryVoList({ id: record.id }); + await queryOpenStatus(record.id); + categorySet(res.data.juryCategoryVOList); + juryIdSet(record.id); + memberCountSet(memberCount + 1); + setMemberVis(true); + }; + + //删除 + 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('删除失败请重试!'); + actionRef.current?.reload(); + 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('提交失败请重试!'); + actionRef.current?.reload(); + return false; + } + }; + + //创建修改 标包方法 + const onChangeCheckBox = (checkedList: any[]) => { + // 获取当前选中的所有 section 对象 + const selectedSections = sections.filter((section: any) => + checkedList.includes(section.sectionId) + ); + + // 获取所有不同的 juryNumber 值 + const uniqueJuryNumbers = [...new Set(selectedSections.map((s: any) => s.juryNumber))]; + + if (uniqueJuryNumbers.length > 1) { + message.error('所选标段的评标委员会人数不一致,不能同时选择'); + return; // 阻止更新 + } + + setCheckedList(checkedList); + getEarliestTime(sections, checkedList); + setIndeterminate(!!checkedList.length && checkedList.length < sectionsVal.length); + setCheckAll(checkedList.length === sectionsVal.length); + }; + const onCheckAllChange = (e: { target: { checked: any; }; }) => { + + const uniqueJuryNumbers = [ + ...new Set(sections.map((s: any) => s.juryNumber)), + ]; + + if (e.target.checked && uniqueJuryNumbers.length > 1) { + message.error("存在不同评标委员会人数,不能全选"); + return; + } + setCheckedList(e.target.checked ? sectionsVal : []); + getEarliestTime(sections, e.target.checked ? sectionsVal : []); + setIndeterminate(false); + setCheckAll(e.target.checked); + }; + + + function disabledDate(current: any) {//日期选择 + return current && current < moment().startOf('day'); + } + + + const rule = (mes: any) => {//创建修改 规则 + return [ + { + required: true, + message: `请录入${mes}`, + }, + ] + } + //专家账号解锁 + 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(() => {//获取标包信息 + + let params = { tpId: proId, roomType: roomType }; + let checked: any = []; + if (updateData !== undefined && JSON.stringify(updateData) !== "{}") { + params['juryId'] = updateData.id; + updateData.juryRoomList.map((item: any) => { + checked.push(item.sectionId); + }); + setCheckedList(checked); + } else { + params['juryId'] = ''; + } + getShouName();//根据采购类型变名字 + modalVis == true ? getSecs({ ...params }).then((res) => { + let data = []; + let secVals = []; + if (res.success) { + secVals = res.data.map((item: any) => { return item.sectionId }) + data = res.data; + } + setSections(data); + setSectionsVal(secVals); + setIndeterminate(!!checked.length && checked.length < secVals.length); + setCheckAll(checked.length === secVals.length); + updateData && String(updateData?.reserveStatus) == "1" && getEarliestTime(data, checked);//初始化赋值数据 + }) : null; + + }, [sectionCount]); + + useEffect(() => {//给表单赋值 + 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, + extractSpecialityList: updateData != undefined ? updateData.extractSpecialityList : null, + }) + }, [updateData]); + + const group = () => {//评审小组modal + return ( + <> + { + setModalVis(false); + updateDataSet({}); + setTableData([]); + setCheckedList([]); + form.resetFields(); + }} + > + {tab1()} + + + ) + } + //人数校验 + function checkMan(count: number, expCon: any) { + let res = true; + const defId = getDefId();//16 + const method = getProMethod();//9 + const yushenType = getProOpenTenderForm(); + let manNumT = 5; + + if (method === 'procurement_mode_1' || method === 'procurement_mode_2') { + if (roomType == '1' && 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 + } + //添加抽取drawer + const formLayoutDrawer = { labelCol: { span: 8 }, wrapperCol: { span: 16 }, }; + const tailLayoutDrawer = { wrapperCol: { offset: 8, span: 20 }, }; + const [cqData, cqDataSet] = useState([]);//抽取表格,提交时需要 + // 在组件内定义函数 + const calculateExpertNumber = () => { + // 没有选中标段时直接返回,不清空 expertNumber 是为了兼容已有值的情况 + if (!checkedList || checkedList.length === 0) return; + + const selectedSections = sections.filter((section: any) => + checkedList.includes(section.sectionId) + ); + + const uniqueJuryNumbers = [...new Set(selectedSections.map((s: any) => s.juryNumber))]; + + if (uniqueJuryNumbers.length > 1) { + form.setFieldsValue({ expertNumber: undefined }); + message.error("所选标段评标委员会人数不一致"); + return; + } + + const juryNumber = parseInt(uniqueJuryNumbers[0]) || 0; + const repNumber = parseInt(form.getFieldValue('representativeNumber')) || 0; + + const expertNumber = Math.max(0, juryNumber - repNumber); + (expertNumber === 0) && setTableData([]); + form.getFieldValue('representativeNumber') && form.setFieldsValue({ expertNumber }); + }; + + const tab1 = () => {//cqtab1 + return ( + <> +

关联{showName.bb}

+
+ + + { return '1' } + }, + () => ({ + validator(rule, value,) { + let leg = 0; + checkedList != undefined ? leg = checkedList.length : leg = 0; + if (leg > 0) { + return Promise.resolve(); + } else { + message.error(`请选择${showName.bb}`) + return Promise.reject(`请选择${showName.bb}`); + } + }, + }), + ]} + > + { + disabled ? + {checkSectionName} + : <> + { + sections.length > 0 ? <> +
+ 全选 +
+
+ + + { + sections.map((item: any, index: any) => { + return ( + + {item.sectionName} + + 评标委员会人数: {item.juryNumber}人 + + + + ) + }) + } + + + + : 无可用{showName.bb} + } + + } +
+ +
+
+

评标时间和地点管理

+
+ + + + + + + + + + + + + +
+

专家申请基本信息

+
+ + + { + const value = e.target.value; + if (value && !checkedList?.length) { + form.resetFields(['representativeNumber']); + message.error("请先选择关联标段"); + return; + } + + // 继续触发计算 + form.setFieldsValue({ representativeNumber: value }); + calculateExpertNumber(); + }} + /> + + + + + {/* + + */} + +
+ + ) + } + //抽取专业-表格类型定义 + type DataSourceType = { + id?: string; + extractNumber: number; + specialityId?: string; + }; + const checkSpecialityUnique = () => { + let res = true; + const specialityIds = tableData.map(item => item.specialityId).filter(Boolean); + const unique = [...new Set(specialityIds)]; + if (specialityIds.length !== unique.length) { + res = false; + message.error('抽取专业名称不可重复选择'); + } + return res; + }; + const idToNameMap = Object.entries(professionalMap || {}).reduce((acc, [id, option]) => { + acc[id] = option.text; + return acc; + }, {} as Record); + const idToCodeMap = Object.entries(professionalMap || {}).reduce((acc, [id, option]) => { + acc[id] = option.text; + return acc; + }, {} as Record); + // 遍历表格数据并附加专业名称 + const enhancedData = tableData.map(item => { + const name = idToNameMap[item.specialityId] || ''; // 获取对应名称 + const code = idToCodeMap[item.specialityId] || ''; // 获取对应名称 + return { + ...item, + specialityName: name, // 添加专业名称字段 + specialityNo: code, + }; + }); + const renderFooter = () => {//评审小组footer + 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([]); + luruSet(0); + updateKeyMemSet(-1); + checkBoxsSet([]); + changeMemberIdSet(''); + setCheckedList([]); + 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 { + 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} +

取消原因: +