diff --git a/jjb.config.js b/jjb.config.js index bdb244f..8e0617e 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -12,10 +12,10 @@ 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.134", //API_HOST: "http://192.168.0.150", //太浅 // API_HOST: "http://192.168.0.152", - API_HOST: "http://192.168.0.103", //huwei + //API_HOST: "http://192.168.0.103", //huwei }, production: { // 应用后端分支名称,部署上线需要 diff --git a/src/pages/Container/QualificationReview/FilingTabs/index.js b/src/pages/Container/QualificationReview/FilingTabs/index.js index 063d28d..577b2b4 100644 --- a/src/pages/Container/QualificationReview/FilingTabs/index.js +++ b/src/pages/Container/QualificationReview/FilingTabs/index.js @@ -4,7 +4,8 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { NS_QUAL_REVIEW } from "~/enumerate/namespace"; import StaffViewModal from "~/components/StaffViewModal"; import PreviewUrlButton from "~/components/PreviewUrlButton/index"; -import { QUALIFICATION_INDUSTRY_OPTIONS_MAP, TITLE_LEVEL_MAP } from "~/enumerate/enterpriseOptions"; +import { QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions"; +import { CAPABILITY_MAP, GENDER_MAP } from "~/enumerate/constant"; /** @@ -17,6 +18,17 @@ import { QUALIFICATION_INDUSTRY_OPTIONS_MAP, TITLE_LEVEL_MAP } from "~/enumerate * @param {Function} [props.onPersonnelView] - 查看人员详情回调(覆盖默认弹窗) * @param {Function} [props.onEquipView] - 查看设备详情回调 (record) => void(覆盖默认弹窗) */ +function calcAge(birthDate) { + if (!birthDate) return "-"; + const birth = new Date(birthDate); + if (isNaN(birth.getTime())) return "-"; + const now = new Date(); + let age = now.getFullYear() - birth.getFullYear(); + const m = now.getMonth() - birth.getMonth(); + if (m < 0 || (m === 0 && now.getDate() < birth.getDate())) age--; + return age >= 0 ? age : "-"; +} + const FilingTabs = ({ detail, isReview = false, @@ -27,6 +39,11 @@ const FilingTabs = ({ const [viewId, setViewId] = useState(""); + const personnelTableData = useMemo( + () => (detail?.personnelList || []).map((item) => ({ ...item, age: item.age ?? calcAge(item.birthDate) })), + [detail?.personnelList], + ); + const attachmentList = useMemo(() => { const v = detail.attachmentUrl; if (!v) return []; @@ -147,14 +164,27 @@ const FilingTabs = ({ key: "personnel", label: "4.备案人员管理", children: ( - i + 1 }, - { title: "人员姓名", dataIndex: "personName", width: 100 }, - { title: "类型", dataIndex: "personTypeName", width: 100 }, - - { title: "职称", dataIndex: "titleName", width: 100, render: (_, record) => TITLE_LEVEL_MAP[record.titleCode] ?? (record.titleCode || "-") }, - { title: "操作", width: 80, + { title: "人员姓名", dataIndex: "personName" }, + { title: "部门", dataIndex: "deptName", ellipsis: true }, + { title: "岗位", dataIndex: "positionName", ellipsis: true }, + { title: "性别", dataIndex: "genderCode", width: 70, render: (v) => GENDER_MAP[v] || "-" }, + { title: "年龄", dataIndex: "age", width: 70 }, + { title: "注册安全工程师", dataIndex: "registerEngineerFlag", width: 120, 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: "操作", width: 80, fixed: "right", render: (_, record) => (
i + 1 }, - { title: "装备名称", dataIndex: "deviceName", width: 140, ellipsis: true }, - { title: "规格型号", dataIndex: "deviceModel", width: 120, ellipsis: true }, - { title: "生产厂家", dataIndex: "manufacturer", width: 140 }, + { title: "装备名称", dataIndex: "deviceName", ellipsis: true }, + { title: "规格型号", dataIndex: "deviceModel", ellipsis: true }, + { title: "生产厂家", dataIndex: "manufacturer" }, + { title: "设备价值(元)", dataIndex: "equipmentValue", width: 150 }, { title: "计量检定情况", width: 120, - render: (_, record) => { - if (record.calibrationReportUrl) { - return 已上传; - } - return 待上传; - }, - }, - { title: "操作", width: 80, - render: (_, record) => ( - - 查看 - - ), + render: (_, record) => + record.calibrationReportUrl ? ( + 预览 + ) : ( + 待上传 + ), }, ]} /> diff --git a/src/pages/Container/index.less b/src/pages/Container/index.less index c5cee5b..2e98d21 100644 --- a/src/pages/Container/index.less +++ b/src/pages/Container/index.less @@ -9,7 +9,7 @@ } .micro-temp-modal-body { - max-height: 630px; + max-height: 66vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;