import React, { useState, useEffect } from "react";
import { Button, Form, Select, Space, Table, Tag } from "antd";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
import { tools } from "@cqsjjb/jjb-common-lib";
import { CHANGE_STATUS_MAP } from "~/enumerate/constant";
const MOCK_DATA = [
{
id: 1,
orgName: "重庆安评技术研究院有限公司",
orgType: "本地机构",
filingNo: "BA-2026-001",
businessScope: "化工",
changeItem: "法定代表人变更",
changeStatus: "pending",
},
{
id: 2,
orgName: "重庆恒安安全评价有限公司",
orgType: "本地机构",
filingNo: "BA-2025-032",
businessScope: "化工, 建筑施工",
changeItem: "注册地址变更",
changeStatus: "stuck",
},
{
id: 3,
orgName: "北京中安评价中心(重庆分公司)",
orgType: "异地机构",
filingNo: "BA-2026-015",
businessScope: "矿山",
changeItem: "业务范围变更",
changeStatus: "approved",
},
];
const { router } = tools;
const QualChange = (props) => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false);
const handleSearch = () => {
setLoading(true);
setTimeout(() => setLoading(false), 500);
};
const handleReset = (values) => {
router.query = {
...router.query,
...values,
current: 1,
pageSize: 10,
};
handleSearch();
};
useEffect(() => {
form.setFieldsValue(router.query);
}, []);
const columns = [
{
title: "序号",
dataIndex: "id",
width: 60,
fixed: "left",
render: (text, record, index) => index + 1,
},
{ title: "机构名称", dataIndex: "orgName", width: 220, ellipsis: true },
{ title: "机构类型", dataIndex: "orgType", width: 100 },
{ title: "备案编号", dataIndex: "filingNo", width: 140, ellipsis: true },
{ title: "安全评价业务范围", dataIndex: "businessScope", width: 180, ellipsis: true },
{ title: "变更项", dataIndex: "changeItem", width: 140, ellipsis: true },
{
title: "变更状态",
dataIndex: "changeStatus",
width: 100,
render: (status) => {
const config = CHANGE_STATUS_MAP[status];
return config ? {config.label} : status;
},
},
{
title: "操作",
width: 140,
fixed: "right",
render: (_, record) => (
{record.changeStatus !== "approved" && (
)}
),
},
];
return (
,
,
石油加工
化工
矿山
建筑施工
,
停滞中
待审核
已审核
,
]}
onReset={handleReset}
onFinish={(values) => {
router.query = {
...router.query,
...values,
current: 1,
pageSize: 10,
};
handleSearch();
}}
/>
`共 ${total} 条`,
current: router.query.current,
pageSize: router.query.pageSize,
onChange: (page, pageSize) => {
router.query = {
...router.query,
current: page,
pageSize,
};
handleSearch();
},
}}
/>
);
};
export default AntdTableFuncControl(QualChange);