年审结果模块
This commit is contained in:
@ -309,6 +309,27 @@ export default [
|
||||
},
|
||||
component: '@/pages/supplierAnnualManage/supplierAnnualResult/supplierAnnualResult',
|
||||
},
|
||||
{
|
||||
name: 'supplierAnnualResultQuery',
|
||||
path: 'supplierAnnualResultQuery',
|
||||
meta: {
|
||||
title: '年审结果一级查询列表',
|
||||
icon: 'icon-liebiaomoshi',
|
||||
hide: true,
|
||||
},
|
||||
component: '@/pages/supplierAnnualManage/supplierAnnualResult/supplierAnnualResultQuery',
|
||||
},
|
||||
{
|
||||
name: 'supplierAnnualResultQuery2',
|
||||
path: 'supplierAnnualResultQuery2',
|
||||
meta: {
|
||||
title: '年审结果二级查询列表',
|
||||
icon: 'icon-liebiaomoshi',
|
||||
hide: true,
|
||||
},
|
||||
component: '@/pages/supplierAnnualManage/supplierAnnualResult/supplierAnnualResultQuery2',
|
||||
},
|
||||
|
||||
{
|
||||
name: 'supplierAnnualResultDetail',
|
||||
path: 'supplierAnnualResultDetail',
|
||||
|
1
src/dicts/supplierAnnualResult.ts
Normal file
1
src/dicts/supplierAnnualResult.ts
Normal file
@ -0,0 +1 @@
|
||||
// 年审结果字典
|
@ -0,0 +1,82 @@
|
||||
.common-container {
|
||||
padding: 24px;
|
||||
background-color: #f0f2f5;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.table-operation {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.result-tag {
|
||||
min-width: 70px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 公共样式类,与supplierEvaluateResult.less一致 */
|
||||
:global {
|
||||
.common-container {
|
||||
background-color: #f0f2f5;
|
||||
min-height: 100%;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.filter-action-row {
|
||||
background-color: #fff;
|
||||
padding: 16px;
|
||||
border-radius: 2px;
|
||||
margin-bottom: 16px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.filter-form {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
|
||||
.ant-form-item {
|
||||
margin-right: 16px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
&.filter-btns {
|
||||
margin-left: auto;
|
||||
|
||||
button {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.content-area {
|
||||
background-color: #fff;
|
||||
padding: 16px;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.ant-card {
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.table-top-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
@ -1,11 +1,220 @@
|
||||
import React from 'react';
|
||||
import { Card } from 'antd';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Card, Table, Button, Input, Row, Col, message, Space, Form, DatePicker, Select, Tag } from 'antd';
|
||||
import { history } from 'umi';
|
||||
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import { getAnnualResultTaskList } from '@/servers/api/supplierAnnual';
|
||||
import styles from './supplierAnnualResult.less';
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
const { Option } = Select;
|
||||
|
||||
// 定义年度审查状态
|
||||
const statusOptions = [
|
||||
{ label: '待审核', value: '0' },
|
||||
{ label: '审核中', value: '1' },
|
||||
{ label: '已完成', value: '2' },
|
||||
];
|
||||
|
||||
const SupplierAnnualResult: React.FC = () => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [data, setData] = useState<supplierAnnualResult.TaskRecord[]>([]);
|
||||
const [pagination, setPagination] = useState({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
showTotal: (total: number) => `共 ${total} 条记录`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
});
|
||||
const [searchParams, setSearchParams] = useState({});
|
||||
|
||||
// 获取年度结果列表
|
||||
const fetchList = async (params: any = {}) => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const { current, pageSize, ...restParams } = params;
|
||||
const res = await getAnnualResultTaskList({
|
||||
basePageRequest: {
|
||||
pageNo: current,
|
||||
pageSize,
|
||||
},
|
||||
...restParams,
|
||||
...searchParams,
|
||||
});
|
||||
|
||||
if (res.success) {
|
||||
setData(res.data?.records || []);
|
||||
setPagination({
|
||||
...pagination,
|
||||
current,
|
||||
pageSize,
|
||||
total: res.data?.total || 0,
|
||||
});
|
||||
} else {
|
||||
message.error(res.message || '获取列表失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取列表失败:', error);
|
||||
message.error('获取列表失败');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
// 首次加载获取数据
|
||||
useEffect(() => {
|
||||
fetchList({ current: 1, pageSize: 10 });
|
||||
}, []);
|
||||
|
||||
// 表格变化处理
|
||||
const handleTableChange = (paginationParams: any) => {
|
||||
fetchList({
|
||||
current: paginationParams.current,
|
||||
pageSize: paginationParams.pageSize,
|
||||
});
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleSearch = (values: any) => {
|
||||
const params = { ...values };
|
||||
|
||||
// 处理日期范围
|
||||
if (params.reviewTime && params.reviewTime.length === 2) {
|
||||
params.startTime = params.reviewTime[0].format('YYYY-MM-DD');
|
||||
params.endTime = params.reviewTime[1].format('YYYY-MM-DD');
|
||||
delete params.reviewTime;
|
||||
}
|
||||
|
||||
setSearchParams(params);
|
||||
fetchList({ current: 1, pageSize: pagination.pageSize, ...params });
|
||||
};
|
||||
|
||||
// 重置搜索
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
setSearchParams({});
|
||||
fetchList({ current: 1, pageSize: pagination.pageSize });
|
||||
};
|
||||
|
||||
// 查看年度统计
|
||||
const handleViewYearStats = (record: supplierAnnualResult.TaskRecord) => {
|
||||
history.push({
|
||||
pathname: '/supplierAnnual/supplierAnnualResultQuery',
|
||||
state: {
|
||||
taskId: record.id,
|
||||
annualTheme: record.annualreviewTheme
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
key: 'index',
|
||||
width: 80,
|
||||
render: (_: any, __: any, index: number) => index + 1 + (pagination.current - 1) * pagination.pageSize,
|
||||
},
|
||||
{
|
||||
title: '主题',
|
||||
dataIndex: 'annualreviewTheme',
|
||||
key: 'annualreviewTheme',
|
||||
},
|
||||
{
|
||||
title: '品类',
|
||||
dataIndex: 'category',
|
||||
key: 'category',
|
||||
},
|
||||
{
|
||||
title: '发起单位',
|
||||
dataIndex: 'deptName',
|
||||
key: 'deptName',
|
||||
},
|
||||
{
|
||||
title: '年审开始时间',
|
||||
dataIndex: 'startTime',
|
||||
key: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '年审结束时间',
|
||||
dataIndex: 'endTime',
|
||||
key: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '年审状态',
|
||||
dataIndex: 'statusName',
|
||||
key: 'statusName',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
render: (text: any, record: supplierAnnualResult.TaskRecord) => (
|
||||
<Space size="middle">
|
||||
<Button type="link" size="small" onClick={() => handleViewYearStats(record)}>
|
||||
查看
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Card title="供应商年度结果">
|
||||
<div>供应商年度结果模块</div>
|
||||
</Card>
|
||||
<div className="common-container">
|
||||
<div className="filter-action-row">
|
||||
<Form
|
||||
form={form}
|
||||
layout="inline"
|
||||
onFinish={handleSearch}
|
||||
className="filter-form"
|
||||
>
|
||||
<Form.Item name="supplierName" label="供应商名称">
|
||||
<Input placeholder="请输入供应商名称" allowClear />
|
||||
</Form.Item>
|
||||
<Form.Item name="reviewTime" label="年审时间">
|
||||
<RangePicker
|
||||
placeholder={['开始日期', '结束日期']}
|
||||
format="YYYY-MM-DD"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="status" label="年审状态">
|
||||
<Select placeholder="请选择状态" allowClear style={{ width: 150 }}>
|
||||
{statusOptions.map(item => (
|
||||
<Option key={item.value} value={item.value}>
|
||||
{item.label}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item className="filter-btns">
|
||||
<Button type="primary" icon={<SearchOutlined />} onClick={() => form.submit()}>
|
||||
搜索
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
danger
|
||||
icon={<DeleteOutlined />}
|
||||
onClick={handleReset}
|
||||
>
|
||||
重置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
<div className="content-area">
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={data}
|
||||
rowKey="id"
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
onChange={handleTableChange}
|
||||
scroll={{ x: 1100 }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -0,0 +1,174 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { history } from 'umi';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
Descriptions,
|
||||
Divider,
|
||||
Spin,
|
||||
message,
|
||||
Typography,
|
||||
Empty,
|
||||
Table,
|
||||
Tag,
|
||||
} from 'antd';
|
||||
import { ArrowLeftOutlined } from '@ant-design/icons';
|
||||
import { getAnnualResultReviewDetail } from '@/servers/api/supplierAnnual';
|
||||
import {
|
||||
AnnualReviewStatus,
|
||||
AnnualReviewStatusText,
|
||||
AnnualReviewStatusColor,
|
||||
ExamineResult,
|
||||
ExamineResultText,
|
||||
ExamineResultColor,
|
||||
} from '@/dicts/supplierAnnualReviewDict';
|
||||
import styles from './supplierAnnualResult.less';
|
||||
|
||||
const { Title } = Typography;
|
||||
|
||||
const SupplierAnnualResultDetail: React.FC = () => {
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [reviewDetail, setReviewDetail] = useState<supplierAnnualResult.ReviewDetailData | null>(null);
|
||||
const [scoreResults, setScoreResults] = useState<supplierAnnualResult.TaskIndicatorVo[]>([]);
|
||||
|
||||
// 从路由获取ID和其他参数
|
||||
const { id, supplierId, supplierName, taskId, annualTheme } = history.location.state as {
|
||||
id: string;
|
||||
supplierId: string;
|
||||
supplierName: string;
|
||||
taskId: string;
|
||||
annualTheme: string;
|
||||
};
|
||||
|
||||
// 获取审查详情
|
||||
const fetchReviewDetail = async (reviewId: string) => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const res = await getAnnualResultReviewDetail(reviewId);
|
||||
if (res.success && res.data) {
|
||||
setReviewDetail(res.data);
|
||||
|
||||
// 设置评分结果
|
||||
if (res.data.taskIndicatorVo && Array.isArray(res.data.taskIndicatorVo)) {
|
||||
setScoreResults(res.data.taskIndicatorVo);
|
||||
}
|
||||
} else {
|
||||
message.error(res.message || '获取审查详情失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取审查详情失败:', error);
|
||||
message.error('获取审查详情失败');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
// 首次加载获取数据
|
||||
useEffect(() => {
|
||||
if (id) {
|
||||
fetchReviewDetail(id);
|
||||
} else {
|
||||
message.error('审查ID不存在,无法获取详情');
|
||||
history.goBack();
|
||||
}
|
||||
}, [id]);
|
||||
|
||||
// 返回列表页
|
||||
const handleBack = () => {
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
// 获取评审结果标签
|
||||
const getResultTag = (result: string | null) => {
|
||||
if (!result) return <Tag>未评审</Tag>;
|
||||
const color = ExamineResultColor[result as keyof typeof ExamineResultColor] || 'default';
|
||||
const text = ExamineResultText[result as keyof typeof ExamineResultText] || '未知';
|
||||
return <Tag color={color}>{text}</Tag>;
|
||||
};
|
||||
|
||||
// 评分结果表格列定义
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
key: 'index',
|
||||
width: 80,
|
||||
render: (_: any, __: any, index: number) => index + 1,
|
||||
},
|
||||
{
|
||||
title: '评分项',
|
||||
dataIndex: 'itemName',
|
||||
key: 'itemName',
|
||||
},
|
||||
{
|
||||
title: '评审结果',
|
||||
dataIndex: 'examineResult',
|
||||
key: 'examineResult',
|
||||
width: 120,
|
||||
render: (result: string | null) => getResultTag(result),
|
||||
},
|
||||
{
|
||||
title: '星号项',
|
||||
dataIndex: 'isStar',
|
||||
key: 'isStar',
|
||||
width: 120,
|
||||
render: (result: string) => result === '1' ? '是' : '否',
|
||||
},
|
||||
{
|
||||
title: '评审说明',
|
||||
dataIndex: 'remark',
|
||||
key: 'remark',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="common-container">
|
||||
<Card>
|
||||
<div className={styles['page-header']}>
|
||||
<Title level={4} style={{ margin: 0 }}>
|
||||
供应商年度审查详情
|
||||
</Title>
|
||||
<Button type="link" icon={<ArrowLeftOutlined />} onClick={handleBack}>
|
||||
返回
|
||||
</Button>
|
||||
</div>
|
||||
<Spin spinning={loading}>
|
||||
{reviewDetail ? (
|
||||
<>
|
||||
<Card title="基本信息" bordered={false} className={styles['detail-card']}>
|
||||
<Descriptions column={2} bordered>
|
||||
<Descriptions.Item label="供应商名称">
|
||||
{supplierName || reviewDetail.name}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="年度主题">
|
||||
{annualTheme}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
|
||||
<Divider />
|
||||
|
||||
<Card title="评分结果" bordered={false} className={styles['detail-card']}>
|
||||
{scoreResults.length > 0 ? (
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={scoreResults}
|
||||
rowKey="id"
|
||||
pagination={false}
|
||||
bordered
|
||||
/>
|
||||
) : (
|
||||
<Empty description="暂无评分数据" />
|
||||
)}
|
||||
</Card>
|
||||
</>
|
||||
) : (
|
||||
!loading && <Empty description="暂无审查详情数据" />
|
||||
)}
|
||||
</Spin>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SupplierAnnualResultDetail;
|
||||
|
@ -0,0 +1,253 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { history } from 'umi';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
Table,
|
||||
Input,
|
||||
Row,
|
||||
Col,
|
||||
message,
|
||||
Space,
|
||||
Form,
|
||||
Select,
|
||||
Typography,
|
||||
Tag,
|
||||
DatePicker
|
||||
} from 'antd';
|
||||
import { ArrowLeftOutlined, SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import { getAnnualResultSupplierList } from '@/servers/api/supplierAnnual';
|
||||
import styles from './supplierAnnualResult.less';
|
||||
|
||||
const { Title } = Typography;
|
||||
const { Option } = Select;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
// 定义年度审查结果状态
|
||||
const resultOptions = [
|
||||
{ label: '合格', value: '1' },
|
||||
{ label: '不合格', value: '2' },
|
||||
];
|
||||
|
||||
const SupplierAnnualResultQuery: React.FC = () => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [data, setData] = useState<supplierAnnualResult.SupplierRecord[]>([]);
|
||||
const [pagination, setPagination] = useState({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
showTotal: (total: number) => `共 ${total} 条记录`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
});
|
||||
const [searchParams, setSearchParams] = useState({});
|
||||
|
||||
// 从路由获取任务ID和主题
|
||||
const { taskId, annualTheme } = history.location.state as { taskId: string; annualTheme: string };
|
||||
|
||||
// 获取供应商列表
|
||||
const fetchList = async (params: any = {}) => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const { current, pageSize, ...restParams } = params;
|
||||
const res = await getAnnualResultSupplierList({
|
||||
annualreviewTaskId: taskId,
|
||||
basePageRequest: {
|
||||
pageNo: current,
|
||||
pageSize,
|
||||
},
|
||||
...restParams,
|
||||
...searchParams,
|
||||
});
|
||||
|
||||
if (res.success) {
|
||||
setData(res.data?.records || []);
|
||||
setPagination({
|
||||
...pagination,
|
||||
current,
|
||||
pageSize,
|
||||
total: res.data?.total || 0,
|
||||
});
|
||||
} else {
|
||||
message.error(res.message || '获取列表失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取列表失败:', error);
|
||||
message.error('获取列表失败');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
// 首次加载获取数据
|
||||
useEffect(() => {
|
||||
if (taskId) {
|
||||
fetchList({ current: 1, pageSize: 10 });
|
||||
} else {
|
||||
message.error('任务ID不存在,无法获取详情');
|
||||
history.goBack();
|
||||
}
|
||||
}, [taskId]);
|
||||
|
||||
// 表格变化处理
|
||||
const handleTableChange = (paginationParams: any) => {
|
||||
fetchList({
|
||||
current: paginationParams.current,
|
||||
pageSize: paginationParams.pageSize,
|
||||
});
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleSearch = (values: any) => {
|
||||
const params = { ...values };
|
||||
|
||||
// 处理日期范围
|
||||
if (params.reviewTime && params.reviewTime.length === 2) {
|
||||
params.startTime = params.reviewTime[0].format('YYYY-MM-DD');
|
||||
params.endTime = params.reviewTime[1].format('YYYY-MM-DD');
|
||||
delete params.reviewTime;
|
||||
}
|
||||
|
||||
setSearchParams(params);
|
||||
fetchList({ current: 1, pageSize: pagination.pageSize, ...params });
|
||||
};
|
||||
|
||||
// 重置搜索
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
setSearchParams({});
|
||||
fetchList({ current: 1, pageSize: pagination.pageSize });
|
||||
};
|
||||
|
||||
// 返回列表页
|
||||
const handleBack = () => {
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleViewDetail = (record: supplierAnnualResult.SupplierRecord) => {
|
||||
history.push({
|
||||
pathname: '/supplierAnnual/supplierAnnualResultQuery2',
|
||||
state: {
|
||||
supplierId: record.supplierId,
|
||||
supplierName: record.name,
|
||||
taskId,
|
||||
annualTheme,
|
||||
annualreviewTaskId: record.annualreviewTaskId,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
key: 'index',
|
||||
width: 80,
|
||||
render: (_: any, __: any, index: number) => index + 1 + (pagination.current - 1) * pagination.pageSize,
|
||||
},
|
||||
{
|
||||
title: '供应商名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: '品类',
|
||||
dataIndex: 'category',
|
||||
key: 'category',
|
||||
},
|
||||
{
|
||||
title: '审查单位',
|
||||
dataIndex: 'deptName',
|
||||
key: 'deptName',
|
||||
},
|
||||
{
|
||||
title: '审查结果',
|
||||
dataIndex: 'reviewResultName',
|
||||
key: 'reviewResultName',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
render: (text: any, record: supplierAnnualResult.SupplierRecord) => (
|
||||
<Space size="middle">
|
||||
<Button type="link" size="small" onClick={() => handleViewDetail(record)}>
|
||||
查看
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="common-container">
|
||||
<Card>
|
||||
<div className={styles['page-header']}>
|
||||
<Title level={4} style={{ margin: 0 }}>
|
||||
{annualTheme || '供应商年度结果'}
|
||||
</Title>
|
||||
<Button type="link" icon={<ArrowLeftOutlined />} onClick={handleBack}>
|
||||
返回
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="filter-action-row">
|
||||
<Form
|
||||
form={form}
|
||||
layout="inline"
|
||||
onFinish={handleSearch}
|
||||
className="filter-form"
|
||||
>
|
||||
<Form.Item name="name" label="供应商名称">
|
||||
<Input placeholder="请输入供应商名称" allowClear />
|
||||
</Form.Item>
|
||||
<Form.Item name="reviewResult" label="审查结果">
|
||||
<Select placeholder="请选择审查结果" allowClear style={{ width: 150 }}>
|
||||
{resultOptions.map(item => (
|
||||
<Option key={item.value} value={item.value}>
|
||||
{item.label}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="reviewTime" label="审查时间">
|
||||
<RangePicker
|
||||
placeholder={['开始日期', '结束日期']}
|
||||
format="YYYY-MM-DD"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item className="filter-btns">
|
||||
<Button type="primary" icon={<SearchOutlined />} onClick={() => form.submit()}>
|
||||
搜索
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
danger
|
||||
icon={<DeleteOutlined />}
|
||||
onClick={handleReset}
|
||||
>
|
||||
重置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
<div className="content-area">
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={data}
|
||||
rowKey="supplierId"
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
onChange={handleTableChange}
|
||||
scroll={{ x: 1100 }}
|
||||
/>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SupplierAnnualResultQuery;
|
@ -0,0 +1,294 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { history } from 'umi';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
Table,
|
||||
Input,
|
||||
Row,
|
||||
Col,
|
||||
message,
|
||||
Space,
|
||||
Form,
|
||||
Select,
|
||||
Typography,
|
||||
Tag,
|
||||
DatePicker
|
||||
} from 'antd';
|
||||
import { ArrowLeftOutlined, SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import { getAnnualResultReviewList } from '@/servers/api/supplierAnnual';
|
||||
import styles from './supplierAnnualResult.less';
|
||||
import {
|
||||
AnnualReviewStatus,
|
||||
AnnualReviewStatusText,
|
||||
AnnualReviewStatusColor
|
||||
} from '@/dicts/supplierAnnualReviewDict';
|
||||
|
||||
const { Title } = Typography;
|
||||
const { Option } = Select;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
// 定义审查结果状态
|
||||
const resultOptions = [
|
||||
{ label: '合格', value: '1' },
|
||||
{ label: '不合格', value: '2' },
|
||||
];
|
||||
|
||||
const SupplierAnnualResultQuery2: React.FC = () => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [data, setData] = useState<supplierAnnualResult.ReviewRecord[]>([]);
|
||||
const [pagination, setPagination] = useState({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
showTotal: (total: number) => `共 ${total} 条记录`,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
});
|
||||
const [searchParams, setSearchParams] = useState({});
|
||||
|
||||
// 从路由获取供应商ID和名称
|
||||
const { supplierId, supplierName, taskId, annualTheme,annualreviewTaskId } = history.location.state as {
|
||||
supplierId: string;
|
||||
supplierName: string;
|
||||
taskId: string;
|
||||
annualTheme: string;
|
||||
annualreviewTaskId: string;
|
||||
};
|
||||
|
||||
// 获取供应商审查列表
|
||||
const fetchList = async (params: any = {}) => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const { current, pageSize, ...restParams } = params;
|
||||
const res = await getAnnualResultReviewList({
|
||||
basePageRequest: {
|
||||
pageNo: current,
|
||||
pageSize,
|
||||
},
|
||||
supplierId, // 使用userId参数传递supplierId
|
||||
annualreviewTaskId,
|
||||
...restParams,
|
||||
...searchParams,
|
||||
});
|
||||
|
||||
if (res.success) {
|
||||
setData(res.data?.records || []);
|
||||
setPagination({
|
||||
...pagination,
|
||||
current,
|
||||
pageSize,
|
||||
total: res.data?.total || 0,
|
||||
});
|
||||
} else {
|
||||
message.error(res.message || '获取列表失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取列表失败:', error);
|
||||
message.error('获取列表失败');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
// 首次加载获取数据
|
||||
useEffect(() => {
|
||||
if (supplierId) {
|
||||
fetchList({ current: 1, pageSize: 10 });
|
||||
} else {
|
||||
message.error('供应商ID不存在,无法获取详情');
|
||||
history.goBack();
|
||||
}
|
||||
}, [supplierId]);
|
||||
|
||||
// 表格变化处理
|
||||
const handleTableChange = (paginationParams: any) => {
|
||||
fetchList({
|
||||
current: paginationParams.current,
|
||||
pageSize: paginationParams.pageSize,
|
||||
});
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const handleSearch = (values: any) => {
|
||||
const params = { ...values };
|
||||
|
||||
// 处理日期范围
|
||||
if (params.reviewTime && params.reviewTime.length === 2) {
|
||||
params.startTime = params.reviewTime[0].format('YYYY-MM-DD');
|
||||
params.endTime = params.reviewTime[1].format('YYYY-MM-DD');
|
||||
delete params.reviewTime;
|
||||
}
|
||||
|
||||
setSearchParams(params);
|
||||
fetchList({ current: 1, pageSize: pagination.pageSize, ...params });
|
||||
};
|
||||
|
||||
// 重置搜索
|
||||
const handleReset = () => {
|
||||
form.resetFields();
|
||||
setSearchParams({});
|
||||
fetchList({ current: 1, pageSize: pagination.pageSize });
|
||||
};
|
||||
|
||||
// 返回列表页
|
||||
const handleBack = () => {
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
// 查看详情
|
||||
const handleViewDetail = (record: supplierAnnualResult.ReviewRecord) => {
|
||||
history.push({
|
||||
pathname: '/supplierAnnual/supplierAnnualResultDetail',
|
||||
state: {
|
||||
id: record.id,
|
||||
supplierId,
|
||||
supplierName,
|
||||
taskId,
|
||||
annualTheme,
|
||||
annualreviewTaskId,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 获取状态标签
|
||||
const getStatusTag = (status: string | undefined, statusName: string | undefined) => {
|
||||
if (!status) return <Tag>未知状态</Tag>;
|
||||
const color = AnnualReviewStatusColor[status as keyof typeof AnnualReviewStatusColor] || 'default';
|
||||
const text = statusName || AnnualReviewStatusText[status as keyof typeof AnnualReviewStatusText] || '未知状态';
|
||||
return <Tag color={color}>{text}</Tag>;
|
||||
};
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
key: 'index',
|
||||
width: 80,
|
||||
render: (_: any, __: any, index: number) => index + 1 + (pagination.current - 1) * pagination.pageSize,
|
||||
},
|
||||
{
|
||||
title: '供应商名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
},
|
||||
{
|
||||
title: '品类',
|
||||
dataIndex: 'category',
|
||||
key: 'category',
|
||||
},
|
||||
{
|
||||
title: '审查单位',
|
||||
dataIndex: 'deptName',
|
||||
key: 'deptName',
|
||||
},
|
||||
{
|
||||
title: '审查部门',
|
||||
dataIndex: 'reviewDept',
|
||||
key: 'reviewDept',
|
||||
},
|
||||
{
|
||||
title: '评价人员',
|
||||
dataIndex: 'userName',
|
||||
key: 'userName',
|
||||
},
|
||||
{
|
||||
title: '审查时间',
|
||||
dataIndex: 'reviewTime',
|
||||
key: 'reviewTime',
|
||||
render: (_: any, record: supplierAnnualResult.ReviewRecord) => (
|
||||
<span>{record.startTime} 至 {record.endTime}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '审查结果',
|
||||
dataIndex: 'reviewStatus',
|
||||
key: 'reviewStatus',
|
||||
render: (status: string, record: supplierAnnualResult.ReviewRecord) =>
|
||||
getStatusTag(status, record.reviewStatusName),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 120,
|
||||
render: (text: any, record: supplierAnnualResult.ReviewRecord) => (
|
||||
<Space size="middle">
|
||||
<Button type="link" size="small" onClick={() => handleViewDetail(record)}>
|
||||
查看
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="common-container">
|
||||
<Card>
|
||||
<div className={styles['page-header']}>
|
||||
<Title level={4} style={{ margin: 0 }}>
|
||||
{supplierName || '供应商'} - 审查记录
|
||||
</Title>
|
||||
<Button type="link" icon={<ArrowLeftOutlined />} onClick={handleBack}>
|
||||
返回
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="filter-action-row">
|
||||
<Form
|
||||
form={form}
|
||||
layout="inline"
|
||||
onFinish={handleSearch}
|
||||
className="filter-form"
|
||||
>
|
||||
<Form.Item name="name" label="供应商名称">
|
||||
<Input placeholder="请输入供应商名称" allowClear />
|
||||
</Form.Item>
|
||||
<Form.Item name="reviewResult" label="审查结果">
|
||||
<Select placeholder="请选择审查结果" allowClear style={{ width: 150 }}>
|
||||
{resultOptions.map(item => (
|
||||
<Option key={item.value} value={item.value}>
|
||||
{item.label}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="reviewTime" label="审查时间">
|
||||
<RangePicker
|
||||
placeholder={['开始日期', '结束日期']}
|
||||
format="YYYY-MM-DD"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item className="filter-btns">
|
||||
<Button type="primary" icon={<SearchOutlined />} onClick={() => form.submit()}>
|
||||
搜索
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
danger
|
||||
icon={<DeleteOutlined />}
|
||||
onClick={handleReset}
|
||||
>
|
||||
重置
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
<div className="content-area">
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={data}
|
||||
rowKey="id"
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
onChange={handleTableChange}
|
||||
scroll={{ x: 1100 }}
|
||||
/>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default SupplierAnnualResultQuery2;
|
@ -119,3 +119,76 @@ export async function submitAnnualReviewScore(params: supplierAnnualReview.Score
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// =================== 供应商年度结果模块 ===================
|
||||
|
||||
/**
|
||||
* 获取供应商年度结果任务列表(一级列表)
|
||||
* @param params 查询参数
|
||||
* @returns Promise
|
||||
*/
|
||||
export async function getAnnualResultTaskList(params: supplierAnnualResult.TaskListRequest) {
|
||||
return request<supplierAnnualResult.TaskListResponse>('/annualreview/task/getPage', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商列表(二级列表)
|
||||
* @param params 查询参数
|
||||
* @returns Promise
|
||||
*/
|
||||
export async function getAnnualResultSupplierList(params: supplierAnnualResult.SupplierListRequest) {
|
||||
return request<supplierAnnualResult.SupplierListResponse>('/system/supplier/getPage', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商审查列表(三级列表)
|
||||
* @param params 查询参数
|
||||
* @returns Promise
|
||||
*/
|
||||
export async function getAnnualResultReviewList(params: supplierAnnualResult.ReviewListRequest) {
|
||||
return request<supplierAnnualResult.ReviewListResponse>('/annualreview/user/getPage', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商审查详情
|
||||
* @param id 审查ID
|
||||
* @returns Promise
|
||||
*/
|
||||
export async function getAnnualResultReviewDetail(id: string) {
|
||||
return request<supplierAnnualResult.ReviewDetailResponse>(`/annualreview/user/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 以下是旧的API函数,可以暂时保留,后续需要确认是否废弃
|
||||
// 获取供应商年度结果列表
|
||||
export async function getAnnualResultList(params: any) {
|
||||
return request<any>('/annualreview/result/getPage', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取年度统计列表
|
||||
export async function getAnnualYearStatsList(params: any) {
|
||||
return request<any>('/annualreview/result/getYearStats', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取供应商年度结果详情
|
||||
export async function getAnnualResultDetail(id: string) {
|
||||
return request<any>(`/annualreview/result/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
176
src/servers/dao/supplierAnnualManage/supplierAnnualResult.d.ts
vendored
Normal file
176
src/servers/dao/supplierAnnualManage/supplierAnnualResult.d.ts
vendored
Normal file
@ -0,0 +1,176 @@
|
||||
// 供应商年度结果模块 dao 接口
|
||||
|
||||
declare namespace supplierAnnualResult {
|
||||
// 基础分页请求参数
|
||||
interface BasePageRequest {
|
||||
pageNo: number;
|
||||
pageSize: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 一级列表接口 - 年度结果任务列表请求参数
|
||||
interface TaskListRequest {
|
||||
basePageRequest: BasePageRequest;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 一级列表接口 - 年度结果任务列表响应
|
||||
interface TaskListResponse {
|
||||
code: number;
|
||||
data: TaskListData;
|
||||
message: string;
|
||||
success: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 年度结果任务列表数据
|
||||
interface TaskListData {
|
||||
countId: null;
|
||||
current: number;
|
||||
hitCount: boolean;
|
||||
maxLimit: null;
|
||||
optimizeCountSql: boolean;
|
||||
orders: any[];
|
||||
pages: number;
|
||||
records: TaskRecord[];
|
||||
searchCount: boolean;
|
||||
size: number;
|
||||
total: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 年度结果任务记录
|
||||
interface TaskRecord {
|
||||
annualreviewTheme: string;
|
||||
basePageRequest: null;
|
||||
deptName: string;
|
||||
endTime: string;
|
||||
id: string;
|
||||
startTime: string;
|
||||
status: string;
|
||||
statusName: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 二级列表接口 - 供应商列表请求参数
|
||||
interface SupplierListRequest {
|
||||
annualreviewTaskId: string;
|
||||
basePageRequest: BasePageRequest;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 二级列表接口 - 供应商列表响应
|
||||
interface SupplierListResponse {
|
||||
code: number;
|
||||
data: SupplierListData;
|
||||
message: string;
|
||||
success: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 供应商列表数据
|
||||
interface SupplierListData {
|
||||
countId: null;
|
||||
current: number;
|
||||
hitCount: boolean;
|
||||
maxLimit: null;
|
||||
optimizeCountSql: boolean;
|
||||
orders: any[];
|
||||
pages: number;
|
||||
records: SupplierRecord[];
|
||||
searchCount: boolean;
|
||||
size: number;
|
||||
total: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 供应商记录
|
||||
interface SupplierRecord {
|
||||
annualreviewTaskId: string;
|
||||
basePageRequest: null;
|
||||
category: null;
|
||||
deptName: string;
|
||||
name: string;
|
||||
reviewResult: null;
|
||||
reviewResultName: string;
|
||||
supplierId: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 三级列表接口 - 审查详情列表请求参数
|
||||
interface ReviewListRequest {
|
||||
basePageRequest: BasePageRequest;
|
||||
userId: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 三级列表接口 - 审查详情列表响应
|
||||
interface ReviewListResponse {
|
||||
code: number;
|
||||
data: ReviewListData;
|
||||
message: string;
|
||||
success: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 审查详情列表数据
|
||||
interface ReviewListData {
|
||||
countId: null;
|
||||
current: number;
|
||||
hitCount: boolean;
|
||||
maxLimit: null;
|
||||
optimizeCountSql: boolean;
|
||||
orders: string[];
|
||||
pages: number;
|
||||
records: ReviewRecord[];
|
||||
searchCount: boolean;
|
||||
size: number;
|
||||
total: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 审查详情记录
|
||||
interface ReviewRecord {
|
||||
annualreviewTheme: string;
|
||||
basePageRequest: null;
|
||||
deptName: string;
|
||||
endTime: string;
|
||||
id: string;
|
||||
name: string;
|
||||
reviewStatus: string;
|
||||
reviewStatusName: string;
|
||||
startTime: string;
|
||||
status: string;
|
||||
statusName: string;
|
||||
userId: null;
|
||||
userName: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 详情接口 - 评审详情响应
|
||||
interface ReviewDetailResponse {
|
||||
code: number;
|
||||
data: ReviewDetailData;
|
||||
message: string;
|
||||
success: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 评审详情数据
|
||||
interface ReviewDetailData {
|
||||
category: null;
|
||||
name: string;
|
||||
taskIndicatorVo: TaskIndicatorVo[];
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 评分项
|
||||
interface TaskIndicatorVo {
|
||||
examineResult: null;
|
||||
id: string;
|
||||
isStar: string;
|
||||
itemName: string;
|
||||
remark: null;
|
||||
[property: string]: any;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user