dev-tmp1^2
tangjie 2026-08-28 18:43:14 +08:00
commit 003a848a19
3 changed files with 143 additions and 160 deletions

View File

@ -181,7 +181,7 @@ export const evalProjectMemberPage = declareRequest(
export const evalProjectEstablishedAttachSave = declareRequest(
"projectEstablishedAttachSaveLoading",
"Post > /safetyEval/institution/eval-project-member/saveProjectEstablishedAttach",
"Post > @/safetyEval/institution/eval-project-member/saveProjectEstablishedAttach",
);
export const evalProjectEstablishedAttachGet = declareRequest(

View File

@ -8,6 +8,12 @@ export const staffInfoList = declareRequest(
"staffInfoList: [] | res.data || [] & staffInfoTotal: 0 | res.total || 0",
);
export const staffInfoRegulationPage = declareRequest(
"staffInfoLoading",
"Get > /safetyEval/org-personnel/regulationPage",
"staffInfoList: [] | res.data || [] & staffInfoTotal: 0 | res.total || 0",
);
export const staffInfoDeptPersonCount = declareRequest(
"staffInfoLoading",
"Get > /safetyEval/org-personnel/deptPersonCount",

View File

@ -1,82 +1,86 @@
import { Button, Descriptions, Form, Modal, Tag, Tooltip, Table } from "antd";
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Form, Space, Table, Tag } from "antd";
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
import { useEffect, useState } from "react";
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
import SearchForm from "~/components/SearchForm";
import StaffResumeModal from "~/components/StaffResumeModal";
import { NS_ORG_INFO, NS_STAFF_INFO } from "~/enumerate/namespace";
import {
REGISTER_ENGINEER_OPTIONS,
TITLE_LEVEL_MAP,
} from "~/enumerate/enterpriseOptions";
import { CERT_LEVEL_LABEL_BY_TYPE } from "~/enumerate/constant";
import { getEvaluatorDetail, queryEvaluatorPage } from "~/mock/regulator/basicInfo";
const YES_NO_OPTIONS = [
{ label: "是", value: 1 },
{ label: "否", value: 0 },
const EMPLOYMENT_STATUS_OPTIONS = [
{ label: "在职", value: 1 },
{ label: "离职", value: 2 },
];
const STATUS_OPTIONS = [
{ label: "正常", value: "normal" },
{ label: "异常", value: "abnormal" },
];
const CERT_STATUS_COLOR = {
normal: "success",
expiring: "warning",
expired: "error",
};
const REGISTER_ENGINEER_MAP = { 1: "是", 2: "否" };
const PERSONNEL_STATUS_MAP = { 1: "正常", 2: "异常" };
const evalCertLevelMap = CERT_LEVEL_LABEL_BY_TYPE.evaluator;
function EvaluatorInfoPage(props) {
const [searchForm] = Form.useForm();
const [viewOpen, setViewOpen] = useState(false);
const [detail, setDetail] = useState(null);
const [detailLoading, setDetailLoading] = useState(false);
const [certPreview, setCertPreview] = useState(null);
const [resumeOpen, setResumeOpen] = useState(false);
const [currentId, setCurrentId] = useState("");
const [orgOptions, setOrgOptions] = useState([]);
const [dataSource, setDataSource] = useState([]);
const [total, setTotal] = useState(0);
const [loading, setLoading] = useState(false);
const [pageIndex, setPageIndex] = useState(1);
const [pageSize, setPageSize] = useState(10);
const loading = props.staffInfo?.staffInfoLoading;
const fetchData = async (page = 1, size = 10) => {
setLoading(true);
try {
const formData = searchForm.getFieldsValue();
const res = await queryEvaluatorPage({ ...formData, pageIndex: page, pageSize: size });
const res = await props.staffInfoRegulationPage({
...formData,
current: page,
size,
});
if (res?.success !== false) {
setDataSource(res?.data || []);
setTotal(res?.totalCount || 0);
setTotal(res?.total || 0);
setPageIndex(page);
setPageSize(size);
}
catch {
setDataSource([]);
setTotal(0);
}
finally {
setLoading(false);
};
const loadOrgOptions = async () => {
try {
const res = await props.registeredOrgList({ current: 1, size: 200 });
const list = res?.data || [];
setOrgOptions(
list.map((item) => ({
label:
item.unitName ||
item.orgName ||
item.name ||
item.enterpriseName ||
String(item.id),
value: String(item.id),
})),
);
} catch {
setOrgOptions([]);
}
};
useEffect(() => {
fetchData();
loadOrgOptions();
}, []);
const openDetail = async (id) => {
setViewOpen(true);
setDetailLoading(true);
const res = await getEvaluatorDetail(id);
setDetail(res?.data || null);
setDetailLoading(false);
};
const closeDetail = () => {
setViewOpen(false);
setDetail(null);
setCertPreview(null);
};
return (
<PageLayout
title={
<div>
<span>评价师信息管理</span>
<div className="pageLayout-extra">
监管端查看辖区内评价师备案及资质状态当前为 Mock 数据
监管端查看辖区内评价师备案及资质状态
</div>
</div>
}
@ -85,28 +89,44 @@ function EvaluatorInfoPage(props) {
form={searchForm}
loading={loading}
formLine={[
<Form.Item key="evaluatorName" name="evaluatorName">
<Form.Item key="userName" name="userName">
<ControlWrapper.Input label="评价师名称" allowClear placeholder="关键字搜索" />
</Form.Item>,
<Form.Item key="orgName" name="orgName">
<ControlWrapper.Input label="机构名称" allowClear placeholder="关键字搜索" />
<Form.Item key="orgId" name="orgId">
<ControlWrapper.Select
label="机构名称"
allowClear
showSearch
optionFilterProp="label"
placeholder="请选择"
options={orgOptions}
/>
</Form.Item>,
<Form.Item key="employmentStatus" name="employmentStatus">
<ControlWrapper.Select label="是否在职" allowClear placeholder="请选择" options={YES_NO_OPTIONS} />
<Form.Item key="employmentStatusCode" name="employmentStatusCode">
<ControlWrapper.Select
label="是否在职"
allowClear
placeholder="请选择"
options={EMPLOYMENT_STATUS_OPTIONS}
/>
</Form.Item>,
<Form.Item key="registerEngineerFlag" name="registerEngineerFlag">
<ControlWrapper.Select label="是否注册安全工程师" allowClear placeholder="请选择" options={YES_NO_OPTIONS} />
</Form.Item>,
<Form.Item key="status" name="status">
<ControlWrapper.Select label="状态" allowClear placeholder="请选择" options={STATUS_OPTIONS} />
<ControlWrapper.Select
label="是否注册安全工程师"
allowClear
placeholder="请选择"
options={REGISTER_ENGINEER_OPTIONS}
/>
</Form.Item>,
]}
onFinish={() => fetchData(1, 10)}
onFinish={() => fetchData(1, pageSize)}
onReset={() => fetchData(1, pageSize)}
style={{
marginBottom: '16px'
marginBottom: "16px",
}}
/>
<Table
rowKey="id"
dataSource={dataSource}
loading={loading}
pagination={{
@ -117,129 +137,86 @@ function EvaluatorInfoPage(props) {
showTotal: (t) => `${t}`,
}}
onChange={(pag) => {
setPageIndex(pag.current);
setPageSize(pag.pageSize);
fetchData(pag.current, pag.pageSize);
}}
scroll={{ y: props.scrollY }}
columns={[
{ title: "机构名称", dataIndex: "orgName", ellipsis: true },
{ title: "评价师名称", dataIndex: "evaluatorName", width: 120 },
{ title: "评价师名称", dataIndex: "userName", width: 120 },
{
title: "是否注册安全工程师",
dataIndex: "registerEngineerLabel",
dataIndex: "registerEngineerFlag",
width: 160,
render: (val) => REGISTER_ENGINEER_MAP[val] || "-",
},
{
title: "证照名称",
dataIndex: "personnelCertFilingPageCOList",
width: 280,
render: (_, record) => {
const arr = [];
if (record.registeredSafetyEngineerCert) {
arr.push(
<Tag color="blue" key="reg">
{TITLE_LEVEL_MAP[record.registeredSafetyEngineerCert.certLevel]}
注册安全工程师
</Tag>,
);
}
if (record.evaluatorCert) {
arr.push(
<Tag color="green" key="eval">
{evalCertLevelMap[record.evaluatorCert.certLevel]}
注册安全评价师
</Tag>,
);
}
return arr.length ? <Space size={4}>{arr}</Space> : "-";
},
},
{ title: "资格证书", dataIndex: "certificatesSummary", ellipsis: true },
{
title: "状态",
dataIndex: "personnelStatus",
width: 90,
render: (_, record) => {
const tag = (
<Tag color={record.status === "normal" ? "success" : "error"}>
{record.statusLabel}
render: (val) => (
<Tag color={val === 2 ? "error" : "success"}>
{PERSONNEL_STATUS_MAP[val] || "正常"}
</Tag>
);
return record.statusTip ? <Tooltip title={record.statusTip}>{tag}</Tooltip> : tag;
},
),
},
{
title: "操作",
width: 80,
render: (_, record) => (
<Button type="link" onClick={() => openDetail(record.id)}>查看</Button>
),
},
]}
/>
<Modal
open={viewOpen}
destroyOnHidden
title="评价师详细信息"
width={900}
loading={detailLoading}
cancelText="关闭"
okButtonProps={{ style: { display: "none" } }}
onCancel={closeDetail}
<Button
type="link"
onClick={() => {
setCurrentId(record.id);
setResumeOpen(true);
}}
>
{detail && (
<>
<Descriptions title="个人信息" bordered column={2} size="small" style={{ marginBottom: 16 }}>
<Descriptions.Item label="姓名">{detail.name}</Descriptions.Item>
<Descriptions.Item label="性别">{detail.gender}</Descriptions.Item>
<Descriptions.Item label="出生日期">{detail.birthDate}</Descriptions.Item>
<Descriptions.Item label="身份证号">{detail.idCard}</Descriptions.Item>
<Descriptions.Item label="学历">{detail.education}</Descriptions.Item>
<Descriptions.Item label="毕业院校">{detail.graduateSchool}</Descriptions.Item>
<Descriptions.Item label="专业">{detail.major}</Descriptions.Item>
</Descriptions>
<Descriptions title="机构信息" bordered column={2} size="small" style={{ marginBottom: 16 }}>
<Descriptions.Item label="所在机构">{detail.orgName}</Descriptions.Item>
<Descriptions.Item label="部门">{detail.deptName}</Descriptions.Item>
<Descriptions.Item label="岗位">{detail.positionName}</Descriptions.Item>
<Descriptions.Item label="账号">{detail.account}</Descriptions.Item>
</Descriptions>
<div style={{ marginBottom: 8, fontWeight: 600 }}>资质证照</div>
<Table
size="small"
bordered
rowKey="id"
pagination={false}
dataSource={detail.certificates || []}
columns={[
{ title: "证书名称", dataIndex: "certName" },
{ title: "证书编号", dataIndex: "certNo" },
{ title: "发证日期", dataIndex: "issueDate", width: 110 },
{ title: "有效期至", dataIndex: "expireDate", width: 110 },
{
title: "状态",
width: 90,
render: (_, record) => {
const tag = (
<Tag color={CERT_STATUS_COLOR[record.status] || "default"}>
{record.statusLabel}
</Tag>
);
return record.statusTip ? <Tooltip title={record.statusTip}>{tag}</Tooltip> : tag;
},
},
{
title: "操作",
width: 90,
render: (_, record) => (
<Button type="link" size="small" onClick={() => setCertPreview(record)}>
查看证书
查看
</Button>
),
},
]}
/>
</>
)}
</Modal>
<Modal
open={!!certPreview}
destroyOnHidden
title="证书预览"
width={520}
cancelText="关闭"
okButtonProps={{ style: { display: "none" } }}
onCancel={() => setCertPreview(null)}
>
{certPreview && (
<Descriptions bordered column={1} size="small">
<Descriptions.Item label="证书名称">{certPreview.certName}</Descriptions.Item>
<Descriptions.Item label="证书编号">{certPreview.certNo}</Descriptions.Item>
<Descriptions.Item label="发证日期">{certPreview.issueDate}</Descriptions.Item>
<Descriptions.Item label="有效期至">{certPreview.expireDate}</Descriptions.Item>
<Descriptions.Item label="状态">{certPreview.statusLabel}</Descriptions.Item>
</Descriptions>
{resumeOpen && (
<StaffResumeModal
open={resumeOpen}
currentId={currentId}
onCancel={() => {
setResumeOpen(false);
setCurrentId("");
}}
/>
)}
</Modal>
</PageLayout>
);
}
export default AntdTableFuncControl(EvaluatorInfoPage);
export default Connect(
[NS_STAFF_INFO, NS_ORG_INFO],
true,
)(AntdTableFuncControl(EvaluatorInfoPage));