diff --git a/src/components/StaffViewModal/index.js b/src/components/StaffViewModal/index.js index 99adb1c..b6e51a6 100644 --- a/src/components/StaffViewModal/index.js +++ b/src/components/StaffViewModal/index.js @@ -10,6 +10,7 @@ import { import { CERT_LEVEL_LABEL_BY_TYPE, CAPABILITY_MAP, + PROFESSIONAL_MAJOR_MAP, } from "~/enumerate/constant"; const GENDER_MAP = { 1: "男", 2: "女" }; @@ -71,6 +72,8 @@ export default function StaffViewModal({ const titleInfo = Array.isArray(info.titleCodeArr) ? info.titleCodeArr.map((item) => ({ titleName: TITLE_LEVEL_MAP[item.titleCode] || item.titleCode || "-", + industryName: + PROFESSIONAL_MAJOR_MAP[item.industryCode] || item.industryCode || "-", proveUrlList: parseFileList(item.proveUrl), })) : []; @@ -228,6 +231,7 @@ export default function StaffViewModal({ dataSource={titleInfo} columns={[ { title: "职称", dataIndex: "titleName", width: 120 }, + { title: "专业", dataIndex: "industryName", width: 150 }, { title: "证明材料", dataIndex: "proveUrlList", diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index 176bc5e..a09ef95 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -515,4 +515,29 @@ export const CAPABILITY_MAP = CAPABILITY_OPTIONS.reduce((acc, cur) => { return acc; }, {}); +/** 专业(职称信息) */ +export const PROFESSIONAL_MAJOR_OPTIONS = [ + { label: "安全工程", value: "SAFETY_ENGINEERING" }, + { label: "机械工程", value: "MECHANICAL_ENGINEERING" }, + { label: "化工机械", value: "CHEMICAL_MACHINERY" }, + { label: "化学工程", value: "CHEMICAL_ENGINEERING" }, + { label: "自动化/测控技术", value: "AUTOMATION" }, + { label: "电气工程", value: "ELECTRICAL_ENGINEERING" }, + { label: "采矿工程", value: "MINING_ENGINEERING" }, + { label: "通风工程", value: "VENTILATION_ENGINEERING" }, + { label: "地质工程", value: "GEOLOGICAL_ENGINEERING" }, + { label: "矿建工程", value: "MINE_CONSTRUCTION_ENGINEERING" }, + { label: "石油工程", value: "PETROLEUM_ENGINEERING" }, + { label: "油气储运工程", value: "OIL_GAS_STORAGE_TRANSPORT" }, + { label: "腐蚀与防护", value: "CORROSION_PROTECTION" }, + { label: "冶金工程", value: "METALLURGY_ENGINEERING" }, + { label: "有色金属冶金", value: "NONFERROUS_METALLURGY" }, + { label: "火炸药/爆炸技术", value: "EXPLOSIVES" }, + { label: "土木工程", value: "CIVIL_ENGINEERING" }, +]; +export const PROFESSIONAL_MAJOR_MAP = PROFESSIONAL_MAJOR_OPTIONS.reduce( + (acc, cur) => ({ ...acc, [cur.value]: cur.label }), + {}, +); + diff --git a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js index d6ff505..76d3ee9 100644 --- a/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js +++ b/src/pages/Container/EnterpriseInfo/PersonnelInfo/List/index.js @@ -14,7 +14,7 @@ import { Table, TreeSelect, Upload, - Divider, + Tag, } from "antd"; import { InboxOutlined } from "@ant-design/icons"; import { Get } from "@cqsjjb/jjb-common-lib/http"; @@ -36,8 +36,15 @@ import { ABILITY_SOURCE_OPTIONS, EVALUATOR_OPTIONS, TITLE_LEVEL_OPTIONS, + TITLE_LEVEL_MAP } from "~/enumerate/enterpriseOptions"; -import { CERT_LEVEL_OPTIONS_BY_TYPE, CAPABILITY_OPTIONS } from "~/enumerate/constant"; +import { + CERT_LEVEL_OPTIONS_BY_TYPE, + CAPABILITY_OPTIONS, + PROFESSIONAL_MAJOR_OPTIONS, + CAPABILITY_MAP, + CERT_LEVEL_LABEL_BY_TYPE +} from "~/enumerate/constant"; import { getBirthDateFromIdCard } from "~/utils"; import { idCardRule, mobileRule } from "~/utils/validators"; import AttachmentUpload from "~/components/AttachmentUpload"; @@ -46,6 +53,7 @@ import "./index.less"; const { router } = tools; const API_HOST = window.process?.env?.app?.API_HOST || ""; +const evalCertLevelMap = CERT_LEVEL_LABEL_BY_TYPE.evaluator; function PersonnelInfoPage(props) { const [formModalOpen, setFormModalOpen] = useState(false); @@ -209,26 +217,40 @@ function PersonnelInfoPage(props) { text || "-", - }, - { - title: "能力", - width: 260, - dataIndex: "abilityNames", - ellipsis: true, - render: (text) => text || "暂无", + title: "专业能力", + dataIndex: "capabilityAssessment", + render: (list) => { + if (!Array.isArray(list) || !list.length) return "-"; + return list + .map((item) => CAPABILITY_MAP[item.professionalCapabilityCode]) + .join("、"); + }, }, + { + title: "证照名称", + dataIndex: "personnelCertFilingPageCOList", + width: 280, + render: (_, record) => { + const arr = []; + if(record.registeredSafetyEngineerCert){ + arr.push({TITLE_LEVEL_MAP[record.registeredSafetyEngineerCert.certLevel]}注册安全工程师); + } + if(record.evaluatorCert){ + arr.push({evalCertLevelMap[record.evaluatorCert.certLevel]}注册安全评价师); + } + return {arr}; + }, + }, { title: "操作", width: 200, + fixed: "right", render: (_, record) => ( - + + @@ -926,13 +960,11 @@ function StaffFormModal({ - +
-
- 职称信息 -
+
职称信息
+ + +
( @@ -52,21 +50,16 @@ export default function BasicInfoStep({ form, disabled, mode }) { - - - - - - {mode!=='application' &&- - + + + - } + + {mode!=='application' &&+ + + + } + + + + + - + + + + + + + + + + + @@ -190,7 +221,7 @@ export default function BasicInfoStep({ form, disabled, mode }) { = 0 ? age : "-"; -} - export default function OrgPersonnelSelectModal(props) { const { open, onCancel, onConfirm, existingIds = [] } = props; const [searchForm] = Form.useForm(); @@ -23,7 +12,11 @@ export default function OrgPersonnelSelectModal(props) { const [viewId, setViewId] = useState(""); const [loading, setLoading] = useState(false); const [dataSource, setDataSource] = useState([]); - const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 }); + const [pagination, setPagination] = useState({ + current: 1, + pageSize: 10, + total: 0, + }); const getData = async (page = 1, pageSize = 10) => { setLoading(true); @@ -35,8 +28,13 @@ export default function OrgPersonnelSelectModal(props) { personName: values.personName || undefined, }); if (res?.success !== false) { - setDataSource((res?.data || []).map((item) => ({ ...item, age: calcAge(item.birthDate) }))); - setPagination((prev) => ({ ...prev, current: page, pageSize, total: res?.total || 0 })); + setDataSource(res?.data || []); + setPagination((prev) => ({ + ...prev, + current: page, + pageSize, + total: res?.total || 0, + })); } } catch (err) { console.warn("[OrgPersonnelSelectModal] list failed:", err); @@ -59,7 +57,9 @@ export default function OrgPersonnelSelectModal(props) { }; const handleOk = () => { - const ids = selectedRowKeys.filter((id) => !existingIds.includes(String(id))); + const ids = selectedRowKeys.filter( + (id) => !existingIds.includes(String(id)), + ); if (!ids.length) { Modal.warning({ title: "提示", content: "请选择至少一名未添加的人员" }); return; @@ -84,8 +84,18 @@ export default function OrgPersonnelSelectModal(props) { - - + +
`共 ${t} 条`, onChange: (page, pageSize) => getData(page, pageSize), }} - scroll={{ x: 1100, y: 400 }} + scroll={{ x: 800, y: 400 }} columns={[ - { title: "人员姓名", dataIndex: "personName", ellipsis: true, width: 100 }, - { title: "部门", dataIndex: "deptName", ellipsis: true, width: 150 }, - { title: "岗位", dataIndex: "positionName", ellipsis: true, width: 120 }, - { title: "性别", dataIndex: "genderCode", width: 70, render: (v) => GENDER_MAP[v] || "-" }, - { title: "年龄", dataIndex: "age", width: 70 }, - { title: "注册安全工程师", dataIndex: "registerEngineerFlag", width: 130, render: (v) => v === 1 ? "是" : "否" }, - { title: "评价师", dataIndex: "evaluatorCertNo", width: 80, render: (v) => v ? "是" : "否" }, { - title: "能力", - render: (_, record) => { - const codes = record.professionalCapabilityCodeList || []; - return codes.length - ? codes.map((code) => CAPABILITY_MAP[code] || code).join("、") - : "-"; + title: "姓名", + dataIndex: "personName", + ellipsis: true, + width: 100, + }, + { + title: "部门", + dataIndex: "deptName", + ellipsis: true, + width: 150, + }, + { + title: "岗位", + dataIndex: "positionName", + ellipsis: true, + width: 120, + }, + + { + title: "专业能力", + dataIndex: "capabilityAssessment", + render: (list) => { + if (!Array.isArray(list) || !list.length) return "-"; + return list.map((item) => CAPABILITY_MAP[item.professionalCapabilityCode] ).join("、"); + }, + }, + { + title: "证照名称", + dataIndex: "personnelCertFilingPageCOList", + width: 200, + render: (list) => { + if (!Array.isArray(list) || !list.length) return "-"; + const colorMap = { + registered_safety_engineer: "blue", + evaluator: "green", + }; + return ( + + {list.map((item) => ( + + {CERT_TYPE_MAP[item.certTypeCode] || item.certTypeCode} + + ))} + + ); }, }, { @@ -133,7 +175,13 @@ export default function OrgPersonnelSelectModal(props) { width: 80, fixed: "right", render: (_, record) => ( - + ), }, ]} diff --git a/src/pages/Container/QualApplication/FilingForm/components/PersonnelStep.jsx b/src/pages/Container/QualApplication/FilingForm/components/PersonnelStep.jsx index 6e20c1f..837d466 100644 --- a/src/pages/Container/QualApplication/FilingForm/components/PersonnelStep.jsx +++ b/src/pages/Container/QualApplication/FilingForm/components/PersonnelStep.jsx @@ -82,7 +82,7 @@ const PersonnelStep=({ { title: "注册安全工程师", dataIndex: "registerEngineerFlag", width: 120, render: (v) => v === 1 ? "是" : "否" }, { title: "评价师", dataIndex: "evaluatorCertNo", width: 80, render: (v) => v ? "是" : "否" }, { - title: "能力", + title: "专业能力", render: (_, record) => { const codes = record.professionalCapabilityCodeList || []; return codes.length