Merge branch 'dev' of http://47.92.113.182:3000/cq_anquan/safety-eval-service-frontend into dev
commit
c60fbb57e2
|
|
@ -137,6 +137,26 @@ export const CERT_TYPE_MAP = {
|
|||
evaluator: "评价师",
|
||||
};
|
||||
|
||||
/** 证书等级选项(按证书类型区分标签,后端枚举 SENIOR/MIDDLE/JUNIOR) */
|
||||
export const CERT_LEVEL_OPTIONS_BY_TYPE = {
|
||||
registered_safety_engineer: [
|
||||
{ label: "初级", value: "JUNIOR" },
|
||||
{ label: "中级", value: "MIDDLE" },
|
||||
{ label: "高级", value: "SENIOR" },
|
||||
],
|
||||
evaluator: [
|
||||
{ label: "一级", value: "SENIOR" },
|
||||
{ label: "二级", value: "MIDDLE" },
|
||||
{ label: "三级", value: "JUNIOR" },
|
||||
],
|
||||
};
|
||||
|
||||
/** 证书等级 value → label 映射(按证书类型区分标签) */
|
||||
export const CERT_LEVEL_LABEL_BY_TYPE = {
|
||||
registered_safety_engineer: { SENIOR: "高级", MIDDLE: "中级", JUNIOR: "初级" },
|
||||
evaluator: { SENIOR: "一级", MIDDLE: "二级", JUNIOR: "三级" },
|
||||
};
|
||||
|
||||
/** 风险预警中心 — 预警大类映射 */
|
||||
export const RISK_TYPE_MAP = {
|
||||
资质预警: { label: "资质预警", color: "error" },
|
||||
|
|
|
|||
|
|
@ -23,7 +23,12 @@ import { NS_STAFF_CERTIFICATE } from "~/enumerate/namespace";
|
|||
import CertPreviewImg from "~/components/CertPreviewImg";
|
||||
import AttachmentUpload from "~/components/AttachmentUpload";
|
||||
import { dateRangeRule } from "~/utils/validators";
|
||||
import { CERT_TYPE_OPTIONS, CERT_TYPE_MAP } from "~/enumerate/constant";
|
||||
import {
|
||||
CERT_TYPE_OPTIONS,
|
||||
CERT_TYPE_MAP,
|
||||
CERT_LEVEL_OPTIONS_BY_TYPE,
|
||||
CERT_LEVEL_LABEL_BY_TYPE,
|
||||
} from "~/enumerate/constant";
|
||||
import { QUALIFICATION_INDUSTRY_OPTIONS, QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions";
|
||||
|
||||
const { router } = tools;
|
||||
|
|
@ -268,6 +273,8 @@ function CertModal({
|
|||
const [uploadFileList, setUploadFileList] = useState([]);
|
||||
const [professionalCapabilityOptions, setProfessionalCapabilityOptions] =
|
||||
useState([]);
|
||||
const certTypeCode = Form.useWatch("certTypeCode", form);
|
||||
const certLevelOptions = CERT_LEVEL_OPTIONS_BY_TYPE[certTypeCode] || [];
|
||||
|
||||
const loadProfessionalCapabilities = async (industryCode) => {
|
||||
if (!industryCode) {
|
||||
|
|
@ -468,7 +475,22 @@ function CertModal({
|
|||
label="证书类型"
|
||||
rules={[{ required: true, message: "请选择证书类型" }]}
|
||||
>
|
||||
<Select placeholder="请选择证书类型" options={CERT_TYPE_OPTIONS} />
|
||||
<Select
|
||||
placeholder="请选择证书类型"
|
||||
options={CERT_TYPE_OPTIONS}
|
||||
onChange={() => form.setFieldValue("cert_level", undefined)}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="certLevel"
|
||||
label="证书等级"
|
||||
rules={[{ required: true, message: "请选择证书等级" }]}
|
||||
>
|
||||
<Select
|
||||
placeholder={certTypeCode ? "请选择证书等级" : "请先选择证书类型"}
|
||||
options={certLevelOptions}
|
||||
disabled={!certTypeCode}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
|
|
@ -583,6 +605,9 @@ function ViewModal({ open, currentId, staffCertificateInfo, onCancel }) {
|
|||
<Descriptions.Item label="证书类型">
|
||||
{CERT_TYPE_MAP[info.certTypeCode] || info.certTypeCode}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="证书等级">
|
||||
{CERT_LEVEL_LABEL_BY_TYPE[info.certTypeCode]?.[info.cert_level] || info.cert_level}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="证书类别编码">
|
||||
{info.certCategoryCode}
|
||||
</Descriptions.Item>
|
||||
|
|
|
|||
Loading…
Reference in New Issue