v0.0.1-final
tangjie 2026-07-16 14:18:40 +08:00
parent 30d4caa034
commit 2dee8705dd
7 changed files with 458 additions and 200 deletions

View File

@ -11,7 +11,7 @@ module.exports = {
// 本地联调 safetyEval-servicecontext-path: /safetyEval默认端口 8095
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
//API_HOST: "https://gbs-gateway.qhdsafety.com",
//API_HOST: "http://192.168.0.150",太浅
//API_HOST: "http://192.168.0.150", //太浅
API_HOST: "http://192.168.0.152",
},
production: {

View File

@ -5,3 +5,9 @@ export const queryRiskOverviewAction = declareRequest(
"Get > /safetyEval/regulator/risk-center/overview",
"overviewStats: [] | res.data.stats || [] & processGuide: '' | res.data.processGuide || ''",
);
export const queryRiskPageAction = declareRequest(
"riskPageLoading",
"Get > /safetyEval/regulator/risk-center/page",
"riskPageList: [] | res.data || [] & riskPageTotal: 0 | res.total || 0",
);

View File

@ -28,6 +28,12 @@ export const staffCertificateRemove = declareRequest(
"Post > @/safetyEval/org-personnel-cert/delete",
);
export const queryIndustryProfessionalStandards = declareRequest(
"staffCertificateLoading",
"Get > /safetyEval/industry-professional-standards",
"professionalStandardsList: [] | res.data || []",
);
/** StaffViewModal 直接调用的辅助函数 — 获取人员下所有证书列表 */
export async function fetchStaffCertListByPersonnelId(personnelId) {
try {

View File

@ -132,3 +132,40 @@ export const CERT_TYPE_MAP = {
senior_engineer: "高工",
evaluator: "评价师",
};
/** 风险预警中心 — 预警大类映射 */
export const RISK_TYPE_MAP = {
"资质预警": { label: "资质预警", color: "error" },
"项目预警": { label: "项目预警", color: "warning" },
};
/** 风险预警中心 — 处理阶段映射 */
export const STAGE_MAP = {
"未处理": { label: "未处理", color: "error" },
"已发机构": { label: "已发机构", color: "warning" },
"待复核": { label: "待复核", color: "processing" },
"已闭环": { label: "已闭环", color: "success" },
};
/** 风险预警中心 — 机构端状态映射 */
export const ORG_STATUS_MAP = {
"未发送": { label: "未发送", color: "error" },
"机构未读": { label: "机构未读", color: "warning" },
"已提交材料": { label: "已提交材料", color: "processing" },
"处理中": { label: "处理中", color: "processing" },
"已提交说明": { label: "已提交说明", color: "processing" },
"整改完成": { label: "整改完成", color: "success" },
};
/** 风险预警中心 — 预警子类选项 */
export const RISK_SUBTYPE_OPTIONS = [
{ label: "资质条件保持异常", value: "资质条件保持异常" },
{ label: "人员比例异常", value: "人员比例异常" },
{ label: "属地材料待核验", value: "属地材料待核验" },
{ label: "项目启动超期", value: "项目启动超期" },
{ label: "关键节点超期", value: "关键节点超期" },
{ label: "项目人员异常", value: "项目人员异常" },
{ label: "从业告知异常", value: "从业告知异常" },
{ label: "现场勘查异常", value: "现场勘查异常" },
{ label: "过程控制/归档异常", value: "过程控制/归档异常" },
];

View File

@ -1,6 +1,16 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, DatePicker, Descriptions, Form, Input, message, Modal, Select, Table, Upload } from "antd";
import { UploadOutlined } from "@ant-design/icons";
import {
Button,
DatePicker,
Descriptions,
Form,
Input,
message,
Modal,
Select,
Table,
Upload,
} from "antd";
import { useEffect, useState } from "react";
import dayjs from "dayjs";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
@ -14,13 +24,18 @@ import CertPreviewImg from "~/components/CertPreviewImg";
import AttachmentUpload from "~/components/AttachmentUpload";
import { dateRangeRule } from "~/utils/validators";
import { CERT_TYPE_OPTIONS, CERT_TYPE_MAP } from "~/enumerate/constant";
import { QUALIFICATION_INDUSTRY_OPTIONS, QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions";
const { router } = tools;
function StaffCertificatePage(props) {
const urlParams = Object.fromEntries(new URLSearchParams(window.location.search));
const urlParams = Object.fromEntries(
new URLSearchParams(window.location.search),
);
const staffId = urlParams.staffId;
const staffName = urlParams.staffName ? decodeURIComponent(urlParams.staffName) : "";
const staffName = urlParams.staffName
? decodeURIComponent(urlParams.staffName)
: "";
const [addModalOpen, setAddModalOpen] = useState(false);
const [viewModalOpen, setViewModalOpen] = useState(false);
const [currentId, setCurrentId] = useState("");
@ -41,10 +56,6 @@ function StaffCertificatePage(props) {
props.staffCertificateList({ ...router.query, personnelId: staffId });
};
const goBack = () => {
window.location.href = window.location.pathname.replace(/\/Certificate.*$/, "/List");
};
const onDelete = (id) => {
Modal.confirm({
title: "提示",
@ -67,7 +78,15 @@ function StaffCertificatePage(props) {
previous
title={`人员证书 - ${staffName || ""}`}
extra={
<Button type="primary" onClick={() => { setCurrentId(""); setAddModalOpen(true); }}>新增证书</Button>
<Button
type="primary"
onClick={() => {
setCurrentId("");
setAddModalOpen(true);
}}
>
新增证书
</Button>
}
>
<SearchForm
@ -80,28 +99,48 @@ function StaffCertificatePage(props) {
name="certName"
rules={[{ max: 200, message: "证照名称不能超过200个字符" }]}
>
<ControlWrapper.Input label="证照名称" placeholder="请输入证照名称" allowClear maxLength={200} />
<ControlWrapper.Input
label="证照名称"
placeholder="请输入证照名称"
allowClear
maxLength={200}
/>
</Form.Item>,
<Form.Item
key="certNo"
name="certNo"
rules={[{ max: 100, message: "证书编号不能超过100个字符" }]}
>
<ControlWrapper.Input label="证书编号" placeholder="请输入证书编号" allowClear maxLength={100} />
<ControlWrapper.Input
label="证书编号"
placeholder="请输入证书编号"
allowClear
maxLength={100}
/>
</Form.Item>,
<Form.Item
key="certCategoryName"
name="certCategoryName"
rules={[{ max: 50, message: "证书类别名称不能超过50个字符" }]}
>
<ControlWrapper.Input label="证书类别名称" placeholder="请输入证书类别名称" allowClear maxLength={50} />
<ControlWrapper.Input
label="证书类别名称"
placeholder="请输入证书类别名称"
allowClear
maxLength={50}
/>
</Form.Item>,
<Form.Item
key="operationCategoryName"
name="operationCategoryName"
rules={[{ max: 50, message: "证书作业类别名称不能超过50个字符" }]}
>
<ControlWrapper.Input label="证书作业类别名称" placeholder="请输入证书作业类别名称" allowClear maxLength={50} />
<ControlWrapper.Input
label="证书作业类别名称"
placeholder="请输入证书作业类别名称"
allowClear
maxLength={50}
/>
</Form.Item>,
]}
onReset={(values) => {
@ -117,7 +156,11 @@ function StaffCertificatePage(props) {
rowKey="id"
columns={[
{ title: "证照名称", dataIndex: "certName", ellipsis: true },
{ title: "证书类型", dataIndex: "certTypeCode", render: (v) => CERT_TYPE_MAP[v] || v },
{
title: "证书类型",
dataIndex: "certTypeCode",
render: (v) => CERT_TYPE_MAP[v] || v,
},
{ title: "证书类别", dataIndex: "certCategoryName" },
{ title: "证书作业类别", dataIndex: "operationCategoryName" },
{ title: "证书编号", dataIndex: "certNo" },
@ -126,13 +169,34 @@ function StaffCertificatePage(props) {
width: 200,
render: (_, record) => (
<TableAction>
<Button type="link" size="small" onClick={() => { setCurrentId(record.id); setViewModalOpen(true); }}>
<Button
type="link"
size="small"
onClick={() => {
setCurrentId(record.id);
setViewModalOpen(true);
}}
>
查看
</Button>
<Button type="link" size="small" onClick={() => { setCurrentId(record.id); setAddModalOpen(true); }}>
<Button
type="link"
size="small"
onClick={() => {
setCurrentId(record.id);
setAddModalOpen(true);
}}
>
编辑
</Button>
<Button danger type="link" size="small" onClick={() => onDelete(record.id)}>删除</Button>
<Button
danger
type="link"
size="small"
onClick={() => onDelete(record.id)}
>
删除
</Button>
</TableAction>
),
},
@ -162,6 +226,9 @@ function StaffCertificatePage(props) {
staffCertificateAdd={props.staffCertificateAdd}
staffCertificateEdit={props.staffCertificateEdit}
staffCertificateInfo={props.staffCertificateInfo}
queryIndustryProfessionalStandards={
props.queryIndustryProfessionalStandards
}
onCancel={() => {
setAddModalOpen(false);
setCurrentId("");
@ -185,18 +252,48 @@ function StaffCertificatePage(props) {
}
function CertModal({
open, staffId, currentId, staffCertificateAdd, staffCertificateEdit, staffCertificateInfo, onCancel, onSuccess,
open,
staffId,
currentId,
staffCertificateAdd,
staffCertificateEdit,
staffCertificateInfo,
queryIndustryProfessionalStandards,
onCancel,
onSuccess,
}) {
const [form] = Form.useForm();
const [submitting, setSubmitting] = useState(false);
const [detailLoading, setDetailLoading] = useState(false);
const [uploadFileList, setUploadFileList] = useState([]);
const [professionalCapabilityOptions, setProfessionalCapabilityOptions] =
useState([]);
const loadProfessionalCapabilities = async (industryCode) => {
if (!industryCode) {
setProfessionalCapabilityOptions([]);
form.setFieldsValue({ professionalCapabilityId: undefined });
return;
}
const res = await queryIndustryProfessionalStandards({
industryCode,
pageSize: 999,
});
const list = res?.data || [];
setProfessionalCapabilityOptions(
list.map((item) => ({
value: item.id,
label: item.professionalCapabilityName,
})),
);
};
useEffect(() => {
if (!open) return;
if (!currentId) {
form.resetFields();
setUploadFileList([]);
setProfessionalCapabilityOptions([]);
return;
}
let cancelled = false;
@ -227,7 +324,10 @@ function CertModal({
url: f.url,
}));
} else if (data.certAttachmentUrl) {
fileList = data.certAttachmentUrl.split(",").filter(Boolean).map((url, i) => ({
fileList = data.certAttachmentUrl
.split(",")
.filter(Boolean)
.map((url, i) => ({
uid: `-${i}`,
name: url.split("/").pop() || `证书附件${i + 1}`,
status: "done",
@ -237,13 +337,18 @@ function CertModal({
data.certAttachmentUrl = fileList;
setUploadFileList(fileList);
form.setFieldsValue(data);
if (data.businessScope) {
loadProfessionalCapabilities(data.businessScope);
}
} catch (err) {
console.warn("[StaffCertificate] load detail failed:", err);
} finally {
if (!cancelled) setDetailLoading(false);
}
})();
return () => { cancelled = true; };
return () => {
cancelled = true;
};
}, [open, currentId]);
const handleCancel = () => {
@ -258,11 +363,20 @@ function CertModal({
const payload = {
...values,
personnelId: staffId,
validStartDate: values.validDate?.[0] ? dayjs(values.validDate[0]).format("YYYY-MM-DD") : undefined,
validEndDate: values.validDate?.[1] ? dayjs(values.validDate[1]).format("YYYY-MM-DD") : undefined,
reviewDate: values.reviewDate ? dayjs(values.reviewDate).format("YYYY-MM-DD") : undefined,
validStartDate: values.validDate?.[0]
? dayjs(values.validDate[0]).format("YYYY-MM-DD")
: undefined,
validEndDate: values.validDate?.[1]
? dayjs(values.validDate[1]).format("YYYY-MM-DD")
: undefined,
reviewDate: values.reviewDate
? dayjs(values.reviewDate).format("YYYY-MM-DD")
: undefined,
certAttachmentUrl: Array.isArray(values.certAttachmentUrl)
? values.certAttachmentUrl.map((f) => f.url || f.response?.url).filter(Boolean).join(",")
? values.certAttachmentUrl
.map((f) => f.url || f.response?.url)
.filter(Boolean)
.join(",")
: "",
};
delete payload.validDate;
@ -275,7 +389,6 @@ function CertModal({
handleCancel();
onSuccess();
} else {
}
} finally {
setSubmitting(false);
@ -294,6 +407,22 @@ function CertModal({
onOk={form.submit}
>
<Form form={form} layout="vertical" onFinish={handleSubmit}>
<Form.Item name="businessScope" label="专业范围" rules={[{ required: true, message: "请选择专业范围" }]}>
<Select
placeholder="请选择专业范围"
allowClear
options={QUALIFICATION_INDUSTRY_OPTIONS}
onChange={loadProfessionalCapabilities}
/>
</Form.Item>
<Form.Item name="professionalCapabilityId" label="专业能力" rules={[{ required: true, message: "请选择专业能力" }]}>
<Select
placeholder="请先选择专业范围"
allowClear
options={professionalCapabilityOptions}
disabled={professionalCapabilityOptions.length === 0}
/>
</Form.Item>
<Form.Item
name="certName"
label="证照名称"
@ -327,7 +456,10 @@ function CertModal({
<Form.Item
name="validDate"
label="证书有效开始/结束日期"
rules={[{ required: true, message: "请选择证书有效期" }, dateRangeRule()]}
rules={[
{ required: true, message: "请选择证书有效期" },
dateRangeRule(),
]}
>
<DatePicker.RangePicker style={{ width: "100%" }} />
</Form.Item>
@ -338,6 +470,7 @@ function CertModal({
>
<Select placeholder="请选择证书类型" options={CERT_TYPE_OPTIONS} />
</Form.Item>
<Form.Item
name="certCategoryCode"
label="证书类别编码"
@ -357,22 +490,33 @@ function CertModal({
label="证书作业类别编码"
rules={[{ max: 32, message: "证书作业类别编码不能超过32个字符" }]}
>
<Input placeholder="请输入证书作业类别编码" maxLength={32} showCount />
<Input
placeholder="请输入证书作业类别编码"
maxLength={32}
showCount
/>
</Form.Item>
<Form.Item
name="operationCategoryName"
label="证书作业类别名称"
rules={[{ max: 50, message: "证书作业类别名称不能超过50个字符" }]}
>
<Input placeholder="请输入证书作业类别名称" maxLength={50} showCount />
<Input
placeholder="请输入证书作业类别名称"
maxLength={50}
showCount
/>
</Form.Item>
<Form.Item name="reviewDate" label="复核日期">
<DatePicker style={{ width: "100%" }} />
</Form.Item>
<AttachmentUpload name="certAttachmentUrl" label="证书附件" maxCount={10} accept=".png,.jpg,.jpeg,.bmp,.webp,.pdf"
extra={'请上传证书附件支持10个以内的图片和PDF格式'}
<AttachmentUpload
name="certAttachmentUrl"
label="证书附件"
maxCount={10}
accept=".png,.jpg,.jpeg,.bmp,.webp,.pdf"
extra={"请上传证书附件支持10个以内的图片和PDF格式"}
/>
</Form>
</Modal>
);
@ -398,7 +542,10 @@ function ViewModal({ open, currentId, staffCertificateInfo, onCancel }) {
if (Array.isArray(data.certImgFiles)) {
data.certDisplayFiles = data.certImgFiles;
} else if (data.certAttachmentUrl) {
data.certDisplayFiles = data.certAttachmentUrl.split(",").filter(Boolean).map((url, i) => ({
data.certDisplayFiles = data.certAttachmentUrl
.split(",")
.filter(Boolean)
.map((url, i) => ({
uid: `-${i}`,
fileName: url.split("/").pop() || `证书附件${i + 1}`,
url,
@ -413,7 +560,9 @@ function ViewModal({ open, currentId, staffCertificateInfo, onCancel }) {
if (!cancelled) setDetailLoading(false);
}
})();
return () => { cancelled = true; };
return () => {
cancelled = true;
};
}, [open, currentId]);
return (
@ -428,21 +577,44 @@ function ViewModal({ open, currentId, staffCertificateInfo, onCancel }) {
onCancel={onCancel}
>
<Descriptions bordered column={1} labelStyle={{ width: 160 }}>
<Descriptions.Item label="专业范围">{QUALIFICATION_INDUSTRY_OPTIONS_MAP[info.businessScope] }</Descriptions.Item>
<Descriptions.Item label="专业能力">{info.professionalCapabilityName }</Descriptions.Item>
<Descriptions.Item label="证照名称">{info.certName}</Descriptions.Item>
<Descriptions.Item label="证书类型">{CERT_TYPE_MAP[info.certTypeCode] || info.certTypeCode}</Descriptions.Item>
<Descriptions.Item label="证书类别编码">{info.certCategoryCode}</Descriptions.Item>
<Descriptions.Item label="证书类别名称">{info.certCategoryName}</Descriptions.Item>
<Descriptions.Item label="证书作业类别编码">{info.operationCategoryCode}</Descriptions.Item>
<Descriptions.Item label="证书作业类别名称">{info.operationCategoryName}</Descriptions.Item>
<Descriptions.Item label="证书类型">
{CERT_TYPE_MAP[info.certTypeCode] || info.certTypeCode}
</Descriptions.Item>
<Descriptions.Item label="证书类别编码">
{info.certCategoryCode}
</Descriptions.Item>
<Descriptions.Item label="证书类别名称">
{info.certCategoryName}
</Descriptions.Item>
<Descriptions.Item label="证书作业类别编码">
{info.operationCategoryCode}
</Descriptions.Item>
<Descriptions.Item label="证书作业类别名称">
{info.operationCategoryName}
</Descriptions.Item>
<Descriptions.Item label="证书编号">{info.certNo}</Descriptions.Item>
<Descriptions.Item label="发证机关">{info.issueOrg}</Descriptions.Item>
<Descriptions.Item label="证书有效开始日期">{info.validStartDate}</Descriptions.Item>
<Descriptions.Item label="证书有效结束日期">{info.validEndDate}</Descriptions.Item>
<Descriptions.Item label="复核日期">{info.reviewDate}</Descriptions.Item>
<Descriptions.Item label="证书图片"><CertPreviewImg files={info.certDisplayFiles} /></Descriptions.Item>
<Descriptions.Item label="证书有效开始日期">
{info.validStartDate}
</Descriptions.Item>
<Descriptions.Item label="证书有效结束日期">
{info.validEndDate}
</Descriptions.Item>
<Descriptions.Item label="复核日期">
{info.reviewDate}
</Descriptions.Item>
<Descriptions.Item label="证书图片">
<CertPreviewImg files={info.certDisplayFiles} />
</Descriptions.Item>
</Descriptions>
</Modal>
);
}
export default Connect([NS_STAFF_CERTIFICATE], true)(AntdTableFuncControl(StaffCertificatePage));
export default Connect(
[NS_STAFF_CERTIFICATE],
true,
)(AntdTableFuncControl(StaffCertificatePage));

View File

@ -182,7 +182,7 @@ const QualMonitor = (props) => {
<div className="org-info">
<div className="org-name">{name}</div>
<div className="org-meta">
统一社会信用代码{record.creditCode} | 注册地{record.districtName || "—"}
统一社会信用代码{record.orgInfoCreditCode} | 注册地{record.districtName || "—"}
</div>
</div>
),

View File

@ -1,52 +1,24 @@
import React, { useState, useEffect } from "react";
import { Button, Form, Table, Tag } from "antd";
import dayjs from "dayjs";
import { Button, Form, Table, Tag, Modal, Select, DatePicker, Input, Space, message } 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 AttachmentUpload from "~/components/AttachmentUpload";
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { NS_RISK_CENTER } from "~/enumerate/namespace";
import {
RISK_TYPE_MAP,
STAGE_MAP,
ORG_STATUS_MAP,
RISK_SUBTYPE_OPTIONS,
} from "~/enumerate/constant";
import "./index.less";
const { router } = tools;
/** 预警大类配置 */
const RISK_TYPE_MAP = {
qual: { label: "资质预警", color: "error" },
proj: { label: "项目预警", color: "warning" },
};
/** 处理阶段配置 */
const STAGE_MAP = {
untreated: { label: "未处理", color: "error" },
sent: { label: "已发机构", color: "warning" },
review: { label: "待复核", color: "processing" },
closed: { label: "已闭环", color: "success" },
};
/** 机构端状态配置 */
const ORG_STATUS_MAP = {
unsent: { label: "未发送", color: "error" },
unread: { label: "机构未读", color: "warning" },
processing: { label: "处理中", color: "processing" },
submitted: { label: "已提交材料", color: "processing" },
done: { label: "整改完成", color: "success" },
};
/** 预警子类选项 */
const RISK_SUBTYPE_OPTIONS = [
{ label: "资质条件保持异常", value: "qual_condition" },
{ label: "人员比例异常", value: "qual_person_rate" },
{ label: "属地材料待核验", value: "qual_area" },
{ label: "项目启动超期", value: "proj_start" },
{ label: "关键节点超期", value: "proj_node" },
{ label: "项目人员异常", value: "proj_person" },
{ label: "从业告知异常", value: "proj_notify" },
{ label: "现场勘查异常", value: "proj_site" },
{ label: "过程控制/归档异常", value: "proj_archive" },
];
/** 项目预警规则提示 */
const PROJ_RULES = [
"项目启动超期",
@ -57,80 +29,6 @@ const PROJ_RULES = [
"过程控制/归档异常",
];
/** mock 数据 */
const MOCK_DATA = [
{
id: "W-QUAL-2026-012",
type: "qual",
subtype: "qual_condition",
target: "重庆渝安风险评估中心",
sources: ["财务材料.固定资产", "场所核验.建筑面积", "人员库.专职人数"],
content: "固定资产、场所面积、档案室面积和专职人员数量不满足保持条件。",
stage: "untreated",
orgStatus: "unsent",
},
{
id: "W-QUAL-2026-011",
type: "qual",
subtype: "qual_person_rate",
target: "重庆恒安安全评价有限公司",
sources: ["人员库.职称等级", "人员库.注册安全工程师"],
content: "高级职称比例 26%,合计比例 59%,低于资质保持条件。",
stage: "sent",
orgStatus: "unread",
},
{
id: "W-QUAL-2026-013",
type: "qual",
subtype: "qual_area",
target: "北京中安评价中心重庆分公司",
sources: ["本市社保.缴纳人数", "场所核验.租赁合同"],
content: "机构已提交本地场所和人员说明,等待监管复核。",
stage: "review",
orgStatus: "submitted",
},
{
id: "W-PROJ-2026-021",
type: "proj",
subtype: "proj_start",
target: "华安化工年度安全现状评价",
sources: ["客户信息.评价到期日", "项目库.新建时间"],
content: "评价周期已到期 14 天,系统内尚未建立新一轮评价项目。",
stage: "untreated",
orgStatus: "unsent",
},
{
id: "W-PROJ-2026-018",
type: "proj",
subtype: "proj_node",
target: "安环检测年度安全现状评价",
sources: ["项目计划.节点期限", "流程记录.当前节点"],
content: "项目停留在过程控制环节 12 天,已超过计划完成时间。",
stage: "sent",
orgStatus: "processing",
},
{
id: "W-PROJ-2026-015",
type: "proj",
subtype: "proj_person",
target: "鼎信建设安全验收评价",
sources: ["项目组.项目负责人", "人员库.在职状态"],
content: "项目负责人已提交离职申请,项目尚未完成负责人变更。",
stage: "review",
orgStatus: "submitted",
},
{
id: "W-PROJ-2026-009",
type: "proj",
subtype: "proj_site",
target: "华安化工园区安全预评价",
sources: ["现场勘查.签到签退", "项目组.参与人员"],
content: "现场勘查仅有签到记录,无签退记录和现场照片。",
stage: "closed",
orgStatus: "done",
},
];
/** 统计卡片样式主题 */
const CARD_THEMES = [
{ bg: "#fee2e2", color: "#dc2626" },
@ -141,21 +39,67 @@ const CARD_THEMES = [
const RiskCenter = (props) => {
const [form] = Form.useForm();
const [data] = useState(MOCK_DATA);
const [processForm] = Form.useForm();
const [processRecord, setProcessRecord] = useState(null);
const [processModalOpen, setProcessModalOpen] = useState(false);
const { riskCenter, queryRiskOverviewAction } = props;
const { overviewStats = [], riskOverviewLoading } = riskCenter || {};
const { riskCenter, queryRiskOverviewAction, queryRiskPageAction } = props;
const { overviewStats = [], riskPageList = [], riskPageTotal = 0, riskPageLoading } = riskCenter || {};
useEffect(() => {
queryRiskOverviewAction();
handleSearch();
}, []);
const handleSearch = () => {
// 接口搜索
queryRiskPageAction(router.query);
};
const handleReset = () => {
const handleReset = (values) => {
form.resetFields();
router.query = { ...values, current: 1, size: 10 };
handleSearch();
};
const handlePageChange = (page, size) => {
router.query = { ...router.query, current: page, size };
handleSearch()
};
/** 处理按钮 — 打开对应阶段的处理弹窗 */
const handleProcess = (record) => {
setProcessRecord(record);
if (record.stage === "未处理" || record.stage === "已发机构") {
processForm.setFieldsValue({
relatedId: record.id,
institution: record.riskObject,
deadline: dayjs().add(15, "day"),
opinion: "请核查来源字段与上传材料,形成监管处置记录。",
});
}
setProcessModalOpen(true);
};
/** 提交预警处置 */
const handleProcessSubmit = () => {
message.success("处理结果已提交");
setProcessModalOpen(false);
setProcessRecord(null);
processForm.resetFields();
};
/** 退回补正 */
const handleReturn = () => {
message.success("已退回机构补正");
setProcessModalOpen(false);
setProcessRecord(null);
};
/** 复核通过并闭环 */
const handleClose = () => {
message.success("预警已复核闭环");
setProcessModalOpen(false);
setProcessRecord(null);
};
const columns = [
@ -166,30 +110,26 @@ const RiskCenter = (props) => {
},
{
title: "预警大类",
dataIndex: "type",
dataIndex: "category",
width: 100,
render: (type) => {
const cfg = RISK_TYPE_MAP[type];
return cfg ? <Tag color={cfg.color}>{cfg.label}</Tag> : "--";
render: (val) => {
const cfg = RISK_TYPE_MAP[val];
return cfg ? <Tag color={cfg.color}>{cfg.label}</Tag> : val || "--";
},
},
{
title: "预警子类",
dataIndex: "subtype",
width: 140,
render: (subtype) => {
const opt = RISK_SUBTYPE_OPTIONS.find((o) => o.value === subtype);
return opt?.label || "--";
},
},
{
title: "风险对象",
dataIndex: "target",
dataIndex: "riskObject",
width: 200,
},
{
title: "来源字段",
dataIndex: "sources",
dataIndex: "sourceFields",
width: 280,
render: (sources) => (
<div style={{ display: "flex", flexWrap: "wrap", gap: 4 }}>
@ -228,8 +168,8 @@ const RiskCenter = (props) => {
title: "监管操作",
width: 100,
fixed: "right",
render: () => (
<Button type="primary" size="small">
render: (_, record) => (
<Button type="primary" size="small" onClick={() => handleProcess(record)}>
处理
</Button>
),
@ -283,15 +223,15 @@ const RiskCenter = (props) => {
allowClear
/>
</Form.Item>,
<Form.Item key="riskType" name="riskType">
<Form.Item key="riskType" name="type">
<ControlWrapper.Select
label="预警大类"
placeholder="全部"
allowClear
style={{ width: "100%" }}
options={[
{ label: "资质预警", value: "qual" },
{ label: "项目预警", value: "proj" },
{ label: "资质预警", value: "资质预警" },
{ label: "项目预警", value: "项目预警" },
]}
/>
</Form.Item>,
@ -311,16 +251,19 @@ const RiskCenter = (props) => {
allowClear
style={{ width: "100%" }}
options={[
{ label: "未处理", value: "untreated" },
{ label: "已发机构", value: "sent" },
{ label: "待复核", value: "review" },
{ label: "已闭环", value: "closed" },
{ label: "未处理", value: "未处理" },
{ label: "已发机构", value: "已发机构" },
{ label: "待复核", value: "待复核" },
{ label: "已闭环", value: "已闭环" },
]}
/>
</Form.Item>,
]}
onReset={handleReset}
onFinish={handleSearch}
onFinish={(values) => {
router.query = { ...values, current: 1, size: 10 };
handleSearch();
}}
/>
{/* 工具条 */}
@ -341,20 +284,114 @@ const RiskCenter = (props) => {
<Table
rowKey="id"
columns={columns}
dataSource={data}
dataSource={riskPageList}
loading={riskPageLoading}
scroll={{ x: 1600, y: props.scrollY }}
pagination={{
total: data.length,
total: riskPageTotal,
showSizeChanger: true,
showQuickJumper: true,
showTotal: (total) => `${total}`,
current: router.query.current || 1,
pageSize: router.query.size || 10,
onChange: (page, size) => {
router.query = { ...router.query, current: page, size };
},
showTotal: (t) => `${t}`,
current: Number(router.query.current) || 1,
pageSize: Number(router.query.size) || 10,
onChange: handlePageChange,
}}
/>
{/* 风险预警处置弹窗(未处理 / 已发机构) */}
{processRecord && (processRecord.stage === "未处理" || processRecord.stage === "已发机构") && (
<Modal
title={`风险预警处置 - ${processRecord.id}`}
open={processModalOpen}
onCancel={() => { setProcessModalOpen(false); setProcessRecord(null); }}
footer={
<Space>
<Button onClick={() => { setProcessModalOpen(false); setProcessRecord(null); }}>关闭</Button>
<Button type="primary" onClick={handleProcessSubmit}>提交</Button>
</Space>
}
width={760}
destroyOnClose
>
<div style={{ padding: "0 0 8px", fontSize: 13, color: "#666" }}>
风险预警中心统一办理监管处置确认来源选择处置方式发送机构消息等待机构反馈复核并闭环
</div>
<Form form={processForm} layout="vertical" style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "0 16px" }}>
<Form.Item name="method" label="处置方式" rules={[{ required: true, message: "请选择处置方式" }]}>
<Select placeholder="请选择处置方式" options={[
{ label: "发送整改通知", value: "send_rectify" },
{ label: "发送核查函", value: "send_check" },
{ label: "退回补正", value: "return" },
{ label: "转办复核", value: "transfer" },
{ label: "标记闭环", value: "mark_closed" },
]} />
</Form.Item>
<Form.Item name="deadline" label="办理期限" rules={[{ required: true, message: "请选择办理期限" }]}>
<DatePicker style={{ width: "100%" }} />
</Form.Item>
<Form.Item name="relatedId" label="关联预警编号">
<Input disabled />
</Form.Item>
<Form.Item name="institution" label="接收机构">
<Input disabled />
</Form.Item>
<Form.Item name="opinion" label="监管意见" style={{ gridColumn: "1 / -1" }}>
<Input.TextArea rows={3} />
</Form.Item>
<AttachmentUpload
name="attachments"
label="监管附件"
accept=".pdf,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png"
extra="可上传核查材料、监管意见附件或其他处置依据。"
/>
</Form>
</Modal>
)}
{/* 机构反馈复核弹窗(待复核 / 已闭环) */}
{processRecord && (processRecord.stage === "待复核" || processRecord.stage === "已闭环") && (
<Modal
title={`机构反馈复核 - ${processRecord.id}`}
open={processModalOpen}
onCancel={() => { setProcessModalOpen(false); setProcessRecord(null); }}
footer={
<Space>
<Button onClick={() => { setProcessModalOpen(false); setProcessRecord(null); }}>关闭</Button>
<Button onClick={handleReturn}>退回补正</Button>
<Button type="primary" onClick={handleClose}>复核通过并闭环</Button>
</Space>
}
width={760}
destroyOnClose
>
<div style={{ padding: "0 0 8px", fontSize: 13, color: "#666" }}>
机构端提交的说明和附件进入本环节复核监管人员可通过退回补正或办结
</div>
<Table
rowKey="name"
dataSource={[
{ name: "整改说明", content: "已说明问题原因和处理措施", status: "待复核", source: "机构端消息.整改说明" },
{ name: "证明附件", content: "机构上传的证明材料", status: "待复核", source: "机构端消息.附件" },
]}
columns={[
{ title: "材料项", dataIndex: "name", width: 100 },
{ title: "机构提交内容", dataIndex: "content", width: 200 },
{ title: "复核状态", dataIndex: "status", width: 100 },
{ title: "来源", dataIndex: "source" },
]}
pagination={false}
size="small"
/>
<div style={{ marginTop: 16 }}>
<AttachmentUpload
name="reviewAttachments"
label="复核附件"
accept=".pdf,.doc,.docx,.xls,.xlsx,.jpg,.jpeg,.png"
extra="可上传复核意见、核查记录或办结依据。"
/>
</div>
</Modal>
)}
</div>
</PageLayout>
);