Merge branch 'dev' into dev_1.0.1
commit
4fdc3f5d43
|
|
@ -231,10 +231,10 @@ export default function StaffViewModal({
|
|||
dataSource={certificates}
|
||||
locale={{ emptyText: "暂无证照信息" }}
|
||||
columns={[
|
||||
{ title: "证照名称", dataIndex: "certName" },
|
||||
{ title: "证书编号", dataIndex: "certNo" },
|
||||
{ title: "证书类别", dataIndex: "certTypeName" },
|
||||
{ title: "发证机关", dataIndex: "issueOrg" },
|
||||
{ title: "证照名称", dataIndex: "certName",ellipsis: true },
|
||||
{ title: "证书编号", dataIndex: "certNo",ellipsis: true },
|
||||
{ title: "证书类别", dataIndex: "certTypeName",ellipsis: true },
|
||||
{ title: "发证机关", dataIndex: "issueOrg",ellipsis: true },
|
||||
{ title: "有效开始日期", dataIndex: "validStartDate", width: 120 },
|
||||
{ title: "有效结束日期", dataIndex: "validEndDate", width: 120 },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ function OrgPersonnelSelectModalInner(props) {
|
|||
current: page,
|
||||
size: pageSize,
|
||||
userName: values.staffName || undefined,
|
||||
employmentStatusCode: 1,
|
||||
});
|
||||
if (res?.success !== false) {
|
||||
setDataSource(res?.data || []);
|
||||
|
|
|
|||
|
|
@ -4,10 +4,12 @@ import {
|
|||
Col,
|
||||
DatePicker,
|
||||
Form,
|
||||
Image,
|
||||
Input,
|
||||
InputNumber,
|
||||
Row,
|
||||
Select,
|
||||
Modal,
|
||||
Spin,
|
||||
Table,
|
||||
Tabs,
|
||||
|
|
@ -18,7 +20,6 @@ import {
|
|||
import dayjs from "dayjs";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import FilePreviewModal from "~/components/FilePreviewModal";
|
||||
import {
|
||||
fetchRegisteredOrgDetail,
|
||||
fetchRegisteredOrgPersonnelList,
|
||||
|
|
@ -108,9 +109,7 @@ function isImageUrl(url) {
|
|||
}
|
||||
|
||||
function MaterialsTab({ materialGroups, loading, onPreview }) {
|
||||
if (loading) {
|
||||
return <Spin />;
|
||||
}
|
||||
|
||||
const groups = Object.entries(materialGroups || {}).map(
|
||||
([code, list], index) => {
|
||||
const items = Array.isArray(list) ? list : [];
|
||||
|
|
@ -190,6 +189,7 @@ function MaterialsTab({ materialGroups, loading, onPreview }) {
|
|||
>
|
||||
<Table
|
||||
size="small"
|
||||
loading={loading}
|
||||
bordered
|
||||
rowKey="id"
|
||||
pagination={false}
|
||||
|
|
@ -244,7 +244,7 @@ function PersonnelTab({ personnel, loading, onView }) {
|
|||
record.qualScope ||
|
||||
"-",
|
||||
},
|
||||
{ title: "学历", dataIndex: "educationName", width: 80 },
|
||||
{ title: "学历", dataIndex: "educationLevelName", width: 80 },
|
||||
{
|
||||
title: "注册安全工程师",
|
||||
width: 120,
|
||||
|
|
@ -285,7 +285,7 @@ function RegisteredOrgDetailPage(props) {
|
|||
const [orgName, setOrgName] = useState("");
|
||||
const [materialGroups, setMaterialGroups] = useState({});
|
||||
const [personnel, setPersonnel] = useState([]);
|
||||
const [filePreview, setFilePreview] = useState(null);
|
||||
const [previewImages, setPreviewImages] = useState([]);
|
||||
const [viewPersonnelId, setViewPersonnelId] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -596,16 +596,14 @@ function RegisteredOrgDetailPage(props) {
|
|||
materialGroups={materialGroups}
|
||||
loading={extrasLoading}
|
||||
onPreview={(record) => {
|
||||
const url = resolvePreviewUrl(record?.previewUrl);
|
||||
if (!url) {
|
||||
const urlStr = record?.previewUrl;
|
||||
if (!urlStr) {
|
||||
message.warning("该材料暂无可预览的附件");
|
||||
return;
|
||||
}
|
||||
if (isImageUrl(url)) {
|
||||
setFilePreview(record);
|
||||
} else {
|
||||
window.open(url, "_blank");
|
||||
}
|
||||
const urls = String(urlStr)
|
||||
?.split(",");
|
||||
setPreviewImages(urls || []);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
|
|
@ -630,13 +628,25 @@ function RegisteredOrgDetailPage(props) {
|
|||
</p>
|
||||
<Tabs items={tabItems} />
|
||||
|
||||
<FilePreviewModal
|
||||
open={!!filePreview}
|
||||
title="文件预览"
|
||||
fileName={filePreview?.name}
|
||||
url={resolvePreviewUrl(filePreview?.previewUrl)}
|
||||
onCancel={() => setFilePreview(null)}
|
||||
<Modal
|
||||
open={previewImages.length > 0}
|
||||
title="材料预览"
|
||||
width={750}
|
||||
footer={null}
|
||||
onCancel={() => setPreviewImages([])}
|
||||
>
|
||||
<Image.PreviewGroup>
|
||||
<div style={{ display: "flex", flexWrap: "wrap", gap: 12 }}>
|
||||
{previewImages.map((url, idx) => (
|
||||
<Image
|
||||
key={idx}
|
||||
src={url}
|
||||
width={220}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</Image.PreviewGroup>
|
||||
</Modal>
|
||||
|
||||
{viewPersonnelId && (
|
||||
<StaffViewModal
|
||||
|
|
|
|||
Loading…
Reference in New Issue