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: ( -