safety-eval-service-frontend/src/pages/Container/QualificationReview/QualReview/index.js

276 lines
8.4 KiB
JavaScript
Raw Normal View History

2026-08-10 17:02:48 +08:00
import React, { useEffect } from "react";
import { Button, Form, Select, Table, Tag } from "antd";
2026-07-01 13:44:23 +08:00
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
2026-06-30 15:59:15 +08:00
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";
2026-07-02 11:00:31 +08:00
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
2026-08-10 14:16:49 +08:00
import { QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions";
import { EXPERT_STATUS_MAP } from "~/enumerate/constant";
2026-07-07 18:07:59 +08:00
import {
REVIEW_BUSINESS_SCOPE_OPTIONS,
2026-08-10 14:16:49 +08:00
REVIEW_LIST_STATUS_MAP,
REVIEW_STATUS_CLASS,
2026-07-07 18:07:59 +08:00
REVIEW_UNIT_TYPE_OPTIONS,
toQualReviewPageQuery,
} from "../reviewPageQuery";
2026-08-10 14:16:49 +08:00
import "./index.less";
2026-06-30 15:59:15 +08:00
const { router } = tools;
2026-08-10 14:16:49 +08:00
/**
* 资质备案初审原型 mod-qual-review
* - 搜索区机构名称 / 机构类型 / 安全评价业务范围 / 是否专家核验 / 审核状态
* - 表格列复选框序号机构名称机构类型证书编号业务范围专家核验审核状态操作
* - 操作查看详情审核非已审核状态
*/
2026-06-30 15:59:15 +08:00
const QualReview = (props) => {
const [form] = Form.useForm();
2026-08-10 14:16:49 +08:00
const { qualReview, queryReviewList } = props;
const { qualReviewList, qualReviewTotal, qualReviewLoading } = qualReview || {};
2026-07-02 11:00:31 +08:00
2026-08-10 14:16:49 +08:00
/**
2026-08-10 17:45:12 +08:00
* 数据加载走真实接口
2026-08-10 14:16:49 +08:00
*/
2026-08-10 17:45:12 +08:00
const loadList = () => {
2026-07-02 13:50:07 +08:00
queryReviewList({
2026-07-07 18:07:59 +08:00
...toQualReviewPageQuery(router.query),
2026-07-02 13:50:07 +08:00
supervision: true,
2026-07-02 18:46:33 +08:00
applyTypeCode: 1,
2026-07-02 13:50:07 +08:00
});
2026-06-30 15:59:15 +08:00
};
2026-08-10 14:16:49 +08:00
const handleSearch = () => {
loadList();
};
2026-06-30 15:59:15 +08:00
const handleReset = (values) => {
router.query = {
...router.query,
...values,
current: 1,
2026-07-02 11:00:31 +08:00
size: 10,
2026-06-30 15:59:15 +08:00
};
handleSearch();
};
useEffect(() => {
form.setFieldsValue(router.query);
2026-08-10 14:16:49 +08:00
loadList();
2026-06-30 15:59:15 +08:00
}, []);
2026-08-10 14:16:49 +08:00
/** 审核状态渲染:优先后端文案,缺失时按状态编码推断 */
const renderStatus = (record) => {
const name = record.filingStatusName || record.statusName;
if (name) {
const code = Number(record.filingStatusCode);
const fallback = REVIEW_LIST_STATUS_MAP[code] || {};
const color = /待审核|待核验/.test(name)
? "warning"
: /审核中/.test(name)
? "processing"
: /打回|退回/.test(name)
? "error"
: /已审核|通过|已备案/.test(name)
? "success"
: fallback.color || "default";
return (
<Tag className={REVIEW_STATUS_CLASS[color] || "tag_default"}>{name}</Tag>
);
}
const config = REVIEW_LIST_STATUS_MAP[Number(record.filingStatusCode)];
return config ? (
<Tag className={REVIEW_STATUS_CLASS[config.color] || "tag_default"}>
{config.label}
</Tag>
) : (
"--"
);
};
const renderExpertStatus = (record) => {
if (!record.needExpertCheck) {
return <span className="expertDash"></span>;
}
const config = EXPERT_STATUS_MAP[record.expertStatus];
return config ? (
<Tag className={REVIEW_STATUS_CLASS[config.color] || "tag_default"}>
{config.label}
</Tag>
) : (
"--"
);
};
2026-06-30 15:59:15 +08:00
const columns = [
{
title: "序号",
dataIndex: "id",
width: 60,
fixed: "left",
render: (text, record, index) => index + 1,
},
2026-07-02 16:58:07 +08:00
{ title: "机构名称", dataIndex: "filingUnitName", width: 220, ellipsis: true },
2026-07-02 11:00:31 +08:00
{ title: "机构类型", dataIndex: "filingUnitTypeName", width: 100 },
2026-08-10 14:16:49 +08:00
{
title: "安全评价业务范围",
dataIndex: "businessScope",
width: 180,
ellipsis: true,
2026-07-14 11:29:29 +08:00
render: (_, record) => {
2026-08-10 14:16:49 +08:00
if (Array.isArray(record.businessScope)) {
return record.businessScope
.map((item) => QUALIFICATION_INDUSTRY_OPTIONS_MAP[item] || item)
.join("、");
2026-07-14 11:29:29 +08:00
}
return record.businessScope || "-";
2026-08-10 14:16:49 +08:00
},
},
2026-06-30 15:59:15 +08:00
{
title: "专家核验",
dataIndex: "expertStatus",
width: 100,
2026-08-10 14:16:49 +08:00
render: (_, record) => renderExpertStatus(record),
2026-06-30 15:59:15 +08:00
},
{
title: "审核状态",
2026-07-02 13:50:07 +08:00
dataIndex: "filingStatusCode",
2026-06-30 15:59:15 +08:00
width: 100,
2026-08-10 14:16:49 +08:00
render: (_, record) => renderStatus(record),
2026-06-30 15:59:15 +08:00
},
{
title: "操作",
width: 140,
fixed: "right",
render: (_, record) => (
2026-07-01 13:44:23 +08:00
<TableAction>
2026-08-10 14:16:49 +08:00
<Button
type="link"
size="small"
onClick={() => props.history.push(`FilingDetail?id=${record.id}`)}
>
2026-06-30 15:59:15 +08:00
查看
</Button>
2026-08-10 17:45:12 +08:00
{/* 仅已审核状态不可审核 */}
{Number(record.filingStatusCode) !== 1 && (
2026-08-10 14:16:49 +08:00
<Button
type="link"
size="small"
onClick={() => props.history.push(`QualReviewForm?id=${record.id}`)}
>
2026-06-30 15:59:15 +08:00
审核
</Button>
)}
2026-07-01 13:44:23 +08:00
</TableAction>
2026-06-30 15:59:15 +08:00
),
},
];
return (
2026-08-10 14:16:49 +08:00
<PageLayout title="资质申请审批">
2026-06-30 15:59:15 +08:00
<SearchForm
style={{ marginBottom: 24 }}
form={form}
2026-08-10 14:16:49 +08:00
defaultExpand
2026-07-02 11:00:31 +08:00
loading={qualReviewLoading}
2026-06-30 15:59:15 +08:00
formLine={[
2026-07-02 16:58:07 +08:00
<Form.Item key="filingUnitName" name="filingUnitName">
2026-08-10 14:16:49 +08:00
<ControlWrapper.Input label="机构名称" placeholder="请输入机构名称" allowClear />
2026-06-30 15:59:15 +08:00
</Form.Item>,
2026-07-07 18:07:59 +08:00
<Form.Item key="filingUnitTypeName" name="filingUnitTypeName">
2026-06-30 15:59:15 +08:00
<ControlWrapper.Select
label="机构类型"
placeholder="请选择"
allowClear
style={{ width: "100%" }}
2026-07-07 18:07:59 +08:00
options={REVIEW_UNIT_TYPE_OPTIONS}
/>
2026-06-30 15:59:15 +08:00
</Form.Item>,
<Form.Item key="businessScope" name="businessScope">
<ControlWrapper.Select
label="安全评价业务范围"
placeholder="请选择"
allowClear
2026-07-07 18:07:59 +08:00
showSearch
optionFilterProp="label"
2026-06-30 15:59:15 +08:00
style={{ width: "100%" }}
2026-07-07 18:07:59 +08:00
options={REVIEW_BUSINESS_SCOPE_OPTIONS}
/>
2026-06-30 15:59:15 +08:00
</Form.Item>,
<Form.Item key="needExpertCheck" name="needExpertCheck">
<ControlWrapper.Select
label="是否专家核验"
placeholder="请选择"
allowClear
style={{ width: "100%" }}
>
<Select.Option value="yes"></Select.Option>
<Select.Option value="no"></Select.Option>
</ControlWrapper.Select>
</Form.Item>,
2026-07-02 13:50:07 +08:00
<Form.Item key="filingStatusCode" name="filingStatusCode">
2026-06-30 15:59:15 +08:00
<ControlWrapper.Select
label="审核状态"
placeholder="请选择"
allowClear
style={{ width: "100%" }}
>
2026-07-08 17:18:14 +08:00
<Select.Option value="1">已审核</Select.Option>
2026-08-10 14:16:49 +08:00
<Select.Option value="2">待审核</Select.Option>
2026-07-02 13:50:07 +08:00
<Select.Option value="3">打回</Select.Option>
2026-06-30 15:59:15 +08:00
</ControlWrapper.Select>
</Form.Item>,
]}
onReset={handleReset}
onFinish={(values) => {
router.query = {
...router.query,
...values,
current: 1,
2026-07-02 11:00:31 +08:00
size: 10,
2026-06-30 15:59:15 +08:00
};
handleSearch();
}}
/>
2026-08-10 14:16:49 +08:00
<div className="toolbar">
<div className="toolbarLeft">
<span className="totalText">
<strong>{qualReviewTotal || 0}</strong>
</span>
</div>
</div>
2026-06-30 15:59:15 +08:00
<Table
rowKey="id"
columns={columns}
2026-08-10 14:16:49 +08:00
dataSource={Array.isArray(qualReviewList) ? qualReviewList : []}
rowSelection={{}}
scroll={{ x: 1000, y: props.scrollY }}
2026-07-02 11:00:31 +08:00
loading={qualReviewLoading}
2026-06-30 15:59:15 +08:00
pagination={{
2026-07-02 11:00:31 +08:00
total: qualReviewTotal,
2026-06-30 15:59:15 +08:00
showSizeChanger: true,
showQuickJumper: true,
showTotal: (total) => `${total}`,
2026-07-02 11:00:31 +08:00
current: router.query.current || 1,
2026-07-02 18:46:33 +08:00
pageSize: router.query.size || 10,
onChange: (page, pageSize) => {
2026-06-30 15:59:15 +08:00
router.query = {
...router.query,
current: page,
2026-07-02 18:46:33 +08:00
size: pageSize,
2026-06-30 15:59:15 +08:00
};
handleSearch();
},
}}
/>
</PageLayout>
);
};
2026-07-02 11:00:31 +08:00
export default Connect([NS_QUAL_REVIEW], true)(AntdTableFuncControl(QualReview));