bug fix
parent
15968e6434
commit
c91abbf6a8
|
|
@ -5,6 +5,7 @@ import {
|
|||
REGISTER_ENGINEER_CATEGORY_MAP,
|
||||
ABILITY_SOURCE_MAP,
|
||||
TITLE_LEVEL_MAP,
|
||||
QUALIFICATION_INDUSTRY_OPTIONS_MAP,
|
||||
} from "~/enumerate/enterpriseOptions";
|
||||
import {
|
||||
CERT_LEVEL_LABEL_BY_TYPE,
|
||||
|
|
@ -88,6 +89,7 @@ export default function StaffViewModal({
|
|||
|
||||
const capabilityList = Array.isArray(info.capabilityAssessment)
|
||||
? info.capabilityAssessment.map((item) => ({
|
||||
industryCode: item.industryCode,
|
||||
capabilityName:
|
||||
CAPABILITY_MAP[item.professionalCapabilityCode] ||
|
||||
item.professionalCapabilityCode ||
|
||||
|
|
@ -264,7 +266,20 @@ export default function StaffViewModal({
|
|||
dataSource={capabilityList}
|
||||
locale={{ emptyText: "暂无专业能力信息" }}
|
||||
columns={[
|
||||
{ title: "专业能力", dataIndex: "capabilityName" },
|
||||
{
|
||||
title: "行业",
|
||||
dataIndex: "industryCode",
|
||||
width: 220,
|
||||
ellipsis: true,
|
||||
render: (code) =>
|
||||
QUALIFICATION_INDUSTRY_OPTIONS_MAP[code] || code || "-",
|
||||
},
|
||||
{
|
||||
title: "专业能力",
|
||||
dataIndex: "capabilityName",
|
||||
width: 80,
|
||||
ellipsis: true,
|
||||
},
|
||||
{ title: "来源", dataIndex: "sourceName", width: 280 },
|
||||
]}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ import {
|
|||
ABILITY_SOURCE_OPTIONS,
|
||||
EVALUATOR_OPTIONS,
|
||||
TITLE_LEVEL_OPTIONS,
|
||||
TITLE_LEVEL_MAP
|
||||
TITLE_LEVEL_MAP,
|
||||
QUALIFICATION_INDUSTRY_OPTIONS,
|
||||
} from "~/enumerate/enterpriseOptions";
|
||||
import {
|
||||
CERT_LEVEL_OPTIONS_BY_TYPE,
|
||||
|
|
@ -501,6 +502,28 @@ function StaffFormModal({
|
|||
const watchedEvaluatorFlag = Form.useWatch("evaluatorFlag", form);
|
||||
const wasOpenRef = useRef(false);
|
||||
const inflightDeptRef = useRef(null);
|
||||
const [capOptionsCache, setCapOptionsCache] = useState({});
|
||||
const watchedCapList = Form.useWatch("capabilityAssessment", form);
|
||||
|
||||
const loadCapOptions = async (code) => {
|
||||
if (!code || capOptionsCache[code]) return;
|
||||
try {
|
||||
const res = await Get("/safetyEval/industry-professional-standards", {
|
||||
industryCode: code,
|
||||
pageSize: 999,
|
||||
});
|
||||
const list = res?.data || [];
|
||||
setCapOptionsCache((prev) => ({
|
||||
...prev,
|
||||
[code]: list.map((item) => ({
|
||||
label: item.professionalCapabilityName,
|
||||
value: item.professionalCapabilityCode,
|
||||
})),
|
||||
}));
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
};
|
||||
|
||||
const loadPositionsByDept = async (deptId) => {
|
||||
const id = deptId;
|
||||
|
|
@ -543,6 +566,7 @@ function StaffFormModal({
|
|||
if (!currentId) {
|
||||
form.resetFields();
|
||||
setDeptPositionOptions([]);
|
||||
setCapOptionsCache({});
|
||||
form.setFieldsValue({
|
||||
registerEngineerFlag: 2,
|
||||
});
|
||||
|
|
@ -550,6 +574,7 @@ function StaffFormModal({
|
|||
}
|
||||
if (!open) {
|
||||
setDeptPositionOptions([]);
|
||||
setCapOptionsCache({});
|
||||
}
|
||||
wasOpenRef.current = open;
|
||||
}, [open, currentId, form]);
|
||||
|
|
@ -610,6 +635,18 @@ function StaffFormModal({
|
|||
}
|
||||
|
||||
form.setFieldsValue(setFields);
|
||||
|
||||
// 从已有的专业能力数据中恢复各行的行业选项
|
||||
if (Array.isArray(setFields.capabilityAssessment)) {
|
||||
const codes = [
|
||||
...new Set(
|
||||
setFields.capabilityAssessment
|
||||
.map((item) => item.industryCode)
|
||||
.filter(Boolean),
|
||||
),
|
||||
];
|
||||
codes.forEach((code) => loadCapOptions(code));
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
if (!cancelled) setDetailLoading(false);
|
||||
|
|
@ -1159,22 +1196,54 @@ function StaffFormModal({
|
|||
bordered
|
||||
columns={[
|
||||
{
|
||||
title: "专业能力",
|
||||
title: "行业",
|
||||
width: 200,
|
||||
render: (_, field) => (
|
||||
<Form.Item
|
||||
name={[field.name, "professionalCapabilityCode"]}
|
||||
name={[field.name, "industryCode"]}
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择专业能力"
|
||||
placeholder="请选择行业"
|
||||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
allowClear
|
||||
options={CAPABILITY_OPTIONS}
|
||||
options={QUALIFICATION_INDUSTRY_OPTIONS}
|
||||
onChange={(code) => {
|
||||
if (code) loadCapOptions(code);
|
||||
form.setFieldValue(
|
||||
["capabilityAssessment", field.name, "professionalCapabilityCode"],
|
||||
undefined,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "专业能力",
|
||||
render: (_, field) => {
|
||||
const rowIndustryCode =
|
||||
watchedCapList?.[field.name]?.industryCode;
|
||||
const rowOptions = rowIndustryCode
|
||||
? capOptionsCache[rowIndustryCode] || []
|
||||
: CAPABILITY_OPTIONS;
|
||||
return (
|
||||
<Form.Item
|
||||
name={[field.name, "professionalCapabilityCode"]}
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<Select
|
||||
placeholder="请选择专业能力"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
allowClear
|
||||
options={rowOptions}
|
||||
/>
|
||||
</Form.Item>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "来源",
|
||||
width: 280,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { Button, Form, Input, Modal, Table, Tag, Space } from "antd";
|
|||
import { useEffect, useState } from "react";
|
||||
import { apiGet } from "~/utils/enterpriseInfo/http";
|
||||
import { CAPABILITY_MAP, CERT_TYPE_MAP } from "~/enumerate/constant";
|
||||
import { QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions";
|
||||
import StaffViewModal from "~/components/StaffViewModal";
|
||||
|
||||
export default function OrgPersonnelSelectModal(props) {
|
||||
|
|
@ -121,7 +122,7 @@ export default function OrgPersonnelSelectModal(props) {
|
|||
showTotal: (t) => `共 ${t} 条`,
|
||||
onChange: (page, pageSize) => getData(page, pageSize),
|
||||
}}
|
||||
scroll={{ x: 800, y: 400 }}
|
||||
scroll={{ x: 1000, y: 400 }}
|
||||
columns={[
|
||||
{
|
||||
title: "姓名",
|
||||
|
|
@ -145,15 +146,28 @@ export default function OrgPersonnelSelectModal(props) {
|
|||
{
|
||||
title: "专业能力",
|
||||
dataIndex: "capabilityAssessment",
|
||||
ellipsis: true,
|
||||
width: 260,
|
||||
render: (list) => {
|
||||
if (!Array.isArray(list) || !list.length) return "-";
|
||||
return list.map((item) => CAPABILITY_MAP[item.professionalCapabilityCode] ).join("、");
|
||||
return list
|
||||
.map((item) => {
|
||||
const cap =
|
||||
CAPABILITY_MAP[item.professionalCapabilityCode];
|
||||
if (!cap) return null;
|
||||
const industry = item.industryCode
|
||||
? QUALIFICATION_INDUSTRY_OPTIONS_MAP[item.industryCode]
|
||||
: null;
|
||||
return industry ? `${industry}【${cap}】` : cap;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("、");
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "证照名称",
|
||||
dataIndex: "personnelCertFilingPageCOList",
|
||||
width: 200,
|
||||
|
||||
render: (list) => {
|
||||
if (!Array.isArray(list) || !list.length) return "-";
|
||||
const colorMap = {
|
||||
|
|
@ -161,7 +175,7 @@ export default function OrgPersonnelSelectModal(props) {
|
|||
evaluator: "green",
|
||||
};
|
||||
return (
|
||||
<Space size={4}>
|
||||
<Space size={4} wrap>
|
||||
{list.map((item) => (
|
||||
<Tag key={item.id} color={colorMap[item.certTypeCode]}>
|
||||
{CERT_TYPE_MAP[item.certTypeCode] || item.certTypeCode}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { useState } from "react";
|
|||
import { CAPABILITY_MAP, CERT_LEVEL_LABEL_BY_TYPE } from "~/enumerate/constant";
|
||||
import {
|
||||
TITLE_LEVEL_MAP,
|
||||
QUALIFICATION_INDUSTRY_OPTIONS_MAP,
|
||||
} from "~/enumerate/enterpriseOptions";
|
||||
import StaffViewModal from "~/components/StaffViewModal";
|
||||
import OrgPersonnelSelectModal from "./OrgPersonnelSelectModal";
|
||||
|
|
@ -113,11 +114,17 @@ const PersonnelStep = ({ personnelList = [], disabled, onAdd, onRemove, manageme
|
|||
render: (list) => {
|
||||
if (!Array.isArray(list) || !list.length) return "-";
|
||||
return list
|
||||
.map(
|
||||
(item) =>
|
||||
.map((item) => {
|
||||
const cap =
|
||||
CAPABILITY_MAP[item.professionalCapabilityCode] ||
|
||||
item.professionalCapabilityCode,
|
||||
)
|
||||
item.professionalCapabilityCode;
|
||||
if (!cap) return null;
|
||||
const industry = item.industryCode
|
||||
? QUALIFICATION_INDUSTRY_OPTIONS_MAP[item.industryCode]
|
||||
: null;
|
||||
return industry ? `${industry}【${cap}】` : cap;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("、");
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -203,12 +203,24 @@ const FilingTabs = ({
|
|||
capList = [];
|
||||
}
|
||||
}
|
||||
const codes =
|
||||
r.professionalCapabilityCodeList ||
|
||||
(Array.isArray(capList)
|
||||
? capList.map((c) => (typeof c === "string" ? c : c?.professionalCapabilityCode)).filter(Boolean)
|
||||
: []) ||
|
||||
[];
|
||||
// 优先使用 capabilityAssessment 对象(含行业信息)
|
||||
if (Array.isArray(capList) && capList.length) {
|
||||
const labels = capList
|
||||
.map((c) => {
|
||||
if (typeof c === "string") {
|
||||
return CAPABILITY_MAP[c] || c;
|
||||
}
|
||||
const cap = CAPABILITY_MAP[c?.professionalCapabilityCode] || c?.professionalCapabilityCode;
|
||||
if (!cap) return null;
|
||||
const industry = c?.industryCode
|
||||
? QUALIFICATION_INDUSTRY_OPTIONS_MAP[c.industryCode]
|
||||
: null;
|
||||
return industry ? `${industry}【${cap}】` : cap;
|
||||
})
|
||||
.filter(Boolean);
|
||||
if (labels.length) return labels.join("、");
|
||||
}
|
||||
const codes = r.professionalCapabilityCodeList || [];
|
||||
return codes.length
|
||||
? codes.map((code) => CAPABILITY_MAP[code] || code).join("、")
|
||||
: "-";
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ const EvalReportLibrary = (props) => {
|
|||
uploadForm.setFieldsValue({
|
||||
reportYear: dayjs().year(),
|
||||
evalTypeCode: "PRE",
|
||||
|
||||
|
||||
secretLevelCode: "NORMAL",
|
||||
issueDate: dayjs(),
|
||||
submitToRegulator: 0,
|
||||
|
|
@ -1108,7 +1108,6 @@ const EvalReportLibrary = (props) => {
|
|||
<span>报告编号不得重复</span>
|
||||
<span>报告须完成签字盖章</span>
|
||||
<span>分类信息用于监管抽查检索</span>
|
||||
<span>涉密内容须先完成脱密处理</span>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,23 @@
|
|||
import { useEffect, useRef, useState } from "react";
|
||||
import { CAPABILITY_MAP } from "~/enumerate/constant";
|
||||
import { QUALIFICATION_INDUSTRY_OPTIONS_MAP } from "~/enumerate/enterpriseOptions";
|
||||
|
||||
/** 渲染专业能力列表,供表格 column render 使用 */
|
||||
export function renderCapabilityList(list) {
|
||||
if (!Array.isArray(list) || !list.length) return "-";
|
||||
return list
|
||||
.map((item) => CAPABILITY_MAP[item.professionalCapabilityCode])
|
||||
.filter(Boolean)
|
||||
.join("、") || "-";
|
||||
return (
|
||||
list
|
||||
.map((item) => {
|
||||
const cap = CAPABILITY_MAP[item.professionalCapabilityCode];
|
||||
if (!cap) return null;
|
||||
const industry = item.industryCode
|
||||
? QUALIFICATION_INDUSTRY_OPTIONS_MAP[item.industryCode]
|
||||
: null;
|
||||
return industry ? `${industry}【${cap}】` : cap;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("、") || "-"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue