diff --git a/config/router.config.ts b/config/router.config.ts index 4ecb400..dc081f4 100644 --- a/config/router.config.ts +++ b/config/router.config.ts @@ -103,6 +103,16 @@ export default [ }, component: '@/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageAdd', }, + { + name: 'supplierTaskManageDetail', + path: 'supplierTaskManageDetail', + meta: { + title: '任务管理详情', + hide: true, + icon: 'icon-liebiaomoshi', + }, + component: '@/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageDetail', + }, { name: 'supplierEvaluateScore', path: 'supplierEvaluateScore', diff --git a/src/components/EvaluateTaskPersonnelSelector/EvaluateTaskPersonnelSelector.tsx b/src/components/EvaluateTaskPersonnelSelector/EvaluateTaskPersonnelSelector.tsx index d866f41..388d7dd 100644 --- a/src/components/EvaluateTaskPersonnelSelector/EvaluateTaskPersonnelSelector.tsx +++ b/src/components/EvaluateTaskPersonnelSelector/EvaluateTaskPersonnelSelector.tsx @@ -77,7 +77,8 @@ const EvaluateTaskPersonnelSelector: React.FC ({ id: user.userId, // 用户ID name: user.userName, // 用户名称 - department: user.userDept, // 用户部门 + userDept: user.userDept, // 用户部门 + userDeptId: user.userDeptId, // 用户部门ID position: '', // API中没有提供职位信息 })); @@ -138,8 +139,8 @@ const EvaluateTaskPersonnelSelector: React.FC = ({ taskData }) => { + // 获取状态标签 + const getStatusTag = (status: string) => { + const color = TaskStatusColor[status as keyof typeof TaskStatusColor] || 'default'; + const text = TaskStatusText[status as keyof typeof TaskStatusText] || '未知状态'; + return {text}; + }; + + return ( + + + {taskData.evaluateTheme || '--'} + + {getStatusTag(taskData.status || '')} + + {taskData.evaluateYear || '--'} + {taskData.startTime || '--'} + {taskData.endTime || '--'} + {taskData.templateName || '--'} + + { + CategoryLimitationTypeText[ + taskData.categoryLimitation as keyof typeof CategoryLimitationTypeText + ] + } + + {taskData.categoryId && ( + {taskData.categoryName} + )} + + + ); +}; + +export default BasicInfo; diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/EvaluatorInfo.tsx b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/EvaluatorInfo.tsx new file mode 100644 index 0000000..88b7339 --- /dev/null +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/EvaluatorInfo.tsx @@ -0,0 +1,88 @@ +import React from 'react'; +import { Card, Table, Button, message } from 'antd'; +import { UnorderedListOutlined } from '@ant-design/icons'; +import styles from '../../supplierTaskManageDetail.less'; +import type { TaskDetailData, IndicatorList, User } from '@/servers/types/supplierEvaluateTask'; + +interface EvaluatorInfoProps { + taskData: TaskDetailData; + onViewIndicators: (record: IndicatorList) => void; +} + +const EvaluatorInfo: React.FC = ({ taskData, onViewIndicators }) => { + const userList = taskData.userList; + // 查看评价人员分工 + const handleViewIndicators = (record: IndicatorList) => { + if (record.indicatorIds && record.indicatorIds.length > 0) { + onViewIndicators(record); + } else { + message.info('该评价人员没有分配指标'); + } + }; + + const columns = [ + { + title: '序号', + dataIndex: 'index', + key: 'index', + render: (_: any, __: any, index: number) => index + 1, + width: 80, + }, + { + title: '评价人员', + dataIndex: 'userId', + key: 'userId', + render: (userId: string) => { + try { + const user = userList.find((userItem: User) => userItem.userId === userId); + return user?.userName; + } catch (error) { + console.error('获取评价人员信息失败:', error); + return userId; + } + }, + }, + { + title: '评价类型', + dataIndex: 'type', + key: 'type', + render: (type: string) => (type === '1' ? '按指标评价' : '按评价单评价'), + }, + { + title: '指标数量', + dataIndex: 'indicatorIds', + key: 'indicatorCount', + render: (indicatorIds: string[]) => indicatorIds?.length || 0, + }, + { + title: '操作', + key: 'action', + render: (record: any) => ( + + ), + }, + ]; + + if (!taskData || !taskData.indicatorList || taskData.indicatorList.length === 0) { + return
暂无评价人员数据
; + } + + return ( + + + + ); +}; + +export default EvaluatorInfo; diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/EvaluatorModal.tsx b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/EvaluatorModal.tsx new file mode 100644 index 0000000..7de8d23 --- /dev/null +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/EvaluatorModal.tsx @@ -0,0 +1,42 @@ +import React from 'react'; +import { Modal, Button, Tag } from 'antd'; +import styles from '../../supplierTaskManageDetail.less'; +import type {TaskDetailData} from '@/servers/types/supplierEvaluateTask' + +interface EvaluatorModalProps { + visible: boolean; + supplier: TaskDetailData; + onCancel: () => void; +} + +const EvaluatorModal: React.FC = ({ visible, supplier, onCancel }) => { + return ( + + 关闭 + + ]} + width={600} + > + {supplier?.userList?.length > 0 ? ( +
+
+ {supplier.userList.map((user) => ( + + {user.userDept} - {user.userName} + + ))} +
+
+ ) : ( +
暂无评价人员数据
+ )} +
+ ); +}; + +export default EvaluatorModal; diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/IndicatorModal.tsx b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/IndicatorModal.tsx new file mode 100644 index 0000000..f77ba05 --- /dev/null +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/IndicatorModal.tsx @@ -0,0 +1,99 @@ +import React, { useState, useEffect } from 'react'; +import { Modal, Button, Spin } from 'antd'; +import styles from '../../supplierTaskManageDetail.less'; +import EvaluateTemplateTable from '@/components/EvaluateTemplateTable/EvaluateTemplateTable'; +import { getTemplateDetail } from '@/servers/api/supplierEvaluate'; + +interface IndicatorModalProps { + visible: boolean; + evaluatorId: string; + indicators: string[]; + templateId?: string; + onCancel: () => void; +} + +const IndicatorModal: React.FC = ({ + visible, + evaluatorId, + indicators, + templateId, + onCancel +}) => { + const [loading, setLoading] = useState(false); + const [filteredIndicators, setFilteredIndicators] = useState([]); + + // 获取模板详情数据 + useEffect(() => { + const fetchTemplateData = async () => { + if (visible && templateId) { + setLoading(true); + try { + const res = await getTemplateDetail(templateId); + if (res.success && res.data) { + + // 筛选出当前评价人员负责的指标 + if (res.data.indicatorStList && indicators.length > 0) { + // 扁平化处理模板数据,提取出所有二级指标 + const allIndicators = []; + for (const stItem of res.data.indicatorStList) { + if (stItem.indicatorNdList) { + for (const ndItem of stItem.indicatorNdList) { + if (indicators.includes(ndItem.id as string)) { + allIndicators.push({ + ...ndItem, + baseIndicator: stItem.baseIndicator, + descIndicator: stItem.descIndicator, + stScore: stItem.score, + indicatorType: stItem.indicatorType, + id: ndItem.id, + score: ndItem.score, + }); + } + } + } + } + setFilteredIndicators(allIndicators); + } + } + } catch (error) { + console.error('获取模板详情失败:', error); + } finally { + setLoading(false); + } + } + }; + + fetchTemplateData(); + }, [visible, templateId, indicators]); + + return ( + + 关闭 + + ]} + width={1200} // 增加宽度以适应表格 + > + {loading ? ( +
+ +
+ ) : indicators.length > 0 && filteredIndicators.length > 0 ? ( +
+ +
+ ) : ( +
暂无指标分工数据
+ )} +
+ ); +}; + +export default IndicatorModal; diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/SupplierInfo.tsx b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/SupplierInfo.tsx new file mode 100644 index 0000000..953f8f9 --- /dev/null +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/SupplierInfo.tsx @@ -0,0 +1,95 @@ +import React from 'react'; +import { Card, Table, Button, message } from 'antd'; +import { TeamOutlined } from '@ant-design/icons'; +import styles from '../../supplierTaskManageDetail.less'; +import type { TaskDetailData,User } from '@/servers/types/supplierEvaluateTask'; + +interface SupplierInfoProps { + taskData: TaskDetailData; + onViewEvaluators: (supplier: any) => void; +} + +const SupplierInfo: React.FC = ({ taskData, onViewEvaluators }) => { + // 查看供应商评价人员 + const handleViewSupplierEvaluators = (record: TaskDetailData) => { + if (!taskData || !taskData.supplierIds) { + message.error('无法获取供应商评价人员信息'); + return; + } + + // 根据供应商ID查找对应的userIds + const supplierData = taskData.supplierIds.find((item) => item.id === record.supplierId); + let userList: User[] = []; + try { + userList = taskData.userList.filter((item) => supplierData?.userIds.includes(item.userId)); + } catch (error) { + console.error('获取供应商评价人员信息失败:', error); + } + + if (supplierData) { + onViewEvaluators({ + ...record, + userIds: supplierData.userIds, + userList: userList, + }); + } else { + message.error('未找到该供应商的评价人员信息'); + } + }; + + const columns = [ + { + title: '序号', + dataIndex: 'index', + key: 'index', + render: (_: any, __: any, index: number) => index + 1, + width: 80, + }, + { + title: '供应商名称', + dataIndex: 'supplierName', + key: 'supplierName', + }, + { + title: '部门', + dataIndex: 'deptName', + key: 'deptName', + }, + { + title: '品类', + dataIndex: 'categoryName', + key: 'categoryName', + render: (text: string) => text || '--', + }, + { + title: '操作', + key: 'action', + render: (record: any) => ( + + ), + }, + ]; + + if (!taskData || !taskData.blackSupplierVos || taskData.blackSupplierVos.length === 0) { + return
暂无供应商数据
; + } + + return ( + +
+ + ); +}; + +export default SupplierInfo; diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/WeightInfo.tsx b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/WeightInfo.tsx new file mode 100644 index 0000000..d7bef38 --- /dev/null +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/WeightInfo.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +import { Card, Table } from 'antd'; +import styles from '../../supplierTaskManageDetail.less'; + +interface WeightInfoProps { + taskData: SupplierEvaluate.TaskDetailData; +} + +const WeightInfo: React.FC = ({ taskData }) => { + const columns = [ + { + title: '序号', + dataIndex: 'index', + key: 'index', + render: (_: any, __: any, index: number) => index + 1, + width: 80, + }, + { + title: '部门名称', + dataIndex: 'weightDept', + key: 'weightDept', + }, + { + title: '权重值', + dataIndex: 'weightValue', + key: 'weightValue', + render: (value: number) => `${value}%`, + }, + ]; + + if (!taskData || !taskData.taskDeptWeightList || taskData.taskDeptWeightList.length === 0) { + return
暂无权重设置数据
; + } + + return ( + +
+ + ); +}; + +export default WeightInfo; diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/index.ts b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/index.ts new file mode 100644 index 0000000..2a6c7df --- /dev/null +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/components/Detail/index.ts @@ -0,0 +1,15 @@ +import BasicInfo from './BasicInfo'; +import SupplierInfo from './SupplierInfo'; +import EvaluatorInfo from './EvaluatorInfo'; +import WeightInfo from './WeightInfo'; +import EvaluatorModal from './EvaluatorModal'; +import IndicatorModal from './IndicatorModal'; + +export { + BasicInfo, + SupplierInfo, + EvaluatorInfo, + WeightInfo, + EvaluatorModal, + IndicatorModal +}; diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/components/DivisionStep.tsx b/src/pages/supplierEvaluateManage/supplierTaskManage/components/DivisionStep.tsx index 340fdba..9244eea 100644 --- a/src/pages/supplierEvaluateManage/supplierTaskManage/components/DivisionStep.tsx +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/components/DivisionStep.tsx @@ -500,6 +500,7 @@ const DivisionStep = forwardRef(({ formData, onFormDataC title="设置评价指标分工" visible={templateViewModalVisible} onCancel={handleCloseTemplateViewModal} + width={1200} footer={[ - ), }, @@ -296,164 +230,6 @@ const SupplierTaskManage: React.FC = () => { fetchTaskList(1, pagination.pageSize, params); }; - // 处理模态框取消 - const handleModalCancel = () => { - setModalVisible(false); - setIsViewMode(false); - setViewData(null); - }; - - // 渲染任务详情 - const renderTaskDetail = () => { - if (!viewData) return null; - - return ( -
- -
-
- 任务名称: - {viewData.taskName} -
- - -
- 任务编号: - {viewData.taskCode} -
- - -
- 任务类型: - - {TaskTypeText[viewData.taskType as keyof typeof TaskTypeText] || '未知类型'} - -
- - -
- 使用模板: - {viewData.templateName} -
- - -
- 状态: - {getStatusTag(viewData.status)} -
- - -
- 开始时间: - {viewData.startTime} -
- - -
- 结束时间: - {viewData.endTime} -
- - -
- 创建人: - {viewData.createBy} -
- - -
- 创建时间: - {viewData.createTime} -
- - {viewData.updateBy && ( - -
- 更新人: - {viewData.updateBy} -
- - )} - {viewData.updateTime && ( - -
- 更新时间: - {viewData.updateTime} -
- - )} - - - ); - }; - - // 渲染任务表单 - const renderTaskForm = () => { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - ); - }; - return (
@@ -511,31 +287,6 @@ const SupplierTaskManage: React.FC = () => { scroll={{ x: 1500 }} />
- - {/* 新增/编辑/查看模态框 */} - - 关闭 - , - ] - : null - } - > - {isViewMode ? renderTaskDetail() : renderTaskForm()} -
); }; diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageAdd.tsx b/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageAdd.tsx index e71403c..1eaed59 100644 --- a/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageAdd.tsx +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageAdd.tsx @@ -23,7 +23,6 @@ const SupplierTaskManageAdd: React.FC = () => { // 处理表单数据变更 const handleFormDataChange = (data: any) => { - console.log(data) // 第一步:基本信息 if (data) { setFormData((prev) => ({ ...prev, ...data })); @@ -55,18 +54,14 @@ const SupplierTaskManageAdd: React.FC = () => { if (data.weightUnits) { // 将 weightUnits 存储在 formData.WeightUnit 中 setFormData((prev) => ({ ...prev, WeightUnit: data.weightUnits })); + } - // 同时将 weightUnits 转换为 taskDeptWeightList 格式 - const taskDeptWeightList = data.weightUnits.map((unit: any) => ({ - weightDept: unit.name, - weightValue: unit.weight.toString(), - })); - - // 更新 taskDeptWeightList 和 weightStatus + // 处理部门权重列表 + if (data.taskDeptWeightList) { setFormData((prev) => ({ ...prev, - taskDeptWeightList, - weightStatus: taskDeptWeightList.length > 0 ? 1 : 0, // 如果有权重设置则为1,否则为0 + taskDeptWeightList: data.taskDeptWeightList, + // weightStatus: data.weightStatus || 0 })); } }; @@ -99,11 +94,6 @@ const SupplierTaskManageAdd: React.FC = () => { description: '不设置按默认全部指标评价', content: , }, - { - title: '创建成功', - description: '评价任务创建成功', - content:
创建成功步骤(待实现)
, - }, ]; // 处理返回 @@ -160,6 +150,7 @@ const SupplierTaskManageAdd: React.FC = () => { const result = divisionFormRef.current.validate(); if (!result.valid) { message.error(result.message); + setLoading(false); return; } } @@ -172,6 +163,7 @@ const SupplierTaskManageAdd: React.FC = () => { templateId: formData.templateId || '', // 模板ID categoryLimitation: formData.categoryLimitation || '0', // 品类限制 evaluateYear: formData.evaluateYear || '', // 评价年份 + // weightStatus: formData.weightStatus || 0, // 权重状态 // 修复供应商ID列表格式,确保包含 userIds 字段 supplierIds: formData.selectedSuppliers?.map((supplier: any) => { @@ -191,9 +183,10 @@ const SupplierTaskManageAdd: React.FC = () => { indicatorIds: item.indicatorIds || [], })) || [], + // 部门权重列表,过滤掉权重为0的 taskDeptWeightList: formData.taskDeptWeightList?.filter((item: any) => { - return item.weightValue !== '0' - }) || [], // 部门权重列表 过滤掉权重为0的 + return item.weightValue && item.weightValue !== '0'; + }) || [], }; // 调用API提交数据 @@ -201,8 +194,8 @@ const SupplierTaskManageAdd: React.FC = () => { if (response.success) { message.success('任务创建成功'); - // 显示最后一步(创建成功) - setCurrentStep(steps.length - 1); + // 创建成功后直接返回列表页面 + history.push('/supplier/supplierTaskManage'); } else { message.error(response.message || '提交失败'); } @@ -239,15 +232,15 @@ const SupplierTaskManageAdd: React.FC = () => {
- {currentStep > 0 && currentStep < steps.length - 1 && ( + {currentStep > 0 && ( )} - {currentStep < steps.length - 2 && ( + {currentStep < steps.length - 1 && ( )} - {currentStep === steps.length - 2 && ( + {currentStep === steps.length - 1 && ( )} - {currentStep === steps.length - 1 && ( - - )}
diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageDetail.less b/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageDetail.less new file mode 100644 index 0000000..1c4dd92 --- /dev/null +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageDetail.less @@ -0,0 +1,100 @@ +.loadingContainer { + display: flex; + justify-content: center; + align-items: center; + height: 300px; +} + +.detailCard { + margin-bottom: 24px; +} + +.supplierList { + display: flex; + flex-direction: column; + gap: 16px; +} + +.supplierCard { + margin-bottom: 16px; +} + +.indicatorList { + .indicatorItem { + padding: 8px 0; + border-bottom: 1px solid #f0f0f0; + display: flex; + align-items: center; + + &:last-child { + border-bottom: none; + } + } + + .indicatorIndex { + width: 30px; + font-weight: bold; + } + + .indicatorId { + flex: 1; + } +} + +.infoItem { + margin-bottom: 8px; + display: flex; + align-items: flex-start; +} + +.label { + font-weight: 500; + margin-right: 8px; + min-width: 100px; +} + +.evaluatorList { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.evaluatorTag { + margin-bottom: 8px; +} + +.idList { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.emptyData { + display: flex; + justify-content: center; + align-items: center; + height: 200px; + color: rgba(0, 0, 0, 0.45); + font-size: 14px; +} + +.tableContainer { + margin-top: 16px; +} + +.weightStatusInfo { + margin-bottom: 16px; + font-size: 14px; + + .label { + font-weight: bold; + margin-right: 8px; + } +} + +.evaluatorModalContent, +.indicatorModalContent { + max-height: 400px; + overflow-y: auto; + padding: 8px; +} diff --git a/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageDetail.tsx b/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageDetail.tsx new file mode 100644 index 0000000..9752dc7 --- /dev/null +++ b/src/pages/supplierEvaluateManage/supplierTaskManage/supplierTaskManageDetail.tsx @@ -0,0 +1,154 @@ +import React, { useState, useEffect } from 'react'; +import { Card, Button, message, Spin, Tabs, Typography } from 'antd'; +import { history, useLocation } from 'umi'; +import { ArrowLeftOutlined } from '@ant-design/icons'; +import { getTaskDetail } from '@/servers/api/supplierEvaluate'; +import { + BasicInfo, + SupplierInfo, + EvaluatorInfo, + WeightInfo, + EvaluatorModal, + IndicatorModal +} from './components/Detail'; +import styles from './supplierTaskManageDetail.less'; +import type { TaskDetailData } from '@/servers/types/supplierEvaluateTask'; + +const { TabPane } = Tabs; +const { Title } = Typography; + +// 解析查询参数 +const useQuery = () => { + const { search } = useLocation(); + return React.useMemo(() => new URLSearchParams(search), [search]); +}; + +const SupplierTaskManageDetail: React.FC = () => { + const query = useQuery(); + const taskId = query.get('id'); + + // 数据加载状态 + const [loading, setLoading] = useState(true); + + // 任务数据 + const [taskData, setTaskData] = useState(null); + + // 当前活动标签页 + const [activeTab, setActiveTab] = useState('1'); + + // 模态框状态 + const [evaluatorModalVisible, setEvaluatorModalVisible] = useState(false); + const [indicatorModalVisible, setIndicatorModalVisible] = useState(false); + const [currentSupplier, setCurrentSupplier] = useState(null); + const [currentIndicators, setCurrentIndicators] = useState([]); + const [currentEvaluator, setCurrentEvaluator] = useState(''); + + // 获取任务详情 + const fetchTaskDetail = async (id: string) => { + if (!id) { + message.error('任务ID不能为空'); + return; + } + + setLoading(true); + try { + const response = await getTaskDetail(id); + if (response.success) { + setTaskData(response.data); + } else { + message.error(response.message || '获取任务详情失败'); + } + } catch (error) { + console.error('获取任务详情失败:', error); + message.error('获取任务详情失败'); + } finally { + setLoading(false); + } + }; + + // 当组件挂载时,获取任务详情 + useEffect(() => { + if (taskId) { + fetchTaskDetail(taskId); + } else { + message.error('未提供任务ID'); + history.push('/supplier/supplierTaskManage'); + } + }, [taskId]); + + // 处理返回 + const handleBack = () => { + history.goBack(); + }; + + // 处理查看供应商评价人员 + const handleViewSupplierEvaluators = (supplier: any) => { + setCurrentSupplier(supplier); + setEvaluatorModalVisible(true); + }; + + // 处理查看评价人员分工 + const handleViewIndicators = (record: any) => { + setCurrentIndicators(record.indicatorIds || []); + setCurrentEvaluator(record.userId); + setIndicatorModalVisible(true); + }; + + return ( +
+ +
+ 评价任务详情 + +
+ + {loading ? ( +
+ +
+ ) : ( + + + {taskData && } + + + {taskData && } + + + {taskData && } + + + {taskData && } + + + )} +
+ + {/* 供应商评价人员模态框 */} + setEvaluatorModalVisible(false)} + /> + + {/* 评价人员分工模态框 */} + setIndicatorModalVisible(false)} + /> +
+ ); +}; + +export default SupplierTaskManageDetail; diff --git a/src/servers/api/supplierEvaluate.ts b/src/servers/api/supplierEvaluate.ts index ee32b64..81e06b0 100644 --- a/src/servers/api/supplierEvaluate.ts +++ b/src/servers/api/supplierEvaluate.ts @@ -1,4 +1,5 @@ import request from '@/utils/request'; +import type { TaskDetailResponse } from '@/servers/types/supplierEvaluateTask'; /** * 获取所有模板列表 @@ -142,7 +143,7 @@ export async function getTaskList(params: SupplierEvaluate.TaskRequest) { * @returns Promise */ export async function getTaskDetail(id: string) { - return request>(`/coscoEvaluate/task/${id}`, { + return request(`/coscoEvaluate/task/${id}`, { method: 'GET', }); } diff --git a/src/servers/api/typings.d.ts b/src/servers/api/typings.d.ts index d02bb1a..7723d1d 100644 --- a/src/servers/api/typings.d.ts +++ b/src/servers/api/typings.d.ts @@ -25,7 +25,8 @@ declare namespace API { export interface PersonnelItem { id: string; name: string; - department: string; + userDept: string; + userDeptId: string; position?: string; selected?: boolean; } diff --git a/src/servers/types/evaluator.ts b/src/servers/types/evaluator.ts index 179d649..98c5c46 100644 --- a/src/servers/types/evaluator.ts +++ b/src/servers/types/evaluator.ts @@ -9,7 +9,8 @@ export interface PersonnelItem { id: string; // 人员ID name: string; // 人员姓名 - department: string; // 所属部门 + userDept: string; // 所属部门 + userDeptId: string; // 所属部门ID position?: string; // 职位(可选) selected?: boolean; // 是否被选中(用于UI显示) // 其他可能的API字段 diff --git a/src/servers/types/index.ts b/src/servers/types/index.ts index 38fa871..a96796b 100644 --- a/src/servers/types/index.ts +++ b/src/servers/types/index.ts @@ -3,3 +3,4 @@ */ export * from './evaluator'; +export * from './supplierEvaluateTask'; diff --git a/src/servers/types/supplierEvaluateTask.ts b/src/servers/types/supplierEvaluateTask.ts new file mode 100644 index 0000000..4885d50 --- /dev/null +++ b/src/servers/types/supplierEvaluateTask.ts @@ -0,0 +1,79 @@ +/** + * 供应商评价任务详情接口类型定义 + */ +export interface IndicatorList { + indicatorIds: string[]; + type: number; + userId: string; +} +export interface User{ + userId: string; + userName: string; + userDept: string; + userDeptId: string; +} +/** + * 任务详情数据 + */ +export interface TaskDetailData { + categoryId: string | null; + categoryLimitation: string | null; + createBy: string | null; + createDate: string | null; + createTime: string | null; + deleteFlag: string | null; + delFlag: string; + deptId: string | null; + endTime: string | null; + evaluateTheme: string | null; + evaluateYear: string | null; + id: string | null; + indicatorList: IndicatorList[] | null; + lastUpdateTime: string | null; + startTime: string | null; + status: string; + supplierIds: { + id: string; + userIds: string[]; + }[] | null; + userList: User[]; + suppliers: { + id: string; + supplierName: string; + socialCreditCode?: string; + category?: string; + department?: string; + evaluators: { + id: string; + name: string; + department: string; + position?: string; + }[]; + [key: string]: any; + }[] | null; + templateId: string | null; + tenantId: string | null; + tenantName: string | null; + updateBy: string | null; + updateDate: string | null; + updateTime: string | null; + weightDept: string | null; + weightStatus: number | null; + weightValue: string | null; + taskDeptWeightList: { + weightDept: string; + weightValue: string; + }[] | null; + [property: string]: any; +} + +/** + * 任务详情响应 + */ +export interface TaskDetailResponse { + code: number; + data: TaskDetailData; + message: string; + success: boolean; + [property: string]: any; +} diff --git a/src/typings.d.ts b/src/typings.d.ts index b04b89f..0e5f453 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -496,7 +496,7 @@ declare namespace SupplierEvaluate { /** * 权重启用状态(0.不启用、1.启用) */ - weightStatus: number; + // weightStatus: number; [property: string]: any; } @@ -508,6 +508,75 @@ declare namespace SupplierEvaluate { endTime: string; [property: string]: any; } + + /** + * 任务详情数据 + */ + interface TaskDetailData { + categoryId: string | null; + categoryLimitation: string | null; + createBy: string | null; + createDate: string | null; + createTime: string | null; + deleteFlag: string | null; + delFlag: string; + deptId: string | null; + endTime: string | null; + evaluateTheme: string | null; + evaluateYear: string | null; + id: string | null; + indicatorList: { + indicatorIds: string[]; + type: number; + userId: string; + }[] | null; + lastUpdateTime: string | null; + startTime: string | null; + status: string; + supplierIds: { + id: string; + userIds: string[]; + }[] | null; + suppliers: { + id: string; + supplierName: string; + socialCreditCode?: string; + category?: string; + department?: string; + evaluators: { + id: string; + name: string; + department: string; + position?: string; + }[]; + [key: string]: any; + }[] | null; + templateId: string | null; + tenantId: string | null; + tenantName: string | null; + updateBy: string | null; + updateDate: string | null; + updateTime: string | null; + weightDept: string | null; + weightStatus: number | null; + weightValue: string | null; + taskDeptWeightList: { + weightDept: string; + weightValue: string; + }[] | null; + [property: string]: any; + } + + /** + * 任务详情响应 + */ + interface TaskDetailResponse { + code: number; + data: TaskDetailData; + message: string; + success: boolean; + [property: string]: any; + } } declare module '*.css';