2026-07-02 16:58:07 +08:00
|
|
|
|
import React, { useState, useEffect } from "react";
|
2026-07-09 14:54:35 +08:00
|
|
|
|
import { Button, Tag, Space, Spin, message } from "antd";
|
2026-06-30 15:59:15 +08:00
|
|
|
|
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
2026-07-02 18:46:33 +08:00
|
|
|
|
import { REVIEW_STATUS_MAP, LEGAL_STATUS_STYLE } from "~/enumerate/constant";
|
2026-07-02 15:01:19 +08:00
|
|
|
|
import { tools } from "@cqsjjb/jjb-common-lib";
|
|
|
|
|
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
|
|
|
|
|
import { NS_QUAL_REVIEW } from "~/enumerate/namespace";
|
2026-06-30 15:59:15 +08:00
|
|
|
|
import FilingTabs from "../FilingTabs";
|
2026-07-02 18:46:33 +08:00
|
|
|
|
import ReviewModal from "./ReviewModal";
|
2026-06-30 15:59:15 +08:00
|
|
|
|
import "./indes.less";
|
|
|
|
|
|
|
2026-07-02 18:46:33 +08:00
|
|
|
|
const { router } = tools;
|
2026-06-30 15:59:15 +08:00
|
|
|
|
|
2026-08-10 14:16:49 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 资质备案初审 - 审核表单页(原型 mod-qual-review-form)
|
|
|
|
|
|
* - 顶部:法律规定内容(十项符合性检查卡片,PASS/WARN/NOT_PASS 三态)
|
|
|
|
|
|
* - 中部:FilingTabs 六项 Tab(审核模式:材料符合性可选)
|
|
|
|
|
|
* - 底部:取消 / 审核操作(打开 ReviewModal)
|
|
|
|
|
|
*/
|
2026-06-30 15:59:15 +08:00
|
|
|
|
const QualReviewForm = (props) => {
|
2026-08-10 14:16:49 +08:00
|
|
|
|
const {
|
|
|
|
|
|
queryComplianceCheck,
|
|
|
|
|
|
fetchQualFilingDetail,
|
|
|
|
|
|
queryChangeComplianceCheck,
|
|
|
|
|
|
fetchQualChangeDetail,
|
|
|
|
|
|
modifyFilingMaterialChange,
|
|
|
|
|
|
modifyFilingMaterial,
|
|
|
|
|
|
qualReview,
|
|
|
|
|
|
} = props;
|
|
|
|
|
|
const {
|
|
|
|
|
|
qualReviewLoading,
|
|
|
|
|
|
complianceCheckItems = [],
|
|
|
|
|
|
fetchQualFilingDetailLoading,
|
|
|
|
|
|
qualFilingDetail = {},
|
|
|
|
|
|
} = qualReview || {};
|
2026-07-03 10:35:36 +08:00
|
|
|
|
const isChange = router.query.mode === "change";
|
2026-06-30 15:59:15 +08:00
|
|
|
|
const [compliance, setCompliance] = useState({});
|
|
|
|
|
|
const [reviewVisible, setReviewVisible] = useState(false);
|
2026-07-03 10:35:36 +08:00
|
|
|
|
|
2026-07-02 16:58:07 +08:00
|
|
|
|
const statusConfig = REVIEW_STATUS_MAP[qualFilingDetail.filingStatusCode];
|
2026-06-30 15:59:15 +08:00
|
|
|
|
|
2026-07-02 16:58:07 +08:00
|
|
|
|
const legalPassCount = complianceCheckItems.filter(
|
|
|
|
|
|
(i) => i.status === "PASS",
|
2026-07-02 15:01:19 +08:00
|
|
|
|
).length;
|
2026-07-02 16:58:07 +08:00
|
|
|
|
const legalFailCount = complianceCheckItems.filter(
|
|
|
|
|
|
(i) => i.status === "NOT_PASS",
|
2026-07-02 15:01:19 +08:00
|
|
|
|
).length;
|
2026-08-10 14:16:49 +08:00
|
|
|
|
const legalWarnCount = complianceCheckItems.filter(
|
|
|
|
|
|
(i) => i.status === "WARN",
|
|
|
|
|
|
).length;
|
2026-06-30 15:59:15 +08:00
|
|
|
|
|
2026-07-02 15:01:19 +08:00
|
|
|
|
useEffect(() => {
|
2026-08-10 14:16:49 +08:00
|
|
|
|
const complianceAction = isChange
|
|
|
|
|
|
? queryChangeComplianceCheck
|
|
|
|
|
|
: queryComplianceCheck;
|
2026-07-03 10:35:36 +08:00
|
|
|
|
const detailAction = isChange ? fetchQualChangeDetail : fetchQualFilingDetail;
|
2026-08-10 14:16:49 +08:00
|
|
|
|
if (router.query.id) {
|
|
|
|
|
|
complianceAction({ id: router.query.id });
|
|
|
|
|
|
detailAction({ id: router.query.id });
|
|
|
|
|
|
}
|
2026-07-02 15:01:19 +08:00
|
|
|
|
}, []);
|
2026-06-30 15:59:15 +08:00
|
|
|
|
|
2026-08-10 14:16:49 +08:00
|
|
|
|
/** 符合性切换:pass -> 1(符合) fail -> 2(不符合) */
|
2026-07-09 14:54:35 +08:00
|
|
|
|
const handleComplianceChange = (id, v) => {
|
|
|
|
|
|
setCompliance((prev) => ({ ...prev, [id]: v }));
|
|
|
|
|
|
if (v == null) return;
|
|
|
|
|
|
const hasSatisfy = v === "pass" ? 1 : 2;
|
|
|
|
|
|
const action = isChange ? modifyFilingMaterialChange : modifyFilingMaterial;
|
|
|
|
|
|
action({ id, hasSatisfy }).then((res) => {
|
|
|
|
|
|
if (res?.success === false) {
|
|
|
|
|
|
message.error(res?.message || "符合性更新失败");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-06-30 15:59:15 +08:00
|
|
|
|
return (
|
|
|
|
|
|
<PageLayout
|
|
|
|
|
|
title={
|
|
|
|
|
|
<Space>
|
2026-08-10 14:16:49 +08:00
|
|
|
|
<span>资质申请审批</span>
|
2026-07-02 15:01:19 +08:00
|
|
|
|
{statusConfig && (
|
|
|
|
|
|
<Tag color={statusConfig.color}>{statusConfig.label}</Tag>
|
|
|
|
|
|
)}
|
2026-06-30 15:59:15 +08:00
|
|
|
|
</Space>
|
|
|
|
|
|
}
|
|
|
|
|
|
history={props.history}
|
|
|
|
|
|
previous
|
2026-07-02 15:01:19 +08:00
|
|
|
|
footer={
|
2026-08-10 14:16:49 +08:00
|
|
|
|
<Space>
|
|
|
|
|
|
<Button onClick={() => props.history.goBack()}>取消</Button>
|
|
|
|
|
|
<Button type="primary" onClick={() => setReviewVisible(true)}>
|
|
|
|
|
|
📋 审核操作
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</Space>
|
2026-07-02 15:01:19 +08:00
|
|
|
|
}
|
2026-06-30 15:59:15 +08:00
|
|
|
|
>
|
2026-07-02 16:58:07 +08:00
|
|
|
|
<Spin spinning={qualReviewLoading || fetchQualFilingDetailLoading}>
|
2026-07-02 15:01:19 +08:00
|
|
|
|
<div className="qual-review-form">
|
2026-08-10 14:16:49 +08:00
|
|
|
|
{complianceCheckItems.length > 0 && (
|
|
|
|
|
|
<div className="legal-check-bar">
|
|
|
|
|
|
<div className="legal-check-title">📋 法律规定内容</div>
|
|
|
|
|
|
<div className="legal-check-grid">
|
|
|
|
|
|
{complianceCheckItems.map((item) => {
|
|
|
|
|
|
const style = LEGAL_STATUS_STYLE[item.status] || {};
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div
|
|
|
|
|
|
key={item.title}
|
|
|
|
|
|
className="legal-check-item"
|
|
|
|
|
|
style={{
|
|
|
|
|
|
borderLeft: `3px solid ${style.borderColor || "#cbd5e1"}`,
|
|
|
|
|
|
background: style.bg || "#f8fafc",
|
|
|
|
|
|
}}
|
|
|
|
|
|
>
|
|
|
|
|
|
<span>{style.icon || "•"}</span>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<div style={{ fontWeight: 500 }}>{item.title}</div>
|
|
|
|
|
|
<div className="legal-check-item-desc">
|
|
|
|
|
|
{item.description}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-07-02 15:01:19 +08:00
|
|
|
|
</div>
|
2026-08-10 14:16:49 +08:00
|
|
|
|
);
|
|
|
|
|
|
})}
|
|
|
|
|
|
</div>
|
2026-07-02 15:01:19 +08:00
|
|
|
|
</div>
|
2026-08-10 14:16:49 +08:00
|
|
|
|
)}
|
2026-06-30 15:59:15 +08:00
|
|
|
|
|
2026-07-02 15:01:19 +08:00
|
|
|
|
<FilingTabs
|
2026-07-02 16:58:07 +08:00
|
|
|
|
detail={qualFilingDetail}
|
2026-07-02 15:01:19 +08:00
|
|
|
|
isReview
|
|
|
|
|
|
compliance={compliance}
|
2026-07-09 14:54:35 +08:00
|
|
|
|
onComplianceChange={handleComplianceChange}
|
2026-07-02 15:01:19 +08:00
|
|
|
|
/>
|
2026-06-30 15:59:15 +08:00
|
|
|
|
|
2026-07-02 18:46:33 +08:00
|
|
|
|
<ReviewModal
|
2026-07-02 15:01:19 +08:00
|
|
|
|
open={reviewVisible}
|
2026-07-02 18:46:33 +08:00
|
|
|
|
filingId={qualFilingDetail?.id}
|
2026-07-03 10:35:36 +08:00
|
|
|
|
isChange={isChange}
|
2026-07-02 18:46:33 +08:00
|
|
|
|
legalPassCount={legalPassCount}
|
|
|
|
|
|
legalFailCount={legalFailCount}
|
2026-08-10 14:16:49 +08:00
|
|
|
|
legalWarnCount={legalWarnCount}
|
2026-07-08 15:38:45 +08:00
|
|
|
|
onSuccess={() => props.history.goBack()}
|
2026-07-02 15:01:19 +08:00
|
|
|
|
onCancel={() => setReviewVisible(false)}
|
2026-07-02 18:46:33 +08:00
|
|
|
|
/>
|
2026-07-02 15:01:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</Spin>
|
2026-06-30 15:59:15 +08:00
|
|
|
|
</PageLayout>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2026-08-10 14:16:49 +08:00
|
|
|
|
export default Connect([NS_QUAL_REVIEW], true)(QualReviewForm);
|