From 0616a469cd93e08bc45ca491ad1b5a6814e2a831 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Thu, 30 Jul 2026 09:59:44 +0800 Subject: [PATCH] fix --- src/components/AttachmentUpload/index.js | 2 +- src/components/BaiduMapPicker/index.js | 3 + .../BusinessReminder/index.js | 2 +- .../SafetyEvalBusiness/MyProject/index.js | 2 +- .../ProjectFlow/ContractContent.js | 27 ++++---- .../ProjectFlow/ControlContent.js | 59 +++++++++-------- .../ProjectFlow/InternalReviewContent.js | 40 ++++++----- .../ProjectFlow/RiskAnalysisContent.js | 66 ++++++++++--------- .../ProjectFlow/SurveyContent.js | 31 +++++---- .../ProjectFlow/TeamContent.js | 12 ++-- .../ProjectFlow/TechnicalReviewContent.js | 46 +++++++------ .../SafetyEvalBusiness/ProjectFlow/index.js | 15 +++-- 12 files changed, 170 insertions(+), 135 deletions(-) diff --git a/src/components/AttachmentUpload/index.js b/src/components/AttachmentUpload/index.js index 1b1b507..3fe8cb4 100644 --- a/src/components/AttachmentUpload/index.js +++ b/src/components/AttachmentUpload/index.js @@ -51,7 +51,7 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou }} > { type: "script", attr: { type: "text/javascript" }, }); + setTimeout(() => { + setLoaded(true); + }, 1000); }; if (window?.base?.loadDynamicResource) { callback(); diff --git a/src/pages/Container/SafetyEvalBusiness/BusinessReminder/index.js b/src/pages/Container/SafetyEvalBusiness/BusinessReminder/index.js index cc171af..0aebf01 100644 --- a/src/pages/Container/SafetyEvalBusiness/BusinessReminder/index.js +++ b/src/pages/Container/SafetyEvalBusiness/BusinessReminder/index.js @@ -94,7 +94,7 @@ const BusinessReminder = (props) => { if (years >= 1) { return Number.isInteger(years) ? `${years}年` : `${years.toFixed(1)}年`; } - return `${days}天`; + return `${days}年`; }; const renderWaringStatus = (status) => { diff --git a/src/pages/Container/SafetyEvalBusiness/MyProject/index.js b/src/pages/Container/SafetyEvalBusiness/MyProject/index.js index 851bcbf..cd7c8d6 100644 --- a/src/pages/Container/SafetyEvalBusiness/MyProject/index.js +++ b/src/pages/Container/SafetyEvalBusiness/MyProject/index.js @@ -129,7 +129,7 @@ const MyProject = (props) => { render: (_, record) => ( + props.history.push(`ProjectFlow?id=${record.id}${record.archiveFlag === 1 ? '&readOnly=1' : ''}`)}>{record.archiveFlag === 1 ? '查看' : '编辑'} ), diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js index 4259301..4485f92 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ContractContent.js @@ -35,7 +35,7 @@ const YES_NO_OPTIONS = [ { label: "否", value: 2 }, ]; -const ContractContent = (props) => { +const ContractContent = ({ readOnly, ...props }) => { const [form] = Form.useForm(); const projectId = router.query?.id; @@ -130,7 +130,7 @@ const ContractContent = (props) => { -
+ { label="项目合同扫描件" accept=".pdf" maxCount={10} + disabled={readOnly} extra="请上传PDF文件,大小不应超过500MB,不超过10个文件。" /> - - - - + {!readOnly && ( + + + + + )}
diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ControlContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ControlContent.js index 64f9ab4..9a69778 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ControlContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/ControlContent.js @@ -26,7 +26,7 @@ import { tools } from "@cqsjjb/jjb-common-lib"; const { TextArea } = Input; const { router } = tools; -const ControlContent = (props) => { +const ControlContent = ({ readOnly, ...props }) => { const projectId = router.query?.id; const { processControlDetail, processControlFiles, evalProjectDetailData } = props.safetyEvalBusiness || {}; @@ -190,6 +190,7 @@ const ControlContent = (props) => { size="small" style={{ width: 130 }} allowClear + disabled={readOnly} placeholder="请选择结果" onChange={(v) => updateRow(idx, "reviewConclusion", v)} > @@ -206,6 +207,7 @@ const ControlContent = (props) => { size="small" value={val} allowClear + disabled={readOnly} maxLength={60} placeholder="请输入意见" onChange={(e) => updateRow(idx, "reviewOpinion", e.target.value)} @@ -364,13 +366,15 @@ const ControlContent = (props) => { ]} /> - + {!readOnly && ( + + )}
)} @@ -422,6 +426,7 @@ const ControlContent = (props) => { rows={3} value={approvalOpinion} onChange={(e) => setApprovalOpinion(e.target.value)} + disabled={readOnly} placeholder="请输入签发意见" style={{ marginTop: 4 }} /> @@ -441,7 +446,7 @@ const ControlContent = (props) => { size="small" allowClear style={{ width: 180 }} - disabled={isDispatched} + disabled={isDispatched || readOnly} value={selectPeople?.value} onChange={(value, option) => { setSelectPeople(option); @@ -457,7 +462,7 @@ const ControlContent = (props) => { loading={ props.safetyEvalBusiness?.processControlAssignLoading } - disabled={isDispatched || !selectPeople?.value} + disabled={isDispatched || !selectPeople?.value || readOnly} > {isDispatched ? "已下发APP签字" : "下发APP签字"} @@ -492,7 +497,7 @@ const ControlContent = (props) => { size="small" /> -
+ @@ -522,21 +527,23 @@ const ControlContent = (props) => { align="center" style={{ marginTop: 12, paddingBottom: 16 }} > - + {!readOnly && ( + + )} )} diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js index d1b15d6..734af68 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js @@ -26,7 +26,7 @@ const CONCLUSION_OPTIONS = [ { value: "not_conform_to", label: "需修改" }, ]; -const InternalReviewContent = (props) => { +const InternalReviewContent = ({ readOnly, ...props }) => { const projectId = router.query?.id; const { internalReviewDetail, @@ -145,6 +145,7 @@ const InternalReviewContent = (props) => { size="small" style={{ width: 130 }} allowClear + disabled={readOnly} defaultValue={'conform_to'} placeholder="请选择结论" onChange={(v) => updateRow(idx, "reviewConclusion", v)} @@ -166,6 +167,7 @@ const InternalReviewContent = (props) => { size="small" value={val} allowClear + disabled={readOnly} placeholder="请输入审核意见" maxLength={80} onChange={(e) => updateRow(idx, "reviewOpinion", e.target.value)} @@ -243,6 +245,7 @@ const InternalReviewContent = (props) => { rows={2} value={overallOpinion} allowClear + disabled={readOnly} placeholder="请输入总体审核意见" maxLength={120} onChange={(e) => setOverallOpinion(e.target.value)} @@ -259,6 +262,7 @@ const InternalReviewContent = (props) => { style={{ width: 140 }} value={selectedReviewer} onChange={setSelectedReviewer} + disabled={readOnly} options={(reviewers || []).map((r) => ({ value: r.personnelId, label: r.personnelName, @@ -268,7 +272,7 @@ const InternalReviewContent = (props) => { size="small" onClick={handleAssign} loading={internalReviewAssignLoading || props.safetyEvalBusiness?.internalReviewConfirmLoading} - disabled={isDispatched || !selectedReviewer} + disabled={isDispatched || !selectedReviewer || readOnly} > {isDispatched ? "已下发APP签字" : "下发APP签字"} @@ -308,21 +312,23 @@ const InternalReviewContent = (props) => { }, ]} /> - - - - + {!readOnly && ( + + + + + )} ); }; diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js index d7c228a..6070560 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/RiskAnalysisContent.js @@ -32,7 +32,7 @@ const EVAL_TYPE_OPTIONS = [ { label: "安全现状评价", value: "STATUS" }, ]; -const RiskAnalysisContent = (props) => { +const RiskAnalysisContent = ({ readOnly, ...props }) => { const [form] = Form.useForm(); const projectId = router.query?.id; @@ -160,7 +160,7 @@ const RiskAnalysisContent = (props) => { title="安全评价风险分析记录表" styles={{ header: { textAlign: "center" } }} > - + @@ -424,7 +424,7 @@ const RiskAnalysisContent = (props) => { evalSignTaskSaveLoading && signingIndex === field.name } - disabled={value === 1 || value === 2} + disabled={value === 1 || value === 2 || readOnly} onClick={() => handleSignApp(field.name)} > {text} @@ -439,6 +439,7 @@ const RiskAnalysisContent = (props) => { type="link" danger size="small" + disabled={readOnly} onClick={() => remove(field.name)} > 删除 @@ -449,17 +450,19 @@ const RiskAnalysisContent = (props) => { rowKey={(_, index) => index} pagination={false} /> - + {!readOnly && ( + + )} ); }} @@ -472,6 +475,7 @@ const RiskAnalysisContent = (props) => { label="风险分析表附件" accept=".pdf,.docx,.jpg,.png" maxCount={10} + disabled={readOnly} extra="支持 PDF、Word、JPG、PNG 格式。上传后可替换修改,系统保留当前归档文件信息" /> @@ -570,22 +574,24 @@ const RiskAnalysisContent = (props) => { /> - - - - - + {!readOnly && ( + + + + + + )} ); diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/SurveyContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/SurveyContent.js index 9cbf1a4..8c6e11f 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/SurveyContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/SurveyContent.js @@ -34,7 +34,7 @@ const downloadTemplate = async () => { } }; -const NoticePanel = () => ( +const NoticePanel = ({ readOnly }) => (
@@ -66,12 +66,13 @@ const NoticePanel = () => ( label="从业告知书" maxCount={1} accept=".docx" + disabled={readOnly} extra="仅支持上传 Word 格式文件" />
); -const InspectionPanel = ({ dataSource = [], evalProjectDetailData = {} }) => { +const InspectionPanel = ({ dataSource = [], evalProjectDetailData = {}, readOnly }) => { const calcDuration = (signIn, signOut) => { if (!signIn || !signOut) return '-'; const start = new Date(signIn); @@ -135,6 +136,7 @@ const InspectionPanel = ({ dataSource = [], evalProjectDetailData = {} }) => { label="现场检查表" maxCount={10} accept=".pdf,.doc,.docx,.xls,.xlsx" + disabled={readOnly} extra="检查表应包含项目名称、检查日期、检查人员、检查依据、逐项检查结果和不符合项记录;上传后与人员打卡记录共同作为现场踏勘凭证。 支持Excel、Word、PDF和清晰扫描件" /> @@ -142,7 +144,7 @@ const InspectionPanel = ({ dataSource = [], evalProjectDetailData = {} }) => { ); }; -const RectificationNoticePanel = () => ( +const RectificationNoticePanel = ({ readOnly }) => (
@@ -156,12 +158,13 @@ const RectificationNoticePanel = () => ( label="整改通知单" maxCount={10} accept=".pdf,.doc,.docx,.jpg,.jpeg,.png,.xls,.xlsx" + disabled={readOnly} extra="支持 PDF、Word、JPG、PNG、Excel 格式,最多上传 10 个文件" />
); -const EnterpriseRectificationPanel = () => ( +const EnterpriseRectificationPanel = ({ readOnly }) => (
@@ -175,12 +178,13 @@ const EnterpriseRectificationPanel = () => ( label="企业整改报告" maxCount={10} accept=".pdf,.doc,.docx,.jpg,.jpeg,.png,.zip,.rar,.7z" + disabled={readOnly} extra="支持 PDF、Word、压缩包、图片格式,最多上传 10 个文件" />
); -const RectificationReviewPanel = () => ( +const RectificationReviewPanel = ({ readOnly }) => (
@@ -194,12 +198,13 @@ const RectificationReviewPanel = () => ( label="整改情况复查单" maxCount={10} accept=".pdf,.doc,.docx,.jpg,.jpeg,.png,.xls,.xlsx" + disabled={readOnly} extra="支持 PDF、Word、JPG、PNG、Excel 格式,最多上传 10 个文件" />
); -const SurveyContent = (props) => { +const SurveyContent = ({ readOnly, ...props }) => { const [form] = Form.useForm(); const [activeStage, setActiveStage] = useState("PRACTICE_NOTIFICATION"); const [attachMap, setAttachMap] = useState({}); @@ -289,28 +294,28 @@ const SurveyContent = (props) => { items={STAGES.map((s) => ({ title: s.label }))} /> -
+
- +
- +
- +
- +
- +
{!isFirst && } {isLast ? ( - + !readOnly && ) : ( )} diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TeamContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TeamContent.js index 812fc2e..4162f40 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TeamContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TeamContent.js @@ -11,7 +11,7 @@ const { router } = tools; -const TeamContent = (props) => { +const TeamContent = ({ readOnly, ...props }) => { const { safetyEvalBusiness, evalProjectMemberPage, evalProjectMemberSave } = props; const { evalProjectDetailData, memberLoading, memberSaveLoading } = safetyEvalBusiness || {}; const participants = evalProjectDetailData?.participants || []; @@ -144,7 +144,7 @@ const TeamContent = (props) => { render: (roles, record) => (
{roles.map((r) => ( - { + { setTeamMembers((prev) => prev.map((m) => { if (m.personnelId !== record.personnelId) return m; const updated = m.roles.filter((role) => role.role !== r.role); @@ -165,7 +165,7 @@ const TeamContent = (props) => { { title: "操作", width: 80, fixed: "right", render: (_, record) => ( - + ), }, ]; @@ -206,7 +206,7 @@ const TeamContent = (props) => { - + {!readOnly && } @@ -227,9 +227,7 @@ const TeamContent = (props) => { - - - + {!readOnly && } setModalOpen(false)} width={700} diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TechnicalReviewContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TechnicalReviewContent.js index d485e36..e058c30 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TechnicalReviewContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/TechnicalReviewContent.js @@ -26,7 +26,7 @@ const CONCLUSION_OPTIONS = [ { value: "not_conform_to", label: "需修改" }, ]; -const TechnicalReviewContent = (props) => { +const TechnicalReviewContent = ({ readOnly, ...props }) => { const projectId = router.query?.id; const { techReviewDetail } = props.safetyEvalBusiness || {}; const { techReview, reviewers, reviewItems } = techReviewDetail || {}; @@ -145,6 +145,7 @@ const TechnicalReviewContent = (props) => { style={{ width: 130 }} defaultValue={'conform_to'} allowClear + disabled={readOnly} placeholder="请选择结论" onChange={(v) => updateRow(idx, "reviewConclusion", v)} > @@ -162,6 +163,7 @@ const TechnicalReviewContent = (props) => { render: (val, _, idx) => ( { - + 技术负责人
{
- + {/* 专业匹配
@@ -227,7 +229,7 @@ const TechnicalReviewContent = (props) => {
- + */}
{ rows={2} value={overallOpinion} allowClear + disabled={readOnly} placeholder="请输入技术审核意见" maxLength={120} onChange={(e) => setOverallOpinion(e.target.value)} @@ -261,6 +264,7 @@ const TechnicalReviewContent = (props) => { style={{ width: 160 }} value={selectedReviewer} onChange={setSelectedReviewer} + disabled={readOnly} options={(reviewers || []).map((r) => ({ value: r.personnelId, label: r.personnelName, @@ -270,7 +274,7 @@ const TechnicalReviewContent = (props) => { size="small" onClick={handleAssign} loading={props.safetyEvalBusiness?.techReviewAssignLoading || props.safetyEvalBusiness?.techReviewConfirmLoading} - disabled={isDispatched || !selectedReviewer} + disabled={isDispatched || !selectedReviewer || readOnly} > {isDispatched ? "已下发APP签字" : "下发APP签字"} @@ -310,21 +314,23 @@ const TechnicalReviewContent = (props) => { }, ]} /> - - - - + {!readOnly && ( + + + + + )} ); }; diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/index.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/index.js index da83454..6f68ff6 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/index.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/index.js @@ -112,6 +112,7 @@ const ProjectFlow = (props) => { const [visible, setVisible] = useState(false); const { wpsDoc, evalProjectDetailData } = props.safetyEvalBusiness || {}; const projectId = router.query?.id; + const readOnly = router.query?.readOnly === '1'; const processTabs = buildProcessTabs(evalProjectDetailData?.projectNode); @@ -145,26 +146,26 @@ const ProjectFlow = (props) => { let children = null; switch (item.key) { case "risk": - children = ; + children = ; break; case "contract": - children = ; + children = ; break; case "team": - children = ; + children = ; break; case "survey": - children = ; + children = ; break; case "internal": - children = ; + children = ; break; case "technical": - children = ; + children = ; break; case "control": - children = ; + children = ; break; default: children = null;