diff --git a/config/BiXuan/router_bixuan.ts b/config/BiXuan/router_bixuan.ts index 40f61e8..9f712c7 100644 --- a/config/BiXuan/router_bixuan.ts +++ b/config/BiXuan/router_bixuan.ts @@ -10,16 +10,6 @@ export default [ path: '/ProjectLayout/ZBiXuan/Detailed', component: './ZBiXuan/EvaluationRoom/Config/FirstLimited/detailedBX.tsx' }, - {//预打分配置 - path: '/ProjectLayout/ZStoreIn/Detailed', - component: './ZBiXuan/EvaluationRoom/Config/FirstLimited/detailedStoreIn.tsx', - name: '配置', - }, - { - path: '/ProjectLayout/ZStoreIn/PreScore', - component: './Evaluation/BidDetailed/BidDetailedReview/preScore.tsx', - name: '预打分', - }, {//报价评审配置 path: '/ProjectLayout/offerEva', component: './ZBiXuan/EvaluationRoom/Config/Offer' diff --git a/src/pages/Evaluation/BidDetailed/BidDetailedReview/preScore.tsx b/src/pages/Evaluation/BidDetailed/BidDetailedReview/preScore.tsx deleted file mode 100644 index f4e79ed..0000000 --- a/src/pages/Evaluation/BidDetailed/BidDetailedReview/preScore.tsx +++ /dev/null @@ -1,1363 +0,0 @@ -import React, { useEffect, useState, useRef } from 'react'; -import { Button, Table, Tabs, Space, Progress, Radio, Input, Checkbox, Select, Modal, Pagination, Spin, Form, message, Upload, Tooltip } from 'antd'; -import { cloneDeep } from 'lodash'; -import { getPreScoreScoreDetail, submitDetail, updateJudgesStatus, findPriceScoreList, getEval, getFile, calculationPriceScore, saveOffer, getPage, getProjectById, getOfferUrl, getPreScoreTabList, getPreScoreRegister, getPreScoreSubmitDetail, getPreScoreSaveOffer } from './service'; -import '@/assets/ld_style.less' -import FirstTrialTableDetailed from '../BidDetailedManager/module/FirstTrialTableDetailed'; -import { getSessionUserData, getRoomId, getUserToken, getProMethod, getProId, getSectionQuot, getSessionRoleData } from '@/utils/session'; -import FileDown from '@/utils/Download'; -import { getURLInformation } from '@/utils/CommonUtils'; -import { btnAuthority } from '@/utils/authority'; -import { getQueryInfo } from '@/pages/ZTanPan/RoomConfig/View/Manager/BidResponseOffer/service'; - -const { TabPane } = Tabs; -const { Option } = Select; -const { TextArea } = Input; -const CheckboxGroup = Checkbox.Group; - -let assessRoomId: any, reviewTurnId: any, reviewType: any, bidEvalId: any -let bidEvalDetailDTOList: any = []; -let totalQualified: any = []; -let idList: any = []; - -let disabledOffer: any = false; -let disabled: any = false; -let endProgress: any = false; - -const PreScore: React.FC<{}> = () => { - const [detailVisible, setDetailVisible] = useState(false); // 详审记录表 - const [tabList, setTabList] = useState([]); // tab - const [typeId, setTypeId] = useState(); // tabId - const [tabListName, setTabListName] = useState(); // tab名称 - const [typeCategory, setTypeCategory] = useState(); // tab类型 - const [process, setProcess] = useState(); // 我的进度 - const [totalSupplier, setTotalSupplier] = useState([]); // 总供应商列头 - const [dataSource, setDataSource] = useState([]); // 详审项配置 - const [supplierColumns, setSupplierColumns] = useState([]); // 当前显示供应商列头 - const [current, setCurrent] = useState(1); // 当前页码 - const [total, setTotal] = useState(1); // 共多少数据 - // const [bidEvalDetailDTOList, setBidEvalDetailDTOList] = useState([]); // 提交数组 - const [subId, setSubId] = useState(); // 提交id - const [spinVisible, setSpinVisible] = useState(false); // 加载中 - const [remarkVisible, setRemarkVisible] = useState(false); // 备注弹窗 - const [remarksVal, setRemarksVal] = useState(); // 备注 - const [remarkForm] = Form.useForm(); // 备注表单 - const [isDisabled, setIsDisabled] = useState(false); // 是否可编辑 - const [offerSource, setOfferSource] = useState([]); // 报价总数据 - const [offerTotalSource, setOfferTotalSource] = useState([]); // 报价数据 - const [offerCurrent, setOfferCurrent] = useState(1); // 当前页码 - const [offerTotal, setOfferTotal] = useState(1); // 共多少数据 - const [isDisabledOffer, setIsDisabledOffer] = useState(false); // 报价是否可编辑 - const [dateLength, setDateLength] = useState([]); // tab签长度 - - const [automaticOffer, setAutomaticOffer] = useState('2'); // 判断是否是自动报价 - const [tit1, setTit1] = useState(); // 自动报价规则1 - const [tit2, setTit2] = useState(); // 自动报价规则2 - const [tit3, setTit3] = useState(); // 自动报价规则3 - const [smallPrice, setSmallPrice] = useState(); // 最小值 - const [bigPrice, setBigPrice] = useState(); // 最小值 - const [averagePrice, setAveragePrice] = useState(); // 平均值 - const [basePrice, setBasePrice] = useState(); - const [priceList, setPriceList] = useState([]); // 自动报价复选框选中数组 - const [offerDataList, setOfferDataList] = useState([]); // 自动报价复选框选中数组 - const [selectedRowKeys, setSelectedRowKeys] = useState([]); - const [offer, setOffer] = useState(false); - const [type, setType] = useState(); // 评标标准类型 - const [inputPrice, setInputPrice] = useState(''); // 评标标准5是否有值 - const proMethod = getProMethod();//获取采购方式 - const [hightSorce, setHightSorce] = useState(''); // 自动报价最高分 - const [count, setCount] = useState(0); - - const [editable, setEditable] = useState(false); // 是否可编辑 - const editableRef = useRef(false); - - const saveBtnVisible = !btnAuthority(['ebtp-agency-project-manager']); - - const modalHeight = (innerHeight * 96) / 100; - //获取标段的标价类型 1-百分比 0-元 - const sectionQuot = getSectionQuot(); - //当前登录人角色 - const roleCode = getSessionRoleData()?.roleCode; - let showNameT: any = { tbr: '', pb: '', tb: '' }//投标人供应商 - if (proMethod === 'procurement_mode_1' || proMethod === 'procurement_mode_2') {//招标 - showNameT = { tbr: '投标人', pb: '评标', tb: '投标' }; - } else { - showNameT = { tbr: '供应商', pb: '评审', tb: '应答' } - } - - //祥审记录表 - const [firstTrialTableDetailedTable, setFirstTrialTableDetailedTable] = useState(); - const [isEndProgress, setIsEndProgress] = useState(false); // 是否可编辑 - - const columns: any[] = [ // 详审表头 - { - title: '类别名称', - dataIndex: 'categoryName', - render: (_: any, record: any, index: number) => { - return { - children: _, - props: { - rowSpan: record.rowSpan, - } - } - } - }, - { - title: '详审项&评分标准', - dataIndex: 'scoreItem', - render: (_: any, record: any) => { - return ( - <> -
{record.scoreItem}({record.highScore})
-
{record.rvwStandard}
- - ) - } - } - ]; - - const createNewArr = (data: any[], fieldName: string) => { - return data.reduce((result: any[], item: any) => { - //首先将name字段作为新数组result取出 - if (result.indexOf(item[fieldName]) < 0) { - result.push(item[fieldName]); - } - return result - }, []).reduce((result: any[], name: any) => { - //将name相同的数据作为新数组取出,并在其内部添加新字段**rowSpan** - const children = data.filter(item => item[fieldName] === name); - result = result.concat( - children.map((item: any, index: number) => ({ - ...item, - rowSpan: index === 0 ? children.length : 0,//将第一行数据添加rowSpan字段 - })) - ) - return result; - }, []) - } - - const offerColumns: any[] = [ // 报价表头 - { - title: '排序', - render: (text: any, record: any, index: any) => `${index + 1}` - }, - { - title: showNameT.tbr, - dataIndex: 'supplierRegisterName', - }, - { - title: proMethod == 'procurement_mode_7' ? '报价总金额净价(元)' : sectionQuot == '1' ? '报价(%)' : '报价(元)', - dataIndex: 'bidContent', - render: (text: any, record: any, index: any) => { - if (record.bidContent && (record.bidContent != null || record.bidContent != undefined || record.bidContent != '')) { - return <>{record.bidContent} - } else { - return <>- - } - } - }, - { - title: proMethod == 'procurement_mode_7' ? '报价总金额含税价(元)' : sectionQuot == '1' ? '评审价(%)' : '评审价(元)', - dataIndex: 'evaluatingContent', - render: (text: any, record: any, index: any) => { - if (record.evaluatingContent && (record.evaluatingContent != null || record.evaluatingContent != undefined || record.evaluatingContent != '')) { - return <>{record.evaluatingContent} - } else { - return <>- - } - } - }, - { - title: '最高分值', - dataIndex: 'highScore', - }, - { - title: proMethod == 'procurement_mode_7' ? '查看报价详情' : '查看报价文件', - render: (text: any, record: any, index: any) => { - if (proMethod == 'procurement_mode_7') { - return - } else { - if (record.tdocId) { - return ( - // - - ) - } else { - return ( - <>未报价 - ) - } - } - } - }, - { - title: '报价分录入', - render: (text: any, record: any, index: any) => { - if (record.judgesStatus != '1') { - disabledOffer = true - } - if (record.priceScore) { - return ( - offerValueChange(e, record)} - onChange={e => offerSourceChange(e, record)} - value={record.priceScore} style={{ width: 160 }} /> - ) - } else { - return ( - offerSourceChange(e, record)} value={record.priceScore} style={{ width: 160 }} /> - ) - } - } - } - ] - - const columnsOffer: any[] = [ // 自动报价表头 - { - title: '报价排名', - render: (text: any, record: any, index: any) => `${index + 1}` - }, - { - title: showNameT.tbr + '名称', - dataIndex: 'supplierRegisterName', - }, - { - title: showNameT.tbr + '报价(元)', - dataIndex: 'evaluatingContent', - sorter: { - compare: (a: any, b: any) => a.evaluatingContent - b.evaluatingContent, - multiple: 2, - }, - }, - { - title: '报价分', - dataIndex: 'detailValue', - }, - { - title: '人工复合得分', - dataIndex: 'priceScore', - width: '300px', - render: (text: any, record: any, index: any) => { - if (record.priceScore != null) { - return ( -
- offerChange(e, record)} - onChange={e => offerAutoChange(e, record)} - value={record.priceScore} /> -
- ) - } - } - }, - ] - - const saveSorce = () => { // 保存 - if (editableRef.current && bidEvalDetailDTOList.length > 0) { - setSpinVisible(true) - let date = { - id: subId, - // categoryId: typeId, - category: typeCategory, - bidEvalDetailDTOList: bidEvalDetailDTOList, - assessRoomId: assessRoomId, - reviewTurnId: reviewTurnId, - } - getPreScoreSubmitDetail({ ...date }).then((res) => { - if (res.code == 200) { - bidEvalDetailDTOList = [] - if (tabListName == '报价') { - offerList(typeCategory) - } else { - ratingData(typeCategory) - } - } else { - bidEvalDetailDTOList = [] - if (tabListName == '报价') { - offerList(typeCategory) - } else { - ratingData(typeCategory) - } - } - }).finally(() => { - setSpinVisible(false) - bidEvalDetailDTOList = [] - }) - } - } - - const tabSaveSorce = () => { // tab保存 - if (editableRef.current && bidEvalDetailDTOList.length > 0) { - setSpinVisible(true) - let date = { - id: subId, - category: typeCategory, - bidEvalDetailDTOList: bidEvalDetailDTOList, - assessRoomId: assessRoomId, - reviewTurnId: reviewTurnId, - } - getPreScoreSubmitDetail({ ...date }).then((res) => { - if (res.code == 200) { - bidEvalDetailDTOList = [] - } else { - bidEvalDetailDTOList = [] - } - }).finally(() => { - setSpinVisible(false) - bidEvalDetailDTOList = [] - }) - } - } - - const saveOfferSorce = () => { // 自动报价保存 - if (!editableRef.current) return; - offerDataList.map((item: any) => { - bidEvalDetailDTOList.push({ 'categoryId': typeId, id: item.id, 'supplierRegisterId': item.supplierRegisterId, 'detailId': item.detailId, 'resultValue': item.priceScore, 'detailValue': item.detailValue, 'chooseStatus': item.chooseStatus ? item.chooseStatus : '0' }) - }) - let date = { - id: subId, - category: typeCategory, - reviewTurnId: reviewTurnId, - assessRoomId: assessRoomId, - bidEvalCalculation: { - lowPrice: smallPrice, - highPrice: bigPrice, - avgPrice: averagePrice, - basePrice: basePrice - }, - bidEvalDetailDTOList: bidEvalDetailDTOList - } - getPreScoreSaveOffer({ ...date }).then((res) => { - if (res.code == 200) { - bidEvalDetailDTOList = [] - offerList(typeCategory) - } - }) - } - - const getTabId = (key: any) => { // tab切换获取当前tab的key - setTypeId(tabList[key].id) - setTypeCategory(tabList[key].category) - setTabListName(tabList[key].name) - if (bidEvalDetailDTOList.length > 0) { - tabSaveSorce() - bidEvalDetailDTOList = [] - } - if (tabList[key].name == '报价') { - offerList(tabList[key].category) - } else { - changePagination(1, tabList[key].category, totalSupplier) - } - } - - const offerList = (category: any) => { // 报价数据 - setSpinVisible(true) - let date = { - bidEvalId: bidEvalId, - reviewType: reviewType, - reviewTurnId: reviewTurnId, - category: category, - } - findPriceScoreList({ ...date }).then((res) => { - if (res.code == 200) { - setSpinVisible(false) - setTypeId(res.data.categoryId) // 设置类别id - setTypeCategory(res.data.category) // 设置类别 - if (res.data.judgesStatus != '1') { - disabledOffer = true - setIsDisabledOffer(true) - } else { - disabledOffer = false - setIsDisabledOffer(false) - } - setSubId(res.data.id) - res.data.priceScoreMap.dataList.map((item: any) => { - item.highScore = res.data.priceScoreMap.priceConfig.highScore - item.judgesStatus = res.data.judgesStatus - }) - - setAutomaticOffer(res.data.priceScoreMap.priceConfig.scoreMethod) - if (res.data.priceScoreMap.priceConfig.scoreMethod == '3') { - setInputPrice(res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice) - setOffer(true) // 自动报价 - let selIdList: any = []; - res.data.priceScoreMap.dataList.map((item: any) => { - if (item.chooseStatus == 1) { - selIdList.push(item.supplierRegisterId) - } - }) - // idList = selIdList - setSelectedRowKeys(selIdList) - setOfferDataList(res.data.priceScoreMap.dataList) - if (res?.data?.priceScoreMap?.bidEvalCalculation != null) { - setSmallPrice(res?.data?.priceScoreMap?.bidEvalCalculation?.lowPrice) - setBigPrice(res?.data?.priceScoreMap?.bidEvalCalculation?.highPrice) - setAveragePrice(res?.data?.priceScoreMap?.bidEvalCalculation?.avgPrice) - setBasePrice(res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice) - } - // 有效报价 - if (res.data.priceScoreMap.priceConfig.effectiveType == '1') { - setTit1('全部报价') - } else if (res.data.priceScoreMap.priceConfig.effectiveType == '2') { - setTit1('去掉最高'+res.data.priceScoreMap.priceConfig.removeMaxNumber + '家 和 最低' + res.data.priceScoreMap.priceConfig.removeMinNumber + '家的报价') - } else if (res.data.priceScoreMap.priceConfig.effectiveType == '3') { - setTit1('去掉最两家高和最低各一家后的报价') - } else if (res.data.priceScoreMap.priceConfig.effectiveType == '4') { - setTit1('去掉最低一家后的报价') - } else if (res.data.priceScoreMap.priceConfig.effectiveType == '5') { - setTit1('去掉最高一家后的报价') - } else if (res.data.priceScoreMap.priceConfig.effectiveType == '6') { - setTit1(res.data.priceScoreMap.priceConfig.includeHighPrice + '元(包含) - ' + res.data.priceScoreMap.priceConfig.includeLowPrice + '元(不包含)') - } else if (res.data.priceScoreMap.priceConfig.effectiveType == '7') { - setTit1(`${showNameT.pb}专家手动勾选`) - } - // 报价分 - if (res.data.priceScoreMap.priceConfig.priceType == '1') { - setTit3(
当报价大于等于基准价时:
-
总分-(报价-基准价)/基准价*{res.data.priceScoreMap.priceConfig.priceMultiplier}最低分:{res.data.priceScoreMap.priceConfig.lowScore}
-
当报价小于基准价时:
-
总分-(基准价-报价)/基准价*{res.data.priceScoreMap.priceConfig.priceMultiplierSecond}最低分:{res.data.priceScoreMap.priceConfig.lowScoreSecond}
-
) - } else if (res.data.priceScoreMap.priceConfig.priceType == '2') { - setTit3(
当报价大于等于基准价时:
-
总分*(基准价/报价)最低分:${res.data.priceScoreMap.priceConfig.lowScore}
-
当报价小于基准价时:
-
总分*(报价/基准价)最低分:${res.data.priceScoreMap.priceConfig.lowScoreSecond}
-
) - } else if (res.data.priceScoreMap.priceConfig.priceType == '3') { - setTit3(
-
总分-(报价-最低报价)/平均报价*{res.data.priceScoreMap.priceConfig.priceMultiplier}
-
) - } else if (res.data.priceScoreMap.priceConfig.priceType == '4') { - setTit3(
-
总分-(报价-最低报价)/最高报价*{res.data.priceScoreMap.priceConfig.priceMultiplier}
-
) - } else if (res.data.priceScoreMap.priceConfig.priceType == '5') { - setTit3(
-
总分-(报价-最低报价)/(最高报价-最低报价)*{res.data.priceScoreMap.priceConfig.priceMultiplier}
-
) - } - // 基准价 - if (res.data.priceScoreMap.priceConfig.baseType == '0') { - if (res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice == undefined) { - setTit2('平均报价=' + '(元)') - } else { - setTit2('平均报价=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } - } else if (res.data.priceScoreMap.priceConfig.baseType == '1') { - if (res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice == undefined) { - setTit2('最低报价=' + '(元)') - } else { - setTit2('最低报价=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } - } else if (res.data.priceScoreMap.priceConfig.baseType == '3') { - if (res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice == undefined) { - setTit2('平均报价*' + res.data.priceScoreMap.priceConfig.avgPriceMultiplier + '=' + '(元)') - } else { - setTit2('平均报价*' + res.data.priceScoreMap.priceConfig.avgPriceMultiplier + '=' + res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice + '(元)') - } - } else if (res.data.priceScoreMap.priceConfig.baseType == '4') { - if (res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice == undefined) { - setTit2('(平均报价+最低报价)/2=' + '(元)') - } else { - setTit2('(平均报价+最低报价)/2=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } - } else if (res.data.priceScoreMap.priceConfig.baseType == '5') { - if (res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice == undefined) { - setType('手动输入') - setTit2(
changeInput(e)} style={{ width: 200, }} />
) - } else { - setType('手动输入') - setTit2(
changeInput(e)} style={{ width: 200, }} />
) - } - } else if (res.data.priceScoreMap.priceConfig.baseType == '6') { - if (res?.data?.priceScoreMap?.bidEvalCalculation?.basePrice == undefined) { - setTit2('不设基准价=' + '(元)') - } else { - setTit2('不设基准价=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } - } - } - res.data.priceScoreMap.dataList.map((item: any) => { - item.categoryId = res.data.categoryId - }) - setOfferTotalSource(res.data.priceScoreMap.dataList) // 报价总数据 - setOfferTotal(res.data.priceScoreMap.dataList.length) // 分页 - changeOffer(1, category, res.data.priceScoreMap.dataList) // 分页数据 - } else { - setSpinVisible(false) - } - }).finally(() => { - setSpinVisible(false) - }) - } - - const onSelectChange = (selectedRowKeys: any, selectedRows: any) => { - setSelectedRowKeys([...selectedRowKeys]) - setPriceList(selectedRows) - } - - const setQuotation = () => { // 自动报价选中供应商确定 - if (type == '手动输入' && inputPrice != '') { - makeSubmit() - } else if (type == '手动输入' && inputPrice == '') { - message.warn('请输入确定基准价!') - } else { - makeSubmit() - } - } - - const makeSubmit = () => { - let supplierIds: any = [] - priceList.map((item: any) => { - supplierIds.push(item.supplierRegisterId) - }) - let date = { - bidEvalId: bidEvalId, - category: typeCategory, - reviewTurnId: reviewTurnId, - reviewType: "2", - basePrice: inputPrice, - supplierRegisterIds: supplierIds - } - calculationPriceScore({ ...date }).then((res) => { - if (res.code == 200) { - setOfferDataList(res.data.priceScoreMap.dataList) - setSmallPrice(res.data.priceScoreMap.bidEvalCalculation.lowPrice) - setBigPrice(res.data.priceScoreMap.bidEvalCalculation.highPrice) - setAveragePrice(res.data.priceScoreMap.bidEvalCalculation.avgPrice) - setBasePrice(res.data.priceScoreMap.bidEvalCalculation.basePrice) - if (res.data.priceScoreMap.priceConfig.baseType == '0') { - setTit2('平均报价=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } else if (res.data.priceScoreMap.priceConfig.baseType == '1') { - setTit2('最低报价=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } else if (res.data.priceScoreMap.priceConfig.baseType == '3') { - setTit2('平均报价*' + res.data.priceScoreMap.priceConfig.avgPriceMultiplier + '=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } else if (res.data.priceScoreMap.priceConfig.baseType == '4') { - setTit2('(平均报价+最低报价)/2=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } else if (res.data.priceScoreMap.priceConfig.baseType == '5') { - setType('手动输入') - setTit2(
changeInput(e)} style={{ width: 200, }} />
) - } else if (res.data.priceScoreMap.priceConfig.baseType == '6') { - setTit2('不设基准价=' + res.data.priceScoreMap.bidEvalCalculation.basePrice + '(元)') - } - } - }) - } - - const changeInput = (e: any) => { - setInputPrice(e.target.value) - } - - const offerAutoChange = (e: any, val: any) => { // 自动报价分数修改 - let targetVal = e.target.value - let inputNum = /^(\-|\+?)\d{0,4}(\.\d{0,5})?$/ - if (inputNum.test(targetVal)) { - if (Number(targetVal) > hightSorce) { - message.error('输入分值不可大于最高分值!') - targetVal = hightSorce - } - } else { - message.error('请输入正确的分值!') - targetVal = targetVal.substring(0, targetVal.length - 1) - } - offerDataList.map((item: any) => { - if (item.supplierRegisterId == val.supplierRegisterId && item.detailId == val.detailId) { - item.priceScore = targetVal - } - }) - setOfferDataList([...offerDataList]) - } - - const offerSourceChange = (e: any, val: any) => { // 报价分数修改 - let targetVal = e.target.value - let inputNum = /^(\-|\+?)\d{0,4}(\.\d{0,5})?$/ - if (inputNum.test(targetVal)) { - if (Number(targetVal) > val.highScore) { - message.error('输入分值不可大于最高分值!') - targetVal = val.highScore - } - } else { - message.error('请输入正确的分值!') - targetVal = targetVal.substring(0, targetVal.length - 1) - } - offerSource.map((item: any) => { - if (item.supplierRegisterId == val.supplierRegisterId && item.detailId == val.detailId) { - item.priceScore = targetVal - } - }) - let x = false; - bidEvalDetailDTOList.map((item: any) => { - if (item.supplierRegisterId == val.supplierRegisterId && item.detailId == val.detailId) { - item.resultValue = targetVal - x = true - } - }) - if (!x) { - if (val.id) { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'resultValue': targetVal, 'id': val.id, 'supplierRegisterId': val.supplierRegisterId, 'detailId': val.detailId }); - } else { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'resultValue': targetVal, 'id': '', 'supplierRegisterId': val.supplierRegisterId, 'detailId': val.detailId }); - } - } - setOfferSource([...offerSource]) - } - - const changeOffer = (page: any, category: any, totalSource: any) => { // 报价数据分页 - if (bidEvalDetailDTOList.length > 0) { - saveSorce() // 保存 - } - setOfferCurrent(page) - let currentDate = (page - 1) * 10 - setOfferSource(totalSource.slice(currentDate, currentDate + 10)) - } - - const getRemark = (val: any, id: any) => { // 备注 - if (val.remarks) { - remarkForm.setFieldsValue({ remarks: val.remarks }) - } else { - remarkForm.setFieldsValue({ remarks: '' }) - } - if (val.detailId) { - setRemarksVal({ 'categoryId': val.categoryId, 'id': val.id, 'supplierRegisterId': id, 'detailId': val.detailId, 'resultValue': val.resultValue, 'remarks': val.remarks }) - } else { - setRemarksVal({ 'categoryId': val.categoryId, 'id': '', 'supplierRegisterId': id, 'detailId': val.id, 'resultValue': '', 'remarks': '' }) - } - setRemarkVisible(true) - } - - const closeRemarks = () => { // 关闭备注 - if (editable) { - let x = false; - bidEvalDetailDTOList.map((item: any) => { - if (item.supplierRegisterId == remarksVal.supplierRegisterId && item.detailId == remarksVal.detailId) { - item.remarks = remarkForm.getFieldsValue().remarks - dataSource.map((item: any) => { - if (remarksVal.detailId == item.id) { - item.scoreMap[remarksVal.supplierRegisterId].remarks = remarkForm.getFieldsValue().remarks - } - }) - x = true - } - }) - if (!x) { - dataSource.map((item: any) => { - if (remarksVal.detailId) { - if (remarksVal.detailId == item.id && item.scoreMap && item.scoreMap[remarksVal.supplierRegisterId] && item.scoreMap[remarksVal.supplierRegisterId].remarks != remarkForm.getFieldsValue().remarks) { - bidEvalDetailDTOList.push({ 'categoryId': remarksVal.categoryId, 'id': remarksVal.id, 'supplierRegisterId': remarksVal.supplierRegisterId, 'detailId': remarksVal.detailId, 'resultValue': remarksVal.resultValue, 'remarks': remarkForm.getFieldsValue().remarks }); - item.scoreMap[remarksVal.supplierRegisterId].remarks = remarkForm.getFieldsValue().remarks - } else if (remarksVal.detailId == item.id && remarksVal.id == '') { - bidEvalDetailDTOList.push({ 'categoryId': remarksVal.categoryId, 'id': remarksVal.id, 'supplierRegisterId': remarksVal.supplierRegisterId, 'detailId': remarksVal.detailId, 'resultValue': remarksVal.resultValue, 'remarks': remarkForm.getFieldsValue().remarks }); - if (item.scoreMap == null) { - item.scoreMap = [] - } - item.scoreMap[remarksVal.supplierRegisterId] = { 'categoryId': remarksVal.categoryId, 'id': '', 'supplierRegisterId': remarksVal.supplierRegisterId, 'detailId': remarksVal.detailId, 'resultValue': '', 'remarks': remarkForm.getFieldsValue().remarks } - } else if (remarksVal.detailId == item.id) { - bidEvalDetailDTOList.push({ 'categoryId': remarksVal.categoryId, 'id': remarksVal.id, 'supplierRegisterId': remarksVal.supplierRegisterId, 'detailId': remarksVal.detailId, 'resultValue': remarksVal.resultValue, 'remarks': remarkForm.getFieldsValue().remarks }); - item.scoreMap[remarksVal.supplierRegisterId].remarks = remarkForm.getFieldsValue().remarks - } - } else { - if (remarkForm.getFieldsValue().remarks != '') { - bidEvalDetailDTOList.push({ 'categoryId': remarksVal.categoryId, 'id': '', 'supplierRegisterId': remarksVal.supplierRegisterId, 'detailId': remarksVal.detailId, 'resultValue': remarksVal.resultValue, 'remarks': remarkForm.getFieldsValue().remarks }); - item.scoreMap[remarksVal.supplierRegisterId] = { 'remarks': remarkForm.getFieldsValue().remarks } - } - } - }) - setDataSource([...dataSource]) - } - } - setRemarkVisible(false) - } - - const supplierTab = (category: any) => { // 供应商列头接口 - let date = { - assessRoomId: assessRoomId, - reviewTurnId: reviewTurnId, - reviewType: "2" - } - getPreScoreRegister({ ...date }).then((res) => { - if (res.code == 200) { - setTotal(res.data.length) - setTotalSupplier(res.data) - changePagination(1, category, res.data) - getFirstTrialTableDetailed(res.data, date); - } - }) - } - - let supplierId: any = [] // 供应商数组id - const changePagination = (page: any, category: any, totalSupplierColumns: any) => { // 供应商列头 - if (bidEvalDetailDTOList.length > 0) { - saveSorce() // 保存 - } - setCurrent(page) - let currentDate = (page - 1) * 3 - let newColumns = cloneDeep(columns); - - totalSupplierColumns.slice(currentDate, currentDate + 3).map((item: any) => { - supplierId.push(item.supplierRegisterId) - newColumns.push({ - title: item.supplierRegisterName, - dataIndex: item.supplierRegisterId, - editable: true, - render: (text: any, record: any) => { - if (record.scoreMethod == '0') { // 单选 - const radioOptions: any[] = []; - record.standardList.map((item: any) => { - radioOptions.push({ label: item.standardName + '(' + item.standardDetailScore + '分)', value: item.standardDetailScore + '-' + item.id }) - }) - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { - return ( -
- onChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId)} - />
- -
- ) - } else { - return ( -
- onChange(e, record, item.supplierRegisterId)} - />
- -
- ) - } - } else if (record.scoreMethod == '1') { // 多选 - const checkboxOptions: any[] = []; - record.standardList.map((item: any) => { - checkboxOptions.push({ label: item.standardName + '(' + item.standardDetailScore + '分)', value: item.standardDetailScore + '-' + item.id }) - }) - if (record?.scoreMap && record?.scoreMap[item.supplierRegisterId] && (record?.scoreMap[item.supplierRegisterId]?.standardId || record?.scoreMap[item.supplierRegisterId]?.id)) { - let defaultArr = record.scoreMap[item.supplierRegisterId].standardId.split(",") - let defaultValue: any = [] - record.standardList.map((item: any) => { - defaultArr.map((val: any) => { - if (item.id == val) { - defaultValue.push(item.standardDetailScore + '-' + item.id) - } - }) - }) - return ( -
- checkChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId)} - />
- -
- ) - } else { - return ( -
- checkChange(e, record, item.supplierRegisterId)} - />
- -
- ) - } - } else if (record.scoreMethod == '2') { // 人工 - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { - return ( -
- 评分区间:{record.lowScore}分~{record.highScore}分} placement="topLeft"> - inputChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId, record.highScore, record.lowScore)} - /> - -
- -
- ) - } else { - return ( -
- 评分区间:{record.lowScore}分~{record.highScore}分} placement="topLeft"> - inputChange(e, record, item.supplierRegisterId, record.highScore, record.lowScore)} style={{ width: '50%' }} /> - -
- -
- ) - } - } else if (record.scoreMethod == '4') { // 步长 - let optionLength = record.highScore / record.lowScore - let optionArr: any = [] - for (let i = 1; i <= optionLength; i++) { - optionArr.push(record.lowScore * i) - } - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { - return ( -
-
- -
- ) - } else { - return ( -
-
- -
- ) - } - } - }, - }) - }) - setSupplierColumns([...newColumns]) - ratingData(category) - } - - - - //询价项目- 报价 -查看报价详情 - const lookFileDetails = async (record: any) => { - const turnId = getURLInformation("turnId") - await getPage(turnId).then(async res => { - if (res?.code == 200 && res?.success == true) { - const data = res?.data - let offerId = '' - if (data?.length > 0) { - data.forEach((e: any) => { - if (e.id == record?.supplierRegisterId) { - offerId = e.offerOrderNo - } - }); - } - await getProjectById(getProId()).then(response => { - if (response?.code == 200 && response?.success == true) { - const data = response?.data - // window.open(`${REACT_APP_XUNJIA_REDIRECT}/inquiryoffer/ztbViewOffer.do?inquiry_no=${resData?.ebpProjectNumber}&offer_no=${offerId}`) - const page = `quote-ztbIndex&inqueryNo=${data?.ebpProjectNumber}&offNo=${record?.offerOrderNo}`; - const userId = roleCode == "ebtp-supplier" ? record.bidUserId : REACT_APP_XUNJIA_UID; - getOfferUrl({ userId, page }).then(response => { - if (response?.code == 200) { - window.open(response?.data); - } - }) - } - }) - } - }) - } - - const ratingData = async (category: any) => { // 评分数据 - if (!category) return; - setSpinVisible(true) - totalQualified = [] - let query = { - reviewTurnId: reviewTurnId, - reviewType: "2", - assessRoomId: assessRoomId, - category: category, - supplierRegisterIds: supplierId - } - await getPreScoreScoreDetail({ ...query }).then((res) => { // 评分数据 - if (res.code == 200) { - setTypeId(res.data.categoryId) // 设置类别id - setTypeCategory(res.data.category) // 设置类别 - setSpinVisible(false) - if (res.data.judgesStatus != '1') { - disabled = true - setIsDisabled(true) - } else { - disabled = false - setIsDisabled(false) - } - setSubId(res.data.id) - // setDataSource(res.data.detailList) - // totalQualified = res.data.detailList - setDataSource(createNewArr(res.data.detailList, 'categoryName')) - totalQualified = createNewArr(res.data.detailList, 'categoryName') - } else { - setSpinVisible(false) - } - }).finally(() => { - setSpinVisible(false) - }) - } - - const onChange = (e: any, val: any, id: any) => { // 单选框操作 - let detailValue = e.target.value.split("-")[0] - let standardId = e.target.value.split("-")[1] - totalQualified.map((item: any) => { - if (val.detailId) { - if (val.detailId == item.id) { - for (let i = 0; i < supplierId.length; i++) { - if (id == supplierId[i]) { - item.scoreMap[supplierId[i]].resultValue = detailValue - item.scoreMap[supplierId[i]].detailValue = detailValue - item.scoreMap[supplierId[i]].standardId = standardId - } - } - } - } else { - if (val.id == item.id) { - for (let i = 0; i < supplierId.length; i++) { - if (id == supplierId[i]) { - if (item.scoreMap == null) { - item.scoreMap = [] - } - item.scoreMap[supplierId[i]] = { 'categoryId': val.categoryId, 'detailValue': detailValue, 'resultValue': detailValue, 'standardId': standardId, 'id': '', 'supplierRegisterId': supplierId[i], 'detailId': val.id, 'remarks': '' } - } - } - } - } - }) - let x = false; - if (val.detailId) { - bidEvalDetailDTOList.map((item: any) => { - if (val.detailId && item.supplierRegisterId == id && item.id == val.id) { - item.resultValue = detailValue - item.detailValue = detailValue - item.standardId = standardId - x = true - } - }) - } - if (!x) { - if (val.detailId) { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'detailValue': detailValue, 'resultValue': detailValue, 'standardId': standardId, 'id': val.id, 'supplierRegisterId': val.supplierRegisterId, 'detailId': val.detailId, 'remarks': val.remarks }); - } else { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'detailValue': detailValue, 'resultValue': detailValue, 'standardId': standardId, 'id': '', 'supplierRegisterId': id, 'detailId': val.id, 'remarks': '' }); - } - } - setDataSource([...totalQualified]) - } - - const checkChange = (list: any, val: any, id: any) => { // 复选框操作 - let detailValue: any, resultValue: any = 0, standardId: any - let detailValueArr: any = [] - let standardIdArr: any = [] - if (val.detailId) { - for (let i = 0; i < list.length; i++) { - detailValueArr.push(list[i].split("-")[0]) - standardIdArr.push(list[i].split("-")[1]) - resultValue += Number(list[i].split("-")[0]) - } - detailValue = detailValueArr.toString() - standardId = standardIdArr.toString() - if (resultValue == 0 && detailValue == "" && standardId == "") { - resultValue = "" - } - } else { - detailValue = list[0].split("-")[0] - resultValue = list[0].split("-")[0] - standardId = list[0].split("-")[1] - } - totalQualified.map((item: any) => { // 处理页面回显 - if (val.detailId) { - if (val.detailId == item.id) { - for (let i = 0; i < supplierId.length; i++) { - if (id == supplierId[i]) { - item.scoreMap[supplierId[i]].resultValue = resultValue - item.scoreMap[supplierId[i]].detailValue = detailValue - item.scoreMap[supplierId[i]].standardId = standardId - } - } - } - } else { - if (val.id == item.id) { - for (let i = 0; i < supplierId.length; i++) { - if (id == supplierId[i]) { - if (item.scoreMap == null) { - item.scoreMap = [] - } - if (item.scoreMap[supplierId[i]]) { - item.scoreMap[supplierId[i]] = { 'categoryId': val.categoryId, 'detailValue': detailValue, 'resultValue': resultValue, 'standardId': standardId, 'id': item.scoreMap[supplierId[i]].id, 'supplierRegisterId': id, 'detailId': val.id, 'remarks': '' } - } else { - item.scoreMap[supplierId[i]] = { 'categoryId': val.categoryId, 'detailValue': detailValue, 'resultValue': resultValue, 'standardId': standardId, 'id': '', 'supplierRegisterId': id, 'detailId': val.id, 'remarks': '' } - } - } - } - } - } - }) - let x = false; - if (val.detailId) { // 处理数据选中 - bidEvalDetailDTOList.map((item: any) => { - if (item.supplierRegisterId == id && item.detailId == val.detailId) { - item.resultValue = resultValue - item.detailValue = detailValue - item.standardId = standardId - x = true - } - }) - } else { - if (bidEvalDetailDTOList) { - bidEvalDetailDTOList.map((item: any) => { - if (item.supplierRegisterId == id && item.detailId == val.id) { - item.resultValue = resultValue - item.detailValue = detailValue - item.standardId = standardId - x = true - } - }) - } - } - if (!x) { // 向保存数组添加数据 - if (val.detailId) { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'detailValue': detailValue, 'resultValue': resultValue, 'standardId': standardId, 'id': val.id, 'supplierRegisterId': val.supplierRegisterId, 'detailId': val.detailId, 'remarks': val.remarks }); - } else { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'detailValue': detailValue, 'resultValue': resultValue, 'standardId': standardId, 'id': '', 'supplierRegisterId': id, 'detailId': val.id, 'remarks': '' }); - } - } - setDataSource([...totalQualified]) - } - - const handleChange = (e: any, val: any, id: any) => { // 下拉框操作 - totalQualified.map((item: any) => { // 处理页面回显 - if (val.detailId) { - if (val.detailId == item.id) { - for (let i = 0; i < supplierId.length; i++) { - if (id == supplierId[i]) { - item.scoreMap[supplierId[i]].resultValue = e - item.scoreMap[supplierId[i]].detailValue = e - } - } - } - } else { - if (val.id == item.id) { - for (let i = 0; i < supplierId.length; i++) { - if (id == supplierId[i]) { - if (item.scoreMap == null) { - item.scoreMap = [] - } - item.scoreMap[supplierId[i]] = { 'categoryId': val.categoryId, 'detailValue': e, 'resultValue': e, 'id': '', 'supplierRegisterId': id, 'detailId': val.id, 'remarks': '' } - } - } - } - } - }) - let x = false; - if (val.detailId) { - bidEvalDetailDTOList.map((item: any) => { - if (item.supplierRegisterId == id && item.detailId == val.detailId) { - item.resultValue = e - item.detailValue = e - x = true - } - }) - } - if (!x) { - if (val.detailId) { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'detailValue': e, 'resultValue': e, 'id': val.id, 'supplierRegisterId': val.supplierRegisterId, 'detailId': val.detailId, 'remarks': val.remarks }); - } else { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'detailValue': e, 'resultValue': e, 'id': '', 'supplierRegisterId': id, 'detailId': val.id, 'remarks': '' }); - } - } - setDataSource([...totalQualified]) - } - - const inputChange = (e: any, val: any, id: any, sorce: any, lowScore: any) => { // 输入框操作 - let inpVal = e.target.value - let inputNum = /^(\-|\+?)\d{0,4}(\.\d{0,5})?$/ - if (inputNum.test(inpVal)) { - if (Number(inpVal) > sorce) { - message.error('输入分值不可大于最高分值!') - inpVal = sorce - } - if (Number(inpVal) < lowScore) { - message.error('输入分值不可小于最低分值!') - inpVal = lowScore - } - } else { - message.error('请输入正确的分值!') - inpVal = inpVal.substring(0, inpVal.length - 1) - } - totalQualified.map((item: any) => { // 处理页面回显 - if (val.detailId) { - if (val.detailId == item.id) { - for (let i = 0; i < supplierId.length; i++) { - if (id == supplierId[i]) { - item.scoreMap[supplierId[i]].resultValue = inpVal - } - } - } - } else { - if (val.id == item.id) { - for (let i = 0; i < supplierId.length; i++) { - if (id == supplierId[i]) { - if (item.scoreMap == null) { - item.scoreMap = [] - } - item.scoreMap[supplierId[i]] = { 'categoryId': val.categoryId, 'detailValue': inpVal, 'resultValue': inpVal, 'id': '', 'supplierRegisterId': id, 'detailId': val.id, 'remarks': '' } - } - } - } - } - }) - let x = false; - if (val.detailId) { - bidEvalDetailDTOList.map((item: any) => { - if (item.supplierRegisterId == id && item.detailId == val.detailId) { - item.resultValue = inpVal - item.detailValue = inpVal - x = true - } - }) - } - if (!x) { - if (val.detailId) { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'detailValue': inpVal, 'resultValue': inpVal, 'id': val.id, 'supplierRegisterId': val.supplierRegisterId, 'detailId': val.detailId, 'remarks': val.remarks }); - } else { - bidEvalDetailDTOList.push({ 'categoryId': val.categoryId, 'detailValue': inpVal, 'resultValue': inpVal, 'id': '', 'supplierRegisterId': id, 'detailId': val.id, 'remarks': '' }); - } - } - setDataSource([...totalQualified]) - } - - const gettabList = () => { // tab - let date = { - assessRoomId: assessRoomId, - reviewTurnId: reviewTurnId, - rvwType: reviewType - } - getPreScoreTabList({ ...date }).then((res) => { - if (res.code == 200) { - setDateLength(res.data.length) - if (res.data.length > 0) { - supplierTab(res.data[0].category) // 供应商列头 - if (res.data[0].name != '报价') { - setTabListName(res.data[0].name) - setTabList(res.data) // tab数据 - setTypeId(res.data[0].id) // 设置类别id - setTypeCategory(res.data[0].category) // 设置类别 - } else if (res.data[0].name == '报价') { - setTabListName(res.data[0].name) - setTabList(res.data) // tab数据 - setTypeId(res.data[0].id) // 设置类别id - setTypeCategory(res.data[0].category) // 设置类别 - offerList(res.data[0].category) - } - } - } - }) - } - - /** - * 获取祥审记录表数据 - * @param defaultSupplierData - * @param findScoreRecordParams - */ - const getFirstTrialTableDetailed = (defaultSupplierData: any, findScoreRecordParams: any) => { - setFirstTrialTableDetailedTable( - ) - } - - - useEffect(() => { - const initializePage = async () => { - const nodeId = getURLInformation("nodeId"); - if (nodeId) { - const queryRes = await getQueryInfo(nodeId); - if (queryRes.code == 200) { - setEditable(queryRes.data.nodeStatus === 3); - editableRef.current = queryRes.data.nodeStatus === 3; - } - } - - bidEvalDetailDTOList = [] - let date = { - reviewTurnId: getURLInformation("turnId"), - reviewType: '2', - } - const res = await getEval({ ...date }) - if (res.code == 200) { - assessRoomId = res.data.assessRoomId - reviewTurnId = res.data.reviewTurnId - reviewType = res.data.reviewType - bidEvalId = res.data.id - if (res.data.reviewStatus != 1) { - endProgress = true - setIsEndProgress(true) - } else { - endProgress = false - setIsEndProgress(false) - } - gettabList() - } - } - initializePage(); - - }, [1]); - - return ( - <> - -
- - { - tabList.map((item: any, index: any) => { - if (item.name == '报价') { - return ( - -
- { - automaticOffer == '2' ? -
-
- -
- - changeOffer(e, typeId, offerTotalSource)} - size="small" - className="mb8" - /> - : -
-
- 1. 确定有效报价 - 注:以下所述平均报价、最低报价、最高报价均根据有效报价计算得出,非有效报价不参与计算,但不以此否决其投标。
- 确定规则为:{tit1} -
-
({ - disabled: isDisabledOffer || isEndProgress, - }), - }} - /> -
- -
-
最低报价:{smallPrice}(元)最高报价:{bigPrice}(元)平均报价:{averagePrice}(元)
-
- 2. 确定基准价 -
{tit2}
-
-
- 3. 计算报价分 -
{tit3}
-
- - } - - - ) - } else { - return ( - -
-
-
- -
-
-
- changePagination(e, typeCategory, totalSupplier)} - size="small" - className="mb8" - /> -
- - - - ) - } - }) - } - - - setRemarkVisible(false)} - onOk={() => closeRemarks()} - okButtonProps={{ - disabled: !editable, - }} - centered - > -
- -