更改状态从字典接口获取
This commit is contained in:
@ -3,18 +3,16 @@ import { Table, Button, Input, message, Space, Form, DatePicker, Select } from '
|
||||
import { history, useIntl } from 'umi';
|
||||
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import { getAnnualResultTaskList } from '@/servers/api/supplierAnnual';
|
||||
import { getDictList } from '@/servers/api/dicts';
|
||||
import type { DictItem } from '@/servers/api/dicts';
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
const { Option } = Select;
|
||||
|
||||
// 定义年度审查状态
|
||||
const statusOptions = [
|
||||
{ label: '待审核', value: '0' },
|
||||
{ label: '审核中', value: '1' },
|
||||
{ label: '已完成', value: '2' },
|
||||
];
|
||||
|
||||
const SupplierAnnualResult: React.FC = () => {
|
||||
// 定义年度审查状态
|
||||
const [statusOptions, setStatusOptions] = useState<DictItem[]>([]);
|
||||
const intl = useIntl();
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
@ -57,7 +55,13 @@ const SupplierAnnualResult: React.FC = () => {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getDictList('project_status ').then((res) => {
|
||||
if (res.success) {
|
||||
setStatusOptions(res.data);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
// 监听搜索参数和分页变化,自动请求数据
|
||||
useEffect(() => {
|
||||
fetchList();
|
||||
@ -194,8 +198,8 @@ const SupplierAnnualResult: React.FC = () => {
|
||||
<Form.Item name="status" label={intl.formatMessage({ id: 'supplierAnnualResult.list.status' })}>
|
||||
<Select placeholder={intl.formatMessage({ id: 'supplierAnnualResult.list.pleaseSelectStatus' })} allowClear style={{ width: 150 }}>
|
||||
{statusOptions.map(item => (
|
||||
<Option key={item.value} value={item.value}>
|
||||
{item.label}
|
||||
<Option key={item.code} value={item.code}>
|
||||
{item.dicName}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
|
@ -213,11 +213,9 @@ const SupplierAnnualReview: React.FC = () => {
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: 'supplierAnnualReview.list.status' }),
|
||||
dataIndex: 'reviewStatus',
|
||||
key: 'reviewStatus',
|
||||
width: 100,
|
||||
render: (status: string, record: supplierAnnualReview.ReviewRecord) =>
|
||||
getStatusTag(status, record.reviewStatusName),
|
||||
dataIndex: 'reviewStatusName',
|
||||
key: 'reviewStatusName',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: intl.formatMessage({ id: 'supplierAnnualReview.common.operation' }),
|
||||
|
Reference in New Issue
Block a user