From 6ad6475911acc1d828f9c3e538f8711e48792101 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Fri, 24 Jul 2026 11:05:09 +0800 Subject: [PATCH] feat --- jjb.config.js | 4 +- src/api/safetyEvalBusiness/index.js | 70 +++ .../ProjectFlow/ControlContent.js | 445 +++++++++++++++++- .../ProjectFlow/InternalReviewContent.js | 284 ++++++++--- .../ProjectFlow/RiskAnalysisContent.js | 4 + .../ProjectFlow/TeamContent.js | 30 +- .../ProjectFlow/TechnicalReviewContent.js | 246 +++++++--- 7 files changed, 926 insertions(+), 157 deletions(-) diff --git a/jjb.config.js b/jjb.config.js index 7f51fa3..f261548 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -13,8 +13,8 @@ module.exports = { //API_HOST: "https://gbs-gateway.qhdsafety.com", //API_HOST: "http://192.168.0.152", - //API_HOST: "http://192.168.0.150", //太浅 - API_HOST: "http://192.168.0.152", + API_HOST: "http://192.168.0.150", //太浅 + //API_HOST: "http://192.168.0.152", //API_HOST: "http://192.168.0.103", //huwei }, production: { diff --git a/src/api/safetyEvalBusiness/index.js b/src/api/safetyEvalBusiness/index.js index 27a5826..3cf2c81 100644 --- a/src/api/safetyEvalBusiness/index.js +++ b/src/api/safetyEvalBusiness/index.js @@ -165,4 +165,74 @@ export const evalSurveyList = declareRequest( export const evalSurveySaveAttach = declareRequest( "evalSurveySaveAttachLoading", "Post > @/safetyEval/institution/eval-survey/saveSurveyAttach", +); + +// ===== 内部审核 ===== + +export const evalInternalReviewDetail = declareRequest( + "internalReviewDetailLoading", + "Get > /safetyEval/institution/eval-internal-review/detail", + "internalReviewDetail: {} | res.data || {}", +); + +export const evalInternalReviewConfirm = declareRequest( + "internalReviewConfirmLoading", + "Post > @/safetyEval/institution/eval-internal-review/confirm", +); + +export const evalInternalReviewAssign = declareRequest( + "internalReviewAssignLoading", + "Post > @/safetyEval/institution/eval-internal-review/assign", +); + +// ===== 技术审核 ===== + +export const evalTechReviewDetail = declareRequest( + "techReviewDetailLoading", + "Get > /safetyEval/institution/eval-tech-review/detail", + "techReviewDetail: {} | res.data || {}", +); + +export const evalTechReviewConfirm = declareRequest( + "techReviewConfirmLoading", + "Post > @/safetyEval/institution/eval-tech-review/confirm", +); + +export const evalTechReviewAssign = declareRequest( + "techReviewAssignLoading", + "Post > @/safetyEval/institution/eval-tech-review/assign", +); + +// ===== 过程控制 ===== + +export const evalProcessControlDetail = declareRequest( + "processControlDetailLoading", + "Get > /safetyEval/institution/eval-process-control/detail", + "processControlDetail: {} | res.data || {}", +); + +export const evalProcessControlConfirm = declareRequest( + "processControlConfirmLoading", + "Post > @/safetyEval/institution/eval-process-control/confirm", +); + +export const evalProcessControlAssign = declareRequest( + "processControlAssignLoading", + "Post > @/safetyEval/institution/eval-process-control/assign", +); + +export const evalProcessControlGenerateHandover = declareRequest( + "processControlHandoverLoading", + "Post > @/safetyEval/institution/eval-process-control/generate-handover-form", +); + +export const evalProcessControlArchive = declareRequest( + "processControlArchiveLoading", + "Post > @/safetyEval/institution/eval-process-control/archive", +); + +export const evalProcessControlFiles = declareRequest( + "processControlFilesLoading", + "Get > /safetyEval/institution/eval-process-control/process-files", + "processControlFiles: [] | res.data || []", ); \ No newline at end of file diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ControlContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ControlContent.js index 62c03d7..2ae9e8d 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ControlContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ControlContent.js @@ -1,26 +1,423 @@ -import React from "react"; -import { Card, Empty, Table } from "antd"; +import React, { useState, useEffect } from "react"; +import { Tag, Button, Card, Row, Col, Table, Select, Input, Flex, Typography, message } from "antd"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { NS_SAFETY_EVAL_BUSINESS } from "~/enumerate/namespace"; +import { tools } from "@cqsjjb/jjb-common-lib"; -const ControlContent = () => ( - - - - -); +const { TextArea } = Input; +const { router } = tools; -export default ControlContent; \ No newline at end of file +const CONCLUSION_OPTIONS = [ + { value: "conform_to", label: "符合" }, + { value: "not_conform_to", label: "需修改" }, +]; + +const ControlContent = (props) => { + const projectId = router.query?.id; + const { processControlDetail, processControlFiles } = props.safetyEvalBusiness || {}; + const { processControl, controllers, reviewItems } = processControlDetail || {}; + + // 当前步骤:1-过程控制审核 2-机构负责人签发 3-项目归档 + const [step, setStep] = useState(1); + + // 过程控制审核 + const [rows, setRows] = useState([]); + const [opinionContent, setOpinionContent] = useState(""); + + // 项目归档 + const [files, setFiles] = useState([]); + + const fetchDetail = () => { + props.evalProcessControlDetail({ projectId }); + }; + + const fetchFiles = () => { + props.evalProcessControlFiles({ projectId }); + }; + + useEffect(() => { + if (projectId) { + fetchDetail(); + fetchFiles(); + } + }, [projectId]); + + useEffect(() => { + if (reviewItems) { + setRows( + reviewItems.map((item) => ({ + ...item, + _key: item.id || item.reviewDimensionCode, + })), + ); + } + if (processControl?.opinionContent) { + setOpinionContent(processControl.opinionContent); + } + }, [processControlDetail]); + + useEffect(() => { + if (processControlFiles) { + setFiles(processControlFiles); + } + }, [processControlFiles]); + + const updateRow = (index, field, value) => { + const next = [...rows]; + next[index] = { ...next[index], [field]: value }; + setRows(next); + }; + + const controllerName = processControl?.controllerName || ""; + const isDispatched = processControl?.reviewerSignatureTaskStatus !== "non_dispatched"; + const isSignatureCompleted = processControl?.reviewerSignatureTaskStatus === "completed"; + const hasHandoverForm = !!processControl?.handoverFormUrl; + const problemCount = rows.filter((r) => r.reviewConclusion === "not_conform_to").length; + const canArchive = isSignatureCompleted && hasHandoverForm; + + // 过程控制签字提交(confirm) + const handleConfirm = async (resultCode) => { + if (!projectId) return; + const payload = { + id: processControl?.id, + projectId, + resultCode, + opinionContent, + reviewItems: rows.map((r) => ({ + bizType: "eval_process_control", + bizId: processControl?.id, + reviewDimensionCode: r.reviewDimensionCode, + reviewDimensionName: r.reviewDimensionName, + reviewFocus: r.reviewFocus, + reviewConclusion: r.reviewConclusion, + reviewOpinion: r.reviewOpinion, + })), + }; + const res = await props.evalProcessControlConfirm(payload); + if (res?.success !== false) { + message.success(resultCode === "passed" ? "已提交通过审核" : "已提交退回修改"); + fetchDetail(); + } + }; + + // 下发签字任务(assign) + const handleAssign = async () => { + if (!projectId) return; + const res = await props.evalProcessControlAssign({ projectId }); + if (res?.success !== false) { + message.success("已下发签字任务"); + fetchDetail(); + } + }; + + // 生成归档交接单 + const handleGenerateHandover = async () => { + if (!projectId) return; + const res = await props.evalProcessControlGenerateHandover({ projectId }); + if (res?.success !== false) { + message.success("归档交接单已生成"); + fetchDetail(); + } + }; + + // 归档项目并入库 + const handleArchive = async () => { + if (!projectId) return; + const res = await props.evalProcessControlArchive({ projectId }); + if (res?.success !== false) { + message.success("项目已归档入库"); + fetchDetail(); + } + }; + + const reviewColumns = [ + { title: "审核维度", dataIndex: "reviewDimensionName", width: 120 }, + { title: "审核重点", dataIndex: "reviewFocus", width: 200 }, + { + title: "结论", + dataIndex: "reviewConclusion", + width: 120, + render: (val, _, idx) => ( + + ), + }, + { + title: "审核意见", + dataIndex: "reviewOpinion", + render: (val, _, idx) => ( + updateRow(idx, "reviewOpinion", e.target.value)} + /> + ), + }, + ]; + + const fileColumns = [ + { title: "流程名称", dataIndex: "processName", width: 100 }, + { title: "条目名称", dataIndex: "itemName", width: 120 }, + { title: "文件名称", dataIndex: "materialName", width: 200 }, + { + title: "文件地址", + dataIndex: "projectDocUrl", + width: 200, + render: (url) => + url ? ( + + 查看文件 + + ) : ( + "-" + ), + }, + { title: "资料类型", dataIndex: "materialType", width: 100 }, + ]; + + const STEP_ITEMS = [ + { key: 1, label: "过程控制审核" }, + { key: 2, label: "机构负责人签发" }, + { key: 3, label: "项目归档" }, + ]; + + return ( +
+ + {STEP_ITEMS.map((item) => ( + + ))} + + + {step === 1 && ( + +
+ + 过程控制负责人 + + 过程控制负责人核验前7节点完成及签字记录 +
+ + +
+ + 过程控制负责人 +
+ {controllerName || "-"} +
+
+ + + + 审核项 +
+ {rows.length}项 +
+
+ + + + 问题 +
+ 0 ? "warning" : undefined}> + {problemCount}项 + +
+
+ + + +
+ +
+ 总体过程控制意见 +