214 lines
6.1 KiB
JavaScript
214 lines
6.1 KiB
JavaScript
|
|
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 { VERIFY_STATUS_MAP } from "~/enumerate/constant";
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
// 静态模拟数据
|
||
|
|
const MOCK_DATA = [
|
||
|
|
{
|
||
|
|
id: 1,
|
||
|
|
orgName: "重庆安评技术研究院有限公司",
|
||
|
|
orgType: "本地机构",
|
||
|
|
certNo: "API-2026-001",
|
||
|
|
businessScope: "化工, 石油加工",
|
||
|
|
confirmStatus: "pending",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: 2,
|
||
|
|
orgName: "北京中安评价中心(重庆分公司)",
|
||
|
|
orgType: "异地机构",
|
||
|
|
certNo: "API-2026-015",
|
||
|
|
businessScope: "矿山",
|
||
|
|
confirmStatus: "passed",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: 3,
|
||
|
|
orgName: "重庆华安评价有限公司",
|
||
|
|
orgType: "异地机构",
|
||
|
|
certNo: "API-2025-088",
|
||
|
|
businessScope: "石油加工",
|
||
|
|
confirmStatus: "pending",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: 4,
|
||
|
|
orgName: "重庆安评科技有限公司",
|
||
|
|
orgType: "本地机构",
|
||
|
|
certNo: "API-2024-056",
|
||
|
|
businessScope: "化工",
|
||
|
|
confirmStatus: "rejected",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
id: 5,
|
||
|
|
orgName: "重庆恒安安全评价有限公司",
|
||
|
|
orgType: "本地机构",
|
||
|
|
certNo: "API-2025-032",
|
||
|
|
businessScope: "矿山, 石油加工",
|
||
|
|
confirmStatus: "passed",
|
||
|
|
},
|
||
|
|
];
|
||
|
|
|
||
|
|
const {router} = tools;
|
||
|
|
|
||
|
|
const ExpertVerification = (props) => {
|
||
|
|
const [form] = Form.useForm();
|
||
|
|
const [loading, setLoading] = useState(false);
|
||
|
|
|
||
|
|
const handleSearch = () => {
|
||
|
|
setLoading(true);
|
||
|
|
console.log(router.query);
|
||
|
|
setTimeout(() => setLoading(false), 500);
|
||
|
|
};
|
||
|
|
|
||
|
|
const handleReset = (values) => {
|
||
|
|
setLoading(true);
|
||
|
|
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: "certNo", width: 140, ellipsis: true },
|
||
|
|
{ title: "安全评价业务范围", dataIndex: "businessScope", width: 180, ellipsis: true },
|
||
|
|
{
|
||
|
|
title: "确认状态",
|
||
|
|
dataIndex: "confirmStatus",
|
||
|
|
width: 100,
|
||
|
|
render: (status) => {
|
||
|
|
const config = VERIFY_STATUS_MAP[status];
|
||
|
|
return config ? <Tag color={config.color}>{config.label}</Tag> : status;
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
title: "操作",
|
||
|
|
width: 140,
|
||
|
|
fixed: "right",
|
||
|
|
render: (_, record) => (
|
||
|
|
<Space>
|
||
|
|
<Button type="link" size="small" onClick={() => props.history.push(`FilingDetail?id=${record.id}`)}>
|
||
|
|
查看
|
||
|
|
</Button>
|
||
|
|
{record.confirmStatus === "pending" && (
|
||
|
|
<Button type="link" size="small" onClick={() => props.history.push(`QualReviewForm?id=${record.id}`)}>
|
||
|
|
核验
|
||
|
|
</Button>
|
||
|
|
)}
|
||
|
|
</Space>
|
||
|
|
),
|
||
|
|
},
|
||
|
|
];
|
||
|
|
|
||
|
|
return (
|
||
|
|
<PageLayout title="专家资料核验">
|
||
|
|
|
||
|
|
<SearchForm
|
||
|
|
style={{ marginBottom: 24 }}
|
||
|
|
form={form}
|
||
|
|
loading={loading}
|
||
|
|
formLine={[
|
||
|
|
<Form.Item key="orgName" name="orgName">
|
||
|
|
<ControlWrapper.Input label="机构名称" placeholder="请输入" allowClear />
|
||
|
|
</Form.Item>,
|
||
|
|
<Form.Item key="orgType" name="orgType">
|
||
|
|
<ControlWrapper.Select
|
||
|
|
label="机构类型"
|
||
|
|
placeholder="请输入"
|
||
|
|
allowClear
|
||
|
|
style={{ width: "100%" }}
|
||
|
|
>
|
||
|
|
<Select.Option value="本地机构">本地机构</Select.Option>
|
||
|
|
<Select.Option value="异地机构">异地机构</Select.Option>
|
||
|
|
</ControlWrapper.Select>
|
||
|
|
</Form.Item>,
|
||
|
|
<Form.Item
|
||
|
|
key="businessScope"
|
||
|
|
name="businessScope"
|
||
|
|
>
|
||
|
|
<ControlWrapper.Select
|
||
|
|
label="安全评价业务范围"
|
||
|
|
placeholder="请输入"
|
||
|
|
allowClear
|
||
|
|
style={{ width: "100%" }}
|
||
|
|
>
|
||
|
|
<Select.Option value="石油加工">石油加工</Select.Option>
|
||
|
|
<Select.Option value="化工">化工</Select.Option>
|
||
|
|
<Select.Option value="矿山">矿山</Select.Option>
|
||
|
|
</ControlWrapper.Select>
|
||
|
|
</Form.Item>,
|
||
|
|
<Form.Item key="confirmStatus" name="confirmStatus">
|
||
|
|
<ControlWrapper.Select
|
||
|
|
label="确认状态"
|
||
|
|
placeholder="请输入"
|
||
|
|
allowClear
|
||
|
|
style={{ width: "100%" }}
|
||
|
|
>
|
||
|
|
<Select.Option value="pending">待确认</Select.Option>
|
||
|
|
<Select.Option value="passed">确认通过</Select.Option>
|
||
|
|
<Select.Option value="rejected">打回</Select.Option>
|
||
|
|
</ControlWrapper.Select>
|
||
|
|
</Form.Item>,
|
||
|
|
]}
|
||
|
|
onReset={handleReset}
|
||
|
|
onFinish={(values) => {
|
||
|
|
router.query={
|
||
|
|
...router.query,
|
||
|
|
...values,
|
||
|
|
current: 1,
|
||
|
|
pageSize: 10,
|
||
|
|
}
|
||
|
|
handleSearch();
|
||
|
|
}}
|
||
|
|
/>
|
||
|
|
|
||
|
|
<Table
|
||
|
|
rowKey="id"
|
||
|
|
columns={columns}
|
||
|
|
dataSource={MOCK_DATA}
|
||
|
|
scroll={{ y: props.scrollY }}
|
||
|
|
loading={loading}
|
||
|
|
pagination={{
|
||
|
|
total: MOCK_DATA.length,
|
||
|
|
showSizeChanger: true,
|
||
|
|
showQuickJumper: true,
|
||
|
|
showTotal: (total) => `共 ${total} 条`,
|
||
|
|
current: router.query.current,
|
||
|
|
pageSize: router.query.pageSize,
|
||
|
|
onChange: (page, pageSize) => {
|
||
|
|
|
||
|
|
router.query={
|
||
|
|
...router.query,
|
||
|
|
current: page,
|
||
|
|
pageSize,
|
||
|
|
};
|
||
|
|
handleSearch();
|
||
|
|
},
|
||
|
|
}}
|
||
|
|
/>
|
||
|
|
</PageLayout>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
export default AntdTableFuncControl(ExpertVerification);
|