修改列表查询bug
This commit is contained in:
@ -29,16 +29,14 @@ const SupplierAnnualResult: React.FC = () => {
|
|||||||
const [searchParams, setSearchParams] = useState({});
|
const [searchParams, setSearchParams] = useState({});
|
||||||
|
|
||||||
// 获取年度结果列表
|
// 获取年度结果列表
|
||||||
const fetchList = async (params: any = {}) => {
|
const fetchList = async () => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { current, pageSize, ...restParams } = params;
|
|
||||||
const res = await getAnnualResultTaskList({
|
const res = await getAnnualResultTaskList({
|
||||||
basePageRequest: {
|
basePageRequest: {
|
||||||
pageNo: current,
|
pageNo: pagination.current,
|
||||||
pageSize,
|
pageSize: pagination.pageSize,
|
||||||
},
|
},
|
||||||
...restParams,
|
|
||||||
...searchParams,
|
...searchParams,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -46,8 +44,6 @@ const SupplierAnnualResult: React.FC = () => {
|
|||||||
setData(res.data?.records || []);
|
setData(res.data?.records || []);
|
||||||
setPagination({
|
setPagination({
|
||||||
...pagination,
|
...pagination,
|
||||||
current,
|
|
||||||
pageSize,
|
|
||||||
total: res.data?.total || 0,
|
total: res.data?.total || 0,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -61,14 +57,15 @@ const SupplierAnnualResult: React.FC = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 首次加载获取数据
|
// 监听搜索参数和分页变化,自动请求数据
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchList({ current: 1, pageSize: 10 });
|
fetchList();
|
||||||
}, []);
|
}, [searchParams, pagination.current, pagination.pageSize]);
|
||||||
|
|
||||||
// 表格变化处理
|
// 表格变化处理
|
||||||
const handleTableChange = (paginationParams: any) => {
|
const handleTableChange = (paginationParams: any) => {
|
||||||
fetchList({
|
setPagination({
|
||||||
|
...pagination,
|
||||||
current: paginationParams.current,
|
current: paginationParams.current,
|
||||||
pageSize: paginationParams.pageSize,
|
pageSize: paginationParams.pageSize,
|
||||||
});
|
});
|
||||||
@ -85,15 +82,28 @@ const SupplierAnnualResult: React.FC = () => {
|
|||||||
delete params.reviewTime;
|
delete params.reviewTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新分页到第一页
|
||||||
|
setPagination({
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新搜索参数,会触发useEffect重新请求
|
||||||
setSearchParams(params);
|
setSearchParams(params);
|
||||||
fetchList({ current: 1, pageSize: pagination.pageSize, ...params });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置搜索
|
// 重置搜索
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
|
|
||||||
|
// 更新分页到第一页
|
||||||
|
setPagination({
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 清空搜索参数,会触发useEffect重新请求
|
||||||
setSearchParams({});
|
setSearchParams({});
|
||||||
fetchList({ current: 1, pageSize: pagination.pageSize });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 查看年度统计
|
// 查看年度统计
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
Form,
|
Form,
|
||||||
Select,
|
Select,
|
||||||
Typography,
|
Typography,
|
||||||
DatePicker
|
DatePicker,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import { ArrowLeftOutlined, SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
import { ArrowLeftOutlined, SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||||
import { getAnnualResultSupplierList } from '@/servers/api/supplierAnnual';
|
import { getAnnualResultSupplierList } from '@/servers/api/supplierAnnual';
|
||||||
@ -44,17 +44,17 @@ const SupplierAnnualResultQuery: React.FC = () => {
|
|||||||
const { taskId, annualTheme } = history.location.state as { taskId: string; annualTheme: string };
|
const { taskId, annualTheme } = history.location.state as { taskId: string; annualTheme: string };
|
||||||
|
|
||||||
// 获取供应商列表
|
// 获取供应商列表
|
||||||
const fetchList = async (params: any = {}) => {
|
const fetchList = async () => {
|
||||||
|
if (!taskId) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { current, pageSize, ...restParams } = params;
|
|
||||||
const res = await getAnnualResultSupplierList({
|
const res = await getAnnualResultSupplierList({
|
||||||
annualreviewTaskId: taskId,
|
annualreviewTaskId: taskId,
|
||||||
basePageRequest: {
|
basePageRequest: {
|
||||||
pageNo: current,
|
pageNo: pagination.current,
|
||||||
pageSize,
|
pageSize: pagination.pageSize,
|
||||||
},
|
},
|
||||||
...restParams,
|
|
||||||
...searchParams,
|
...searchParams,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -62,8 +62,6 @@ const SupplierAnnualResultQuery: React.FC = () => {
|
|||||||
setData(res.data?.records || []);
|
setData(res.data?.records || []);
|
||||||
setPagination({
|
setPagination({
|
||||||
...pagination,
|
...pagination,
|
||||||
current,
|
|
||||||
pageSize,
|
|
||||||
total: res.data?.total || 0,
|
total: res.data?.total || 0,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -77,19 +75,20 @@ const SupplierAnnualResultQuery: React.FC = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 首次加载获取数据
|
// 监听任务ID变化,初始化数据
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (taskId) {
|
if (taskId) {
|
||||||
fetchList({ current: 1, pageSize: 10 });
|
fetchList();
|
||||||
} else {
|
} else {
|
||||||
message.error('任务ID不存在,无法获取详情');
|
message.error('任务ID不存在,无法获取详情');
|
||||||
history.goBack();
|
history.goBack();
|
||||||
}
|
}
|
||||||
}, [taskId]);
|
}, [taskId, searchParams, pagination.current, pagination.pageSize]);
|
||||||
|
|
||||||
// 表格变化处理
|
// 表格变化处理
|
||||||
const handleTableChange = (paginationParams: any) => {
|
const handleTableChange = (paginationParams: any) => {
|
||||||
fetchList({
|
setPagination({
|
||||||
|
...pagination,
|
||||||
current: paginationParams.current,
|
current: paginationParams.current,
|
||||||
pageSize: paginationParams.pageSize,
|
pageSize: paginationParams.pageSize,
|
||||||
});
|
});
|
||||||
@ -106,15 +105,28 @@ const SupplierAnnualResultQuery: React.FC = () => {
|
|||||||
delete params.reviewTime;
|
delete params.reviewTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新分页到第一页
|
||||||
|
setPagination({
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新搜索参数,会触发useEffect重新请求
|
||||||
setSearchParams(params);
|
setSearchParams(params);
|
||||||
fetchList({ current: 1, pageSize: pagination.pageSize, ...params });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置搜索
|
// 重置搜索
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
|
|
||||||
|
// 更新分页到第一页
|
||||||
|
setPagination({
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 清空搜索参数,会触发useEffect重新请求
|
||||||
setSearchParams({});
|
setSearchParams({});
|
||||||
fetchList({ current: 1, pageSize: pagination.pageSize });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 返回列表页
|
// 返回列表页
|
||||||
@ -142,7 +154,8 @@ const SupplierAnnualResultQuery: React.FC = () => {
|
|||||||
dataIndex: 'index',
|
dataIndex: 'index',
|
||||||
key: 'index',
|
key: 'index',
|
||||||
width: 80,
|
width: 80,
|
||||||
render: (_: any, __: any, index: number) => index + 1 + (pagination.current - 1) * pagination.pageSize,
|
render: (_: any, __: any, index: number) =>
|
||||||
|
index + 1 + (pagination.current - 1) * pagination.pageSize,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '供应商名称',
|
title: '供应商名称',
|
||||||
@ -191,18 +204,13 @@ const SupplierAnnualResultQuery: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="filter-action-row">
|
<div className="filter-action-row">
|
||||||
<Form
|
<Form form={form} layout="inline" onFinish={handleSearch} className="filter-form">
|
||||||
form={form}
|
|
||||||
layout="inline"
|
|
||||||
onFinish={handleSearch}
|
|
||||||
className="filter-form"
|
|
||||||
>
|
|
||||||
<Form.Item name="name" label="供应商名称">
|
<Form.Item name="name" label="供应商名称">
|
||||||
<Input placeholder="请输入供应商名称" allowClear />
|
<Input placeholder="请输入供应商名称" allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="reviewResult" label="审查结果">
|
<Form.Item name="reviewResult" label="审查结果">
|
||||||
<Select placeholder="请选择审查结果" allowClear style={{ width: 150 }}>
|
<Select placeholder="请选择审查结果" allowClear style={{ width: 150 }}>
|
||||||
{resultOptions.map(item => (
|
{resultOptions.map((item) => (
|
||||||
<Option key={item.value} value={item.value}>
|
<Option key={item.value} value={item.value}>
|
||||||
{item.label}
|
{item.label}
|
||||||
</Option>
|
</Option>
|
||||||
@ -210,21 +218,13 @@ const SupplierAnnualResultQuery: React.FC = () => {
|
|||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="reviewTime" label="审查时间">
|
<Form.Item name="reviewTime" label="审查时间">
|
||||||
<RangePicker
|
<RangePicker placeholder={['开始日期', '结束日期']} format="YYYY-MM-DD" />
|
||||||
placeholder={['开始日期', '结束日期']}
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item className="filter-btns">
|
<Form.Item className="filter-btns">
|
||||||
<Button type="primary" icon={<SearchOutlined />} onClick={() => form.submit()}>
|
<Button type="primary" icon={<SearchOutlined />} onClick={() => form.submit()}>
|
||||||
搜索
|
搜索
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button type="primary" danger icon={<DeleteOutlined />} onClick={handleReset}>
|
||||||
type="primary"
|
|
||||||
danger
|
|
||||||
icon={<DeleteOutlined />}
|
|
||||||
onClick={handleReset}
|
|
||||||
>
|
|
||||||
重置
|
重置
|
||||||
</Button>
|
</Button>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
@ -55,18 +55,18 @@ const SupplierAnnualResultQuery2: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 获取供应商审查列表
|
// 获取供应商审查列表
|
||||||
const fetchList = async (params: any = {}) => {
|
const fetchList = async () => {
|
||||||
|
if (!supplierId) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { current, pageSize, ...restParams } = params;
|
|
||||||
const res = await getAnnualResultReviewList({
|
const res = await getAnnualResultReviewList({
|
||||||
basePageRequest: {
|
basePageRequest: {
|
||||||
pageNo: current,
|
pageNo: pagination.current,
|
||||||
pageSize,
|
pageSize: pagination.pageSize,
|
||||||
},
|
},
|
||||||
supplierId, // 使用userId参数传递supplierId
|
userId: supplierId, // 使用userId参数传递supplierId
|
||||||
annualreviewTaskId,
|
annualreviewTaskId,
|
||||||
...restParams,
|
|
||||||
...searchParams,
|
...searchParams,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -74,8 +74,6 @@ const SupplierAnnualResultQuery2: React.FC = () => {
|
|||||||
setData(res.data?.records || []);
|
setData(res.data?.records || []);
|
||||||
setPagination({
|
setPagination({
|
||||||
...pagination,
|
...pagination,
|
||||||
current,
|
|
||||||
pageSize,
|
|
||||||
total: res.data?.total || 0,
|
total: res.data?.total || 0,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -89,19 +87,20 @@ const SupplierAnnualResultQuery2: React.FC = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 首次加载获取数据
|
// 监听supplierId和搜索参数、分页变化获取数据
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (supplierId) {
|
if (supplierId) {
|
||||||
fetchList({ current: 1, pageSize: 10 });
|
fetchList();
|
||||||
} else {
|
} else {
|
||||||
message.error('供应商ID不存在,无法获取详情');
|
message.error('供应商ID不存在,无法获取详情');
|
||||||
history.goBack();
|
history.goBack();
|
||||||
}
|
}
|
||||||
}, [supplierId]);
|
}, [supplierId, searchParams, pagination.current, pagination.pageSize]);
|
||||||
|
|
||||||
// 表格变化处理
|
// 表格变化处理
|
||||||
const handleTableChange = (paginationParams: any) => {
|
const handleTableChange = (paginationParams: any) => {
|
||||||
fetchList({
|
setPagination({
|
||||||
|
...pagination,
|
||||||
current: paginationParams.current,
|
current: paginationParams.current,
|
||||||
pageSize: paginationParams.pageSize,
|
pageSize: paginationParams.pageSize,
|
||||||
});
|
});
|
||||||
@ -118,15 +117,28 @@ const SupplierAnnualResultQuery2: React.FC = () => {
|
|||||||
delete params.reviewTime;
|
delete params.reviewTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新分页到第一页
|
||||||
|
setPagination({
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新搜索参数,会触发useEffect重新请求
|
||||||
setSearchParams(params);
|
setSearchParams(params);
|
||||||
fetchList({ current: 1, pageSize: pagination.pageSize, ...params });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置搜索
|
// 重置搜索
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
|
|
||||||
|
// 更新分页到第一页
|
||||||
|
setPagination({
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 清空搜索参数,会触发useEffect重新请求
|
||||||
setSearchParams({});
|
setSearchParams({});
|
||||||
fetchList({ current: 1, pageSize: pagination.pageSize });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 返回列表页
|
// 返回列表页
|
||||||
@ -163,7 +175,8 @@ const SupplierAnnualResultQuery2: React.FC = () => {
|
|||||||
dataIndex: 'index',
|
dataIndex: 'index',
|
||||||
key: 'index',
|
key: 'index',
|
||||||
width: 80,
|
width: 80,
|
||||||
render: (_: any, __: any, index: number) => index + 1 + (pagination.current - 1) * pagination.pageSize,
|
render: (_: any, __: any, index: number) =>
|
||||||
|
index + 1 + (pagination.current - 1) * pagination.pageSize,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '供应商名称',
|
title: '供应商名称',
|
||||||
|
@ -11,16 +11,12 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
Tag,
|
Tag,
|
||||||
DatePicker,
|
DatePicker,
|
||||||
Row,
|
|
||||||
Col,
|
|
||||||
Card,
|
Card,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import type { TablePaginationConfig } from 'antd';
|
import type { TablePaginationConfig } from 'antd';
|
||||||
import {
|
import {
|
||||||
SearchOutlined,
|
SearchOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
EyeOutlined,
|
|
||||||
EditOutlined,
|
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { getAnnualReviewList } from '@/servers/api/supplierAnnual';
|
import { getAnnualReviewList } from '@/servers/api/supplierAnnual';
|
||||||
import {
|
import {
|
||||||
@ -28,7 +24,8 @@ import {
|
|||||||
AnnualReviewStatusText,
|
AnnualReviewStatusText,
|
||||||
AnnualReviewStatusColor,
|
AnnualReviewStatusColor,
|
||||||
} from '@/dicts/supplierAnnualReviewDict';
|
} from '@/dicts/supplierAnnualReviewDict';
|
||||||
import styles from './supplierAnnualReview.less';
|
import { getDictList } from '@/servers/api/dicts';
|
||||||
|
import type { DictItem } from '@/servers/api/dicts';
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
@ -44,7 +41,7 @@ interface AnnualReviewSearchParams {
|
|||||||
const SupplierAnnualReview: React.FC = () => {
|
const SupplierAnnualReview: React.FC = () => {
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
const [reviewStatus, setReviewStatus] = useState<DictItem[]>([]);
|
||||||
const [reviewData, setReviewData] = useState<supplierAnnualReview.ReviewRecord[]>([]);
|
const [reviewData, setReviewData] = useState<supplierAnnualReview.ReviewRecord[]>([]);
|
||||||
const [pagination, setPagination] = useState<TablePaginationConfig>({
|
const [pagination, setPagination] = useState<TablePaginationConfig>({
|
||||||
current: 1,
|
current: 1,
|
||||||
@ -114,6 +111,11 @@ const SupplierAnnualReview: React.FC = () => {
|
|||||||
// 首次加载获取数据
|
// 首次加载获取数据
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchReviewList(pagination.current, pagination.pageSize, {});
|
fetchReviewList(pagination.current, pagination.pageSize, {});
|
||||||
|
getDictList('project_status ').then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
setReviewStatus(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// 处理查看
|
// 处理查看
|
||||||
@ -282,8 +284,8 @@ const SupplierAnnualReview: React.FC = () => {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="reviewStatus" label="状态">
|
<Form.Item name="reviewStatus" label="状态">
|
||||||
<Select placeholder="请选择状态" allowClear style={{ width: 120 }}>
|
<Select placeholder="请选择状态" allowClear style={{ width: 120 }}>
|
||||||
{Object.entries(AnnualReviewStatusText).map(([key, value]) => (
|
{reviewStatus.map((item) => (
|
||||||
<Option key={key} value={key}>{value}</Option>
|
<Option key={item.code} value={item.code}>{item.dicName}</Option>
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
@ -44,17 +44,16 @@ const SupplierAnnualTaskManage: React.FC = () => {
|
|||||||
});
|
});
|
||||||
const [searchParams, setSearchParams] = useState<any>({});
|
const [searchParams, setSearchParams] = useState<any>({});
|
||||||
const [evaluateStatus, setEvaluateStatus] = useState<DictItem[]>([]);
|
const [evaluateStatus, setEvaluateStatus] = useState<DictItem[]>([]);
|
||||||
|
|
||||||
// 获取年度任务列表
|
// 获取年度任务列表
|
||||||
const fetchList = async (params: any = {}) => {
|
const fetchList = async () => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const { current, pageSize, ...restParams } = params;
|
|
||||||
const res = await getAnnualTaskList({
|
const res = await getAnnualTaskList({
|
||||||
basePageRequest: {
|
basePageRequest: {
|
||||||
pageNo: current,
|
pageNo: pagination.current,
|
||||||
pageSize,
|
pageSize: pagination.pageSize,
|
||||||
},
|
},
|
||||||
...restParams,
|
|
||||||
...searchParams,
|
...searchParams,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -62,8 +61,6 @@ const SupplierAnnualTaskManage: React.FC = () => {
|
|||||||
setData(res.data?.records || []);
|
setData(res.data?.records || []);
|
||||||
setPagination({
|
setPagination({
|
||||||
...pagination,
|
...pagination,
|
||||||
current,
|
|
||||||
pageSize,
|
|
||||||
total: res.data?.total || 0,
|
total: res.data?.total || 0,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -77,20 +74,24 @@ const SupplierAnnualTaskManage: React.FC = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 首次加载获取数据
|
// 获取状态字典
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchList({ current: 1, pageSize: 10 });
|
|
||||||
getDictList('project_status').then((res) => {
|
getDictList('project_status').then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
setEvaluateStatus(res.data);
|
setEvaluateStatus(res.data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// 监听搜索参数和分页变化,自动请求数据
|
||||||
|
useEffect(() => {
|
||||||
|
fetchList();
|
||||||
|
}, [searchParams, pagination.current, pagination.pageSize]);
|
||||||
|
|
||||||
// 表格变化处理
|
// 表格变化处理
|
||||||
const handleTableChange = (paginationParams: any) => {
|
const handleTableChange = (paginationParams: any) => {
|
||||||
fetchList({
|
setPagination({
|
||||||
|
...pagination,
|
||||||
current: paginationParams.current,
|
current: paginationParams.current,
|
||||||
pageSize: paginationParams.pageSize,
|
pageSize: paginationParams.pageSize,
|
||||||
});
|
});
|
||||||
@ -107,15 +108,28 @@ const SupplierAnnualTaskManage: React.FC = () => {
|
|||||||
delete params.timeRange;
|
delete params.timeRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新分页到第一页
|
||||||
|
setPagination({
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 更新搜索参数,会触发useEffect重新请求
|
||||||
setSearchParams(params);
|
setSearchParams(params);
|
||||||
fetchList({ current: 1, pageSize: pagination.pageSize, ...params });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 重置搜索
|
// 重置搜索
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
|
|
||||||
|
// 更新分页到第一页
|
||||||
|
setPagination({
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 清空搜索参数,会触发useEffect重新请求
|
||||||
setSearchParams({});
|
setSearchParams({});
|
||||||
fetchList({ current: 1, pageSize: pagination.pageSize });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 新增任务
|
// 新增任务
|
||||||
|
Reference in New Issue
Block a user