From 907c0d384249dc5beaa1ac2b54c29a3ef7e662a7 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Fri, 3 Jul 2026 10:35:36 +0800 Subject: [PATCH] feat --- src/api/qualExpert/index.js | 5 - src/api/qualReview/index.js | 31 +++++ src/enumerate/constant/index.js | 9 ++ .../QualificationReview/FilingDetail/index.js | 12 +- .../QualificationReview/QualChange/index.js | 129 ++++++------------ .../QualificationReview/QualConfirm/index.js | 6 +- .../QualConfirmForm/index.js | 18 +-- .../QualReviewForm/ReviewModal.js | 16 ++- .../QualReviewForm/index.js | 15 +- 9 files changed, 123 insertions(+), 118 deletions(-) diff --git a/src/api/qualExpert/index.js b/src/api/qualExpert/index.js index bc048e4..94c4005 100644 --- a/src/api/qualExpert/index.js +++ b/src/api/qualExpert/index.js @@ -32,8 +32,3 @@ export const deleteExpert = declareRequest( "Post > @/safetyEval/qual-filing-expert/delete", ); -// 审核提交 -export const reviewSubmit = declareRequest( - "qualExpertSubmitLoading", - "Post > @/safetyEval/qual-filing/review", -); \ No newline at end of file diff --git a/src/api/qualReview/index.js b/src/api/qualReview/index.js index d1333f9..6373fa6 100644 --- a/src/api/qualReview/index.js +++ b/src/api/qualReview/index.js @@ -16,4 +16,35 @@ export const fetchQualFilingDetail = declareRequest( "fetchQualFilingDetailLoading", "Get > /safetyEval/qual-filing/detail", 'qualFilingDetail: {} | res.data || {}', +); + +export const queryQualChangePage = declareRequest( + "qualReviewLoading", + "Get > /safetyEval/qual-filing-change/page", + "qualReviewList: [] | res.data || [] & qualReviewTotal: 0 | res.total || 0", +); + +// 审核提交 +export const reviewSubmit = declareRequest( + "qualReviewSubmitLoading", + "Post > @/safetyEval/qual-filing/review", +); + +// ─── 变更模式 ─── + +export const fetchQualChangeDetail = declareRequest( + "fetchQualFilingDetailLoading", + "Get > /safetyEval/qual-filing-change/detail", + 'qualFilingDetail: {} | res.data || {}', +); + +export const queryChangeComplianceCheck = declareRequest( + "qualReviewLoading", + "Get > /safetyEval/qual-filing-change/compliance-check", + 'complianceCheckItems: [] | res.data || []', +); + +export const changeReviewSubmit = declareRequest( + "qualReviewSubmitLoading", + "Post > @/safetyEval/qual-filing-change/review", ); \ No newline at end of file diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index 10ebc28..3e85f17 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -37,6 +37,15 @@ export const PUBLICITY_STATUS_MAP = { published: { label: "已公示", color: "success" }, }; +/** 备案状态(通用,含变更审核中、暂存) */ +export const FILING_STATUS_MAP = { + 1: { label: "已备案", color: "success" }, + 2: { label: "审核中", color: "processing" }, + 3: { label: "已打回", color: "error" }, + 4: { label: "变更审核中", color: "processing" }, + 5: { label: "暂存", color: "default" }, +}; + /** 变更状态 */ export const CHANGE_STATUS_MAP = { stuck: { label: "停滞中", color: "error" }, diff --git a/src/pages/Container/QualificationReview/FilingDetail/index.js b/src/pages/Container/QualificationReview/FilingDetail/index.js index 9bd6849..edf83b4 100644 --- a/src/pages/Container/QualificationReview/FilingDetail/index.js +++ b/src/pages/Container/QualificationReview/FilingDetail/index.js @@ -12,15 +12,15 @@ const {router}=tools; const FilingDetail = (props) => { - const { qualReview, fetchQualFilingDetail } = props; - const { fetchQualFilingDetailLoading, qualFilingDetail } = qualReview; + const { qualReview, fetchQualFilingDetail, fetchQualChangeDetail } = props; + const { fetchQualFilingDetailLoading, qualFilingDetail } = qualReview; + const isChange = router.query.mode === "change"; - const statusConfig = REVIEW_STATUS_MAP[qualFilingDetail.reviewStatus]; + const statusConfig = REVIEW_STATUS_MAP[qualFilingDetail.filingStatusCode]; useEffect(() => { - fetchQualFilingDetail({ - id: router.query.id, - }); + const action = isChange ? fetchQualChangeDetail : fetchQualFilingDetail; + action({ id: router.query.id }); }, []); return ( diff --git a/src/pages/Container/QualificationReview/QualChange/index.js b/src/pages/Container/QualificationReview/QualChange/index.js index bbc7b95..b52ad5a 100644 --- a/src/pages/Container/QualificationReview/QualChange/index.js +++ b/src/pages/Container/QualificationReview/QualChange/index.js @@ -1,51 +1,28 @@ -import React, { useState, useEffect } from "react"; -import { Button, Form, Select, Space, Table, Tag } from "antd"; +import React, { useEffect } from "react"; +import { Button, Form, Select, 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 TableAction from "@cqsjjb/jjb-react-admin-component/TableAction"; 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", - }, -]; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { NS_QUAL_REVIEW } from "~/enumerate/namespace"; +import { FILING_STATUS_MAP } from "~/enumerate/constant"; const { router } = tools; const QualChange = (props) => { const [form] = Form.useForm(); - const [loading, setLoading] = useState(false); + const { qualReview, queryQualChangePage } = props; + const { qualReviewList, qualReviewTotal, qualReviewLoading } = qualReview || {}; const handleSearch = () => { - setLoading(true); - setTimeout(() => setLoading(false), 500); + queryQualChangePage({ + ...router.query, + current: router.query.current || 1, + size: router.query.size || 10, + }); }; const handleReset = (values) => { @@ -53,35 +30,34 @@ const QualChange = (props) => { ...router.query, ...values, current: 1, - pageSize: 10, + size: 10, }; handleSearch(); }; useEffect(() => { form.setFieldsValue(router.query); + handleSearch(); }, []); const columns = [ { title: "序号", - dataIndex: "id", width: 60, fixed: "left", - render: (text, record, index) => index + 1, + render: (_, __, index) => index + 1, }, - { title: "机构名称", dataIndex: "orgName", width: 220, ellipsis: true }, - { title: "机构类型", dataIndex: "orgType", width: 100 }, + { title: "机构名称", dataIndex: "filingUnitName", width: 220, ellipsis: true }, + { title: "机构类型", dataIndex: "filingUnitTypeName", 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: "businessScope", width: 180, ellipsis: true }, { - title: "变更状态", - dataIndex: "changeStatus", + title: "备案状态", + dataIndex: "filingStatusCode", width: 100, - render: (status) => { - const config = CHANGE_STATUS_MAP[status]; - return config ? {config.label} : status; + render: (code) => { + const config = FILING_STATUS_MAP[code]; + return config ? {config.label} : "--"; }, }, { @@ -89,16 +65,17 @@ const QualChange = (props) => { width: 140, fixed: "right", render: (_, record) => ( - - - {record.changeStatus !== "approved" && ( - )} - + ), }, ]; @@ -108,37 +85,21 @@ const QualChange = (props) => { - - , , - + - 石油加工 - 化工 - 矿山 - 建筑施工 - - , - - - 停滞中 - 待审核 - 已审核 + {Object.entries(FILING_STATUS_MAP).map(([code, config]) => ( + {config.label} + ))} , ]} @@ -148,7 +109,7 @@ const QualChange = (props) => { ...router.query, ...values, current: 1, - pageSize: 10, + size: 10, }; handleSearch(); }} @@ -157,21 +118,21 @@ const QualChange = (props) => { `共 ${total} 条`, - current: router.query.current, - pageSize: router.query.pageSize, + current: router.query.current || 1, + pageSize: router.query.size || 10, onChange: (page, pageSize) => { router.query = { ...router.query, current: page, - pageSize, + size: pageSize, }; handleSearch(); }, @@ -181,4 +142,4 @@ const QualChange = (props) => { ); }; -export default AntdTableFuncControl(QualChange); +export default Connect([NS_QUAL_REVIEW], true)(AntdTableFuncControl(QualChange)); \ No newline at end of file diff --git a/src/pages/Container/QualificationReview/QualConfirm/index.js b/src/pages/Container/QualificationReview/QualConfirm/index.js index 5821c1c..566f5d2 100644 --- a/src/pages/Container/QualificationReview/QualConfirm/index.js +++ b/src/pages/Container/QualificationReview/QualConfirm/index.js @@ -8,7 +8,7 @@ import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd"; import { tools } from "@cqsjjb/jjb-common-lib"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { NS_QUAL_REVIEW } from "~/enumerate/namespace"; -import { VERIFY_STATUS_MAP } from "~/enumerate/constant"; +import { FILING_STATUS_MAP } from "~/enumerate/constant"; const { router } = tools; @@ -56,7 +56,7 @@ const QualConfirm = (props) => { dataIndex: "filingStatusCode", width: 100, render: (status) => { - const config = VERIFY_STATUS_MAP[status]; + const config = FILING_STATUS_MAP[status]; return config ? {config.label} : "--"; }, }, @@ -69,7 +69,7 @@ const QualConfirm = (props) => { - {record.filingStatusCode !== "passed" && ( + {record.filingStatusCode == 2&& ( diff --git a/src/pages/Container/QualificationReview/QualConfirmForm/index.js b/src/pages/Container/QualificationReview/QualConfirmForm/index.js index cc1d0f0..e01cf70 100644 --- a/src/pages/Container/QualificationReview/QualConfirmForm/index.js +++ b/src/pages/Container/QualificationReview/QualConfirmForm/index.js @@ -2,7 +2,7 @@ import React, { useEffect } from "react"; import { Button, Form, Input, Select, Tag, Space, message } from "antd"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { tools } from "@cqsjjb/jjb-common-lib"; -import { NS_QUAL_REVIEW, NS_QUAL_EXPERT } from "~/enumerate/namespace"; +import { NS_QUAL_REVIEW } from "~/enumerate/namespace"; import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; import "./indes.less"; @@ -12,24 +12,26 @@ const { TextArea } = Input; const QualConfirmForm = (props) => { const [form] = Form.useForm(); const { router } = tools; - const { qualReview, qualExpert, fetchQualFilingDetail, reviewSubmit } = props; - const { fetchQualFilingDetailLoading, qualFilingDetail } = qualReview || {}; - const {qualExpertSubmitLoading}= qualExpert; + const { qualReview, fetchQualFilingDetail, fetchQualChangeDetail, reviewSubmit, changeReviewSubmit } = props; + const { fetchQualFilingDetailLoading, qualReviewSubmitLoading, qualFilingDetail } = qualReview || {}; + const isChange = router.query.mode === "change"; useEffect(() => { - fetchQualFilingDetail({ id: router.query.id }); + const action = isChange ? fetchQualChangeDetail : fetchQualFilingDetail; + action({ id: router.query.id }); }, []); const handleSubmit = async () => { const values = await form.validateFields(); const REMARK_MAP = { 1: "确认通过", 3: "打回" }; + const submitAction = isChange ? changeReviewSubmit : reviewSubmit; const params = { filingId: router.query.id, reviewResult: values.reviewResult, reviewResultRemark: REMARK_MAP[values.reviewResult], reviewOpinion: values.reviewOpinion, }; - const res = await reviewSubmit(params); + const res = await submitAction(params); if (res?.success !== false) { message.success("确认提交成功"); props.history.goBack(); @@ -97,7 +99,7 @@ const QualConfirmForm = (props) => { {/* 操作按钮 */}
-
@@ -108,6 +110,6 @@ const QualConfirmForm = (props) => { export default Connect( - [NS_QUAL_REVIEW, NS_QUAL_EXPERT], + [NS_QUAL_REVIEW], true, )(QualConfirmForm); diff --git a/src/pages/Container/QualificationReview/QualReviewForm/ReviewModal.js b/src/pages/Container/QualificationReview/QualReviewForm/ReviewModal.js index 26a743a..352a6f5 100644 --- a/src/pages/Container/QualificationReview/QualReviewForm/ReviewModal.js +++ b/src/pages/Container/QualificationReview/QualReviewForm/ReviewModal.js @@ -1,7 +1,7 @@ import React, { useEffect, useMemo } from "react"; import { Button, Form, Input, message, Modal, Select } from "antd"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { NS_QUAL_EXPERT } from "~/enumerate/namespace"; +import { NS_QUAL_EXPERT, NS_QUAL_REVIEW } from "~/enumerate/namespace"; import { REVIEW_RESULT_OPTIONS } from "~/enumerate/constant"; const { TextArea } = Input; @@ -17,9 +17,10 @@ const statStyle = { background: "#fff", border: "1px solid #d9d9d9", borderRadiu const statLabelStyle = { fontSize: "0.7rem", color: "rgba(0,0,0,0.45)" }; const ReviewModal = (props) => { - const { open, filingId, legalPassCount = 0, legalFailCount = 0, onCancel, onSuccess } = props; - const { qualExpert, queryExpertPage, reviewSubmit } = props; - const { qualExpertList, qualExpertSubmitLoading } = qualExpert || {}; + const { open, filingId, isChange = false, legalPassCount = 0, legalFailCount = 0, onCancel, onSuccess } = props; + const { qualExpert, qualReview, queryExpertPage, reviewSubmit, changeReviewSubmit } = props; + const { qualExpertList } = qualExpert || {}; + const { qualReviewSubmitLoading } = qualReview || {}; const [form] = Form.useForm(); @@ -43,6 +44,7 @@ const ReviewModal = (props) => { const handleOk = async () => { const values = await form.validateFields(); const selected = expertOptions.find((o) => o.value === values.filingExpertId); + const submitAction = isChange ? changeReviewSubmit : reviewSubmit; const params = { filingId, reviewResult: values.reviewResult, @@ -51,7 +53,7 @@ const ReviewModal = (props) => { filingExpertName: selected?.expert?.userName, reviewOpinion: values.reviewOpinion, }; - const res = await reviewSubmit(params); + const res = await submitAction(params); if (res?.success !== false) { message.success("审核提交成功"); onCancel(); @@ -68,7 +70,7 @@ const ReviewModal = (props) => { footer={
-
@@ -154,4 +156,4 @@ const ReviewModal = (props) => { ); }; -export default Connect([NS_QUAL_EXPERT], true)(ReviewModal); \ No newline at end of file +export default Connect([NS_QUAL_EXPERT, NS_QUAL_REVIEW], true)(ReviewModal); \ No newline at end of file diff --git a/src/pages/Container/QualificationReview/QualReviewForm/index.js b/src/pages/Container/QualificationReview/QualReviewForm/index.js index 990e302..98e4bec 100644 --- a/src/pages/Container/QualificationReview/QualReviewForm/index.js +++ b/src/pages/Container/QualificationReview/QualReviewForm/index.js @@ -12,11 +12,13 @@ import "./indes.less"; const { router } = tools; const QualReviewForm = (props) => { - const { queryComplianceCheck, qualReview, fetchQualFilingDetail } = props; - const { qualReviewLoading, complianceCheckItems, fetchQualFilingDetailLoading, qualFilingDetail } = qualReview; + const { queryComplianceCheck, fetchQualFilingDetail, queryChangeComplianceCheck, fetchQualChangeDetail } = props; + const { qualReview, qualReviewLoading, complianceCheckItems, fetchQualFilingDetailLoading, qualFilingDetail } = qualReview; + const { router } = tools; + const isChange = router.query.mode === "change"; const [compliance, setCompliance] = useState({}); const [reviewVisible, setReviewVisible] = useState(false); - + const statusConfig = REVIEW_STATUS_MAP[qualFilingDetail.filingStatusCode]; const legalPassCount = complianceCheckItems.filter( @@ -27,8 +29,10 @@ const QualReviewForm = (props) => { ).length; useEffect(() => { - queryComplianceCheck({id: router.query.id}); - fetchQualFilingDetail({id: router.query.id}); + const complianceAction = isChange ? queryChangeComplianceCheck : queryComplianceCheck; + const detailAction = isChange ? fetchQualChangeDetail : fetchQualFilingDetail; + complianceAction({ id: router.query.id }); + detailAction({ id: router.query.id }); }, []); return ( @@ -88,6 +92,7 @@ const QualReviewForm = (props) => { setReviewVisible(false)}