diff --git a/config/BiXuan/router_bixuan.ts b/config/BiXuan/router_bixuan.ts index 9f712c7..40f61e8 100644 --- a/config/BiXuan/router_bixuan.ts +++ b/config/BiXuan/router_bixuan.ts @@ -10,6 +10,16 @@ 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/config/HomePage/router_home.ts b/config/HomePage/router_home.ts index dc02a47..3186226 100644 --- a/config/HomePage/router_home.ts +++ b/config/HomePage/router_home.ts @@ -1,5 +1,6 @@ export default [ { + name: '首页', path: '/Dashboard', component: './MainPage/ProjectManager', }, diff --git a/config/proxy.ts b/config/proxy.ts index 9aac713..8a2014b 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -14,7 +14,7 @@ export default { }, UAT: { '/api/sys-manager-ebtp-project': { - target: 'http://localhost:18030', + target: 'http://192.168.110.231:18030', changeOrigin: true, pathRewrite: { '/api/sys-manager-ebtp-project': '' }, }, @@ -58,7 +58,11 @@ export default { changeOrigin: true, pathRewrite: { '/api/biz-supplier-manage': '' }, }, - + '/api/biz-service-ebtp-resps': { + target: 'http://192.168.110.51:18013', + changeOrigin: true, + pathRewrite: { '/api/biz-service-ebtp-resps': '' }, + }, // '/api/wfap/v1/audit/bill/find/by/procid': { // target: 'http://10.242.31.158:8891/',//审批单 uat环境自动审批,暂时用不到 // changeOrigin: true, diff --git a/package.json b/package.json index 6c56a81..9567b17 100644 --- a/package.json +++ b/package.json @@ -98,6 +98,7 @@ "devDependencies": { "@alita/plugins": "^3.5.5", "@types/classnames": "^2.2.7", + "@types/cookie": "0.5.4", "@types/express": "^4.17.0", "@types/history": "^4.7.2", "@types/jest": "^26.0.0", diff --git a/src/app.tsx b/src/app.tsx index bbc867b..66063c0 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -50,7 +50,8 @@ function TabLayout({ const items = Object.entries(keepElements.current).map( ([pathname]: any) => { const pathnameLowerCase = pathname.toLowerCase(); - const label = pathKeyMap.get(pathnameLowerCase)?.name || 'Unknown'; + const pathKeyMapItem = pathKeyMap.get(pathnameLowerCase); + const label = pathKeyMapItem?.name || pathKeyMapItem?.routeName || 'Unknown'; const active = pathnameLowerCase === activeKeyLowerCase; return ({ label, key: pathnameLowerCase, closeIcon: }) }, @@ -61,7 +62,8 @@ function TabLayout({ { - navigate(key); + const { pathname, search } = keepElements.current[key].location; + navigate(`${pathname}${search}`); }} activeKey={activeKeyLowerCase} type="editable-card" @@ -79,12 +81,14 @@ function TabLayout({ return } dropByCacheKey(targetKey) - if (targetKey === activeKey) { + if (targetKey === activeKey?.toLowerCase()) { // 删除当前选中的tab时: // 1.如果当前tab是第一个时自动选中后一个 // 2.不是第一个时自动选中前一个 const i = pathList.indexOf(targetKey) - navigate(pathList[i === 0 ? i + 1 : i - 1]) + const to = pathList[i === 0 ? i + 1 : i - 1] + const { pathname, search } = keepElements.current[to].location; + navigate(`${pathname}${search}`) } }} items={items} diff --git a/src/baseStyle.less b/src/baseStyle.less index c4f8cdf..e54feab 100644 --- a/src/baseStyle.less +++ b/src/baseStyle.less @@ -315,6 +315,7 @@ input::-webkit-outer-spin-button, &.ant-menu-item-only-child { padding-left: 40px !important; height: 56px; + line-height: 25px; margin: 0; padding-top: 16px; padding-bottom: 16px; diff --git a/src/components/BiddingRoom/index.js b/src/components/BiddingRoom/index.js index 95c56e0..70b42fc 100644 --- a/src/components/BiddingRoom/index.js +++ b/src/components/BiddingRoom/index.js @@ -3,7 +3,6 @@ import { Link, history } from '@umijs/max'; import './index.less'; import styles from './index.less'; import { connect } from "dva"; -// import { routerRedux } from 'dva/router'; import React, { useState, useEffect, useReducer } from 'react'; import { getSessionUserData, getRoomId, getRoomStatus, getProMethod, getSessionRoleData, getIPassDecode, getDefId, getProId, getOfflineStatusById } from '@/utils/session'; import { getURLInformation } from '@/utils/CommonUtils'; diff --git a/src/components/Promenu/index.less b/src/components/Promenu/index.less index c0f0dd1..29e82c5 100644 --- a/src/components/Promenu/index.less +++ b/src/components/Promenu/index.less @@ -90,10 +90,10 @@ min-width: 60px; } .horizontal-stepper .MuiStepIcon-completed { - color: #b30000 !important; + color: @primary-color !important; } .horizontal-stepper .MuiStepIcon-active { - color: #b30000 !important; + color: @primary-color !important; } .horizontal-stepper .MuiStep-completed { // min-width: 90px ; diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 1fe5aa0..d201261 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -4,7 +4,7 @@ import ProLayout, { Settings, } from '@ant-design/pro-layout'; import React, { useEffect, useMemo, useRef, useState } from 'react'; -import { Link, connect, Dispatch, history, Outlet, useLocation, useKeepOutlets } from '@umijs/max'; +import { Link, connect, Dispatch, history, useLocation, useKeepOutlets, useAppData } from '@umijs/max'; import { Result, Button, message } from 'antd'; import Authorized from '@/utils/Authorized'; import RightContent from '@/components/GlobalHeader/RightContent'; @@ -105,6 +105,8 @@ const BasicLayout: React.FC = (props) => { const mall3_token: any = sessionStorage.getItem('Authorization');//当前登录token const userData: any = getSessionUserData();//当前登录人信息 const children = useKeepOutlets(); + const routeData = useAppData(); + useEffect(() => { if (getSessionRoleData()?.roleId) { let params = { @@ -116,7 +118,10 @@ const BasicLayout: React.FC = (props) => { if (dispatch) { dispatch({ type: 'user/saveMenuData', - payload: res.data || [], + payload: { + menuData: res.data || [], + routeData: routeData.routes, + }, }); } setmenuShow(true) diff --git a/src/models/user.ts b/src/models/user.ts index 5e802c8..72cba41 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -16,10 +16,16 @@ export interface CurrentUser { unreadCount?: number; } +export interface PathKeyMap { + name: string; + icon?: string; + routeName?: string; +} + export interface UserModelState { currentUser?: CurrentUser; menuData?: any[]; - pathKeyMap?: Map; + pathKeyMap?: Map; } export interface UserModelType { @@ -42,7 +48,7 @@ const UserModel: UserModelType = { state: { currentUser: {}, menuData: [], - pathKeyMap: new Map(), + pathKeyMap: new Map(), }, effects: { @@ -70,8 +76,9 @@ const UserModel: UserModelType = { }; }, saveMenuData(state, action) { - const menuData = action.payload || []; - const pathKeyMap = new Map(); + const menuData = action.payload.menuData || []; + const routeData = action.payload.routeData || []; + const pathKeyMap = new Map(); // 将menuData转换为pathKeyMap 递归处理 const convertToPathKeyMap = (menuData: any[]) => { menuData.forEach((item: any) => { @@ -83,7 +90,24 @@ const UserModel: UserModelType = { }); }; convertToPathKeyMap(menuData); - pathKeyMap.set('/dashboard', { name: '首页' }); + let i = 1; + while (routeData[i]) { + const item = routeData[i]; + if (item.name) { + const pathname = item.path.toLowerCase(); + if (pathKeyMap.has(pathname)) { + const target = pathKeyMap.get(pathname)!; + const newItem = { + ...target, + routeName: item.name, + } + pathKeyMap.set(pathname, newItem); + } else { + pathKeyMap.set(pathname, { name: item.name, icon: item.icon }); + } + } + i++; + } return { ...state, menuData: action.payload || [], diff --git a/src/pages/BidEvaluation/Jury.js b/src/pages/BidEvaluation/Jury.js index 8fe7a0f..09dc3fb 100644 --- a/src/pages/BidEvaluation/Jury.js +++ b/src/pages/BidEvaluation/Jury.js @@ -226,7 +226,6 @@ class Jury extends PureComponent { // 再跳转 if(txt==1){ // sessionStorage.setItem("roomId",record.id) - // this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom')) // history.push('/EvaRoom') window.open('/EvaRoom/Eva') }else{ diff --git a/src/pages/BidEvaluation/manager.js b/src/pages/BidEvaluation/manager.js index d460a77..0faa1a5 100644 --- a/src/pages/BidEvaluation/manager.js +++ b/src/pages/BidEvaluation/manager.js @@ -7,7 +7,6 @@ import { getDictBidMethodDict, getProMethod, getRoomId, getDefId, getQuotationMe import { saveLeaderId, getJuryData, checkOpenBidSupplier, getPackageList, createReviewRoom, closingReviewRoom } from './components/service'; import './index.less'; import { connect } from "dva"; -// import { routerRedux } from 'dva/router'; import { getProId, getProSignDict } from '@/utils/session'; import ReviewDevided from '@/pages/BidEvaluation/components/ReviewDevided'; import CreateReviewRoom from '@/pages/BidEvaluation/components/CreateReviewRoom'; @@ -68,7 +67,6 @@ class manager extends PureComponent { sessionStorage.setItem("roomId", record.id) this.savePageAndParams(); history.push(`/ProjectLayout/FlowConfig`) - // this.props.dispatch() } //查询评审室列表 getManagerList = (params) => { @@ -126,7 +124,6 @@ class manager extends PureComponent { sessionStorage.setItem("openTime", record.openTime) this.setState({ loading: true }) await getQuotationMethodById(record.id) - // this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom')) this.setState({ loading: false }) window.open(`/EvaRoom`) } @@ -134,7 +131,6 @@ class manager extends PureComponent { onJurySet = (record) => { this.savePageAndParams(); history.push({ pathname: '/ProjectLayout/JudgingPanel', state: { roomId: record.id, secId: record.sectionId, openTime: record.openTime } }); - // this.props.dispatch(routerRedux.push(`/ProjectLayout/JudgingPanel?roomId=${record.id}&secId=${record.sectionId}&openTime=${record.openTime}`)); } //创建评审室 onCreateClick = async () => { @@ -429,8 +425,7 @@ class manager extends PureComponent { } // 跳转组建评委会 onRedirectRate = () => { - // this.props.dispatch(history.push('/JudgingPanel/list')) - history.push(`/JudgingPanel/list`) + history.push('/JudgingPanel/list') } render() { diff --git a/src/pages/BidEvaluation/supplier.js b/src/pages/BidEvaluation/supplier.js index 8797235..1458803 100644 --- a/src/pages/BidEvaluation/supplier.js +++ b/src/pages/BidEvaluation/supplier.js @@ -3,7 +3,6 @@ import { Divider, Button, Form, Card, Tabs, Table, Tooltip, Input, Select, Row, import './index.less'; import { connect } from "dva"; import { getProId, getProMethod, getDefId, getQuotationMethodById, getSessionUserData } from '@/utils/session'; -// import { routerRedux } from 'dva/router'; import { getURLInformation } from '@/utils/CommonUtils'; import { btnAuthority } from '@/utils/authority'; import { getMaxTurnSortSupplier } from './components/service'; @@ -72,7 +71,6 @@ class supplier extends PureComponent { sessionStorage.setItem("isBxOneSecondCustom", "0") } this.setState({ loading: false }) - // this.props.dispatch(routerRedux.push('/ProjectLayout/EvaRoom')) window.open('/EvaRoom') } render() { diff --git a/src/pages/ElecEvaluation/ManuPlatformManage/index.tsx b/src/pages/ElecEvaluation/ManuPlatformManage/index.tsx index 94c9dca..a36ffca 100644 --- a/src/pages/ElecEvaluation/ManuPlatformManage/index.tsx +++ b/src/pages/ElecEvaluation/ManuPlatformManage/index.tsx @@ -2,7 +2,7 @@ import { isNotEmpty } from '@/utils/CommonUtils'; import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; import { Button, Spin, message, Popconfirm } from 'antd'; import React, { useRef, useState } from 'react'; -import { useHistory } from '@umijs/max'; +import { history } from '@umijs/max'; import ManuPlatformModal from './modal/ManuPlatformModal'; import { getManuPlatformList, deleteManuPlatformInfo } from './service'; @@ -15,7 +15,7 @@ const ManuPlatformModalManage: React.FC<{}> = () => { const [spin, spinSet] = useState(false); const [visible, setVisible] = useState(false); const manuPlatformInfo = useRef(); - // const history = useHistory(); + const manuPlatformModalRef = useRef(null); //编辑 const editManuPlatform = (record: any) => { diff --git a/src/pages/ElecEvaluation/PlaceAreasManage/components/Areas.tsx b/src/pages/ElecEvaluation/PlaceAreasManage/components/Areas.tsx index 3990067..ca85bb2 100644 --- a/src/pages/ElecEvaluation/PlaceAreasManage/components/Areas.tsx +++ b/src/pages/ElecEvaluation/PlaceAreasManage/components/Areas.tsx @@ -3,7 +3,7 @@ import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; import tableProps from '@/utils/tableProps'; import { Button, Spin, message, Popconfirm } from 'antd'; import React, { useRef, useState } from 'react'; -import { useHistory } from '@umijs/max'; +import { history } from '@umijs/max'; import AreasModal from './modal/AreasModal'; import { getAreasPage, deleteAreasInfo } from '../service'; @@ -21,7 +21,7 @@ const AreasManage: React.FC<{}> = () => { pageNo: 1, pageSize: 10 }); - // const history = useHistory(); + const areasModalRef = useRef(null); //编辑 const editAreas = (record: any) => { diff --git a/src/pages/ElecEvaluation/PlaceAreasManage/components/Place.tsx b/src/pages/ElecEvaluation/PlaceAreasManage/components/Place.tsx index b17d031..8c7aae5 100644 --- a/src/pages/ElecEvaluation/PlaceAreasManage/components/Place.tsx +++ b/src/pages/ElecEvaluation/PlaceAreasManage/components/Place.tsx @@ -3,7 +3,7 @@ import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table'; import tableProps from '@/utils/tableProps'; import { Button, Spin, message, Popconfirm } from 'antd'; import React, { useRef, useState } from 'react'; -import { useHistory } from '@umijs/max'; +import { history } from '@umijs/max'; import PlaceModal from './modal/PlaceModal'; import { getPlacePage, deletePlaceInfo } from '../service'; import PcaSelect from './PcaSelect'; @@ -44,7 +44,7 @@ const PlaceManage: React.FC<{}> = () => { pageNo: 1, pageSize: 10 }); - // const history = useHistory(); + const placeModalRef = useRef(null); //编辑 const editPlace = (record: any) => { diff --git a/src/pages/ElecEvaluation/VideoMonitor/Online/components/OnlineSupervision.tsx b/src/pages/ElecEvaluation/VideoMonitor/Online/components/OnlineSupervision.tsx index 287c39e..e87c806 100644 --- a/src/pages/ElecEvaluation/VideoMonitor/Online/components/OnlineSupervision.tsx +++ b/src/pages/ElecEvaluation/VideoMonitor/Online/components/OnlineSupervision.tsx @@ -3,7 +3,7 @@ import ProTable, { ProColumns } from '@ant-design/pro-table'; import tableProps from '@/utils/tableProps'; import { Button, Spin, message } from 'antd'; import React, { useRef, useState } from 'react'; -import { useHistory } from '@umijs/max'; +import { history } from '@umijs/max'; import ViewModal from '../../ViewModal'; import { getPage } from '../../service'; import { btnAuthority } from '@/utils/authority'; @@ -20,7 +20,7 @@ const OnlineSupervision: React.FC<{}> = () => { pageNo: 1, pageSize: 10 }); - // const history = useHistory(); + const viewModalRef = useRef(null); //查看详情 const viewDetails = (record: any) => { diff --git a/src/pages/ElecEvaluation/VideoMonitor/Online/components/ReservedItems.tsx b/src/pages/ElecEvaluation/VideoMonitor/Online/components/ReservedItems.tsx index 03af547..d9d2181 100644 --- a/src/pages/ElecEvaluation/VideoMonitor/Online/components/ReservedItems.tsx +++ b/src/pages/ElecEvaluation/VideoMonitor/Online/components/ReservedItems.tsx @@ -3,7 +3,7 @@ import ProTable, { ProColumns } from '@ant-design/pro-table'; import tableProps from '@/utils/tableProps'; import { Button, Spin } from 'antd'; import React, { useRef, useState } from 'react'; -import { useHistory } from '@umijs/max'; +import { history } from '@umijs/max'; import ViewModal from '../../ViewModal'; import { getPage } from '../../service'; import { btnAuthority } from '@/utils/authority'; @@ -21,7 +21,7 @@ const ReservedItems: React.FC<{}> = () => { pageNo: 1, pageSize: 10 }); - // const history = useHistory(); + const viewModalRef = useRef(null); //查看详情 diff --git a/src/pages/ElecEvaluation/VideoMonitor/Post/index.tsx b/src/pages/ElecEvaluation/VideoMonitor/Post/index.tsx index 5f476a4..1a7c74b 100644 --- a/src/pages/ElecEvaluation/VideoMonitor/Post/index.tsx +++ b/src/pages/ElecEvaluation/VideoMonitor/Post/index.tsx @@ -3,7 +3,7 @@ import ProTable, { ProColumns } from '@ant-design/pro-table'; import tableProps from '@/utils/tableProps'; import { Button, Spin, message, Card } from 'antd'; import React, { useRef, useState } from 'react'; -import { useHistory } from '@umijs/max'; +import { history } from '@umijs/max'; import ViewModal from '../ViewModal'; import { getPage } from '../service'; import { btnAuthority } from '@/utils/authority'; @@ -20,7 +20,7 @@ const PostSupervision: React.FC<{}> = () => { pageNo: 1, pageSize: 10 }); - // const history = useHistory(); + const viewModalRef = useRef(null); //查看详情 diff --git a/src/pages/Evaluation/BaseInf/index.tsx b/src/pages/Evaluation/BaseInf/index.tsx index 2385ce4..78efb5c 100644 --- a/src/pages/Evaluation/BaseInf/index.tsx +++ b/src/pages/Evaluation/BaseInf/index.tsx @@ -6,7 +6,7 @@ import ProTable, { ProColumns } from '@ant-design/pro-table'; import ReviewDevided from '@/pages/BidEvaluation/components/ReviewDevided'; import { getRoomDataById } from '@/services/common'; import { ExclamationCircleOutlined } from '@ant-design/icons'; - +import '@/assets/zjl_style.less' /** * 评审室内页-基本信息 * @author wuxianhui diff --git a/src/pages/Evaluation/BidDetailed/BidDetailedManager/BPR.js b/src/pages/Evaluation/BidDetailed/BidDetailedManager/BPR.js index 4c0f474..297f832 100644 --- a/src/pages/Evaluation/BidDetailed/BidDetailedManager/BPR.js +++ b/src/pages/Evaluation/BidDetailed/BidDetailedManager/BPR.js @@ -2,7 +2,6 @@ import React, {PureComponent} from 'react'; import {Divider,Button,Form,Card,Tabs,Table,Tooltip,Input,Select,Row,Col,message,Modal,Pagination,Spin} from 'antd'; // import './index.less'; import { connect } from "dva"; -// import { routerRedux } from 'dva/router'; import { getRoomId } from '@/utils/session'; import { getURLInformation } from '@/utils/CommonUtils'; diff --git a/src/pages/Evaluation/BidDetailed/BidDetailedReview/preScore.tsx b/src/pages/Evaluation/BidDetailed/BidDetailedReview/preScore.tsx new file mode 100644 index 0000000..f4e79ed --- /dev/null +++ b/src/pages/Evaluation/BidDetailed/BidDetailedReview/preScore.tsx @@ -0,0 +1,1363 @@ +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 + > +
+ +