import React, { useEffect, useMemo, useState } from 'react'; import { Button, Card, Collapse, Form, Input, List, message, Popover, Select, Space, Spin, Typography } from "antd"; import ProTable from "@ant-design/pro-table"; import { getBidAssessmentResultList, getBidAssessmentResultsList, pushBidAssessmentResult, saveResult } from "./service" import CurrentTable from "./components/currentTable" import { getDefId, getProId, getProMethod } from "@/utils/session"; import { btnAuthority } from "@/utils/authority"; import { isEmpty } from '@/utils/CommonUtils'; const BidAssessmentResults: React.FC<{}> = (props) => { const [Refresh, setRefresh] = useState(0); const { Panel } = Collapse; const [ListData, setListData] = useState([]); const [assessRoomId, setAssessRoomId] = useState(); const [currentTable, setCurrentTable] = useState(false); const [spintype, setSpintype] = useState(false); //查询条件-包件名称 const [name, setName] = useState(''); //折叠面板 const [collapseActiveKeys, setCollapseActiveKeys] = useState(['0']); const FormItem = Form.Item; const { Option } = Select; const { Paragraph, Text } = Typography; const firstRvwResult = ['否', '是']; const [contractedMoney, contractedMoneySet] = useState('') const proID = getProId();//项目id let name1 = "中标"; let name2 = "评标"; let name3 = "标段"; let TpPackageName = ""; let type1 = false; let type2 = false; let type3 = false; let type4 = false; let type5 = false; let proDict = getProMethod(); let defId = getDefId(); if (proDict == "procurement_mode_1" || proDict == "procurement_mode_2") { TpPackageName = "招标"; name1 = "中标"; name2 = "评标"; name3 = "标段"; } else if (proDict == "procurement_mode_3") { TpPackageName = "比选"; name1 = "中选"; name2 = "评审"; name3 = "采购包"; } else if (proDict == "procurement_mode_5" || proDict == "procurement_mode_6" || proDict == "procurement_mode_9") { TpPackageName = "谈判"; name1 = "中选"; name2 = "评审"; name3 = "采购包"; } else if (proDict == "procurement_mode_4") { TpPackageName = "招募"; name1 = "中选"; name2 = "评审"; name3 = "包件"; type1 = true; type2 = true; type3 = true; type4 = true; } else if (proDict == "procurement_mode_7") { TpPackageName = "询价"; name1 = "中选"; name2 = "评审"; name3 = "采购包"; type3 = true; type4 = true; type5 = true; } useEffect(() => { setSpintype(true); /*projectType :2 评标 1 资审*/ getBidAssessmentResultsList({ "projectId": proID, "roomType": "2", "sectionName": name }).then(res => { if (res.code == 200) { setListData(res.data); } }).finally(() => { setSpintype(false); }) }, [proID, Refresh]) /*推送评标结果*/ const pushResult = (record: any) => { setSpintype(true); pushBidAssessmentResult(proID, record.sectionId, record.assesRoomId).then(res => { if (res.code == 200) { message.success('推送成功'); setRefresh(Refresh + 1); } }).finally(() => { setSpintype(false); }) } /*推送列表查看*/ const getResultList = (record: any) => { setAssessRoomId(record.assesRoomId); setCurrentTable(true); } //折叠面板change const onCollapseChange = (key: any) => { setCollapseActiveKeys(key); }; //确认评审结果ListRender封装 const ResultListRender = (props: { item: any, setSpintype: (value: boolean) => void, getResultList: (record: any) => void, ListData: any, pushResult: (record: any) => void }) => { const { item, setSpintype, getResultList, ListData, pushResult } = props; //单一来源简化 const [form] = Form.useForm(); //综合得分展开关闭 const [expandTotalScore, setExpandTotalScore] = useState(proDict == "procurement_mode_7" ? false : true); //单一简化 function returnInput(name: any, name2: any, val: any, must: boolean, pattern?: boolean, hid?: boolean) { let rule = [ { required: must }, { pattern: /^.{0,21}$/, message: '超长' } ]; pattern && rule.push({ pattern: /(^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d{1,4})?$)/, message: '请输入正确数值(最多4位小数)' }); return (
) } function returnSelect(name: any, val: any) { return (
) } //初审详审原因render const rvwResultRender = (field: any, reason: any) => { const content = (
{reason}
) return isEmpty(field) || field == '-' ? '-' : ( {firstRvwResult[field]} {field == 0 && 说明 } ) } return ( { //标段上的报价类型确认 1-% 0-元 let sectionQuot = item?.quotationMethodDict == 'quotation_method_2' || item?.quotationMethodDict == 'quotation_method_3' ? '1' : '0' const columns: any = [ { title: '排名', dataIndex: 'sort', valueType: 'text', width: 50, }, { title: '供应商名称', dataIndex: 'companyName', valueType: 'text', width: 120, }, { hideInTable: type1, title: proDict == 'procurement_mode_7' ? '报价总金额净价(元)' : sectionQuot == '1' ? '报价(%)' : '报价(元)', dataIndex: 'price', width: 100, render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnInput('price', '报价', record.price, true, true) } else { return record.price } } }, { hideInTable: type2, title: proDict == 'procurement_mode_7' ? '报价总金额含税价(元)' : sectionQuot == '1' ? '评审价(%)' : '评审价(元)', dataIndex: 'priceReview', width: 100, render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnInput('priceReview', '评审价', record.priceReview, true, true) } else { return record.priceReview } } }, { title: '商务分', dataIndex: 'businessScore', width: 60, hideInTable: expandTotalScore, render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnInput('businessScore', '商务分', record.businessScore, false, true) } else { return record.businessScore } } }, { title: '技术分', width: 60, dataIndex: 'technicalScore', hideInTable: expandTotalScore, render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnInput('technicalScore', '技术分', record.technicalScore, false, true) } else { return record.technicalScore } } }, { title: '服务分', width: 60, dataIndex: 'serviceScore', hideInTable: expandTotalScore, render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnInput('serviceScore', '服务分', record.serviceScore, false, true) } else { return record.serviceScore } } }, { title: '价格分', width: 60, dataIndex: 'priceScore', hideInTable: expandTotalScore, render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnInput('priceScore', '价格分', record.priceScore, false, true) } else { return record.priceScore } } }, { title: ( 综合得分 setExpandTotalScore(!expandTotalScore)} style={{ cursor: 'pointer', color: '#1890ff' }}>{expandTotalScore ? "展开" : "收起"} ), dataIndex: 'totalScore', width: 120, render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnInput('totalScore', '综合得分', record.totalScore, false, true) } else { return record.totalScore } } }, { hideInTable: defId === 'negotiation_single_simple', title: '是否通过初步评审', dataIndex: 'firstRvwResult', width: 100, render: (_: any, record: any) => rvwResultRender(_, record.firstRvwReason) }, { hideInTable: type5 || defId === 'negotiation_single_simple', title: '是否通过详审', dataIndex: 'detailRvwResult', width: 100, render: (_: any, record: any) => rvwResultRender(_, record.detailRvwReason) }, { hideInTable: type5 || defId === 'negotiation_single_simple', title: '应答是否有效', width: 80, dataIndex: 'answerValid', render: (_: any, record: any) => { return record.answerValid === 1 ? '是' : record.answerValid === 0 ? '否' : '-' } }, { title: '是否' + name1 + '候选人', dataIndex: 'winnerCandidate', width: 100, render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnSelect('winnerCandidate', record.winnerCandidate) } else { return record.winnerCandidate === 1 ? '是' : '否' } } }, { hideInTable: type5 || defId === 'negotiation_single_simple', title: '是否拟' + name1 + '人', width: 80, dataIndex: 'winnerBidder', render: (_: any, record: any) => { return record.winnerBidder === 1 ? '是' : record.winnerBidder === 0 ? '否' : '-' } }, { hideInTable: type3, title: '拟签约金额(不含增值税)(元)', width: 150, dataIndex: 'contractedMoney', render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return ( <> {returnInput('contractedMoney', '拟签约金额', record.contractedMoney, false, true)} {returnInput('id', '供应商id', record.id, false, false, true)} {returnInput('resultId', '结果id', record.resultId, false, false, true)} {returnInput('companyId', '公司id', record.companyId, false, false, true)} {returnInput('companyName', '公司名称', record.companyName, false, false, true)} ) } else { return record.contractedMoney } } }, { hideInTable: type4, title: '增值税金额(元)', width: 150, dataIndex: 'taxRatePrice', render: (_: any, record: any) => { if (defId === 'negotiation_single_simple' && record.pushStatus == "0") { return returnInput('taxRatePrice', '增值税金额', record.taxRatePrice, false, true) } else { return record.taxRatePrice } } }, ] return ( [ <> { defId === 'negotiation_single_simple' ? : } ]} pagination={{ defaultPageSize: 10, showSizeChanger: false, }} /> ) }} > ) } return ( <>
setName(event.target.value)} />
{ListData.map((item, index) => ( { setSpintype(value); }} getResultList={getResultList} ListData={ListData} pushResult={pushResult} /> ))} setCurrentTable(false)} />
) } export default BidAssessmentResults