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",