diff --git a/src/baseStyle.less b/src/baseStyle.less index e54feab..953f66d 100644 --- a/src/baseStyle.less +++ b/src/baseStyle.less @@ -178,8 +178,8 @@ .myselfContent .ant-menu-submenu-title { padding-right: 34px; text-align: center; - color: #b30000; - border-top: 2px solid #b30000; + color: @primary-color; + border-top: 2px solid @primary-color; //background: #b30000; } .myselfContent .ant-menu-submenu-title i { diff --git a/src/components/LayLeftMenu/index.less b/src/components/LayLeftMenu/index.less index 377dbb8..708148c 100644 --- a/src/components/LayLeftMenu/index.less +++ b/src/components/LayLeftMenu/index.less @@ -23,9 +23,9 @@ text-align: center; overflow-x: hidden; overflow-y: auto; - .ant-menu-item:hover{ - background-color: rgb(247, 221, 217); - } + // .ant-menu-item:hover{ + // background-color: rgb(247, 221, 217); + // } } .xsy-menu-style::-webkit-scrollbar { width:0px; diff --git a/src/pages/BidEvaluation/components/SupplementFileUpload.tsx b/src/pages/BidEvaluation/components/SupplementFileUpload.tsx new file mode 100644 index 0000000..7e54f45 --- /dev/null +++ b/src/pages/BidEvaluation/components/SupplementFileUpload.tsx @@ -0,0 +1,122 @@ +import React, { useState } from 'react'; +import { Modal, Form, Spin, message } from 'antd'; +import ExtendUpload from '@/utils/ExtendUpload'; +import { saveSupplementFile } from '../../../services/bidev'; + +// 支持的文件格式 +const SUPPORTED_FILE_TYPES = { + 'zip': ['.zip'], + 'rar': ['.rar'], + 'pdf': ['.pdf'], + 'word': ['.doc', '.docx'], + 'excel': ['.xls', '.xlsx'] +}; + +const ACCEPT_TYPES = '.zip,.rar,.pdf,.doc,.docx,.xls,.xlsx'; + +// 文件格式验证函数 +const validateFileFormat = (file: File): boolean => { + const fileName = file.name.toLowerCase(); + const fileExtension = fileName.substring(fileName.lastIndexOf('.')); + const supportedExtensions = Object.values(SUPPORTED_FILE_TYPES).flat(); + return supportedExtensions.includes(fileExtension); +}; + +interface SupplementFileUploadProps { + modalVisible: boolean; + onCancel: (fileId?: string) => void; + onOk: (fileId: string) => void; + fileId?: string; + readOnly?: boolean; + recordData?: any; +} + +const layout = { + labelCol: { span: 4 }, + wrapperCol: { span: 20 }, +}; + +const modalHeight = window.innerHeight * 96 / 100; + +/** + * 补充评审文件上传组件 + * @param props + * @returns + */ +const SupplementFileUpload: React.FC = (props) => { + const { modalVisible, onCancel, onOk, fileId, readOnly, recordData } = props; + const [form] = Form.useForm(); + const [loading, setLoading] = useState(false); + + const handleOk = async () => { + const annexId = form.getFieldValue('annexId'); + const finalFileId = annexId || fileId || ''; + + if (!readOnly && !finalFileId) { + message.warning('请先上传文件'); + return; + } + + setLoading(true); + try { + const params = { + id: recordData?.id, + supplementReviewFile: finalFileId, + }; + + const res = await saveSupplementFile(params); + if (res.code === 200 && res.success) { + message.success('补充评审文件保存成功'); + onOk(finalFileId); + } else { + message.error(res.message || '保存失败'); + } + } catch (error) { + message.error('保存失败,请重试'); + } finally { + setLoading(false); + } + }; + + const handleCancel = () => { + const annexId = form.getFieldValue('annexId'); + onCancel(annexId); + }; + + return ( + + +
+ + + +
+
+
+ ); +}; + +export default SupplementFileUpload; \ No newline at end of file diff --git a/src/pages/Evaluation/BidDetailed/BidDetailedReview/index.tsx b/src/pages/Evaluation/BidDetailed/BidDetailedReview/index.tsx index d369098..6216fa2 100644 --- a/src/pages/Evaluation/BidDetailed/BidDetailedReview/index.tsx +++ b/src/pages/Evaluation/BidDetailed/BidDetailedReview/index.tsx @@ -171,8 +171,8 @@ const Index: React.FC<{}> = () => { } else { if (record.tdocId) { return ( - // - + // + ) } else { return ( @@ -835,6 +835,16 @@ const Index: React.FC<{}> = () => { setCurrent(page) let currentDate = (page - 1) * 3 let newColumns = [...columns]; + + // 辅助函数:优先获取scoreMap,如果不存在则获取managerScoreMap + const getScoreData = (record: any, supplierRegisterId: string) => { + if (record.scoreMap && record.scoreMap[supplierRegisterId]) { + return { data: record.scoreMap[supplierRegisterId], hasData: true }; + } else if (record.managerScoreMap && record.managerScoreMap[supplierRegisterId]) { + return { data: record.managerScoreMap[supplierRegisterId], hasData: true }; + } + return { data: null, hasData: false }; + }; totalSupplierColumns.slice(currentDate, currentDate + 3).map((item: any) => { supplierId.push(item.supplierRegisterId) newColumns.push({ @@ -847,17 +857,18 @@ const Index: React.FC<{}> = () => { record.standardList.map((item: any) => { radioOptions.push({ label: item.standardName + '(' + item.standardDetailScore + '分)', value: item.standardDetailScore + '-' + item.id }) }) - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { + const scoreResult = getScoreData(record, item.supplierRegisterId); + if (scoreResult.hasData) { return (
onChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId)} + onChange={e => onChange(e, scoreResult.data, item.supplierRegisterId)} />
- - + +
) } else { @@ -869,8 +880,8 @@ const Index: React.FC<{}> = () => { options={radioOptions} onChange={e => onChange(e, record, item.supplierRegisterId)} />
- - + + ) } @@ -879,8 +890,9 @@ const Index: React.FC<{}> = () => { 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(",") + const scoreResult = getScoreData(record, item.supplierRegisterId); + if (scoreResult.hasData && (scoreResult.data?.standardId || scoreResult.data?.id)) { + let defaultArr = scoreResult.data.standardId.split(",") let defaultValue: any = [] record.standardList.map((item: any) => { defaultArr.map((val: any) => { @@ -896,10 +908,10 @@ const Index: React.FC<{}> = () => { disabled={disabled || endProgress} options={checkboxOptions} value={defaultValue} - onChange={e => checkChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId)} + onChange={e => checkChange(e, scoreResult.data, item.supplierRegisterId)} />
- - + + ) } else { @@ -912,27 +924,28 @@ const Index: React.FC<{}> = () => { value={[]} onChange={e => checkChange(e, record, item.supplierRegisterId)} />
- - + + ) } } else if (record.scoreMethod == '2') { // 人工 - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { + const scoreResult = getScoreData(record, item.supplierRegisterId); + if (scoreResult.hasData) { return (
评分区间:{record.lowScore}分~{record.highScore}分} placement="topLeft"> inputChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId, record.highScore, record.lowScore)} + onChange={e => inputChange(e, scoreResult.data, item.supplierRegisterId, record.highScore, record.lowScore)} />
- - + +
) } else { @@ -942,8 +955,8 @@ const Index: React.FC<{}> = () => { inputChange(e, record, item.supplierRegisterId, record.highScore, record.lowScore)} style={{ width: 160 }} />
- - + + ) } @@ -953,14 +966,15 @@ const Index: React.FC<{}> = () => { for (let i = 1; i <= optionLength; i++) { optionArr.push(record.lowScore * i) } - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { + const scoreResult = getScoreData(record, item.supplierRegisterId); + if (scoreResult.hasData) { return (

- - + +
) @@ -987,8 +1001,8 @@ const Index: React.FC<{}> = () => { }) }
- - + + ) } @@ -1513,12 +1527,12 @@ const Index: React.FC<{}> = () => { isDisabledOffer || isEndProgress ? null :
- + { - smallPrice ? : null + smallPrice ? : null } { - smallPrice ? : null + smallPrice ? : null }
diff --git a/src/pages/Evaluation/BidDetailed/BidDetailedReviewLeader/index.tsx b/src/pages/Evaluation/BidDetailed/BidDetailedReviewLeader/index.tsx index 4bcbc7a..3acc475 100644 --- a/src/pages/Evaluation/BidDetailed/BidDetailedReviewLeader/index.tsx +++ b/src/pages/Evaluation/BidDetailed/BidDetailedReviewLeader/index.tsx @@ -207,7 +207,7 @@ const Index: React.FC<{}> = () => { } else { if (record.tdocId) { return ( - + ) } else { return ( @@ -875,6 +875,17 @@ const Index: React.FC<{}> = () => { setCurrent(page) let currentDate = (page - 1) * 3 let newColumns = [...columns]; + + // 辅助函数:优先获取scoreMap,如果不存在则获取managerScoreMap + const getScoreData = (record: any, supplierRegisterId: string) => { + if (record.scoreMap && record.scoreMap[supplierRegisterId]) { + return { data: record.scoreMap[supplierRegisterId], hasData: true }; + } else if (record.managerScoreMap && record.managerScoreMap[supplierRegisterId]) { + return { data: record.managerScoreMap[supplierRegisterId], hasData: true }; + } + return { data: null, hasData: false }; + }; + totalSupplierColumns.slice(currentDate, currentDate + 3).map((item: any) => { supplierId.push(item.supplierRegisterId) newColumns.push({ @@ -887,17 +898,18 @@ const Index: React.FC<{}> = () => { record?.standardList?.map((item: any) => { radioOptions.push({ label: item.standardName + '(' + item.standardDetailScore + '分)', value: item.standardDetailScore + '-' + item.id }) }) - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { + const scoreResult = getScoreData(record, item.supplierRegisterId); + if (scoreResult.hasData) { return (
onChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId)} + onChange={e => onChange(e, scoreResult.data, item.supplierRegisterId)} />
- - + +
) } else { @@ -909,8 +921,8 @@ const Index: React.FC<{}> = () => { options={radioOptions} onChange={e => onChange(e, record, item.supplierRegisterId)} />
- - + + ) } @@ -919,8 +931,9 @@ const Index: React.FC<{}> = () => { 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(",") + const scoreResult = getScoreData(record, item.supplierRegisterId); + if (scoreResult.hasData && (scoreResult.data?.standardId || scoreResult.data?.id)) { + let defaultArr = scoreResult.data.standardId.split(",") let defaultValue: any = [] record?.standardList?.map((item: any) => { defaultArr.map((val: any) => { @@ -936,10 +949,10 @@ const Index: React.FC<{}> = () => { disabled={disabled || endProgress} options={checkboxOptions} value={defaultValue} - onChange={e => checkChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId)} + onChange={e => checkChange(e, scoreResult.data, item.supplierRegisterId)} />
- - + + ) } else { @@ -952,27 +965,28 @@ const Index: React.FC<{}> = () => { value={[]} onChange={e => checkChange(e, record, item.supplierRegisterId)} />
- - + + ) } } else if (record.scoreMethod == '2') { // 人工 - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { + const scoreResult = getScoreData(record, item.supplierRegisterId); + if (scoreResult.hasData) { return (
评分区间:{record.lowScore}分~{record.highScore}分} placement="topLeft"> inputChange(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId, record.highScore, record.lowScore)} + onChange={e => inputChange(e, scoreResult.data, item.supplierRegisterId, record.highScore, record.lowScore)} // onFocus={e => inputFocus(e, record.scoreMap[item.supplierRegisterId], item.supplierRegisterId)} />
- - + +
) } else { @@ -982,8 +996,8 @@ const Index: React.FC<{}> = () => { inputChange(e, record, item.supplierRegisterId, record.highScore, record.lowScore)} style={{ width: 160 }} />
- - + + ) } @@ -993,14 +1007,15 @@ const Index: React.FC<{}> = () => { for (let i = 1; i <= optionLength; i++) { optionArr.push(record.lowScore * i) } - if (record.scoreMap && record.scoreMap[item.supplierRegisterId]) { + const scoreResult = getScoreData(record, item.supplierRegisterId); + if (scoreResult.hasData) { return (

- - + +
) } else { @@ -1026,8 +1041,8 @@ const Index: React.FC<{}> = () => { }) }
- - + + ) } @@ -1718,12 +1733,12 @@ const Index: React.FC<{}> = () => { isDisabledOffer || isEndProgress ? null :
- + { - smallPrice ? : null + smallPrice ? : null } { - smallPrice ? : null + smallPrice ? : null }
diff --git a/src/services/bidev.js b/src/services/bidev.js index ef31f72..cebd7ac 100644 --- a/src/services/bidev.js +++ b/src/services/bidev.js @@ -95,3 +95,8 @@ export async function getCheckedByRoomId(params) { export async function checkOpenBidSupplier(params) { return request(`/api/biz-service-ebtp-tender/v1/supplier_register/tender/count/${params}`) } + +//保存补充评审文件 +export async function saveSupplementFile(params) { + return request(`/api/biz-service-ebtp-process/v1/bizassessroom`, { method: 'POST', data: params }); +} diff --git a/src/services/untilService.ts b/src/services/untilService.ts index 68acc42..1bebcdb 100644 --- a/src/services/untilService.ts +++ b/src/services/untilService.ts @@ -1,8 +1,8 @@ import request from '@/utils/request'; -import {doc} from "prettier"; + /*雪花id获取*/ export async function SnowflakeID() { - return request('/api/core-service-ebtp-updownload/v1/business/id', {method: 'get'}) + return request('/api/sys-manager-ebtp-project/v1/business/id', {method: 'get'}) } /*文档中心 根据bid获取文件列表 直接返回 upload组件 fileList 格式*/ export async function getFileBidList(BidID: any) { diff --git a/src/utils/DownloadUtils.ts b/src/utils/DownloadUtils.ts index 1fca0a1..1875011 100644 --- a/src/utils/DownloadUtils.ts +++ b/src/utils/DownloadUtils.ts @@ -13,35 +13,35 @@ import { isEmpty, isNotEmpty } from "./CommonUtils"; /** * 文件上传 */ -export const uploadAttachmentPath = '/api/doc/v1.0/files/upload'; +export const uploadAttachmentPath = '/api/sys-manager-ebtp-project/v1.0/files/upload'; /** * 获取密钥 */ -export const downloadSecretKeyPath = '/api/doc/api/data-service-document-center/outer/v1.0/files/getSecretKey'; +export const downloadSecretKeyPath = '/api/sys-manager-ebtp-project/v1.0/files/getSecretKey'; /** * 文件下载(必须有密钥) */ -export const downloadAttachmentPath = '/api/doc/api/data-service-document-center/outer/v1.0/files/getDownload'; +export const downloadAttachmentPath = '/api/sys-manager-ebtp-project/v1.0/files/getDownload'; /** * 获取雪花id */ -export const getSnowIdPath = '/api/core-service-ebtp-updownload/v1/business/id'; +export const getSnowIdPath = '/api/sys-manager-ebtp-project/v1/business/id'; /** * 文件物理删除 */ -export const removeFilePath = '/api/doc/v1.0/files/disk'; +export const removeFilePath = '/api/sys-manager-ebtp-project/v1.0/files/disk'; /** * 查询文件列表(根据objectId) */ -export const findFilelistPath = '/api/doc/v1.0/files/queryReturn'; +export const findFilelistPath = '/api/sys-manager-ebtp-project/v1.0/files/queryReturn'; /** * 图片展示 */ -export const pictureDisplayPath = '/api/doc/v1.0/files/display'; +export const pictureDisplayPath = '/api/sys-manager-ebtp-project/v1.0/files/display'; /** * 文件下载(不用文件流) */ -export const downloadPath = '/api/doc/v1.0/files/download'; +export const downloadPath = '/api/sys-manager-ebtp-project/v1.0/files/download'; /** * 查询文件列表(根据2.0 bid) */ diff --git a/src/utils/ExtendUpload/index.tsx b/src/utils/ExtendUpload/index.tsx index 3e4571b..d0a3863 100644 --- a/src/utils/ExtendUpload/index.tsx +++ b/src/utils/ExtendUpload/index.tsx @@ -14,11 +14,12 @@ interface ExtendUploadProps { maxCount?: number; maxSize?: number; uploadProps?: UploadProps; + formatValidator?: (file: File) => boolean; } const ExtendUpload: React.FC = (props) => { - const { bid, onChange, btnName, maxCount, maxSize, uploadProps } = { + const { bid, onChange, btnName, maxCount, maxSize, uploadProps, formatValidator } = { maxCount: 0, maxSize: 30, btnName: "上传", @@ -54,6 +55,13 @@ const ExtendUpload: React.FC = (props) => { const fileBeforeUpload = (curFile: any, curFileList: any) => { const promise = new Promise((resolve, reject) => { + // 格式校验 + if (formatValidator && !formatValidator(curFile)) { + message.error('文件格式校验失败,请检查文件类型'); + reject(false); + return; + } + if (maxSize === 0) { } else { @@ -145,6 +153,7 @@ const ExtendUpload: React.FC = (props) => { {...uploadProps} key={"file" + returnValue} action={uploadAttachmentPath} + accept={uploadProps?.accept || ''} data={{ appCode: 'ebtp-cloud-frontend', objectId: returnValue, diff --git a/src/utils/request.ts b/src/utils/request.ts index e628a8f..1b55f56 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -128,7 +128,7 @@ request.interceptors.response.use(async (response) => { }); } else { //2021.9.7 zhoujianlong 新增风险防控专用错误码4004 - if (data.code != undefined && data.code != '200' && data.code != '4004' && data.code !== '1') { + if (data.code != undefined && data.code != '200' && data.code != '4004' && data.code != '1') { message.error(data.message, 3); } }