From 61333696b447741fc78598aedb331ada1ee6ea51 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Fri, 14 Aug 2026 17:32:18 +0800 Subject: [PATCH] fix --- src/components/AttachmentUpload/index.js | 2 +- .../Container/EnterpriseInfo/OrgInfo/index.js | 20 + .../Supervision/BasicInfo/OrgAccount/index.js | 354 +++++++++++++----- 3 files changed, 283 insertions(+), 93 deletions(-) diff --git a/src/components/AttachmentUpload/index.js b/src/components/AttachmentUpload/index.js index 3fe8cb4..61cadd2 100644 --- a/src/components/AttachmentUpload/index.js +++ b/src/components/AttachmentUpload/index.js @@ -4,7 +4,7 @@ import { PlusOutlined } from "@ant-design/icons"; const isImage = (url) => /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(url || ""); -export default function AttachmentUpload({ name, label, disabled = false, maxCount, accept, extra ,rules, style }) { +export default function AttachmentUpload({ name, label, disabled, maxCount, accept, extra ,rules, style }) { const [previewImage, setPreviewImage] = useState(""); return ( diff --git a/src/pages/Container/EnterpriseInfo/OrgInfo/index.js b/src/pages/Container/EnterpriseInfo/OrgInfo/index.js index 55dd573..665127f 100644 --- a/src/pages/Container/EnterpriseInfo/OrgInfo/index.js +++ b/src/pages/Container/EnterpriseInfo/OrgInfo/index.js @@ -18,6 +18,7 @@ import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout"; // 二者取值集合完全一致(煤矿/金属非金属矿/陆地油气/油气管道/石油化工医药/烟花爆竹/金属冶炼),无需新增枚举。 import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions"; import { NS_ORG_INFO } from "~/enumerate/namespace"; +import AttachmentUpload from "~/components/AttachmentUpload"; import { creditCodeRule, @@ -73,8 +74,13 @@ function OrgInfoPage(props) { if (res?.data?.id) { sessionStorage.setItem("orgInfo", JSON.stringify(res.data)); setDetail(res.data); + let attachmentUrls = res.data.attachmentUrls; + if (typeof attachmentUrls === "string" && attachmentUrls) { + try { attachmentUrls = JSON.parse(attachmentUrls); } catch {} + } form.setFieldsValue({ ...res.data, + attachmentUrls, // 2026-08-08 联系人及电话:后端 contactName/contactPhone 两列合并为单字段展示 contactNamePhone: mergeContactNamePhone( res.data.contactName, @@ -122,6 +128,9 @@ function OrgInfoPage(props) { contactPhone, // 移除仅用于展示的合并字段,避免提交冗余 contactNamePhone: undefined, + attachmentUrls: formValues.attachmentUrls + ? JSON.stringify(formValues.attachmentUrls) + : undefined, infoDisclosureUrl: formValues.infoDisclosureUrl ? normalizeUrl(formValues.infoDisclosureUrl) : undefined, @@ -198,6 +207,17 @@ function OrgInfoPage(props) { /> + {/* 营业执照附件 */} + + + {/* 原型:注册地址占整行(full) */} { const formValues = await editForm.validateFields(); const split = splitContactNamePhone(formValues.contactNamePhone); + const contactName = split.contactName + ? split.contactName.replace(/\s+/g, "") + : undefined; + const contactPhone = split.contactPhone + ? split.contactPhone.replace(/\s+/g, "") + : undefined; const values = { ...formValues, - contactName: split.contactName, - contactPhone: split.contactPhone, + contactName, + contactPhone, contactNamePhone: undefined, + attachmentUrls: formValues.attachmentUrls + ? JSON.stringify(formValues.attachmentUrls) + : undefined, + infoDisclosureUrl: formValues.infoDisclosureUrl + ? normalizeUrl(formValues.infoDisclosureUrl) + : undefined, id: currentId, }; setEditLoading(true); @@ -234,9 +258,17 @@ function OrgAccountPage(props) { }; const columns = [ - { title: "机构名称", dataIndex: "unitName", ellipsis: true }, - { title: "账号", dataIndex: "account", ellipsis: true }, - { title: "属地", dataIndex: "districtName", width: 260 }, + { title: "单位名称", dataIndex: "unitName", ellipsis: true }, + { + title: "拟申请的法定安全评价业务范围", + dataIndex: "safetyIndustryCategoryCode", + ellipsis: true, + render: (codes) => + (Array.isArray(codes) ? codes : []) + .map((code) => QUALIFICATION_INDUSTRY_OPTIONS_MAP[code] || code) + .join("、") || "-", + }, + { title: "办公地址", dataIndex: "businessAddress", ellipsis: true }, { title: "状态", width: 80, @@ -382,7 +414,7 @@ function OrgAccountPage(props) { open={viewOpen} destroyOnHidden title="机构信息查看" - width={760} + width={900} loading={detailLoading} cancelText="关闭" okButtonProps={{ style: { display: "none" } }} @@ -393,38 +425,74 @@ function OrgAccountPage(props) { > {detail && ( - + {detail.unitName} {detail.creditCode} - - {detail.districtName} + + {(() => { + let files = []; + if (Array.isArray(detail.attachmentUrls)) { + files = detail.attachmentUrls; + } else if (typeof detail.attachmentUrls === "string" && detail.attachmentUrls) { + try { files = JSON.parse(detail.attachmentUrls); } catch {} + } + if (!files.length) return "-"; + return files.map((f, i) => ( + + {f.name || f.url} + + )); + })()} - + + {detail.registerAddress || "-"} + + + {detail.businessAddress || "-"} + + + {detail.infoDisclosureUrl || "-"} + + + {detail.qualificationCertNo || "-"} + + + {detail.legalRepresentative || "-"} + + + {detail.legalRepresentativePhone || "-"} + + + {detail.fax || "-"} + + + {mergeContactNamePhone(detail.contactName, detail.contactPhone) || "-"} + + + {detail.fixedAssetsTotal ?? "-"} + + + {detail.workplaceArea ?? "-"} + + + {detail.archiveRoomArea ?? "-"} + + + {detail.fulltimeEvaluatorCount ?? "-"} + + + {detail.registeredEngineerCount ?? "-"} + + {(detail.safetyIndustryCategoryCode || []) .map((code) => QUALIFICATION_INDUSTRY_OPTIONS_MAP[code] || code) .join("、") || "-"} - - {detail.businessAddress} - - - {ENTERPRISE_STATUS_OPTIONS_MAP[detail.enterpriseStatusCode]} - - - - {mergeContactNamePhone(detail.contactName, detail.contactPhone) || "-"} - - - {detail.legalRepresentative} - - - {detail.legalRepresentativePhone} - - - {detail.enterpriseScaleName} + + {detail.orgIntro || "-"} )} @@ -434,7 +502,7 @@ function OrgAccountPage(props) { open={editOpen} destroyOnHidden title="编辑机构信息" - width={760} + width={900} confirmLoading={editLoading} okText="保存" cancelText="取消" @@ -450,58 +518,94 @@ function OrgAccountPage(props) { - + - - - - - - - {QUALIFICATION_INDUSTRY_OPTIONS.map((opt) => ( - - {opt.label} - - ))} - - - - - - - + - - + + + + + + + + + + typeof value === "string" ? value.trim() : value + } + > + + + + + + + + + + + + + + + + typeof value === "string" ? value.trim() : value + } + > + + + + + + @@ -552,33 +656,99 @@ function OrgAccountPage(props) { - - + { + if (value === undefined || value === null || value === "") { + return Promise.resolve(); + } + if (Number(value) < 0) { + return Promise.reject(new Error("固定资产总值应为非负数字")); + } + return Promise.resolve(); + }, + }, + ]} + > + - + - -