Merge branch 'dev-tmp1' of http://47.92.113.182:3000/cq_anquan/safety-eval-service-frontend into dev-tmp1
commit
003a848a19
|
|
@ -181,7 +181,7 @@ export const evalProjectMemberPage = declareRequest(
|
||||||
|
|
||||||
export const evalProjectEstablishedAttachSave = declareRequest(
|
export const evalProjectEstablishedAttachSave = declareRequest(
|
||||||
"projectEstablishedAttachSaveLoading",
|
"projectEstablishedAttachSaveLoading",
|
||||||
"Post > /safetyEval/institution/eval-project-member/saveProjectEstablishedAttach",
|
"Post > @/safetyEval/institution/eval-project-member/saveProjectEstablishedAttach",
|
||||||
);
|
);
|
||||||
|
|
||||||
export const evalProjectEstablishedAttachGet = declareRequest(
|
export const evalProjectEstablishedAttachGet = declareRequest(
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,12 @@ export const staffInfoList = declareRequest(
|
||||||
"staffInfoList: [] | res.data || [] & staffInfoTotal: 0 | res.total || 0",
|
"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(
|
export const staffInfoDeptPersonCount = declareRequest(
|
||||||
"staffInfoLoading",
|
"staffInfoLoading",
|
||||||
"Get > /safetyEval/org-personnel/deptPersonCount",
|
"Get > /safetyEval/org-personnel/deptPersonCount",
|
||||||
|
|
@ -46,4 +52,4 @@ export const queryBasicDisciplineMajor = declareRequest(
|
||||||
"staffInfoLoading",
|
"staffInfoLoading",
|
||||||
"Get > /safetyEval/basic-discipline-major",
|
"Get > /safetyEval/basic-discipline-major",
|
||||||
"basicDisciplineMajorList: [] | res.data || []",
|
"basicDisciplineMajorList: [] | res.data || []",
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -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 { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
|
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
|
||||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||||
import SearchForm from "~/components/SearchForm";
|
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 EMPLOYMENT_STATUS_OPTIONS = [
|
||||||
|
{ label: "在职", value: 1 },
|
||||||
const YES_NO_OPTIONS = [
|
{ label: "离职", value: 2 },
|
||||||
{ label: "是", value: 1 },
|
|
||||||
{ label: "否", value: 0 },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const STATUS_OPTIONS = [
|
const REGISTER_ENGINEER_MAP = { 1: "是", 2: "否" };
|
||||||
{ label: "正常", value: "normal" },
|
const PERSONNEL_STATUS_MAP = { 1: "正常", 2: "异常" };
|
||||||
{ label: "异常", value: "abnormal" },
|
const evalCertLevelMap = CERT_LEVEL_LABEL_BY_TYPE.evaluator;
|
||||||
];
|
|
||||||
|
|
||||||
const CERT_STATUS_COLOR = {
|
|
||||||
normal: "success",
|
|
||||||
expiring: "warning",
|
|
||||||
expired: "error",
|
|
||||||
};
|
|
||||||
|
|
||||||
function EvaluatorInfoPage(props) {
|
function EvaluatorInfoPage(props) {
|
||||||
const [searchForm] = Form.useForm();
|
const [searchForm] = Form.useForm();
|
||||||
const [viewOpen, setViewOpen] = useState(false);
|
const [resumeOpen, setResumeOpen] = useState(false);
|
||||||
const [detail, setDetail] = useState(null);
|
const [currentId, setCurrentId] = useState("");
|
||||||
const [detailLoading, setDetailLoading] = useState(false);
|
const [orgOptions, setOrgOptions] = useState([]);
|
||||||
const [certPreview, setCertPreview] = useState(null);
|
|
||||||
const [dataSource, setDataSource] = useState([]);
|
const [dataSource, setDataSource] = useState([]);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
const [pageIndex, setPageIndex] = useState(1);
|
const [pageIndex, setPageIndex] = useState(1);
|
||||||
const [pageSize, setPageSize] = useState(10);
|
const [pageSize, setPageSize] = useState(10);
|
||||||
|
|
||||||
|
const loading = props.staffInfo?.staffInfoLoading;
|
||||||
|
|
||||||
const fetchData = async (page = 1, size = 10) => {
|
const fetchData = async (page = 1, size = 10) => {
|
||||||
setLoading(true);
|
const formData = searchForm.getFieldsValue();
|
||||||
try {
|
const res = await props.staffInfoRegulationPage({
|
||||||
const formData = searchForm.getFieldsValue();
|
...formData,
|
||||||
const res = await queryEvaluatorPage({ ...formData, pageIndex: page, pageSize: size });
|
current: page,
|
||||||
|
size,
|
||||||
|
});
|
||||||
|
if (res?.success !== false) {
|
||||||
setDataSource(res?.data || []);
|
setDataSource(res?.data || []);
|
||||||
setTotal(res?.totalCount || 0);
|
setTotal(res?.total || 0);
|
||||||
|
setPageIndex(page);
|
||||||
|
setPageSize(size);
|
||||||
}
|
}
|
||||||
catch {
|
};
|
||||||
setDataSource([]);
|
|
||||||
setTotal(0);
|
const loadOrgOptions = async () => {
|
||||||
}
|
try {
|
||||||
finally {
|
const res = await props.registeredOrgList({ current: 1, size: 200 });
|
||||||
setLoading(false);
|
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(() => {
|
useEffect(() => {
|
||||||
fetchData();
|
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 (
|
return (
|
||||||
<PageLayout
|
<PageLayout
|
||||||
title={
|
title={
|
||||||
<div>
|
<div>
|
||||||
<span>评价师信息管理</span>
|
<span>评价师信息管理</span>
|
||||||
<div className="pageLayout-extra">
|
<div className="pageLayout-extra">
|
||||||
监管端查看辖区内评价师备案及资质状态(当前为 Mock 数据)。
|
监管端查看辖区内评价师备案及资质状态。
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -85,28 +89,44 @@ function EvaluatorInfoPage(props) {
|
||||||
form={searchForm}
|
form={searchForm}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
formLine={[
|
formLine={[
|
||||||
<Form.Item key="evaluatorName" name="evaluatorName">
|
<Form.Item key="userName" name="userName">
|
||||||
<ControlWrapper.Input label="评价师名称" allowClear placeholder="关键字搜索" />
|
<ControlWrapper.Input label="评价师名称" allowClear placeholder="关键字搜索" />
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="orgName" name="orgName">
|
<Form.Item key="orgId" name="orgId">
|
||||||
<ControlWrapper.Input label="机构名称" allowClear placeholder="关键字搜索" />
|
<ControlWrapper.Select
|
||||||
|
label="机构名称"
|
||||||
|
allowClear
|
||||||
|
showSearch
|
||||||
|
optionFilterProp="label"
|
||||||
|
placeholder="请选择"
|
||||||
|
options={orgOptions}
|
||||||
|
/>
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="employmentStatus" name="employmentStatus">
|
<Form.Item key="employmentStatusCode" name="employmentStatusCode">
|
||||||
<ControlWrapper.Select label="是否在职" allowClear placeholder="请选择" options={YES_NO_OPTIONS} />
|
<ControlWrapper.Select
|
||||||
|
label="是否在职"
|
||||||
|
allowClear
|
||||||
|
placeholder="请选择"
|
||||||
|
options={EMPLOYMENT_STATUS_OPTIONS}
|
||||||
|
/>
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="registerEngineerFlag" name="registerEngineerFlag">
|
<Form.Item key="registerEngineerFlag" name="registerEngineerFlag">
|
||||||
<ControlWrapper.Select label="是否注册安全工程师" allowClear placeholder="请选择" options={YES_NO_OPTIONS} />
|
<ControlWrapper.Select
|
||||||
</Form.Item>,
|
label="是否注册安全工程师"
|
||||||
<Form.Item key="status" name="status">
|
allowClear
|
||||||
<ControlWrapper.Select label="状态" allowClear placeholder="请选择" options={STATUS_OPTIONS} />
|
placeholder="请选择"
|
||||||
|
options={REGISTER_ENGINEER_OPTIONS}
|
||||||
|
/>
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
]}
|
]}
|
||||||
onFinish={() => fetchData(1, 10)}
|
onFinish={() => fetchData(1, pageSize)}
|
||||||
|
onReset={() => fetchData(1, pageSize)}
|
||||||
style={{
|
style={{
|
||||||
marginBottom: '16px'
|
marginBottom: "16px",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Table
|
<Table
|
||||||
|
rowKey="id"
|
||||||
dataSource={dataSource}
|
dataSource={dataSource}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
|
@ -117,129 +137,86 @@ function EvaluatorInfoPage(props) {
|
||||||
showTotal: (t) => `共 ${t} 条`,
|
showTotal: (t) => `共 ${t} 条`,
|
||||||
}}
|
}}
|
||||||
onChange={(pag) => {
|
onChange={(pag) => {
|
||||||
setPageIndex(pag.current);
|
|
||||||
setPageSize(pag.pageSize);
|
|
||||||
fetchData(pag.current, pag.pageSize);
|
fetchData(pag.current, pag.pageSize);
|
||||||
}}
|
}}
|
||||||
scroll={{ y: props.scrollY }}
|
scroll={{ y: props.scrollY }}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "机构名称", dataIndex: "orgName", ellipsis: true },
|
{ title: "机构名称", dataIndex: "orgName", ellipsis: true },
|
||||||
{ title: "评价师名称", dataIndex: "evaluatorName", width: 120 },
|
{ title: "评价师名称", dataIndex: "userName", width: 120 },
|
||||||
{
|
{
|
||||||
title: "是否注册安全工程师",
|
title: "是否注册安全工程师",
|
||||||
dataIndex: "registerEngineerLabel",
|
dataIndex: "registerEngineerFlag",
|
||||||
width: 160,
|
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: "状态",
|
title: "状态",
|
||||||
|
dataIndex: "personnelStatus",
|
||||||
width: 90,
|
width: 90,
|
||||||
render: (_, record) => {
|
render: (val) => (
|
||||||
const tag = (
|
<Tag color={val === 2 ? "error" : "success"}>
|
||||||
<Tag color={record.status === "normal" ? "success" : "error"}>
|
{PERSONNEL_STATUS_MAP[val] || "正常"}
|
||||||
{record.statusLabel}
|
</Tag>
|
||||||
</Tag>
|
),
|
||||||
);
|
|
||||||
return record.statusTip ? <Tooltip title={record.statusTip}>{tag}</Tooltip> : tag;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
width: 80,
|
width: 80,
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<Button type="link" onClick={() => openDetail(record.id)}>查看</Button>
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentId(record.id);
|
||||||
|
setResumeOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</Button>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Modal
|
{resumeOpen && (
|
||||||
open={viewOpen}
|
<StaffResumeModal
|
||||||
destroyOnHidden
|
open={resumeOpen}
|
||||||
title="评价师详细信息"
|
currentId={currentId}
|
||||||
width={900}
|
onCancel={() => {
|
||||||
loading={detailLoading}
|
setResumeOpen(false);
|
||||||
cancelText="关闭"
|
setCurrentId("");
|
||||||
okButtonProps={{ style: { display: "none" } }}
|
}}
|
||||||
onCancel={closeDetail}
|
/>
|
||||||
>
|
)}
|
||||||
{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>
|
|
||||||
)}
|
|
||||||
</Modal>
|
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AntdTableFuncControl(EvaluatorInfoPage);
|
export default Connect(
|
||||||
|
[NS_STAFF_INFO, NS_ORG_INFO],
|
||||||
|
true,
|
||||||
|
)(AntdTableFuncControl(EvaluatorInfoPage));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue