From e718168366d8ead20738849d43a939057ee1c939 Mon Sep 17 00:00:00 2001 From: linxd <544554903@qq.com> Date: Mon, 30 Jun 2025 18:00:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E4=B8=8B=E8=BD=BD=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/proxy.ts | 4 +- config/router.config.ts | 136 ---- src/components/FileUpload/FileUpload.tsx | 2 +- src/dicts/download.ts | 62 ++ src/layouts/SiderMenu.tsx | 68 -- src/pages/downloadManage/downloadManage.tsx | 686 ++++++++++-------- .../supplierAnnualQuery.tsx | 12 - .../supplierAnnualResult.tsx | 12 - .../supplierAnnualTaskManage.tsx | 12 - .../supplierAnnualTemplateManage.tsx | 12 - .../components/GeneralEvaluation.tsx | 221 ------ .../components/TechnicalEvaluation.tsx | 265 ------- .../components/components.less | 80 -- .../supplierEvaluateResult.less | 113 --- .../supplierEvaluateResult.tsx | 322 -------- .../supplierEvaluateResultByZb.tsx | 205 ------ .../supplierEvaluateResultInfo.tsx | 310 -------- .../supplierEvaluateResultScoreByList.tsx | 295 -------- .../supplierEvaluateResultScoreDetail.tsx | 64 -- .../supplierEvaluateResultApproval.less | Bin 922 -> 0 bytes .../supplierEvaluateResultApproval.tsx | 452 ------------ .../supplierEvaluateResultApprovalInfo.tsx | 318 -------- .../supplierEvaluateScore.tsx | 349 --------- .../components/BasicInfoStep.tsx | 244 ------- .../components/EvaluatorSelectStep.tsx | 421 ----------- .../components/SupplierSelectStep.tsx | 414 ----------- .../supplierTaskManage.less | 51 -- .../supplierTaskManage/supplierTaskManage.tsx | 543 -------------- .../supplierTaskManageAdd.less | 83 --- .../supplierTaskManageAdd.tsx | 188 ----- .../supplierTemplateManage.less | 41 -- .../supplierTemplateManage.tsx | 336 --------- .../supplierTemplateManageAdd.tsx | 400 ---------- .../supplierTemplateManageDetail.tsx | 135 ---- src/servers/api/download.ts | 57 ++ src/servers/api/typings.d.ts | 50 +- src/utils/utils.ts | 8 +- 37 files changed, 537 insertions(+), 6434 deletions(-) create mode 100644 src/dicts/download.ts delete mode 100644 src/pages/supplierAnnualManage/supplierAnnualQuery/supplierAnnualQuery.tsx delete mode 100644 src/pages/supplierAnnualManage/supplierAnnualResult/supplierAnnualResult.tsx delete mode 100644 src/pages/supplierAnnualManage/supplierAnnualTaskManage/supplierAnnualTaskManage.tsx delete mode 100644 src/pages/supplierAnnualManage/supplierAnnualTemplateManage/supplierAnnualTemplateManage.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/components/GeneralEvaluation.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/components/TechnicalEvaluation.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/components/components.less delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult.less delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultByZb.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultInfo.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreByList.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreDetail.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApproval.less delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApproval.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApprovalInfo.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierEvaluateScore/supplierEvaluateScore.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierTaskManage/components/BasicInfoStep.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierTaskManage/components/EvaluatorSelectStep.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierTaskManage/components/SupplierSelectStep.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManage.less delete mode 100644 src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManage.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageAdd.less delete mode 100644 src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageAdd.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierTemplateManage/supplierTemplateManage.less delete mode 100644 src/pages/supplierEvaluateManage/supplierTemplateManage/supplierTemplateManage.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierTemplateManage/supplierTemplateManageAdd.tsx delete mode 100644 src/pages/supplierEvaluateManage/supplierTemplateManage/supplierTemplateManageDetail.tsx create mode 100644 src/servers/api/download.ts diff --git a/config/proxy.ts b/config/proxy.ts index 9e663ac..b87da51 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -2,12 +2,12 @@ export default { dev: { '/api': { // target: 'http://10.242.37.148:18022',// - target: 'http://10.0.0.10:18012',// + target: 'http://10.0.0.14:18013',// changeOrigin: true, pathRewrite: { '^/api': '' }, }, '/upload': { - target: 'http://10.0.0.10:18013',// + target: 'http://10.0.0.14:18013',// changeOrigin: true, pathRewrite: { '^/upload': '' }, }, diff --git a/config/router.config.ts b/config/router.config.ts index 1e9304b..4f2b48b 100644 --- a/config/router.config.ts +++ b/config/router.config.ts @@ -112,142 +112,6 @@ export default [ }, component: '@/pages/friendLinkManage/friendLinkManage', }, - { - name: 'supplierTemplateManage', - path: '/supplierTemplateManage', - meta: { - title: '供应商模板管理', - }, - component: '@/pages/supplierEvaluateManage/supplierTemplateManage/supplierTemplateManage', - }, - { - name: 'supplierTemplateManageAdd', - path: '/supplierTemplateManage/supplierTemplateManageAdd', - meta: { - title: '供应商模板管理新增', - }, - component: '@/pages/supplierEvaluateManage/supplierTemplateManage/supplierTemplateManageAdd', - }, - { - name: 'supplierTemplateManageDetail', - path: '/supplierTemplateManage/supplierTemplateManageDetail', - meta: { - title: '供应商模板管理详情', - }, - component: '@/pages/supplierEvaluateManage/supplierTemplateManage/supplierTemplateManageDetail', - }, - { - name: 'supplierTaskManage', - path: '/supplierTaskManage', - meta: { - title: '供应商任务管理', - }, - component: '@/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManage', - }, - { - name: 'supplierTaskManageAdd', - path: '/supplierTaskManage/supplierTaskManageAdd', - meta: { - title: '供应商任务管理新增', - }, - component: '@/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageAdd', - }, - { - name: 'supplierEvaluateScore', - path: '/supplierEvaluateScore', - meta: { - title: '供应商评分管理', - }, - component: '@/pages/supplierEvaluateManage/supplierEvaluateScore/supplierEvaluateScore', - }, - { - name: 'supplierEvaluateResult', - path: '/supplierEvaluateResult', - meta: { - title: '供应商评价结果', - }, - component: '@/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult', - }, - { - name: 'supplierEvaluateResultInfo', - path: '/supplierEvaluateResult/supplierEvaluateResultInfo', - meta: { - title: '供应商评价结果详情', - }, - component: '@/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultInfo', - }, - { - name: 'supplierEvaluateResultScoreDetail', - path: '/supplierEvaluateResult/supplierEvaluateResultScoreDetail', - meta: { - title: '供应商评价结果得分明细', - }, - component: '@/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreDetail', - }, - { - name: 'supplierEvaluateResultScoreByList', - path: '/supplierEvaluateResult/supplierEvaluateResultScoreByList', - meta: { - title: '供应商评价结果打分情况', - }, - component: '@/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreByList', - }, - { - name: 'supplierEvaluateResultByZb', - path: '/supplierEvaluateResult/supplierEvaluateResultByZb', - meta: { - title: '评价结果详情', - }, - component: '@/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultByZb', - }, - { - name: 'supplierEvaluateResultApproval', - path: '/supplierEvaluateResultApproval', - meta: { - title: '供应商评价结果审批', - }, - component: '@/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApproval', - }, - { - name: 'supplierEvaluateResultApprovalInfo', - path: '/supplierEvaluateResultApproval/supplierEvaluateResultApprovalInfo', - meta: { - title: '供应商评价审批', - }, - component: '@/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApprovalInfo', - }, - { - name: 'supplierAnnualTemplateManage', - path: '/supplierAnnualTemplateManage', - meta: { - title: '供应商年度模板管理', - }, - component: '@/pages/supplierAnnualManage/supplierAnnualTemplateManage/supplierAnnualTemplateManage', - }, - { - name: 'supplierAnnualTaskManage', - path: '/supplierAnnualTaskManage', - meta: { - title: '供应商年度任务管理', - }, - component: '@/pages/supplierAnnualManage/supplierAnnualTaskManage/supplierAnnualTaskManage', - }, - { - name: 'supplierAnnualQuery', - path: '/supplierAnnualQuery', - meta: { - title: '供应商年度查询', - }, - component: '@/pages/supplierAnnualManage/supplierAnnualQuery/supplierAnnualQuery', - }, - { - name: 'supplierAnnualResult', - path: '/supplierAnnualResult', - meta: { - title: '供应商年度结果', - }, - component: '@/pages/supplierAnnualManage/supplierAnnualResult/supplierAnnualResult', - }, ] }, diff --git a/src/components/FileUpload/FileUpload.tsx b/src/components/FileUpload/FileUpload.tsx index 92b1a13..6c8672f 100644 --- a/src/components/FileUpload/FileUpload.tsx +++ b/src/components/FileUpload/FileUpload.tsx @@ -203,7 +203,7 @@ const FileUpload: React.FC = ({ } return ( - ); diff --git a/src/dicts/download.ts b/src/dicts/download.ts new file mode 100644 index 0000000..ecc7092 --- /dev/null +++ b/src/dicts/download.ts @@ -0,0 +1,62 @@ +// 下载中心字典 +// is_top int 是 0 是否置顶(0.否、1.是) +// status int 是 0 状态(0.草稿、1.上架、2.下架) +// del_flag varchar(16) 是 normal 删除标识(normal.正常、deleted.已删除) +// is_bold int 是 0 是否加粗(0.否、1.是) + +export enum DownloadStatus { + DRAFT = '0', + ON_SHELF = '1', + OFF_SHELF = '2', +} + +export enum DownloadIsTop { + NO = '0', + YES = '1', +} + +export enum DownloadIsBold { + NO = '0', + YES = '1', +} + +// 状态标签类型定义 +export const DownloadStatusLabels: Record = { + [DownloadStatus.DRAFT]: '草稿', + [DownloadStatus.ON_SHELF]: '已发布', + [DownloadStatus.OFF_SHELF]: '已下架', +}; + +// 栏目类型 +export enum DownloadColumnType { + FORM = 'form', // 表单文档 + POLICY = 'policy', // 政策文件 + MANUAL = 'manual', // 操作手册 + OTHER = 'other', // 其他资料 +} + +// 栏目类型标签 +export const DownloadColumnTypeLabels: Record = { + [DownloadColumnType.FORM]: '表单文档', + [DownloadColumnType.POLICY]: '政策文件', + [DownloadColumnType.MANUAL]: '操作手册', + [DownloadColumnType.OTHER]: '其他资料', +}; + +// 栏目类型选项(用于Select) +export const DownloadColumnTypeOptions = [ + { label: DownloadColumnTypeLabels[DownloadColumnType.FORM], value: DownloadColumnType.FORM }, + { label: DownloadColumnTypeLabels[DownloadColumnType.POLICY], value: DownloadColumnType.POLICY }, + { label: DownloadColumnTypeLabels[DownloadColumnType.MANUAL], value: DownloadColumnType.MANUAL }, + { label: DownloadColumnTypeLabels[DownloadColumnType.OTHER], value: DownloadColumnType.OTHER }, +]; + +// 获取状态标签文字 +export const getDownloadStatusText = (status: string): string => { + return DownloadStatusLabels[status] || '未知'; +}; + +// 获取栏目类型标签文字 +export const getDownloadColumnTypeText = (columnType: string): string => { + return DownloadColumnTypeLabels[columnType] || columnType; +}; diff --git a/src/layouts/SiderMenu.tsx b/src/layouts/SiderMenu.tsx index aa2dfb4..d7f8f36 100644 --- a/src/layouts/SiderMenu.tsx +++ b/src/layouts/SiderMenu.tsx @@ -92,74 +92,6 @@ const items: IMenuItem[] = [ }, ], }, - { - label: 'menu.供应商评价', - key: 'supplierEvaluateManage', - icon: 'icon-youqinglianjie', - children: [ - { - label: 'menu.模板管理', - key: 'supplierTemplateManage', - icon: 'icon-fenlei', - path: '/supplierTemplateManage', - }, - { - label: 'menu.任务管理', - key: 'supplierTaskManage', - icon: 'icon-liebiaomoshi', - path: '/supplierTaskManage', - }, - { - label: 'menu.评价打分', - key: 'supplierEvaluateScore', - icon: 'icon-liebiaomoshi', - path: '/supplierEvaluateScore', - }, - { - label: 'menu.评价结果', - key: 'supplierEvaluateResult', - icon: 'icon-liebiaomoshi', - path: '/supplierEvaluateResult', - }, - { - label: 'menu.评价结果审批', - key: 'supplierEvaluateResultApproval', - icon: 'icon-liebiaomoshi', - path: '/supplierEvaluateResultApproval', - }, - ], - }, - { - label: 'menu.供应商年审', - key: 'supplierAnnualManage', - icon: 'icon-youqinglianjie', - children: [ - { - label: 'menu.年审模板管理', - key: 'supplierAnnualTemplateManage', - icon: 'icon-fenlei', - path: '/supplierAnnualTemplateManage', - }, - { - label: 'menu.年审任务管理', - key: 'supplierAnnualTaskManage', - icon: 'icon-liebiaomoshi', - path: '/supplierAnnualTaskManage', - }, - { - label: 'menu.年度查询', - key: 'supplierAnnualQuery', - icon: 'icon-liebiaomoshi', - path: '/supplierAnnualQuery', - }, - { - label: 'menu.年审结果', - key: 'supplierAnnualResult', - icon: 'icon-liebiaomoshi', - path: '/supplierAnnualResult', - }, - ], - }, ]; const SiderMenu: React.FC = (props) => { diff --git a/src/pages/downloadManage/downloadManage.tsx b/src/pages/downloadManage/downloadManage.tsx index d55c800..f59b8e9 100644 --- a/src/pages/downloadManage/downloadManage.tsx +++ b/src/pages/downloadManage/downloadManage.tsx @@ -1,23 +1,38 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { useIntl } from 'umi'; -import { Button, Table, Space, Modal, message, Input, Select, Form, Tooltip, Switch, Upload, Tag } from 'antd'; +import { Button, Table, Space, Modal, message, Input, Select, Form, Tooltip, Tag } from 'antd'; import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined, SearchOutlined, - InboxOutlined, } from '@ant-design/icons'; -import { validateFileSize } from '@/utils/utils'; +import FileUpload from '@/components/FileUpload/FileUpload'; +import { + getDownloadList, + getDownloadDetail, + addDownload, + updateDownload, + updateDownloadStatus, + batchDeleteDownload, +} from '@/servers/api/download'; +import { + DownloadStatus, + DownloadIsTop, + DownloadIsBold, + DownloadColumnType, + DownloadColumnTypeOptions, + DownloadStatusLabels, + DownloadColumnTypeLabels, + getDownloadStatusText, + getDownloadColumnTypeText, +} from '@/dicts/download'; import styles from './downloadManage.less'; import type { UploadFile } from 'antd/es/upload/interface'; const { Option } = Select; -const { Dragger } = Upload; -type DownloadType = API.DownloadRecord & { - key: string; -}; +type DownloadType = API.DownloadRecord; const DownloadManage: React.FC = () => { const intl = useIntl(); @@ -30,105 +45,132 @@ const DownloadManage: React.FC = () => { const [modalForm] = Form.useForm(); const [fileList, setFileList] = useState([]); const [thumbnailList, setThumbnailList] = useState([]); - const [downloadData, setDownloadData] = useState([ - { - key: '1', - id: '1', - name: '采购申请模板', - category: '模板文件', - keyword: '采购,申请,模板', - createTime: '2023-06-15 10:30:00', - createBy: 'admin', - status: '1', // 已发布 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - { - key: '2', - id: '2', - name: '系统操作手册V1.0', - category: '操作手册', - keyword: '系统,操作,手册', - createTime: '2023-06-20 14:45:00', - createBy: 'admin', - status: '0', // 草稿 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - { - key: '3', - id: '3', - name: '发票申请指南', - category: '操作手册', - keyword: '发票,申请,指南', - createTime: '2023-06-25 09:15:00', - createBy: 'admin', - status: '1', // 已发布 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - ]); + const [downloadData, setDownloadData] = useState([]); const [pagination, setPagination] = useState({ current: 1, pageSize: 10, - total: 3, + total: 0, showSizeChanger: true, showQuickJumper: true, showTotal: (total: number) => `共 ${total} 条记录`, }); const [searchParams, setSearchParams] = useState({}); - // 获取下载中心列表(模拟数据) - const fetchDownloadList = (current: number = 1, pageSize: number = 10) => { + // 获取下载中心列表 + const fetchDownloadList = async ( + current: number = 1, + pageSize: number = 10, + params: API.DownloadSearchParams = searchParams, + ) => { setLoading(true); - // 模拟API请求延迟 - setTimeout(() => { + try { + const requestParams = { + ...params, + pageNo: current, + pageSize: pageSize, + }; + const res = await getDownloadList(requestParams); + if (res.success) { + setDownloadData(res.data.records); + setPagination({ + ...pagination, + current: res.data.current, + pageSize: res.data.size, + total: res.data.total, + }); + } else { + message.error(res.message || '获取列表失败'); + } + } catch (error) { + console.error('获取下载中心列表失败:', error); + message.error('获取列表失败'); + } finally { setLoading(false); - }, 500); + } + }; + + // 首次加载 + useEffect(() => { + fetchDownloadList(); + }, []); + + // 获取详情 + const fetchDownloadDetail = async (id: string) => { + try { + const res = await getDownloadDetail(id); + if (res.success) { + return res.data; + } else { + message.error(res.message || '获取详情失败'); + return null; + } + } catch (error) { + console.error('获取下载详情失败:', error); + message.error('获取详情失败'); + return null; + } }; // 处理编辑 - const handleEdit = (record: DownloadType) => { - // 检查是否为已发布状态 - if (record.status === '1') { - message.warning('已发布的文件不能编辑'); - return; - } - + const handleEdit = async (record: DownloadType) => { setIsEdit(true); setCurrentId(record.id); setModalVisible(true); + setLoading(true); - // 填充表单数据 - modalForm.setFieldsValue({ - name: record.name, - category: record.category, - keyword: record.keyword, - }); + try { + // 获取详细数据 + const detailData = await fetchDownloadDetail(record.id); + if (!detailData) { + setModalVisible(false); + return; + } - // 重置文件列表和缩略图 - setFileList([]); - if (record.thumbnail) { - setThumbnailList([ - { + // 先设置基本表单数据 + modalForm.setFieldsValue({ + ...detailData + }); + + // 设置文件信息 + let fileInfo = null; + if (detailData.fileUrl) { + fileInfo = { uid: '-1', - name: 'thumbnail.png', + name: detailData.fileName || '文件', status: 'done', - url: record.thumbnail, - type: 'image/png', - size: 0, - } as UploadFile - ]); - } else { - setThumbnailList([]); + url: detailData.fileUrl, + type: detailData.fileType || '', + } as UploadFile; + setFileList([fileInfo]); + } else { + setFileList([]); + } + + // 设置缩略图 + let thumbnailInfo = null; + if (detailData.thumbnail) { + thumbnailInfo = { + uid: '-1', + name: '缩略图', + status: 'done', + url: detailData.thumbnail, + type: 'image/jpeg', + } as UploadFile; + setThumbnailList([thumbnailInfo]); + } else { + setThumbnailList([]); + } + + } catch (error) { + console.error('加载详情数据失败:', error); + message.error('加载详情数据失败'); + } finally { + setLoading(false); } }; // 处理删除 const showDeleteConfirm = (record: DownloadType) => { - // 检查是否为已发布状态 - if (record.status === '1') { - message.warning('已发布的文件不能删除'); - return; - } - Modal.confirm({ title: '确定要删除该文件吗?', icon: , @@ -139,10 +181,13 @@ const DownloadManage: React.FC = () => { maskClosable: false, onOk: async () => { try { - // 模拟删除操作 - const newData = downloadData.filter(item => item.id !== record.id); - setDownloadData(newData); - message.success('删除成功'); + const res = await batchDeleteDownload([record.id]); + if (res.success) { + message.success('删除成功'); + fetchDownloadList(pagination.current, pagination.pageSize); + } else { + message.error(res.message || '删除失败'); + } } catch (error) { console.error('删除文件失败:', error); message.error('删除失败'); @@ -153,46 +198,71 @@ const DownloadManage: React.FC = () => { // 处理发布/下架 const handlePublishStatus = async (record: DownloadType) => { - // 状态: 0-草稿,1-已发布 - const isPublished = record.status === '1'; - const actionText = isPublished ? '下架' : '发布'; - const newStatus = isPublished ? '0' : '1'; + // 状态: 0-草稿,1-已发布,2-已下架 + let newStatus: string; + let actionText: string; - try { - // 模拟API请求 - const newData = downloadData.map(item => - item.id === record.id ? { ...item, status: newStatus } : item - ); - setDownloadData(newData); - message.success(`${actionText}成功`); - } catch (error) { - console.error(`${actionText}失败:`, error); - message.error(`${actionText}失败`); + if (record.status === DownloadStatus.DRAFT) { + newStatus = DownloadStatus.ON_SHELF; + actionText = '发布'; + } else if (record.status === DownloadStatus.ON_SHELF) { + newStatus = DownloadStatus.OFF_SHELF; + actionText = '下架'; + } else { + newStatus = DownloadStatus.ON_SHELF; + actionText = '上架'; } + + // 添加确认提示 + Modal.confirm({ + title: `确定要${actionText}该文件吗?`, + icon: , + content: `文件名称: ${record.name}`, + okText: '确定', + cancelText: '取消', + maskClosable: false, + onOk: async () => { + try { + const res = await updateDownloadStatus(record.id, newStatus); + if (res.success) { + message.success(`${actionText}成功`); + fetchDownloadList(pagination.current, pagination.pageSize); + } else { + message.error(res.message || `${actionText}失败`); + } + } catch (error) { + console.error(`${actionText}失败:`, error); + message.error(`${actionText}失败`); + } + }, + }); }; // 获取栏目标签 - const getCategoryTag = (category: string) => { - switch (category) { - case '模板文件': - return 模板文件; - case '操作手册': - return 操作手册; - default: - return 其他; - } + const getColumnTypeTag = (columnType: string) => { + const typeMap: Record = { + [DownloadColumnType.FORM]: { color: 'blue' }, + [DownloadColumnType.POLICY]: { color: 'green' }, + [DownloadColumnType.MANUAL]: { color: 'orange' }, + [DownloadColumnType.OTHER]: { color: 'default' }, + }; + + const type = typeMap[columnType] || { color: 'default' }; + const label = getDownloadColumnTypeText(columnType); + return {label}; }; // 获取状态标签 const getStatusTag = (status: string) => { - switch (status) { - case '0': - return 草稿; - case '1': - return 已发布; - default: - return 未知; - } + const statusMap: Record = { + [DownloadStatus.DRAFT]: { color: 'default' }, + [DownloadStatus.ON_SHELF]: { color: 'green' }, + [DownloadStatus.OFF_SHELF]: { color: 'red' }, + }; + + const type = statusMap[status] || { color: 'default' }; + const label = getDownloadStatusText(status); + return {label}; }; // 处理表格分页变化 @@ -206,14 +276,19 @@ const DownloadManage: React.FC = () => { dataIndex: 'id', key: 'id', width: 80, + render: (_: string, __: any, index: number) => + (pagination.current - 1) * pagination.pageSize + index + 1, }, { title: '缩略图', dataIndex: 'thumbnail', key: 'thumbnail', - render: (thumbnail: string) => ( - thumbnail ? 缩略图 : '无' - ), + render: (thumbnail: string) => + thumbnail ? ( + 缩略图 + ) : ( + '无' + ), }, { title: '名称', @@ -222,28 +297,30 @@ const DownloadManage: React.FC = () => { ellipsis: { showTitle: false, }, - render: (name: string) => ( + render: (name: string, record: DownloadType) => ( - {name} + + {name} + ), }, { title: '栏目', - dataIndex: 'category', - key: 'category', - render: (category: string) => getCategoryTag(category), + dataIndex: 'columnType', + key: 'columnType', + render: (columnType: string) => getColumnTypeTag(columnType), }, { title: '关键词', - dataIndex: 'keyword', - key: 'keyword', + dataIndex: 'keywords', + key: 'keywords', ellipsis: { showTitle: false, }, - render: (keyword: string) => ( - - {keyword} + render: (keywords: string) => ( + + {keywords} ), }, @@ -271,10 +348,10 @@ const DownloadManage: React.FC = () => { align: 'center' as const, render: (_: unknown, record: DownloadType) => ( <> - - {record.status === '1' ? ( + {record.status === DownloadStatus.ON_SHELF ? ( @@ -283,20 +360,13 @@ const DownloadManage: React.FC = () => { - )} - {record.status !== '1' && ( - )} @@ -307,7 +377,7 @@ const DownloadManage: React.FC = () => { // 行选择限制 const checkSelectable = (record: DownloadType) => { - return record.status !== '1'; // 已发布的不能选择 + return record.status !== DownloadStatus.ON_SHELF; // 已发布的不能选择 }; const onSelectChange = (newSelectedRowKeys: React.Key[]) => { @@ -318,7 +388,7 @@ const DownloadManage: React.FC = () => { selectedRowKeys, onChange: onSelectChange, getCheckboxProps: (record: DownloadType) => ({ - disabled: record.status === '1', // 已发布的不能选择 + disabled: record.status === DownloadStatus.ON_SHELF, // 已发布的不能选择 }), }; @@ -339,7 +409,7 @@ const DownloadManage: React.FC = () => { Modal.confirm({ title: '确定要删除选中的文件吗?', icon: , - content: '删除后无法恢复', + content: `将要删除 ${selectedRowKeys.length} 个文件,删除后无法恢复`, okText: '确定', okType: 'danger', cancelText: '取消', @@ -347,16 +417,14 @@ const DownloadManage: React.FC = () => { onOk: async () => { setLoading(true); try { - // 模拟批量删除,过滤掉已发布的文件 - const deleteIds = selectedRowKeys.filter(key => { - const record = downloadData.find(item => item.key === key); - return record && record.status !== '1'; - }); - - const newData = downloadData.filter(item => !deleteIds.includes(item.key)); - setDownloadData(newData); - setSelectedRowKeys([]); - message.success('删除成功'); + const res = await batchDeleteDownload(selectedRowKeys as string[]); + if (res.success) { + setSelectedRowKeys([]); + message.success('批量删除成功'); + fetchDownloadList(pagination.current, pagination.pageSize); + } else { + message.error(res.message || '批量删除失败'); + } } catch (error) { console.error('批量删除失败:', error); message.error('批量删除失败'); @@ -369,126 +437,109 @@ const DownloadManage: React.FC = () => { // 处理搜索 const handleSearch = (values: API.DownloadSearchParams) => { - console.log('搜索条件:', values); + // 先保存搜索参数 setSearchParams(values); - - // 模拟搜索,实际项目中应调用API - const initialData = [ - { - key: '1', - id: '1', - name: '采购申请模板', - category: '模板文件', - keyword: '采购,申请,模板', - createTime: '2023-06-15 10:30:00', - createBy: 'admin', - status: '1', // 已发布 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - { - key: '2', - id: '2', - name: '系统操作手册V1.0', - category: '操作手册', - keyword: '系统,操作,手册', - createTime: '2023-06-20 14:45:00', - createBy: 'admin', - status: '0', // 草稿 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - { - key: '3', - id: '3', - name: '发票申请指南', - category: '操作手册', - keyword: '发票,申请,指南', - createTime: '2023-06-25 09:15:00', - createBy: 'admin', - status: '1', // 已发布 - thumbnail: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - }, - ]; - - if (values.name || values.category || values.status) { - const filteredData = initialData.filter(item => { - const nameMatch = values.name ? item.name.includes(values.name) : true; - const categoryMatch = values.category ? item.category === values.category : true; - const statusMatch = values.status ? item.status === values.status : true; - return nameMatch && categoryMatch && statusMatch; - }); - setDownloadData(filteredData); - } else { - setDownloadData(initialData); - } + // 直接使用当前的values进行搜索,而非依赖searchParams状态 + fetchDownloadList(1, pagination.pageSize, values); }; + // 使用useEffect监听fileList和thumbnailList的变化,更新表单值 + useEffect(() => { + if (isEdit && fileList.length > 0) { + modalForm.setFieldsValue({ file: fileList }); + } + }, [fileList, isEdit]); + + useEffect(() => { + if (isEdit && thumbnailList.length > 0) { + modalForm.setFieldsValue({ thumbnail: thumbnailList }); + } + }, [thumbnailList, isEdit]); + // 处理文件上传变化 - const handleFileChange = (info: any) => { - setFileList(info.fileList.slice(-1)); // 只保留最后一个文件 + const handleFileChange = (uploadFiles: UploadFile[]) => { + setFileList(uploadFiles); + + // 更新表单中的文件值,支持多文件 + modalForm.setFieldsValue({ file: uploadFiles }); }; // 处理缩略图上传变化 - const handleThumbnailChange = (info: any) => { - setThumbnailList(info.fileList.slice(-1)); // 只保留最后一个文件 + const handleThumbnailChange = (uploadFiles: UploadFile[]) => { + setThumbnailList(uploadFiles); - // 如果上传成功,模拟获取URL - if (info.file.status === 'done') { - message.success(`${info.file.name} 上传成功`); - } else if (info.file.status === 'error') { - message.error(`${info.file.name} 上传失败`); - } + // 更新表单中的缩略图值,支持多文件 + modalForm.setFieldsValue({ thumbnail: uploadFiles }); }; // 处理模态框提交 - const handleModalSubmit = () => { - modalForm.validateFields().then(values => { - try { - // 检查是否有文件上传 - if (!isEdit && fileList.length === 0) { - message.error('请上传文件'); - return; - } + const handleModalSubmit = async () => { + try { + const values = await modalForm.validateFields(); - const thumbnailUrl = thumbnailList.length > 0 - ? thumbnailList[0].url || 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' - : undefined; - - const newItem: DownloadType = { - key: isEdit ? currentId : (downloadData.length + 1).toString(), - id: isEdit ? currentId : (downloadData.length + 1).toString(), - name: values.name, - category: values.category, - keyword: values.keyword, - createTime: new Date().toLocaleString(), - createBy: 'admin', - status: '0', // 默认为草稿状态 - thumbnail: thumbnailUrl, - }; - - if (isEdit) { - // 编辑模式,更新数据 - const newData = downloadData.map(item => - item.id === currentId ? newItem : item - ); - setDownloadData(newData); - message.success('更新成功'); - } else { - // 新增模式,添加数据 - setDownloadData([...downloadData, newItem]); - message.success('添加成功'); - } - - setModalVisible(false); - modalForm.resetFields(); - setFileList([]); - setThumbnailList([]); - } catch (error) { - console.error(isEdit ? '更新文件失败:' : '添加文件失败:', error); - message.error(isEdit ? '更新失败' : '添加失败'); + // 检查文件上传 + if (fileList.length === 0 && !isEdit) { + message.error('请上传文件'); + return; } - }).catch(info => { - console.log('校验失败:', info); - }); + + // 获取文件和缩略图信息 + const fileInfo = fileList.length > 0 ? fileList[0] : null; + const thumbnailInfo = thumbnailList.length > 0 ? thumbnailList[0] : null; + + if (!fileInfo && !isEdit) { + message.error('文件上传失败'); + return; + } + + // 构建请求参数 - 注意这里我们仍然只使用第一个文件,因为API可能不支持多文件 + const requestData: API.DownloadRequest = { + name: values.name, + columnType: values.columnType, + keywords: values.keywords, + isBold: parseInt(values.isBold), // 转换为数字类型 + isTop: parseInt(values.isTop), // 转换为数字类型 + thumbnail: thumbnailInfo?.url || thumbnailInfo?.response?.data?.url || '', + fileName: fileInfo?.name || '', + fileType: fileInfo?.type || '', + fileSize: fileInfo?.size?.toString() || '0', + filePath: fileInfo?.response?.data?.filePath || '', + fileUrl: fileInfo?.url || fileInfo?.response?.data?.url || '', + }; + + if (isEdit) { + requestData.id = currentId; + } + + // 添加确认提示 + Modal.confirm({ + title: isEdit ? '确定要保存修改吗?' : '确定要添加该文件吗?', + icon: , + content: `文件名称: ${values.name}`, + okText: '确定', + cancelText: '取消', + maskClosable: false, + onOk: async () => { + // 区分新增和修改操作 + const res = isEdit + ? await updateDownload(requestData) + : await addDownload(requestData); + + if (res.success) { + message.success(isEdit ? '更新成功' : '添加成功'); + setModalVisible(false); + modalForm.resetFields(); + setFileList([]); + setThumbnailList([]); + fetchDownloadList(pagination.current, pagination.pageSize); + } else { + message.error(res.message || (isEdit ? '更新失败' : '添加失败')); + } + }, + }); + } catch (info) { + console.log('表单验证失败:', info); + } }; // 处理模态框取消 @@ -512,16 +563,26 @@ const DownloadManage: React.FC = () => { - + @@ -544,12 +605,7 @@ const DownloadManage: React.FC = () => {
- {hasSelected && ( - - 已选择 {selectedRowKeys.length} 项 - + 已选择 {selectedRowKeys.length} 项 )}
@@ -577,12 +631,13 @@ const DownloadManage: React.FC = () => { pagination={pagination} loading={loading} onChange={handleTableChange} + rowKey="id" /> {/* 新增/编辑模态框 */} { maskClosable={false} destroyOnClose > -
- + + @@ -628,20 +677,15 @@ const DownloadManage: React.FC = () => { label="文件上传" rules={[{ required: !isEdit, message: '请上传文件' }]} > - validateFileSize(file, 20, ['pdf', 'zip', 'rar', 'doc', 'docx'])} + -

- -

-

点击或拖拽文件到此区域上传

-

支持格式:.rar .zip .doc .docx .pdf,单个文件不能超过20MB

-
+ allowedTypes={['pdf', 'zip', 'rar', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']} + tip="支持格式:PDF、Office文档、压缩包等,单个文件不能超过20MB" + isDragger={true} + />
{ label="缩略图" extra="支持jpg、png、gif等图片格式,大小不超过2MB" > - validateFileSize(file, 2, ['jpg', 'png', 'gif'])} + - {thumbnailList.length >= 1 ? null : ( -
- -
上传
-
- )} -
+ allowedTypes={['jpg', 'jpeg', 'png', 'gif']} + listType="picture-card" + /> +
+ + + + + + +
diff --git a/src/pages/supplierAnnualManage/supplierAnnualQuery/supplierAnnualQuery.tsx b/src/pages/supplierAnnualManage/supplierAnnualQuery/supplierAnnualQuery.tsx deleted file mode 100644 index b029eab..0000000 --- a/src/pages/supplierAnnualManage/supplierAnnualQuery/supplierAnnualQuery.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { Card } from 'antd'; - -const SupplierAnnualQuery: React.FC = () => { - return ( - -
供应商年度查询模块
-
- ); -}; - -export default SupplierAnnualQuery; diff --git a/src/pages/supplierAnnualManage/supplierAnnualResult/supplierAnnualResult.tsx b/src/pages/supplierAnnualManage/supplierAnnualResult/supplierAnnualResult.tsx deleted file mode 100644 index 3c6c1a8..0000000 --- a/src/pages/supplierAnnualManage/supplierAnnualResult/supplierAnnualResult.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { Card } from 'antd'; - -const SupplierAnnualResult: React.FC = () => { - return ( - -
供应商年度结果模块
-
- ); -}; - -export default SupplierAnnualResult; diff --git a/src/pages/supplierAnnualManage/supplierAnnualTaskManage/supplierAnnualTaskManage.tsx b/src/pages/supplierAnnualManage/supplierAnnualTaskManage/supplierAnnualTaskManage.tsx deleted file mode 100644 index 8c11536..0000000 --- a/src/pages/supplierAnnualManage/supplierAnnualTaskManage/supplierAnnualTaskManage.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { Card } from 'antd'; - -const SupplierAnnualTaskManage: React.FC = () => { - return ( - -
供应商年度任务管理模块
-
- ); -}; - -export default SupplierAnnualTaskManage; diff --git a/src/pages/supplierAnnualManage/supplierAnnualTemplateManage/supplierAnnualTemplateManage.tsx b/src/pages/supplierAnnualManage/supplierAnnualTemplateManage/supplierAnnualTemplateManage.tsx deleted file mode 100644 index e8fcaa8..0000000 --- a/src/pages/supplierAnnualManage/supplierAnnualTemplateManage/supplierAnnualTemplateManage.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import { Card } from 'antd'; - -const SupplierAnnualTemplateManage: React.FC = () => { - return ( - -
供应商年度模板管理模块
-
- ); -}; - -export default SupplierAnnualTemplateManage; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/GeneralEvaluation.tsx b/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/GeneralEvaluation.tsx deleted file mode 100644 index 2bd4c25..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/GeneralEvaluation.tsx +++ /dev/null @@ -1,221 +0,0 @@ -import React from 'react'; -import { Table, Progress, Typography, Card, Tag } from 'antd'; -import styles from './components.less'; - -const { Title, Text } = Typography; - -interface GeneralEvaluationProps { - supplierName?: string; -} - -const GeneralEvaluation: React.FC = ({ supplierName }) => { - // 评价数据 - const evaluationData = [ - { - key: '1', - firstIndex: '基本情况(base case)', - firstDescription: '企业基本资质与存续状态证明', - firstScore: 4, - secondIndex: '资质文件', - secondScore: 1, - averageScore: 3, - rowSpan: 2, - }, - { - key: '2', - firstIndex: '基本情况(base case)', - firstDescription: '企业基本资质与存续状态证明', - firstScore: 4, - secondIndex: 'XXX', - secondScore: 3, - averageScore: 1, - rowSpan: 0, // 设为0表示不显示 - }, - { - key: '3', - firstIndex: '成本(cost)', - firstDescription: '商品与服务的总拥有成本', - firstScore: 7, - secondIndex: 'XXX', - secondScore: 7, - averageScore: 6.5, - rowSpan: 1, - }, - { - key: '4', - firstIndex: '创新(innovate)', - firstDescription: '为公司提供竞争优势,提高商业价值而持续提供创新性建议及解决方案', - firstScore: 20, - secondIndex: 'XXX', - secondScore: 20, - averageScore: 18.5, - rowSpan: 1, - }, - { - key: '5', - firstIndex: '服务 (service)', - firstDescription: '为满足公司商业需求而提供的服务与支持', - firstScore: 10, - secondIndex: 'XXX', - secondScore: 10, - averageScore: 10, - rowSpan: 1, - }, - { - key: '6', - firstIndex: '质量(quality)', - firstDescription: '提供满足需求(规格)的产品与服务', - firstScore: 25, - secondIndex: 'XXX', - secondScore: 25, - averageScore: 24, - rowSpan: 1, - }, - { - key: '7', - firstIndex: '绿色(environment protection)', - firstDescription: '优秀的交付能力及与之相关的灵活性', - firstScore: 25, - secondIndex: 'XXX', - secondScore: 25, - averageScore: 24, - rowSpan: 1, - }, - { - key: '8', - firstIndex: '安全(safety)', - firstDescription: '产品质量安全、环境保护、风险防控及商业道德约束', - firstScore: 6, - secondIndex: 'XXX', - secondScore: 6, - averageScore: 5, - rowSpan: 1, - }, - { - key: '9', - firstIndex: '廉洁(integrity)', - firstDescription: '商业道德约束', - firstScore: 3, - secondIndex: '商业贿赂与道德风险', - secondScore: 3, - averageScore: 3, - rowSpan: 1, - }, - { - key: '10', - firstIndex: '合计', - firstDescription: '', - firstScore: 100, - secondIndex: '', - secondScore: 100, - averageScore: 95, - rowSpan: 1, - }, - ]; - - const columns = [ - { - title: '', - dataIndex: 'index', - key: 'index', - width: 50, - render: (text: string, record: any, index: number) => index + 1, - }, - { - title: '一级指标', - children: [ - { - title: '*基本指标', - dataIndex: 'firstIndex', - key: 'firstIndex', - width: 150, - render: (text: string, record: any, index: number) => { - return { - children: text, - props: { - rowSpan: record.rowSpan, - }, - }; - }, - }, - { - title: '*指标说明', - dataIndex: 'firstDescription', - key: 'firstDescription', - width: 220, - render: (text: string, record: any) => { - return { - children: text, - props: { - rowSpan: record.rowSpan, - }, - }; - }, - }, - { - title: '分值', - dataIndex: 'firstScore', - key: 'firstScore', - width: 80, - render: (text: number, record: any) => { - return { - children: text, - props: { - rowSpan: record.rowSpan, - }, - }; - }, - }, - ], - }, - { - title: '二级指标', - children: [ - { - title: '*细分指标', - dataIndex: 'secondIndex', - key: 'secondIndex', - width: 180, - }, - { - title: '分值', - dataIndex: 'secondScore', - key: 'secondScore', - width: 80, - }, - ], - }, - { - title: '平均分', - dataIndex: 'averageScore', - key: 'averageScore', - width: 80, - render: (score: number) => ( - - {score} - - ), - }, - ]; - - // 计算总分 - const totalScore = evaluationData[evaluationData.length - 1].averageScore; - const totalPossibleScore = evaluationData[evaluationData.length - 1].firstScore; - const scorePercentage = (totalScore / totalPossibleScore) * 100; - - return ( -
- - - - ); -}; - -export default GeneralEvaluation; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/TechnicalEvaluation.tsx b/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/TechnicalEvaluation.tsx deleted file mode 100644 index 0339a20..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/TechnicalEvaluation.tsx +++ /dev/null @@ -1,265 +0,0 @@ -import React from 'react'; -import { Table, Progress, Typography, Card, Tag } from 'antd'; -import styles from './components.less'; - -const { Title, Text } = Typography; - -interface TechnicalEvaluationProps { - supplierName?: string; -} - -const TechnicalEvaluation: React.FC = ({ supplierName }) => { - // 评价数据 - const evaluationData = [ - { - key: '1', - firstIndex: '技术实力', - firstDescription: '技术团队规模与研发能力', - firstScore: 20, - secondIndex: '研发团队规模', - secondScore: 10, - averageScore: 9, - rowSpan: 2, - }, - { - key: '2', - firstIndex: '技术实力', - firstDescription: '技术团队规模与研发能力', - firstScore: 20, - secondIndex: '技术创新能力', - secondScore: 10, - averageScore: 8, - rowSpan: 0, // 设为0表示不显示 - }, - { - key: '3', - firstIndex: '产品性能', - firstDescription: '产品的技术指标与性能表现', - firstScore: 25, - secondIndex: '核心性能指标', - secondScore: 15, - averageScore: 14, - rowSpan: 2, - }, - { - key: '4', - firstIndex: '产品性能', - firstDescription: '产品的技术指标与性能表现', - firstScore: 25, - secondIndex: '稳定性与可靠性', - secondScore: 10, - averageScore: 9.5, - rowSpan: 0, - }, - { - key: '5', - firstIndex: '技术支持', - firstDescription: '提供的技术服务与支持能力', - firstScore: 15, - secondIndex: '响应速度', - secondScore: 8, - averageScore: 7.5, - rowSpan: 2, - }, - { - key: '6', - firstIndex: '技术支持', - firstDescription: '提供的技术服务与支持能力', - firstScore: 15, - secondIndex: '问题解决能力', - secondScore: 7, - averageScore: 6.5, - rowSpan: 0, - }, - { - key: '7', - firstIndex: '技术文档', - firstDescription: '技术文档的完整性与准确性', - firstScore: 10, - secondIndex: '文档完整性', - secondScore: 5, - averageScore: 4.5, - rowSpan: 2, - }, - { - key: '8', - firstIndex: '技术文档', - firstDescription: '技术文档的完整性与准确性', - firstScore: 10, - secondIndex: '文档准确性', - secondScore: 5, - averageScore: 4, - rowSpan: 0, - }, - { - key: '9', - firstIndex: '技术培训', - firstDescription: '提供的技术培训与知识转移', - firstScore: 15, - secondIndex: '培训质量', - secondScore: 8, - averageScore: 7, - rowSpan: 2, - }, - { - key: '10', - firstIndex: '技术培训', - firstDescription: '提供的技术培训与知识转移', - firstScore: 15, - secondIndex: '培训频率', - secondScore: 7, - averageScore: 6, - rowSpan: 0, - }, - { - key: '11', - firstIndex: '兼容性', - firstDescription: '与现有系统的兼容性', - firstScore: 15, - secondIndex: '系统兼容性评估', - secondScore: 15, - averageScore: 13.5, - rowSpan: 1, - }, - { - key: '12', - firstIndex: '合计', - firstDescription: '', - firstScore: 100, - secondIndex: '', - secondScore: 100, - averageScore: 89.5, - rowSpan: 1, - }, - ]; - - const columns = [ - { - title: '', - dataIndex: 'index', - key: 'index', - width: 50, - render: (text: string, record: any, index: number) => index + 1, - }, - { - title: '一级指标', - children: [ - { - title: '*基本指标', - dataIndex: 'firstIndex', - key: 'firstIndex', - width: 150, - className: styles.requiredColumn, - render: (text: string, record: any, index: number) => { - return { - children: text, - props: { - rowSpan: record.rowSpan, - }, - }; - }, - }, - { - title: '*指标说明', - dataIndex: 'firstDescription', - key: 'firstDescription', - width: 220, - className: styles.requiredColumn, - render: (text: string, record: any) => { - return { - children: text, - props: { - rowSpan: record.rowSpan, - }, - }; - }, - }, - { - title: '分值', - dataIndex: 'firstScore', - key: 'firstScore', - width: 80, - render: (text: number, record: any) => { - return { - children: text, - props: { - rowSpan: record.rowSpan, - }, - }; - }, - }, - ], - }, - { - title: '二级指标', - children: [ - { - title: '*细分指标', - dataIndex: 'secondIndex', - key: 'secondIndex', - width: 180, - className: styles.requiredColumn, - }, - { - title: '分值', - dataIndex: 'secondScore', - key: 'secondScore', - width: 80, - }, - ], - }, - { - title: '平均分', - dataIndex: 'averageScore', - key: 'averageScore', - width: 80, - render: (score: number) => ( - - {score} - - ), - }, - ]; - - // 计算总分 - const totalScore = evaluationData[evaluationData.length - 1].averageScore; - const totalPossibleScore = evaluationData[evaluationData.length - 1].firstScore; - const scorePercentage = (totalScore / totalPossibleScore) * 100; - - return ( -
- -
-
- `${totalScore}`} - width={80} - strokeColor={{ - '0%': '#108ee9', - '100%': '#87d068', - }} - /> -
-
- 技术评价总分 - 满分: {totalPossibleScore}分 - {supplierName && 供应商: {supplierName}} -
-
-
- -
- - ); -}; - -export default TechnicalEvaluation; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/components.less b/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/components.less deleted file mode 100644 index 77e9de3..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/components/components.less +++ /dev/null @@ -1,80 +0,0 @@ -.evaluationContainer { - margin-top: 16px; -} - -.summaryCard { - margin-bottom: 16px; -} - -.scoreSummary { - display: flex; - align-items: center; -} - -.scoreCircle { - margin-right: 24px; -} - -.scoreInfo { - display: flex; - flex-direction: column; - justify-content: center; - - h4 { - margin-bottom: 4px; - } -} - -.scoreCell { - display: flex; - flex-direction: column; - - span { - margin-bottom: 4px; - } -} - -.scoreTable { - margin-top: 16px; - - :global { - .ant-table-thead > tr > th { - background-color: #f5f5f5; - text-align: center; - font-weight: 500; - } - - .ant-table-tbody > tr > td { - text-align: center; - vertical-align: middle; - } - } -} - -/* 必填列样式 */ -.requiredColumn { - position: relative; - - &::before { - content: '*'; - color: #ff4d4f; - position: absolute; - left: 8px; - top: 50%; - transform: translateY(-50%); - } -} - -/* 低分警示 */ -.lowScore { - color: #ff4d4f; - font-weight: 500; -} - -/* 表格嵌套表头样式 */ -:global { - .ant-table-thead > tr > th.ant-table-cell-fix-left, - .ant-table-thead > tr > th.ant-table-cell-fix-right { - background-color: #f5f5f5; - } -} diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult.less b/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult.less deleted file mode 100644 index 0f528a4..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult.less +++ /dev/null @@ -1,113 +0,0 @@ -/* 供应商评价结果模块公共样式 */ - -/* 详情项样式 */ -.detail-item { - display: flex; - margin-bottom: 12px; - - .label { - width: 120px; - text-align: right; - color: rgba(0, 0, 0, 0.85); - font-weight: 500; - margin-right: 8px; - } - - .content { - flex: 1; - word-break: break-all; - } -} - -/* 页面标题行样式 */ -.headerRow { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 16px; -} - -/* 标题区域样式 */ -.titleSection { - display: flex; - align-items: center; -} - -/* 操作区域样式 */ -.actionSection { - display: flex; - align-items: center; - - button { - margin-left: 8px; - } -} - -/* 页面标题样式 */ -.pageTitle { - margin-bottom: 0 !important; -} - -/* 页面头部样式 - 从supplierEvaluateResultInfo.less */ -.page-header { - margin-bottom: 24px; - - h2 { - margin-top: 16px; - margin-bottom: 16px; - font-size: 20px; - font-weight: 500; - } -} - -/* 详情项样式 - 从supplierEvaluateResultInfo.less */ -.detailItem { - margin-bottom: 8px; - line-height: 22px; - - .label { - display: inline-block; - width: 100px; - color: rgba(0, 0, 0, 0.65); - font-weight: 500; - } - - .content { - display: inline-block; - color: rgba(0, 0, 0, 0.85); - } -} - -/* 得分详情模态框样式 - 从supplierEvaluateResultInfo.less */ -.scoreDetailModal { - .scoreItem { - display: flex; - margin-bottom: 12px; - - .scoreLabel { - width: 120px; - font-weight: 500; - } - - .scoreValue { - flex: 1; - } - } -} - -/* 打分情况模态框样式 - 从supplierEvaluateResultInfo.less */ -.scoringModal { - .scoringItem { - display: flex; - margin-bottom: 12px; - - .scoringLabel { - width: 120px; - font-weight: 500; - } - - .scoringValue { - flex: 1; - } - } -} diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult.tsx b/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult.tsx deleted file mode 100644 index 7292aa4..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResult.tsx +++ /dev/null @@ -1,322 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { - Card, - Form, - Input, - Select, - Button, - Table, - Space, - Tag, - DatePicker, - TablePaginationConfig, - Modal, - Row, - Col, - Tooltip, - message, -} from 'antd'; -import { - SearchOutlined, - DeleteOutlined, - EyeOutlined, - PlusOutlined, -} from '@ant-design/icons'; -import { TaskStatus, TaskStatusText, TaskStatusColor, TaskType, TaskTypeText } from '@/dicts/supplierTaskDict'; -import moment from 'moment'; -import styles from './supplierEvaluateResult.less'; -import { history } from 'umi'; - -const { Option } = Select; -const { RangePicker } = DatePicker; - -// 删除本地接口定义,使用全局定义 - -const SupplierEvaluateResult: React.FC = () => { - const [loading, setLoading] = useState(false); - const [form] = Form.useForm(); - const [resultData, setResultData] = useState([]); - const [pagination, setPagination] = useState({ - current: 1, - pageSize: 10, - total: 0, - showSizeChanger: true, - showQuickJumper: true, - showTotal: (total) => `共 ${total} 条记录`, - }); - const [searchParams, setSearchParams] = useState({}); - - // 品类数据 - const categoryOptions = [ - { label: '食品', value: '食品' }, - { label: '电子', value: '电子' }, - { label: '机械', value: '机械' }, - { label: '化工', value: '化工' }, - { label: '医药', value: '医药' }, - ]; - - // 创建单位数据 - const unitOptions = [ - { label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' }, - { label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' }, - { label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' }, - { label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' }, - ]; - - // 模拟获取评价结果列表 - const fetchResultList = async ( - current = 1, - pageSize = 10, - params: SupplierEvaluate.EvaluateResultSearchParams = searchParams, - ) => { - // 更新搜索参数状态 - if (params !== searchParams) { - setSearchParams(params); - } - - setLoading(true); - try { - // 模拟API请求 - setTimeout(() => { - // 模拟数据 - const mockData: SupplierEvaluate.EvaluateResultRecord[] = Array.from({ length: 35 }).map((_, index) => { - const id = `${index + 1}`; - const status = Object.values(TaskStatus)[Math.floor(Math.random() * 3)]; - const taskType = Math.random() > 0.5 ? TaskType.REGULAR : TaskType.SPECIAL; - - // 随机选择单位和品类 - const unitIndex = Math.floor(Math.random() * unitOptions.length); - const categoryIndex = Math.floor(Math.random() * categoryOptions.length); - - // 随机生成日期 - const startDate = moment().subtract(Math.floor(Math.random() * 60), 'days'); - const endDate = moment(startDate).add(Math.floor(Math.random() * 30) + 15, 'days'); - - return { - id, - key: id, - evaluateTitle: `${TaskTypeText[taskType]}任务${index + 1}`, - evaluateCategory: categoryOptions[categoryIndex].value, - initiatingUnit: unitOptions[unitIndex].value, - startTime: startDate.format('YYYY-MM-DD'), - endTime: endDate.format('YYYY-MM-DD'), - status, - createTime: moment().subtract(Math.floor(Math.random() * 90), 'days').format('YYYY-MM-DD HH:mm:ss'), - }; - }); - - // 根据搜索条件过滤 - let filteredData = [...mockData]; - if (params.evaluateTitle) { - filteredData = filteredData.filter(item => - item.evaluateTitle.includes(params.evaluateTitle || '') - ); - } - if (params.status) { - filteredData = filteredData.filter(item => - item.status === params.status - ); - } - if (params.timeRange && params.timeRange.length === 2) { - const start = moment(params.timeRange[0]); - const end = moment(params.timeRange[1]); - filteredData = filteredData.filter(item => { - const itemStart = moment(item.startTime); - return itemStart.isBetween(start, end, null, '[]'); - }); - } - - // 分页 - const startIndex = (current - 1) * pageSize; - const endIndex = startIndex + pageSize; - const paginatedData = filteredData.slice(startIndex, endIndex); - - setResultData(paginatedData); - setPagination({ - ...pagination, - current, - pageSize, - total: filteredData.length, - }); - - setLoading(false); - }, 500); - } catch (error) { - console.error('获取评价结果列表失败:', error); - message.error('获取评价结果列表失败'); - setLoading(false); - } - }; - - // 首次加载获取数据 - useEffect(() => { - fetchResultList(pagination.current, pagination.pageSize, {}); - }, []); - - // 处理表格分页变化 - const handleTableChange = (newPagination: TablePaginationConfig) => { - fetchResultList(newPagination.current, newPagination.pageSize, searchParams); - }; - - // 处理搜索 - const handleSearch = (values: any) => { - const { timeRange, ...rest } = values; - const params: SupplierEvaluate.EvaluateResultSearchParams = { ...rest }; - - if (timeRange && timeRange.length === 2) { - params.timeRange = [timeRange[0].format('YYYY-MM-DD'), timeRange[1].format('YYYY-MM-DD')]; - } - - fetchResultList(1, pagination.pageSize, params); - }; - - // 处理重置 - const handleReset = () => { - form.resetFields(); - fetchResultList(1, pagination.pageSize, {}); - }; - - // 查看详情 - 修改为跳转到详情页 - const handleViewDetail = (record: SupplierEvaluate.EvaluateResultRecord) => { - history.push({ - pathname: '/supplierEvaluateResult/supplierEvaluateResultInfo', - state: { record } - }); - }; - - // 获取状态标签 - const getStatusTag = (status: string) => { - const color = TaskStatusColor[status as keyof typeof TaskStatusColor] || 'default'; - const text = TaskStatusText[status as keyof typeof TaskStatusText] || '未知状态'; - return {text}; - }; - - const columns = [ - { - title: '序号', - render: (_: any, __: SupplierEvaluate.EvaluateResultRecord, index: number) => - (pagination.current! - 1) * pagination.pageSize! + index + 1, - width: 80, - }, - { - title: '评价主题', - dataIndex: 'evaluateTitle', - key: 'evaluateTitle', - width: 200, - ellipsis: { - showTitle: false, - }, - render: (evaluateTitle: string) => ( - - {evaluateTitle} - - ), - }, - { - title: '评价品类', - dataIndex: 'evaluateCategory', - key: 'evaluateCategory', - width: 120, - }, - { - title: '发起单位', - dataIndex: 'initiatingUnit', - key: 'initiatingUnit', - width: 200, - ellipsis: { - showTitle: false, - }, - render: (text: string) => ( - - {text} - - ), - }, - { - title: '评价开始时间', - dataIndex: 'startTime', - key: 'startTime', - width: 120, - }, - { - title: '评价结束时间', - dataIndex: 'endTime', - key: 'endTime', - width: 120, - }, - { - title: '评价状态', - dataIndex: 'status', - key: 'status', - width: 100, - render: (status: string) => getStatusTag(status), - }, - { - title: '操作', - key: 'action', - width: 100, - align: 'center' as const, - render: (_: unknown, record: SupplierEvaluate.EvaluateResultRecord) => ( - - ), - }, - ]; - - return ( -
-
-
- - - - - - - - - - - - - - -
- -
-
- - - ); -}; - -export default SupplierEvaluateResult; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultByZb.tsx b/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultByZb.tsx deleted file mode 100644 index 52c9e0b..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultByZb.tsx +++ /dev/null @@ -1,205 +0,0 @@ -// 评价结果详情 -import React, { useState, useEffect } from 'react'; -import { Card, Form, Button, Descriptions, Divider, Row, Col, Tabs, message } from 'antd'; -import { ArrowLeftOutlined } from '@ant-design/icons'; -import { history, useLocation } from 'umi'; -import { EvaluateLevel, EvaluateLevelText } from '@/dicts/supplierTemplateDict'; -import GeneralEvaluation from './components/GeneralEvaluation'; -import TechnicalEvaluation from './components/TechnicalEvaluation'; -import styles from './supplierEvaluateResult.less'; - -const { TabPane } = Tabs; - -// 组件使用默认的接口定义 - -const SupplierEvaluateResultByZb: React.FC = () => { - const location = useLocation<{ record: any }>(); - const [loading, setLoading] = useState(false); - const [scoreRecord, setScoreRecord] = useState(null); - const [evaluationData, setEvaluationData] = useState<{ - general: any[]; - technical: any[]; - }>({ - general: [], - technical: [], - }); - - // 模拟获取评价详情数据 - const fetchEvaluationData = (record: any) => { - setLoading(true); - try { - // 模拟API请求 - setTimeout(() => { - // 模拟通用评价数据 - const generalData = [ - { - id: '1', - firstIndex: '质量管理', - firstDescription: '供应商质量管理体系评价', - secondIndex: '质量管理体系认证', - secondDescription: '是否通过ISO9001认证', - score: 9, - weight: 0.1, - weightedScore: 0.9, - comment: '已通过ISO9001认证,证书有效', - }, - { - id: '2', - firstIndex: '质量管理', - firstDescription: '供应商质量管理体系评价', - secondIndex: '质量控制流程', - secondDescription: '是否建立完善的质量控制流程', - score: 8, - weight: 0.1, - weightedScore: 0.8, - comment: '质量控制流程完善,但执行记录不够完整', - }, - { - id: '3', - firstIndex: '交付能力', - firstDescription: '供应商交付能力评价', - secondIndex: '准时交付率', - secondDescription: '过去一年准时交付率评价', - score: 9.5, - weight: 0.15, - weightedScore: 1.425, - comment: '准时交付率98%,表现优秀', - }, - ]; - - // 模拟技术评价数据 - const technicalData = [ - { - id: '1', - firstIndex: '技术能力', - firstDescription: '供应商技术研发能力评价', - secondIndex: '研发投入', - secondDescription: '研发投入占营业额比例', - score: 8.5, - weight: 0.1, - weightedScore: 0.85, - comment: '研发投入占营业额5%,符合行业平均水平', - }, - { - id: '2', - firstIndex: '技术能力', - firstDescription: '供应商技术研发能力评价', - secondIndex: '专利数量', - secondDescription: '拥有专利数量评价', - score: 9, - weight: 0.05, - weightedScore: 0.45, - comment: '拥有15项有效专利,其中发明专利5项', - }, - { - id: '3', - firstIndex: '设备设施', - firstDescription: '供应商设备设施评价', - secondIndex: '设备先进性', - secondDescription: '生产设备先进程度评价', - score: 8, - weight: 0.1, - weightedScore: 0.8, - comment: '主要生产设备较为先进,但部分设备需要更新', - }, - ]; - - setEvaluationData({ - general: generalData, - technical: technicalData, - }); - setLoading(false); - }, 500); - } catch (error) { - console.error('获取评价详情数据失败:', error); - message.error('获取评价详情数据失败'); - setLoading(false); - } - }; - - // 获取上级页面传递的数据 - useEffect(() => { - if (location.state?.record) { - setScoreRecord(location.state.record); - // 模拟获取评价详情数据 - fetchEvaluationData(location.state.record); - } - }, [location]); - - // 返回上一页 - const handleBack = () => { - history.goBack(); - }; - - // 计算总得分 - const calculateTotalScore = () => { - let totalScore = 0; - let totalWeight = 0; - - // 计算通用评价得分 - evaluationData.general.forEach((item: any) => { - totalScore += item.weightedScore; - totalWeight += item.weight; - }); - - // 计算技术评价得分 - evaluationData.technical.forEach((item: any) => { - totalScore += item.weightedScore; - totalWeight += item.weight; - }); - - // 如果权重总和不为0,则计算加权平均分 - if (totalWeight > 0) { - return (totalScore / totalWeight).toFixed(2); - } - - return '0.00'; - }; - - // 获取评价等级 - const getEvaluateLevel = (score: number) => { - if (score >= 90) { - return EvaluateLevelText[EvaluateLevel.EXCELLENT]; - } else if (score >= 80) { - return EvaluateLevelText[EvaluateLevel.GOOD]; - } else if (score >= 70) { - return EvaluateLevelText[EvaluateLevel.AVERAGE]; - } else { - return EvaluateLevelText[EvaluateLevel.POOR]; - } - }; - - if (!scoreRecord) { - return
加载中...
; - } - - return ( -
-
- -
- - - - {scoreRecord.supplierName} - {scoreRecord.category} - {scoreRecord.evaluateUnit} - {scoreRecord.evaluator} - {scoreRecord.evaluateTime} - {scoreRecord.score} - - {getEvaluateLevel(scoreRecord.score)} - - - - - - - -
- ); -}; - -export default SupplierEvaluateResultByZb; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultInfo.tsx b/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultInfo.tsx deleted file mode 100644 index 3404eeb..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultInfo.tsx +++ /dev/null @@ -1,310 +0,0 @@ -// 供应商评价结果详情 -import React, { useState, useEffect } from 'react'; -import { - Card, - Form, - Input, - Select, - Button, - Table, - Space, - Tag, - TablePaginationConfig, - Modal, - Row, - Col, - Tooltip, - message, -} from 'antd'; -import { - SearchOutlined, - DeleteOutlined, - ArrowLeftOutlined, - FileTextOutlined, - BarChartOutlined, -} from '@ant-design/icons'; -import { history, useLocation } from 'umi'; -import moment from 'moment'; -import { EvaluateLevel, EvaluateLevelText, EvaluateLevelColor } from '@/dicts/supplierTemplateDict'; -import styles from './supplierEvaluateResult.less'; - -const { Option } = Select; - -const SupplierEvaluateResultInfo: React.FC = () => { - const location = useLocation<{ record: SupplierEvaluate.EvaluateResultRecord }>(); - const [loading, setLoading] = useState(false); - const [form] = Form.useForm(); - const [resultData, setResultData] = useState([]); - const [pagination, setPagination] = useState({ - current: 1, - pageSize: 10, - total: 0, - showSizeChanger: true, - showQuickJumper: true, - showTotal: (total) => `共 ${total} 条记录`, - }); - const [searchParams, setSearchParams] = - useState({}); - const [parentRecord, setParentRecord] = useState( - null, - ); - - // 品类数据 - const categoryOptions = [ - { label: '食品', value: '食品' }, - { label: '电子', value: '电子' }, - { label: '机械', value: '机械' }, - { label: '化工', value: '化工' }, - { label: '医药', value: '医药' }, - ]; - - // 评价等级选项 - const levelOptions = Object.entries(EvaluateLevelText).map(([value, label]) => ({ - label, - value, - })); - - // 获取上级页面传递的数据 - useEffect(() => { - if (location.state?.record) { - setParentRecord(location.state.record); - } - }, [location]); - - // 模拟获取评价结果详情列表 - const fetchResultDetailList = async ( - current = 1, - pageSize = 10, - params: SupplierEvaluate.EvaluateResultDetailSearchParams = searchParams, - ) => { - // 更新搜索参数状态 - if (params !== searchParams) { - setSearchParams(params); - } - - setLoading(true); - try { - // 模拟API请求 - setTimeout(() => { - // 模拟数据 - const mockData: SupplierEvaluate.EvaluateResultDetailRecord[] = Array.from({ - length: 35, - }).map((_, index) => { - const id = `${index + 1}`; - - // 随机选择品类 - const categoryIndex = Math.floor(Math.random() * categoryOptions.length); - - // 随机生成得分和等级 - const score = Math.floor(Math.random() * 40) + 60; // 60-100分 - let level; - if (score >= 90) { - level = EvaluateLevel.EXCELLENT; - } else if (score >= 80) { - level = EvaluateLevel.GOOD; - } else if (score >= 70) { - level = EvaluateLevel.AVERAGE; - } else { - level = EvaluateLevel.POOR; - } - - return { - id, - key: id, - supplierName: `供应商${index + 1}`, - category: categoryOptions[categoryIndex].value, - score, - level, - }; - }); - - // 根据搜索条件过滤 - let filteredData = [...mockData]; - if (params.supplierName) { - filteredData = filteredData.filter((item) => - item.supplierName.includes(params.supplierName || ''), - ); - } - if (params.level) { - filteredData = filteredData.filter((item) => item.level === params.level); - } - - // 分页 - const startIndex = (current - 1) * pageSize; - const endIndex = startIndex + pageSize; - const paginatedData = filteredData.slice(startIndex, endIndex); - - setResultData(paginatedData); - setPagination({ - ...pagination, - current, - pageSize, - total: filteredData.length, - }); - - setLoading(false); - }, 500); - } catch (error) { - console.error('获取评价结果详情列表失败:', error); - message.error('获取评价结果详情列表失败'); - setLoading(false); - } - }; - - // 首次加载获取数据 - useEffect(() => { - fetchResultDetailList(pagination.current, pagination.pageSize, {}); - }, []); - - // 处理表格分页变化 - const handleTableChange = (newPagination: TablePaginationConfig) => { - fetchResultDetailList(newPagination.current, newPagination.pageSize, searchParams); - }; - - // 处理搜索 - const handleSearch = (values: any) => { - fetchResultDetailList(1, pagination.pageSize, values); - }; - - // 处理重置 - const handleReset = () => { - form.resetFields(); - fetchResultDetailList(1, pagination.pageSize, {}); - }; - - // 返回上一页 - const handleBack = () => { - history.goBack(); - }; - - // 查看得分明细 - const handleViewScoreDetail = (record: SupplierEvaluate.EvaluateResultDetailRecord) => { - history.push({ - pathname: '/supplierEvaluateResult/supplierEvaluateResultScoreDetail', - state: { record } - }); - }; - - // 查看打分情况 - const handleViewScoring = (record: SupplierEvaluate.EvaluateResultDetailRecord) => { - history.push({ - pathname: '/supplierEvaluateResult/supplierEvaluateResultScoreByList', - state: { record } - }); - }; - - // 获取等级标签 - const getLevelTag = (level: string) => { - const text = EvaluateLevelText[level as keyof typeof EvaluateLevelText] || '未知等级'; - return text; - }; - - const columns = [ - { - title: '序号', - render: (_: any, __: SupplierEvaluate.EvaluateResultDetailRecord, index: number) => - (pagination.current! - 1) * pagination.pageSize! + index + 1, - width: 80, - }, - { - title: '供应商名称', - dataIndex: 'supplierName', - key: 'supplierName', - width: 200, - ellipsis: { - showTitle: false, - }, - render: (supplierName: string) => ( - - {supplierName} - - ), - }, - { - title: '品类', - dataIndex: 'category', - key: 'category', - width: 120, - }, - { - title: '评价得分', - dataIndex: 'score', - key: 'score', - width: 100 - }, - { - title: '评价等级', - dataIndex: 'level', - key: 'level', - width: 100, - align: 'center' as const, - render: (level: string) => getLevelTag(level), - }, - { - title: '操作', - key: 'action', - width: 180, - align: 'center' as const, - render: (_: unknown, record: SupplierEvaluate.EvaluateResultDetailRecord) => ( - - - - - ), - }, - ]; - - return ( -
-
-
- - - - - - - - - - - -
- -
-
- -
-
- - - ); -}; - -export default SupplierEvaluateResultInfo; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreByList.tsx b/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreByList.tsx deleted file mode 100644 index 72634fa..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreByList.tsx +++ /dev/null @@ -1,295 +0,0 @@ -// 供应商评价结果打分情况 -import React, { useState, useEffect } from 'react'; -import { - Card, - Form, - Input, - Select, - Button, - Table, - Space, - TablePaginationConfig, - Tooltip, - message, -} from 'antd'; -import { - SearchOutlined, - DeleteOutlined, - ArrowLeftOutlined, - EyeOutlined, -} from '@ant-design/icons'; -import { history, useLocation } from 'umi'; -import { EvaluateLevel, EvaluateLevelText } from '@/dicts/supplierTemplateDict'; -import styles from './supplierEvaluateResult.less'; - -const { Option } = Select; - -const SupplierEvaluateResultScoreByList: React.FC = () => { - const location = useLocation<{ record: SupplierEvaluate.EvaluateResultDetailRecord }>(); - const [loading, setLoading] = useState(false); - const [form] = Form.useForm(); - const [scoreData, setScoreData] = useState([]); - const [pagination, setPagination] = useState({ - current: 1, - pageSize: 10, - total: 0, - showSizeChanger: true, - showQuickJumper: true, - showTotal: (total) => `共 ${total} 条记录`, - }); - const [searchParams, setSearchParams] = useState({}); - const [supplierRecord, setSupplierRecord] = useState(null); - - // 评价等级选项 - const levelOptions = Object.entries(EvaluateLevelText).map(([value, label]) => ({ - label, - value, - })); - - // 获取上级页面传递的数据 - useEffect(() => { - if (location.state?.record) { - setSupplierRecord(location.state.record); - } - }, [location]); - - // 模拟获取评价打分情况列表 - const fetchScoreList = async ( - current = 1, - pageSize = 10, - params: any = searchParams, - ) => { - // 更新搜索参数状态 - if (params !== searchParams) { - setSearchParams(params); - } - - setLoading(true); - try { - // 模拟API请求 - setTimeout(() => { - // 模拟数据 - const mockData = Array.from({ length: 35 }).map((_, index) => { - const id = `${index + 1}`; - - // 随机生成得分 - const score = Math.floor(Math.random() * 40) + 60; // 60-100分 - - // 评价单位 - const units = ['中山市合创展包装材料有限公司', '广州市科技发展有限公司', '深圳市创新科技有限公司', '东莞市制造业有限公司']; - const unitIndex = Math.floor(Math.random() * units.length); - - return { - id, - key: id, - supplierName: supplierRecord?.supplierName || `供应商${index + 1}`, - category: supplierRecord?.category || '电子', - evaluateUnit: units[unitIndex], - evaluator: `评价人${index + 1}`, - evaluateTime: `2023-${Math.floor(Math.random() * 12) + 1}-${Math.floor(Math.random() * 28) + 1}`, - score, - }; - }); - - // 根据搜索条件过滤 - let filteredData = [...mockData]; - if (params.supplierName) { - filteredData = filteredData.filter((item) => - item.supplierName.includes(params.supplierName || ''), - ); - } - if (params.level) { - filteredData = filteredData.filter((item) => { - let level; - if (item.score >= 90) { - level = EvaluateLevel.EXCELLENT; - } else if (item.score >= 80) { - level = EvaluateLevel.GOOD; - } else if (item.score >= 70) { - level = EvaluateLevel.AVERAGE; - } else { - level = EvaluateLevel.POOR; - } - return level === params.level; - }); - } - - // 分页 - const startIndex = (current - 1) * pageSize; - const endIndex = startIndex + pageSize; - const paginatedData = filteredData.slice(startIndex, endIndex); - - setScoreData(paginatedData); - setPagination({ - ...pagination, - current, - pageSize, - total: filteredData.length, - }); - - setLoading(false); - }, 500); - } catch (error) { - console.error('获取评价打分情况列表失败:', error); - message.error('获取评价打分情况列表失败'); - setLoading(false); - } - }; - - // 首次加载获取数据 - useEffect(() => { - fetchScoreList(pagination.current, pagination.pageSize, {}); - }, []); - - // 处理表格分页变化 - const handleTableChange = (newPagination: TablePaginationConfig) => { - fetchScoreList(newPagination.current, newPagination.pageSize, searchParams); - }; - - // 处理搜索 - const handleSearch = (values: any) => { - fetchScoreList(1, pagination.pageSize, values); - }; - - // 处理重置 - const handleReset = () => { - form.resetFields(); - fetchScoreList(1, pagination.pageSize, {}); - }; - - // 返回上一页 - const handleBack = () => { - history.goBack(); - }; - - // 查看评价详情 - const handleViewDetail = (record: any) => { - history.push({ - pathname: '/supplierEvaluateResult/supplierEvaluateResultByZb', - state: { record } - }); - }; - - const columns = [ - { - title: '序号', - render: (_: any, __: any, index: number) => - (pagination.current! - 1) * pagination.pageSize! + index + 1, - width: 80, - }, - { - title: '供应商名称', - dataIndex: 'supplierName', - key: 'supplierName', - width: 200, - ellipsis: { - showTitle: false, - }, - render: (supplierName: string) => ( - - {supplierName} - - ), - }, - { - title: '品类', - dataIndex: 'category', - key: 'category', - width: 120, - }, - { - title: '评价单位', - dataIndex: 'evaluateUnit', - key: 'evaluateUnit', - width: 180, - ellipsis: { - showTitle: false, - }, - render: (text: string) => ( - - {text} - - ), - }, - { - title: '评价人员', - dataIndex: 'evaluator', - key: 'evaluator', - width: 120, - }, - { - title: '评价时间', - dataIndex: 'evaluateTime', - key: 'evaluateTime', - width: 120, - }, - { - title: '评价得分', - dataIndex: 'score', - key: 'score', - align: 'center' as const, - width: 100, - }, - { - title: '操作', - key: 'action', - width: 100, - align: 'center' as const, - render: (_: unknown, record: any) => ( - - ), - }, - ]; - - return ( -
-
-
- - - - - - - - - - - -
- -
-
- -
-
- - - ); -}; - -export default SupplierEvaluateResultScoreByList; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreDetail.tsx b/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreDetail.tsx deleted file mode 100644 index b5e276d..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResult/supplierEvaluateResultScoreDetail.tsx +++ /dev/null @@ -1,64 +0,0 @@ -// 供应商评价结果得分明细 -import React, { useState, useEffect } from 'react'; -import { Tabs, Button, Typography, Row, Col } from 'antd'; -import { ArrowLeftOutlined } from '@ant-design/icons'; -import { history, useLocation } from 'umi'; -import GeneralEvaluation from './components/GeneralEvaluation'; -import TechnicalEvaluation from './components/TechnicalEvaluation'; -import styles from './supplierEvaluateResult.less'; - -const { Title } = Typography; -const { TabPane } = Tabs; - -const SupplierEvaluateResultScoreDetail: React.FC = () => { - const location = useLocation<{ record: SupplierEvaluate.EvaluateResultDetailRecord }>(); - const [supplierRecord, setSupplierRecord] = useState(null); - const [activeTab, setActiveTab] = useState('1'); - - // 获取上级页面传递的数据 - useEffect(() => { - if (location.state?.record) { - setSupplierRecord(location.state.record); - } - }, [location]); - - // 处理Tab切换 - const handleTabChange = (key: string) => { - setActiveTab(key); - }; - - // 返回上一页 - const handleBack = () => { - history.goBack(); - }; - - return ( -
-
-
- - {supplierRecord?.supplierName || '供应商'} - 评价得分明细 - -
-
- -
-
- -
- - - - - - - - -
-
- ); -}; - -export default SupplierEvaluateResultScoreDetail; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApproval.less b/src/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApproval.less deleted file mode 100644 index 7780f1885eb1167f6238aa6ea6ba231b0fcdd6df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 922 zcmb7?T~5MK6olv5Rj`2;CB_GR;z1UGD=1Kqgcj0*K#W^gziGL)6^xpj_WsS8Gk4DU zc#ljqZqTxZlWe zS?z?V9A#a#UG{=33q6B0_w|?JHfy3O_e&I5&y?9dX6(AmcIf~zs+=}&Ua?L&&pEe; z;hpBMbM)1R=e!1fz5VX-+61nYRSC { - const [loading, setLoading] = useState(false); - const [form] = Form.useForm(); - const [approvalData, setApprovalData] = useState([]); - const [pagination, setPagination] = useState({ - current: 1, - pageSize: 10, - total: 0, - showSizeChanger: true, - showQuickJumper: true, - showTotal: (total) => `共 ${total} 条记录`, - }); - const [searchParams, setSearchParams] = useState({}); - - // 审批相关状态 - const [historyModalVisible, setHistoryModalVisible] = useState(false); - const [currentRecord, setCurrentRecord] = useState(null); - const [approvalHistoryData, setApprovalHistoryData] = useState([]); - - // 品类数据 - const categoryOptions = [ - { label: '食品', value: '食品' }, - { label: '电子', value: '电子' }, - { label: '机械', value: '机械' }, - { label: '化工', value: '化工' }, - { label: '医药', value: '医药' }, - ]; - - // 创建单位数据 - const unitOptions = [ - { label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' }, - { label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' }, - { label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' }, - { label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' }, - ]; - - // 模拟获取审批列表 - const fetchApprovalList = async ( - current = 1, - pageSize = 10, - params: SupplierEvaluate.ApprovalSearchParams = searchParams, - ) => { - // 更新搜索参数状态 - if (params !== searchParams) { - setSearchParams(params); - } - - setLoading(true); - try { - // 模拟API请求 - setTimeout(() => { - // 模拟数据 - const mockData: SupplierEvaluate.ApprovalRecord[] = Array.from({ length: 35 }).map((_, index) => { - const id = `${index + 1}`; - - // 随机生成流程状态 - const processStatusOptions = Object.values(ProcessStatus); - const processStatus = processStatusOptions[Math.floor(Math.random() * processStatusOptions.length)]; - - // 随机生成审批结果 - const approvalResultOptions = Object.values(ApprovalResult); - const approvalResult = approvalResultOptions[Math.floor(Math.random() * approvalResultOptions.length)]; - - // 随机选择单位和品类 - const unitIndex = Math.floor(Math.random() * unitOptions.length); - const categoryIndex = Math.floor(Math.random() * categoryOptions.length); - - // 随机生成申请日期 - const applyDate = moment().subtract(Math.floor(Math.random() * 60), 'days'); - - return { - id, - key: id, - evaluateTitle: `供应商评价任务${index + 1}`, - evaluateCategory: categoryOptions[categoryIndex].value, - initiatingUnit: unitOptions[unitIndex].value, - applyTime: applyDate.format('YYYY-MM-DD'), - processStatus, - approvalResult, - }; - }); - - // 根据搜索条件过滤 - let filteredData = [...mockData]; - if (params.evaluateTitle) { - filteredData = filteredData.filter(item => - item.evaluateTitle.includes(params.evaluateTitle || '') - ); - } - if (params.processStatus) { - filteredData = filteredData.filter(item => - item.processStatus === params.processStatus - ); - } - if (params.approvalResult) { - filteredData = filteredData.filter(item => - item.approvalResult === params.approvalResult - ); - } - if (params.timeRange && params.timeRange.length === 2) { - const start = moment(params.timeRange[0]); - const end = moment(params.timeRange[1]); - filteredData = filteredData.filter(item => { - const itemDate = moment(item.applyTime); - return itemDate.isBetween(start, end, null, '[]'); - }); - } - - // 分页 - const startIndex = (current - 1) * pageSize; - const endIndex = startIndex + pageSize; - const paginatedData = filteredData.slice(startIndex, endIndex); - - setApprovalData(paginatedData); - setPagination({ - ...pagination, - current, - pageSize, - total: filteredData.length, - }); - - setLoading(false); - }, 500); - } catch (error) { - console.error('获取审批列表失败:', error); - message.error('获取审批列表失败'); - setLoading(false); - } - }; - - // 模拟获取审批历史记录 - const fetchApprovalHistory = (recordId: string) => { - // 模拟数据 - const historyData: SupplierEvaluate.ApprovalHistoryRecord[] = [ - { - id: '1', - operator: '张三', - action: '提交申请', - comment: '提交供应商评价结果审批', - time: moment().subtract(5, 'days').format('YYYY-MM-DD HH:mm:ss'), - }, - { - id: '2', - operator: '李四', - action: '部门审核', - comment: '部门审核通过', - time: moment().subtract(4, 'days').format('YYYY-MM-DD HH:mm:ss'), - }, - { - id: '3', - operator: '王五', - action: '经理审批', - comment: '经理审批通过', - time: moment().subtract(3, 'days').format('YYYY-MM-DD HH:mm:ss'), - }, - { - id: '4', - operator: '赵六', - action: '总监审批', - comment: '总监审批中', - time: moment().subtract(2, 'days').format('YYYY-MM-DD HH:mm:ss'), - }, - ]; - - setApprovalHistoryData(historyData); - }; - - // 首次加载获取数据 - useEffect(() => { - fetchApprovalList(pagination.current, pagination.pageSize, {}); - }, []); - - // 处理表格分页变化 - const handleTableChange = (newPagination: TablePaginationConfig) => { - fetchApprovalList(newPagination.current, newPagination.pageSize, searchParams); - }; - - // 处理搜索 - const handleSearch = (values: any) => { - const { timeRange, ...rest } = values; - const params: SupplierEvaluate.ApprovalSearchParams = { ...rest }; - - if (timeRange && timeRange.length === 2) { - params.timeRange = [timeRange[0].format('YYYY-MM-DD'), timeRange[1].format('YYYY-MM-DD')]; - } - - fetchApprovalList(1, pagination.pageSize, params); - }; - - // 处理重置 - const handleReset = () => { - form.resetFields(); - fetchApprovalList(1, pagination.pageSize, {}); - }; - - // 跳转到审批页面 - const handleApproval = (record: SupplierEvaluate.ApprovalRecord) => { - history.push({ - pathname: '/supplierEvaluateResultApproval/supplierEvaluateResultApprovalInfo', - state: { record } - }); - }; - - // 打开审批历史弹窗 - const handleViewHistory = (record: SupplierEvaluate.ApprovalRecord) => { - setCurrentRecord(record); - fetchApprovalHistory(record.id); - setHistoryModalVisible(true); - }; - - // 刷新列表 - const refreshList = () => { - fetchApprovalList(pagination.current, pagination.pageSize, searchParams); - }; - - // 获取流程状态标签 - const getProcessStatusTag = (status: string) => { - const color = ProcessStatusColor[status as keyof typeof ProcessStatusColor] || 'default'; - const text = ProcessStatusText[status as keyof typeof ProcessStatusText] || '未知状态'; - return {text}; - }; - - // 获取审批结果标签 - const getApprovalResultTag = (result: string) => { - const color = ApprovalResultColor[result as keyof typeof ApprovalResultColor] || 'default'; - const text = ApprovalResultText[result as keyof typeof ApprovalResultText] || '未知结果'; - return {text}; - }; - - const columns = [ - { - title: '序号', - render: (_: any, __: SupplierEvaluate.ApprovalRecord, index: number) => - (pagination.current! - 1) * pagination.pageSize! + index + 1, - width: 80, - }, - { - title: '评价主题', - dataIndex: 'evaluateTitle', - key: 'evaluateTitle', - width: 200, - ellipsis: { - showTitle: false, - }, - render: (evaluateTitle: string) => ( - - {evaluateTitle} - - ), - }, - { - title: '评价品类', - dataIndex: 'evaluateCategory', - key: 'evaluateCategory', - width: 120, - }, - { - title: '发起单位', - dataIndex: 'initiatingUnit', - key: 'initiatingUnit', - width: 200, - ellipsis: { - showTitle: false, - }, - render: (text: string) => ( - - {text} - - ), - }, - { - title: '申请时间', - dataIndex: 'applyTime', - key: 'applyTime', - width: 120, - }, - { - title: '流程状态', - dataIndex: 'processStatus', - key: 'processStatus', - width: 100, - align: 'center' as const, - render: (status: string) => getProcessStatusTag(status), - }, - { - title: '审批结果', - dataIndex: 'approvalResult', - key: 'approvalResult', - width: 100, - align: 'center' as const, - render: (result: string) => getApprovalResultTag(result), - }, - { - title: '操作', - key: 'action', - width: 180, - align: 'center' as const, - render: (_: unknown, record: SupplierEvaluate.ApprovalRecord) => ( - - {record.approvalResult === ApprovalResult.PENDING && ( - - )} - - - ), - }, - ]; - - return ( -
-
-
- - - - - - - - - - - - - - - - - -
- -
-
- - - {/* 审批历史弹窗 */} - setHistoryModalVisible(false)} - footer={[ - , - ]} - width={600} - > - {currentRecord && ( -
- - - {currentRecord.evaluateTitle} - - - {currentRecord.evaluateCategory} - - - {currentRecord.initiatingUnit} - - - - - {approvalHistoryData.map((item) => ( - -

{item.operator} - {item.action}

-

{item.comment}

-
- ))} -
-
- )} -
- - ); -}; - -export default SupplierEvaluateResultApproval; diff --git a/src/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApprovalInfo.tsx b/src/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApprovalInfo.tsx deleted file mode 100644 index 67c99da..0000000 --- a/src/pages/supplierEvaluateManage/supplierEvaluateResultApproval/supplierEvaluateResultApprovalInfo.tsx +++ /dev/null @@ -1,318 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import { - Card, - Typography, - Form, - Input, - Select, - Button, - Table, - Space, - Divider, - Radio, - message, - Row, - Col, -} from 'antd'; -import { ArrowLeftOutlined, CheckCircleOutlined, CloseCircleOutlined } from '@ant-design/icons'; -import { history, useLocation } from 'umi'; -import { - ProcessStatus, - ProcessStatusText, - ApprovalResult, - ApprovalResultText -} from '@/dicts/supplierEvaluateDict'; -// Use inline styles instead of importing a less file - -const { Title, Text } = Typography; -const { Option } = Select; -const { TextArea } = Input; - -const SupplierEvaluateResultApprovalInfo: React.FC = () => { - const location = useLocation<{ record: SupplierEvaluate.ApprovalRecord }>(); - const [loading, setLoading] = useState(false); - const [submitting, setSubmitting] = useState(false); - const [record, setRecord] = useState(null); - const [form] = Form.useForm(); - const [evaluationData, setEvaluationData] = useState([]); - - // 模拟获取评价详情数据 - const fetchEvaluationData = () => { - setLoading(true); - // 模拟API请求 - setTimeout(() => { - // 模拟数据 - const mockData = [ - { - id: '1', - supplierName: '中山市合创展包装材料有限公司', - category: '燃油', - score: 98, - level: 'A', - evaluator: '张三', - evaluateTime: '2023-05-15', - }, - { - id: '2', - supplierName: '深圳市欧阳华斯电源有限公司', - category: '燃油', - score: 95, - level: 'A', - evaluator: '李四', - evaluateTime: '2023-05-16', - }, - { - id: '3', - supplierName: '广东振兴塑胶机械有限公司', - category: '燃油', - score: 80, - level: 'B', - evaluator: '王五', - evaluateTime: '2023-05-17', - }, - { - id: '4', - supplierName: '上海硕建建筑技术工程有限公司', - category: '备件', - score: 60, - level: 'C', - evaluator: '赵六', - evaluateTime: '2023-05-18', - }, - { - id: '5', - supplierName: '中山市合创展包装材料有限公司', - category: '润滑油', - score: 98, - level: 'A', - evaluator: '张三', - evaluateTime: '2023-05-19', - }, - { - id: '6', - supplierName: '深圳市欧阳华斯电源有限公司', - category: '备件', - score: 95, - level: 'A', - evaluator: '李四', - evaluateTime: '2023-05-20', - }, - { - id: '7', - supplierName: '广东振兴塑胶机械有限公司', - category: '润滑油', - score: 80, - level: 'B', - evaluator: '王五', - evaluateTime: '2023-05-21', - }, - { - id: '8', - supplierName: '上海硕建建筑技术工程有限公司', - category: '备件', - score: 60, - level: 'C', - evaluator: '赵六', - evaluateTime: '2023-05-22', - }, - { - id: '9', - supplierName: '广东振兴塑胶机械有限公司', - category: '润滑油', - score: 80, - level: 'B', - evaluator: '王五', - evaluateTime: '2023-05-23', - }, - { - id: '10', - supplierName: '上海硕建建筑技术工程有限公司', - category: '备件', - score: 60, - level: 'C', - evaluator: '赵六', - evaluateTime: '2023-05-24', - }, - ]; - - setEvaluationData(mockData); - setLoading(false); - }, 500); - }; - - // 获取上级页面传递的数据 - useEffect(() => { - if (location.state?.record) { - setRecord(location.state.record); - // 模拟获取评价详情数据 - fetchEvaluationData(); - } - }, [location]); - - // 处理返回 - const handleBack = () => { - history.goBack(); - }; - - // 处理提交 - const handleSubmit = async (values: SupplierEvaluate.ApprovalFormValues) => { - setSubmitting(true); - try { - // 模拟提交 - setTimeout(() => { - console.log('提交审批结果:', values); - message.success('审批提交成功'); - setSubmitting(false); - history.goBack(); - }, 1000); - } catch (error) { - console.error('提交失败:', error); - message.error('提交失败'); - setSubmitting(false); - } - }; - - const columns = [ - { - title: '序号', - render: (_: any, __: SupplierEvaluate.SupplierEvaluationRecord, index: number) => index + 1, - width: 80, - }, - { - title: '供应商名称', - dataIndex: 'supplierName', - key: 'supplierName', - width: 200, - }, - { - title: '评价品类', - dataIndex: 'category', - key: 'category', - width: 120, - }, - { - title: '评价得分', - dataIndex: 'score', - key: 'score', - width: 100, - align: 'center' as const, - }, - { - title: '评价等级', - dataIndex: 'level', - key: 'level', - width: 100, - align: 'center' as const, - }, - { - title: '评价人', - dataIndex: 'evaluator', - key: 'evaluator', - width: 120, - }, - { - title: '评价时间', - dataIndex: 'evaluateTime', - key: 'evaluateTime', - width: 120, - }, - ]; - - if (!record) { - return
加载中...
; - } - - return ( -
- -
- - 供应商评价结果审批 -
- -
- -
- 评价主题: - {record.evaluateTitle} - - - 评价品类: - {record.evaluateCategory} - - - 发起单位: - {record.initiatingUnit} - - - - - 申请时间: - {record.applyTime} - - - 流程状态: - {ProcessStatusText[record.processStatus as keyof typeof ProcessStatusText] || '未知状态'} - - - - - - -
- - - -
- 审批意见 - - - - {ApprovalResultText[ApprovalResult.APPROVED]} - - - {ApprovalResultText[ApprovalResult.REJECTED]} - - - - -