From 605c3c26acdd9bb05c032ebb02e42ec7a0214ff7 Mon Sep 17 00:00:00 2001 From: linxd <544554903@qq.com> Date: Tue, 12 Aug 2025 16:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=84=E4=BB=B7=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=AE=A1=E6=89=B9iframe=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EvaluationApproval.tsx | 139 ++++++++++++++++++ src/pages/supplier/ViewReviewPage/index.tsx | 5 +- 2 files changed, 142 insertions(+), 2 deletions(-) diff --git a/src/pages/supplier/ViewReviewPage/components/EvaluationApproval.tsx b/src/pages/supplier/ViewReviewPage/components/EvaluationApproval.tsx index e69de29..0ae162e 100644 --- a/src/pages/supplier/ViewReviewPage/components/EvaluationApproval.tsx +++ b/src/pages/supplier/ViewReviewPage/components/EvaluationApproval.tsx @@ -0,0 +1,139 @@ +import React, { useEffect, useState } from 'react'; +import { history, useLocation, useIntl } from 'umi'; +import { + Card, + Form, + Input, + Select, + Button, + Table, + Space, + Row, + Col, + Tooltip, + message, + Divider, +} from 'antd'; +import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; +import { getEvaluateSupplierList, getAllEvaluateRules } from '@/servers/api/supplierEvaluate'; +import GlobalModal from '../GlobalModal/index'; + +const EvaluationApproval: React.FC<{ + visible: boolean; + record: any; +}> = ({ visible, record = {} }) => { + const intl = useIntl(); + const supplierDetailModal = useSupplierDetailModal(); + const [resultData, setResultData] = useState([]); + const [loading, setLoading] = useState(false); + const [visibleGlobalModal, setVisibleGlobalModal] = useState(false); + const [id, setId] = useState(''); + const columns = [ + { + title: intl.formatMessage({ id: 'supplierEvaluateResult.column.index' }), + render: (_: any, __: SupplierEvaluateResult.EvaluateSupplierItem, index: number) => index + 1, + width: 80, + }, + { + title: intl.formatMessage({ id: 'supplierEvaluateResult.column.supplierName' }), + dataIndex: 'supplierName', + key: 'supplierName', + width: 200, + ellipsis: { + showTitle: false, + }, + render: (supplierName: string, record: SupplierEvaluateResult.EvaluateSupplierItem) => ( + + { + setId(record.supplierId); + setVisibleGlobalModal(true); + }} + > + {supplierName} + + + ), + }, + { + title: intl.formatMessage({ id: 'supplierEvaluateResult.column.categoryName' }), + dataIndex: 'categoryName', + key: 'categoryName', + width: 120, + }, + { + title: intl.formatMessage({ id: 'supplierEvaluateResult.column.reviewScore' }), + dataIndex: 'reviewScore', + key: 'reviewScore', + width: 100, + }, + { + title: intl.formatMessage({ id: 'supplierEvaluateResult.column.levelName' }), + dataIndex: 'levelName', + key: 'levelName', + width: 100, + align: 'center' as const, + }, + ]; + // 获取评价规则列表 + const fetchResultDetailList = async () => { + // 确保有评价任务ID + if (!record?.id) { + message.error(intl.formatMessage({ id: 'supplierEvaluateResult.message.missingTaskId' })); + return; + } + setLoading(true); + try { + // 构建请求参数 + const requestParams: SupplierEvaluateResult.EvaluateSupplierRequest = { + basePageRequest: { + pageNo: 1, + pageSize: 999, + }, + evaluateTaskId: record.id, + }; + // 调用接口获取数据 + const response = await getEvaluateSupplierList(requestParams); + if (response.data && response.success) { + const { records } = response.data; + setResultData(records); + } else { + message.error( + response.message || + intl.formatMessage({ id: 'supplierEvaluateResult.message.fetchDetailFailed' }), + ); + } + } catch (error) { + console.error('获取评价结果详情列表失败:', error); + message.error(intl.formatMessage({ id: 'supplierEvaluateResult.message.fetchDetailFailed' })); + } finally { + setLoading(false); + } + }; + useEffect(() => { + if (visible) { + fetchResultDetailList(); + } + }, [visible, record]); + return ( +
+
+ + + setVisibleGlobalModal(false)} + /> + + ); +}; + +export default EvaluationApproval; diff --git a/src/pages/supplier/ViewReviewPage/index.tsx b/src/pages/supplier/ViewReviewPage/index.tsx index cb712ff..b281622 100644 --- a/src/pages/supplier/ViewReviewPage/index.tsx +++ b/src/pages/supplier/ViewReviewPage/index.tsx @@ -7,6 +7,7 @@ import CategoryLibraryApproval from './components/CategoryLibraryApproval'; import CategoryLibrarySupplierApproval from './components/CategoryLibrarySupplierApproval'; import SupplierCategoryAccessApproval from './components/SupplierCategoryAccessApproval'; import SupplierInfoChangeApproval from './components/SupplierInfoChangeApproval'; +import EvaluationApproval from './components/EvaluationApproval'; import { refreshDictCache } from '@/servers/api/login'; import { encryptWithRsa } from '@/utils/encryptWithRsa'; @@ -134,10 +135,10 @@ const ViewReviewPage: React.FC = () => { {/* 评价审批 */} {['evaluationApproval'].includes(type) && ( <> - {/* */} + /> )}