From 373fe6d612f518d93109792229b95f3dca96a21c Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Fri, 31 Jul 2026 16:59:40 +0800 Subject: [PATCH 1/5] 1.2 --- src/components/StaffViewModal/index.js | 84 +++++- src/enumerate/enterpriseOptions.js | 20 -- .../PersonnelInfo/List/index.js | 277 ++++++++++++------ .../EvalProject/Create/StaffPickerModal.js | 12 +- 4 files changed, 263 insertions(+), 130 deletions(-) diff --git a/src/components/StaffViewModal/index.js b/src/components/StaffViewModal/index.js index da5246b..cef0107 100644 --- a/src/components/StaffViewModal/index.js +++ b/src/components/StaffViewModal/index.js @@ -99,6 +99,54 @@ export default function StaffViewModal({ ? JSON.parse(info.proofMaterialUrl) : []; + const titleCodeArr = Array.isArray(info.titleCodeArr) + ? info.titleCodeArr.map((item) => { + let proveUrlList = []; + if (item.proveUrl) { + try { + proveUrlList = + typeof item.proveUrl === "string" + ? JSON.parse(item.proveUrl) + : item.proveUrl; + } catch { + proveUrlList = []; + } + } + return { + industryName: + QUALIFICATION_INDUSTRY_OPTIONS_MAP[item.industryCode] || + item.industryCode || + "-", + titleName: TITLE_LEVEL_MAP[item.titleCode] || item.titleCode || "-", + proveUrlList, + }; + }) + : []; + + const renderFileList = (files) => { + if (!files?.length) return "-"; + return files.map((item) => { + const isImage = /\.(jpg|jpeg|png|gif|webp|bmp|svg)(\?.*)?$/i.test( + item.url, + ); + return ( +
+ {isImage ? ( + + ) : ( + + )} +
+ ); + }); + }; + const certPreviewFiles = certPreviewInfo?.certImgs?.length ? certPreviewInfo.certImgs : certPreviewInfo?.certImgFiles || []; @@ -134,26 +182,36 @@ export default function StaffViewModal({ {info.account} {info.deptName} {info.postName} - - {info.personTypeName || "基础人员"} - {QUALIFICATION_INDUSTRY_OPTIONS_MAP[info.qualScope] || info.qualScope || "-"} - - {info.professionalLevelName || "-"} - - - {info.evaluatorCertNo || "-"} - {info.educationTypeName || "-"} {info.educationLevelName || "-"} - - {TITLE_LEVEL_MAP[info.titleCode] ?? (info.titleCode || "-")} + + {titleCodeArr.length ? ( + idx} + dataSource={titleCodeArr} + columns={[ + { title: "行业", dataIndex: "industryName", width: 150 }, + { title: "职称", dataIndex: "titleName", width: 100 }, + { + title: "证明材料", + dataIndex: "proveUrlList", + render: renderFileList, + }, + ]} + /> + ) : ( + "-" + )} {REGISTER_ENGINEER_MAP[info.registerEngineerFlag] ?? "-"} @@ -177,7 +235,7 @@ export default function StaffViewModal({ {info.graduateSchool} - {info.major} + {info.workExperience || "-"} - + {proofMaterialUrl.length ? proofMaterialUrl.map((item) => { const isImage = diff --git a/src/enumerate/enterpriseOptions.js b/src/enumerate/enterpriseOptions.js index abe601b..c052f16 100644 --- a/src/enumerate/enterpriseOptions.js +++ b/src/enumerate/enterpriseOptions.js @@ -138,27 +138,7 @@ export const PERSON_TYPE_OPTIONS = [ { label: "专职评价师", value: "专职评价师" }, ]; -/** 职业等级 */ -export const PROFESSIONAL_LEVEL_OPTIONS = [ - { - label: "三级安全评价师(对应职业技能等级三级 / 高级工,入门级)", - value: "三级安全评价师(对应职业技能等级三级 / 高级工,入门级)", - }, - { - label: "二级安全评价师(对应职业技能等级二级 / 技师,中级)", - value: "二级安全评价师(对应职业技能等级二级 / 技师,中级)", - }, - { - label: "一级安全评价师(对应职业技能等级一级 / 高级技师,最高级)", - value: "一级安全评价师(对应职业技能等级一级 / 高级技师,最高级)", - }, -]; -export const PROFESSIONAL_LEVEL_OPTIONS_MAP = - PROFESSIONAL_LEVEL_OPTIONS.reduce( - (acc, cur) => ({ ...acc, [cur.value]: cur.label }), - {}, - ); /** 学历类型 */ export const EDUCATION_TYPE_OPTIONS = [ diff --git a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js index b4d32b2..a7c311f 100644 --- a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js +++ b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js @@ -25,8 +25,6 @@ import { NS_STAFF_INFO, NS_ORG_DEPARTMENT } from "~/enumerate/namespace"; import { EDUCATION_LEVEL_OPTIONS, EDUCATION_TYPE_OPTIONS, - PERSON_TYPE_OPTIONS, - PROFESSIONAL_LEVEL_OPTIONS, QUALIFICATION_INDUSTRY_OPTIONS, REGISTER_ENGINEER_OPTIONS, TITLE_LEVEL_OPTIONS, @@ -407,12 +405,26 @@ function StaffFormModal({ ...data, }; if (data.birthDate) setFields.birthDate = dayjs(data.birthDate); - if (data.joinWorkDate) setFields.joinWorkDate = dayjs(data.joinWorkDate); + if (data.joinWorkDate) + setFields.joinWorkDate = dayjs(data.joinWorkDate); if (setFields.proofMaterialUrl) { setFields.proofMaterialUrl = JSON.parse(setFields.proofMaterialUrl); } + if (Array.isArray(setFields.titleCodeArr)) { + setFields.titleCodeArr = setFields.titleCodeArr.map((item) => { + if (item.proveUrl && typeof item.proveUrl === "string") { + try { + return { ...item, proveUrl: JSON.parse(item.proveUrl) }; + } catch { + return item; + } + } + return item; + }); + } + form.setFieldsValue(setFields); loadBasicDisciplineMajors(data.qualScope); }) @@ -461,6 +473,14 @@ function StaffFormModal({ proofMaterialUrl: Array.isArray(values.proofMaterialUrl) ? JSON.stringify(values.proofMaterialUrl) : undefined, + titleCodeArr: Array.isArray(values.titleCodeArr) + ? values.titleCodeArr.map((item) => ({ + ...item, + proveUrl: Array.isArray(item.proveUrl) + ? JSON.stringify(item.proveUrl) + : item.proveUrl, + })) + : undefined, }; if (payload.birthDate && typeof payload.birthDate !== "string") { payload.birthDate = payload.birthDate.format("YYYY-MM-DD"); @@ -478,7 +498,6 @@ function StaffFormModal({ handleCancel(); onSuccess(); } else { - } } finally { setSubmitting(false); @@ -536,7 +555,11 @@ function StaffFormModal({ - + @@ -544,12 +567,9 @@ function StaffFormModal({ - + @@ -601,18 +621,6 @@ function StaffFormModal({ - - - ({ - label: item.professionalName, - value: item.id, - }))} + options={(staffInfo?.basicDisciplineMajorList || []).map( + (item) => ({ + label: item.professionalName, + value: item.id, + }), + )} loading={staffInfo?.staffInfoLoading} disabled={!staffInfo?.basicDisciplineMajorList?.length} /> - - - - - + - + + - - - + + + + + + {(fields, { add, remove }) => ( + <> +
field.key} + pagination={false} + size="small" + bordered + locale={{ emptyText: "暂无职称信息,点击下方按钮添加" }} + columns={[ + { + title: "行业", + width: 200, + render: (_, field) => ( + + + + ), + }, + { + title: "证明材料", + render: (_, field) => ( + + ), + }, + { + title: "操作", + width: 80, + render: (_, field) => ( + + ), + }, + ]} + /> + + + )} + @@ -726,7 +835,12 @@ function StaffFormModal({ label="出版学术专著、专利、获奖、发表学术论文等" rules={[{ max: 500, message: "不能超过1000个字符" }]} > - + @@ -735,27 +849,25 @@ function StaffFormModal({ label="自我申报的专业能力及认定方式" rules={[{ max: 500, message: "不能超过1000个字符" }]} > - + - - + + - - - + - - - - - diff --git a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/StaffPickerModal.js b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/StaffPickerModal.js index ca9d64b..a6ef2d9 100644 --- a/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/StaffPickerModal.js +++ b/src/pages/Container/SafetyEvalBusiness/EvalProject/Create/StaffPickerModal.js @@ -13,7 +13,7 @@ import { import { CloseOutlined } from "@ant-design/icons"; import { NS_STAFF_INFO, NS_ORG_DEPARTMENT } from "~/enumerate/namespace"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { QUALIFICATION_INDUSTRY_OPTIONS_MAP, PROFESSIONAL_LEVEL_OPTIONS_MAP, TITLE_LEVEL_MAP } from "~/enumerate/enterpriseOptions"; +import { QUALIFICATION_INDUSTRY_OPTIONS_MAP, TITLE_LEVEL_MAP } from "~/enumerate/enterpriseOptions"; @@ -129,15 +129,7 @@ const StaffPickerModal = (props) => { return status || "-"; }, }, - { - title: "职业等级", - dataIndex: "professionalLevelCode", - ellipsis: true, - render: (code) => { - const status = PROFESSIONAL_LEVEL_OPTIONS_MAP[code]; - return status || "-"; - }, - }, + { title: "职称", dataIndex: "titleCode", From cdebb79a03382f86797dab0164d3b152cf334034 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Fri, 31 Jul 2026 17:15:16 +0800 Subject: [PATCH 2/5] feat --- .../Container/EnterpriseInfo/PersonnelInfo/List/index.js | 9 ++++++++- .../Container/Supervision/BasicInfo/OrgAccount/index.js | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js index a7c311f..b041531 100644 --- a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js +++ b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js @@ -212,6 +212,13 @@ function PersonnelInfoPage(props) { dataIndex: "certNames", ellipsis: true, render: (text) => text || "-", + }, + { + title: "能力", + width: 80, + dataIndex: "abilityNames", + ellipsis: true, + render: (text) => '暂无', }, { title: "操作", @@ -246,7 +253,7 @@ function PersonnelInfoPage(props) { goCertificate(record.id, record.userName); }} > - 证书 + 证书能力 From 430b13872f698f0e34726b25e9cba8e52d883299 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Fri, 31 Jul 2026 17:49:35 +0800 Subject: [PATCH 3/5] feat --- src/enumerate/constant/index.js | 32 +++++++++++++++++++ .../PersonnelInfo/List/index.js | 3 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index f7c2d23..adc1d11 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -481,3 +481,35 @@ export const NATIONAL_COUNTIES = (() => { }); return result; })(); + +/** 专业学科 */ +export const DISCIPLINE_OPTIONS = [ + { label: "安全", value: "SAFETY" }, + { label: "机械", value: "MECHANICAL" }, + { label: "电气", value: "ELECTRICAL" }, + { label: "采矿", value: "MINING" }, + { label: "通风", value: "VENTILATION" }, + { label: "矿建", value: "MINE_CONSTRUCTION" }, + { label: "地质", value: "GEOLOGY" }, + { label: "水工结构", value: "HYDRAULIC_STRUCTURE" }, + { label: "采油", value: "OIL_PRODUCTION" }, + { label: "储运", value: "STORAGE_AND_TRANSPORT" }, + { label: "油气储运", value: "OIL_GAS_STORAGE_TRANSPORT" }, + { label: "工艺设备与控制", value: "PROCESS_EQUIPMENT_CONTROL" }, + { label: "自动化(仪表)", value: "AUTOMATION_INSTRUMENT" }, + { label: "防腐", value: "ANTICORROSION" }, + { label: "化工工艺", value: "CHEMICAL_PROCESS" }, + { label: "化工机械", value: "CHEMICAL_MECHANICAL" }, + { label: "自动化", value: "AUTOMATION" }, + { label: "火炸药", value: "EXPLOSIVES" }, + { label: "爆炸技术", value: "EXPLOSION_TECHNOLOGY" }, + { label: "冶金", value: "METALLURGY" }, + { label: "有色金属", value: "NONFERROUS_METAL" }, + { label: "设备", value: "EQUIPMENT" }, + { label: "仪表", value: "INSTRUMENT" }, +]; + +export const DISCIPLINE_MAP = DISCIPLINE_OPTIONS.reduce((acc, cur) => { + acc[cur.value] = cur.label; + return acc; +}, {}); diff --git a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js index b041531..22a56f4 100644 --- a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js +++ b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js @@ -29,6 +29,7 @@ import { REGISTER_ENGINEER_OPTIONS, TITLE_LEVEL_OPTIONS, } from "~/enumerate/enterpriseOptions"; +import { DISCIPLINE_MAP } from "~/enumerate/constant"; import { getBirthDateFromIdCard } from "~/utils"; import { idCardRule, mobileRule } from "~/utils/validators"; import AttachmentUpload from "~/components/AttachmentUpload"; @@ -646,7 +647,7 @@ function StaffFormModal({ optionFilterProp="label" options={(staffInfo?.basicDisciplineMajorList || []).map( (item) => ({ - label: item.professionalName, + label: `${item.professionalName}(${DISCIPLINE_MAP[item.professionalCapabilityCode]})`, value: item.id, }), )} From 7ffd8a0217fae45c6e1a5dfaf9095c1b4695ee35 Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Mon, 3 Aug 2026 10:28:20 +0800 Subject: [PATCH 4/5] feat --- jjb.config.js | 4 +- src/components/StaffViewModal/index.js | 82 ++++--- src/enumerate/constant/index.js | 30 --- .../PersonnelInfo/List/index.js | 203 +++++++++++++++--- 4 files changed, 227 insertions(+), 92 deletions(-) diff --git a/jjb.config.js b/jjb.config.js index 054f850..b95671a 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -10,9 +10,9 @@ module.exports = { javaGitBranch: "dev", // 本地联调 safetyEval-service(context-path: /safetyEval,默认端口 8095) // 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095 - API_HOST: "https://gbs-gateway.qhdsafety.com", + // API_HOST: "https://gbs-gateway.qhdsafety.com", - //API_HOST: "http://192.168.0.152", + API_HOST: "http://192.168.0.134", //API_HOST: "http://192.168.0.150", //太浅 // API_HOST: "http://192.168.0.152", //API_HOST: "http://192.168.0.103", //huwei diff --git a/src/components/StaffViewModal/index.js b/src/components/StaffViewModal/index.js index cef0107..5eb3290 100644 --- a/src/components/StaffViewModal/index.js +++ b/src/components/StaffViewModal/index.js @@ -9,7 +9,10 @@ import { fetchStaffCertListByPersonnelId, } from "~/api/staffCertificate"; import { fetchOrgPersonnelDetail } from "~/utils/qualFiling/personnelHelper"; -import { QUALIFICATION_INDUSTRY_OPTIONS_MAP, TITLE_LEVEL_MAP } from "~/enumerate/enterpriseOptions"; +import { + QUALIFICATION_INDUSTRY_OPTIONS_MAP, + TITLE_LEVEL_MAP, +} from "~/enumerate/enterpriseOptions"; const GENDER_MAP = { 1: "男", 2: "女" }; const REGISTER_ENGINEER_MAP = { 1: "是", 2: "否" }; @@ -182,45 +185,30 @@ export default function StaffViewModal({ {info.account}{info.deptName}{info.postName} - - {QUALIFICATION_INDUSTRY_OPTIONS_MAP[info.qualScope] || info.qualScope || "-"} - + {info.educationTypeName || "-"} {info.educationLevelName || "-"} - - {titleCodeArr.length ? ( -
idx} - dataSource={titleCodeArr} - columns={[ - { title: "行业", dataIndex: "industryName", width: 150 }, - { title: "职称", dataIndex: "titleName", width: 100 }, - { - title: "证明材料", - dataIndex: "proveUrlList", - render: renderFileList, - }, - ]} - /> - ) : ( - "-" - )} - + {REGISTER_ENGINEER_MAP[info.registerEngineerFlag] ?? "-"} - {info.technicalDirectorFlag === true ? "是" : info.technicalDirectorFlag === false ? "否" : "-"} + {info.technicalDirectorFlag === true + ? "是" + : info.technicalDirectorFlag === false + ? "否" + : "-"} - {info.processControlLeaderFlag === true ? "是" : info.processControlLeaderFlag === false ? "否" : "-"} + {info.processControlLeaderFlag === true + ? "是" + : info.processControlLeaderFlag === false + ? "否" + : "-"} {info.idCardNo} @@ -235,7 +223,7 @@ export default function StaffViewModal({ {info.graduateSchool} - + +
+ 职称信息 +
+
idx} + dataSource={titleCodeArr} + columns={[ + { title: "行业", dataIndex: "industryName", width: 150 }, + { title: "职称", dataIndex: "titleName", width: 100 }, + { + title: "证明材料", + dataIndex: "proveUrlList", + render: renderFileList, + }, + ]} + />
证照信息 @@ -289,10 +296,10 @@ export default function StaffViewModal({ dataSource={certificates} locale={{ emptyText: "暂无证照信息" }} columns={[ - { title: "证照名称", dataIndex: "certName",ellipsis: true }, - { title: "证书编号", dataIndex: "certNo",ellipsis: true }, - { title: "证书类别", dataIndex: "certTypeName",ellipsis: true }, - { title: "发证机关", dataIndex: "issueOrg",ellipsis: true }, + { title: "证照名称", dataIndex: "certName", ellipsis: true }, + { title: "证书编号", dataIndex: "certNo", ellipsis: true }, + { title: "证书类别", dataIndex: "certTypeName", ellipsis: true }, + { title: "发证机关", dataIndex: "issueOrg", ellipsis: true }, { title: "有效开始日期", dataIndex: "validStartDate", width: 120 }, { title: "有效结束日期", dataIndex: "validEndDate", width: 120 }, { @@ -372,11 +379,16 @@ export default function StaffViewModal({ {certPreviewInfo.certAttachmentUrl && certPreviewInfo.certAttachmentUrl.split(",").map((item) => { - const isImage = /\.(png|jpe?g|gif|bmp|webp|svg)(\?|#|$)/i.test(item); + const isImage = + /\.(png|jpe?g|gif|bmp|webp|svg)(\?|#|$)/i.test(item); return (
{isImage ? ( - + ) : ( window.open(item)}>{item} )} diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index adc1d11..74d8704 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -482,34 +482,4 @@ export const NATIONAL_COUNTIES = (() => { return result; })(); -/** 专业学科 */ -export const DISCIPLINE_OPTIONS = [ - { label: "安全", value: "SAFETY" }, - { label: "机械", value: "MECHANICAL" }, - { label: "电气", value: "ELECTRICAL" }, - { label: "采矿", value: "MINING" }, - { label: "通风", value: "VENTILATION" }, - { label: "矿建", value: "MINE_CONSTRUCTION" }, - { label: "地质", value: "GEOLOGY" }, - { label: "水工结构", value: "HYDRAULIC_STRUCTURE" }, - { label: "采油", value: "OIL_PRODUCTION" }, - { label: "储运", value: "STORAGE_AND_TRANSPORT" }, - { label: "油气储运", value: "OIL_GAS_STORAGE_TRANSPORT" }, - { label: "工艺设备与控制", value: "PROCESS_EQUIPMENT_CONTROL" }, - { label: "自动化(仪表)", value: "AUTOMATION_INSTRUMENT" }, - { label: "防腐", value: "ANTICORROSION" }, - { label: "化工工艺", value: "CHEMICAL_PROCESS" }, - { label: "化工机械", value: "CHEMICAL_MECHANICAL" }, - { label: "自动化", value: "AUTOMATION" }, - { label: "火炸药", value: "EXPLOSIVES" }, - { label: "爆炸技术", value: "EXPLOSION_TECHNOLOGY" }, - { label: "冶金", value: "METALLURGY" }, - { label: "有色金属", value: "NONFERROUS_METAL" }, - { label: "设备", value: "EQUIPMENT" }, - { label: "仪表", value: "INSTRUMENT" }, -]; -export const DISCIPLINE_MAP = DISCIPLINE_OPTIONS.reduce((acc, cur) => { - acc[cur.value] = cur.label; - return acc; -}, {}); diff --git a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js index 22a56f4..c6a35c1 100644 --- a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js +++ b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js @@ -1,5 +1,6 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { + Alert, Button, DatePicker, Form, @@ -9,9 +10,12 @@ import { Row, Col, Select, + Space, Table, TreeSelect, + Upload, } from "antd"; +import { InboxOutlined } from "@ant-design/icons"; import { Get } from "@cqsjjb/jjb-common-lib/http"; import { useEffect, useRef, useState } from "react"; import dayjs from "dayjs"; @@ -29,17 +33,18 @@ import { REGISTER_ENGINEER_OPTIONS, TITLE_LEVEL_OPTIONS, } from "~/enumerate/enterpriseOptions"; -import { DISCIPLINE_MAP } from "~/enumerate/constant"; import { getBirthDateFromIdCard } from "~/utils"; import { idCardRule, mobileRule } from "~/utils/validators"; import AttachmentUpload from "~/components/AttachmentUpload"; import StaffViewModal from "~/components/StaffViewModal"; const { router } = tools; +const API_HOST = window.process?.env?.app?.API_HOST || ""; function PersonnelInfoPage(props) { const [formModalOpen, setFormModalOpen] = useState(false); const [viewModalOpen, setViewModalOpen] = useState(false); + const [importModalOpen, setImportModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); const [searchForm] = Form.useForm(); const [deptOptions, setDeptOptions] = useState([]); @@ -135,15 +140,18 @@ function PersonnelInfoPage(props) {
} extra={ - + + + + } > )} + {importModalOpen && ( + setImportModalOpen(false)} + onSuccess={handleSearch} + /> + )} ); } @@ -378,13 +393,14 @@ function StaffFormModal({ } }; - const loadBasicDisciplineMajors = async (industryCode) => { - if (!industryCode) return; - await queryBasicDisciplineMajor({ industryCode, pageSize: 999 }); + const loadBasicDisciplineMajors = async () => { + + await queryBasicDisciplineMajor({ pageSize: 999 }); }; useEffect(() => { if (open && !wasOpenRef.current) { + loadBasicDisciplineMajors(); if (!currentId) { form.resetFields(); setDeptPositionOptions([]); @@ -434,7 +450,7 @@ function StaffFormModal({ } form.setFieldsValue(setFields); - loadBasicDisciplineMajors(data.qualScope); + }) .finally(() => { if (!cancelled) setDetailLoading(false); @@ -463,7 +479,7 @@ function StaffFormModal({ } if ("qualScope" in changed) { form.setFieldValue("basicDisciplineMajorId", undefined); - loadBasicDisciplineMajors(changed.qualScope); + loadBasicDisciplineMajors(); } }; @@ -629,15 +645,7 @@ function StaffFormModal({ -
- - ({ - label: `${item.professionalName}(${DISCIPLINE_MAP[item.professionalCapabilityCode]})`, + label: `${item.professionalName}`, value: item.id, }), )} @@ -909,6 +917,151 @@ function StaffFormModal({ ); } +function StaffImportModal({ open, onCancel, onSuccess }) { + const [result, setResult] = useState(null); + const [errorMsg, setErrorMsg] = useState(""); + const [uploading, setUploading] = useState(false); + + const handleDownloadTemplate = async () => { + try { + const res = await Get("/safetyEval/org-personnel/import/template"); + const url = res?.data ; + if (!url) { + message.warning("未获取到模板下载地址"); + return; + } + const resolved = /^https?:\/\//i.test(url) + ? url + : `${window.fileUrl || API_HOST}${url}`; + const response = await fetch(resolved); + if (!response.ok) throw new Error(`HTTP ${response.status}`); + const blob = await response.blob(); + const blobUrl = window.URL.createObjectURL(blob); + const link = document.createElement("a"); + link.href = blobUrl; + link.download = "人员导入模板.xlsx"; + link.style.display = "none"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(blobUrl); + } catch (err) { + message.error(err?.message || "下载模板失败"); + } + }; + + const customRequest = async (options) => { + const { file, onSuccess: onDone, onError } = options; + setUploading(true); + setResult(null); + setErrorMsg(""); + try { + const formData = new FormData(); + formData.append("file", file); + const headers = { token: sessionStorage.getItem("token") || "" }; + const orgInfoId = sessionStorage.getItem("orgInfoId"); + if (orgInfoId) headers.orgInfoId = String(orgInfoId); + const resp = await fetch( + `${API_HOST}/safetyEval/org-personnel/import`, + { method: "POST", headers, body: formData }, + ); + const json = await resp.json(); + if (json && json.success !== false) { + onDone(json.data, file); + setResult(json.data || {}); + if ((json.data?.successCount || 0) > 0) onSuccess?.(); + } else { + onError(new Error(json?.errMessage || json?.message || "导入失败")); + setErrorMsg(json?.errMessage || json?.message || "导入失败"); + } + } catch (err) { + onError(err); + setErrorMsg(err?.message || "导入失败"); + } finally { + setUploading(false); + } + }; + + const errorList = result?.errors || []; + + return ( + 关闭} + > +
+ +
+ { + const ext = + "." + (file.name.split(".").pop() || "").toLowerCase(); + if (![".xlsx", ".xls"].includes(ext)) { + message.error("仅支持 .xlsx / .xls 格式文件"); + return Upload.LIST_IGNORE; + } + return true; + }} + onRemove={() => { + setResult(null); + setErrorMsg(""); + return true; + }} + > +

+ +

+

点击或拖拽文件到此区域上传

+

仅支持 .xlsx / .xls 格式文件

+
+ + {errorMsg && ( + + )} + {result && ( + 0 ? "warning" : "success"} + showIcon + message={`成功导入 ${result.successCount || 0} 条,失败 ${result.failCount || 0} 条`} + /> + )} + {errorList.length > 0 && ( +
i} + pagination={false} + scroll={{ y: 240 }} + dataSource={errorList} + columns={[ + { title: "行号", dataIndex: "rowIndex", width: 70 }, + { title: "账号", dataIndex: "account", ellipsis: true }, + { title: "姓名", dataIndex: "userName", ellipsis: true }, + { title: "异常原因", dataIndex: "errorMessage", ellipsis: true }, + ]} + /> + )} + + ); +} + export default Connect( [NS_STAFF_INFO, NS_ORG_DEPARTMENT], true, From 9c33047c277b99da4b979647f3b1512a43adc86c Mon Sep 17 00:00:00 2001 From: tangjie <122778500@qq.com> Date: Mon, 3 Aug 2026 15:45:58 +0800 Subject: [PATCH 5/5] fix --- jjb.config.js | 4 ++-- .../SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js | 3 ++- .../SafetyEvalBusiness/ProjectFlow/TechnicalReviewContent.js | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jjb.config.js b/jjb.config.js index b95671a..a347480 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -12,8 +12,8 @@ module.exports = { // 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095 // API_HOST: "https://gbs-gateway.qhdsafety.com", - API_HOST: "http://192.168.0.134", - //API_HOST: "http://192.168.0.150", //太浅 + // API_HOST: "http://192.168.0.134", + API_HOST: "http://192.168.0.150", //太浅 // API_HOST: "http://192.168.0.152", //API_HOST: "http://192.168.0.103", //huwei }, diff --git a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js index 6b24a21..3a98a72 100644 --- a/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js +++ b/src/pages/Container/SafetyEvalBusiness/ProjectFlow/InternalReviewContent.js @@ -57,6 +57,7 @@ const InternalReviewContent = ({ readOnly, ...props }) => { setRows( reviewItems.map((item) => ({ ...item, + reviewConclusion: item.reviewConclusion || "conform_to", _key: item.id || item.reviewDimensionCode, })), ); @@ -141,7 +142,7 @@ const InternalReviewContent = ({ readOnly, ...props }) => { width: 120, render: (val, _, idx) => (