年审
This commit is contained in:
@ -26,7 +26,7 @@ import { TaskStatus, TaskStatusText, TaskStatusColor, TaskType, TaskTypeText } f
|
||||
import moment from 'moment';
|
||||
import styles from './supplierEvaluateResult.less';
|
||||
import { history } from 'umi';
|
||||
import { getEvaluateResultList } from '@/servers/api/supplierEvaluate';
|
||||
import { getEvaluateResultList, submitTaskForApproval } from '@/servers/api/supplierEvaluate';
|
||||
|
||||
const { Option } = Select;
|
||||
const { RangePicker } = DatePicker;
|
||||
@ -152,6 +152,31 @@ const SupplierEvaluateResult: React.FC = () => {
|
||||
fetchResultList(1, pagination.pageSize, {});
|
||||
};
|
||||
|
||||
// 处理提交审批
|
||||
const handleApprove = (record: API.EvaluateTaskRecord) => {
|
||||
Modal.confirm({
|
||||
title: '提交审批确认',
|
||||
content: `确定要提交"${record.evaluateTheme}"的评价任务进行审批吗?`,
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
try {
|
||||
const response = await submitTaskForApproval(record.id);
|
||||
if (response.success) {
|
||||
message.success('提交审批成功');
|
||||
// 刷新数据
|
||||
fetchResultList(pagination.current, pagination.pageSize, searchParams);
|
||||
} else {
|
||||
message.error(response.message || '提交审批失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交审批失败:', error);
|
||||
message.error('提交审批失败,请稍后重试');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 查看详情 - 修改为跳转到详情页
|
||||
const handleViewDetail = (record: API.EvaluateTaskRecord) => {
|
||||
history.push({
|
||||
@ -241,9 +266,16 @@ const SupplierEvaluateResult: React.FC = () => {
|
||||
width: 100,
|
||||
align: 'center' as const,
|
||||
render: (_: unknown, record: API.EvaluateTaskRecord) => (
|
||||
<Button type="link" onClick={() => handleViewDetail(record)}>
|
||||
查看
|
||||
</Button>
|
||||
<Space>
|
||||
<Button type="link" onClick={() => handleViewDetail(record)}>
|
||||
查看
|
||||
</Button>
|
||||
{record.approveStatus === null && record.status === '2' && (
|
||||
<Button type="link" onClick={() => handleApprove(record)}>
|
||||
提交审批
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
Reference in New Issue
Block a user