diff --git a/src/pages/ApplicationMaterial/attachment.module.css b/src/pages/ApplicationMaterial/attachment.module.css index 93290826ed164d783ae783425a337ed8f5a7ac06..c5701e68d7ef428c59972f2395cf4097ad9cb259 100644 --- a/src/pages/ApplicationMaterial/attachment.module.css +++ b/src/pages/ApplicationMaterial/attachment.module.css @@ -23,6 +23,12 @@ justify-content: center; } +.rightBox { + display: flex; + align-items: center; + gap: 10px; +} + .noValueIcon { width: 18px; height: 18px; diff --git a/src/pages/ApplicationMaterial/attachment.tsx b/src/pages/ApplicationMaterial/attachment.tsx index d741cdd585c193cc0f4b923f3e458f2cfaaeef49..27189d9ff64dc0c6f586c43f7b33af900a1775e7 100644 --- a/src/pages/ApplicationMaterial/attachment.tsx +++ b/src/pages/ApplicationMaterial/attachment.tsx @@ -1,33 +1,96 @@ -import { Empty, Flex, Image } from "antd"; +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { Button, Empty, Flex, Image, Modal, Tag, message } from "antd"; import styles from "./attachment.module.css"; import classNames from "classnames"; import { useMemo } from "react"; import { CheckOutlined, FileUnknownOutlined } from "@ant-design/icons"; import { composeImgUrl, downloadFile } from "@/utils"; +import RenderComponent from "@/components/FormComponentRender/renderComponent"; +import service from "@/service"; -const Item = ({ label, value }: { label: string; value: string }) => { - let fileType = "none"; +const Item = ({ + label, + value, + meta, + actionObj, + mode, + update, +}: { + meta: any; + actionObj: any; + mode: string; + label: string; + value: any[]; + update: () => void; +}) => { + const getFileType = (value: string) => { + let fileType = "none"; - if (value && value.length > 0) { - const strList = value?.split(".") ?? []; - const extra = strList[strList.length - 1]; - // pdf - if (extra === "pdf") { - fileType = "pdf"; + if (value && value.length > 0) { + const strList = value?.split(".") ?? []; + const extra = strList[strList.length - 1]; + // pdf + if (extra === "pdf") { + fileType = "pdf"; + } + //img + if (extra === "jpg" || extra === "png" || extra === "jpeg") { + fileType = "img"; + } + // 其他 + else { + fileType = "other"; + } } - //img - if (extra === "jpg" || extra === "png" || extra === "jpeg") { - fileType = "img"; - } - // 其他 - else { - fileType = "other"; - } - } - /** @description 不显示没有文件类型的 */ - if (fileType === "none") { + return fileType; + }; + + const replace = () => { + let value = ""; + Modal.confirm({ + title: `补录附件${label}`, + content: ( + { + value = val; + }} + > + ), + onOk() { + const newData = [ + { + contentId: meta.fieldKey, + content: value, + + downFlag: + meta.componentType === "FileUpload" || + meta.componentType === "ImgUpload" + ? true + : false, + }, + ]; + + service.managementService + .changeFormValue({ + thingId: actionObj.thingId, + recordId: actionObj.id, + reportContents: newData, + }) + .then(() => { + update(); + message.success("替换成功"); + }); + }, + onCancel() {}, + }); + }; + + if (value?.length === 0) { return undefined; } @@ -38,43 +101,72 @@ const Item = ({ label, value }: { label: string; value: string }) => { !value?.length && styles.noItem )} > - - -
- -
-
{label}
-
- {fileType === "pdf" && ( -
{ - window.open(composeImgUrl(value)); - }} - > - pdf -
- )} - {fileType === "img" && ( - - )} - - {fileType === "other" && ( -
{ - downloadFile(composeImgUrl(value), label); + {value?.map((v, index) => { + const fileType = getFileType(v.content); + + if (typeof v.content !== "string") { + return undefined; + } + + return ( + - -
- )} -
+ +
+ +
+
{label}
+
{index > 0 && 补录}
+
+
+ {fileType === "pdf" && ( +
{ + window.open(composeImgUrl(v.content)); + }} + > + pdf +
+ )} + {fileType === "img" && ( + + )} + + {fileType === "other" && ( +
{ + downloadFile(composeImgUrl(v.content), label); + }} + > + +
+ )} + {index === 0 && mode === "edit" && ( + + )} +
+ + ); + })} ); }; @@ -82,10 +174,13 @@ const Item = ({ label, value }: { label: string; value: string }) => { type AttachmentProps = { configSource: any; data: any; + actionObj: any; + update: () => void; + mode: string; }; /** 附件列表 */ const Attachment = (props: AttachmentProps) => { - const { configSource, data } = props; + const { configSource, data, actionObj, mode, update } = props; const hasAttachmentConfig = useMemo(() => { return ( @@ -97,9 +192,9 @@ const Attachment = (props: AttachmentProps) => { ); }, [configSource]); - const findValue = (key: string) => { + const findValues = (key: string) => { const reportContents = data?.reportContents ?? []; - return reportContents.find((v: any) => v.contentId === key)?.content; + return reportContents.filter((v: any) => v.contentId === key); }; return ( @@ -109,8 +204,12 @@ const Attachment = (props: AttachmentProps) => { return ( ); })} diff --git a/src/pages/ApplicationMaterial/index.tsx b/src/pages/ApplicationMaterial/index.tsx index 7b0ae72ec33f713bb81abe96d62d6489dccdddf7..b1c7a631406b0208c4d61d11f1a827520e853b6f 100644 --- a/src/pages/ApplicationMaterial/index.tsx +++ b/src/pages/ApplicationMaterial/index.tsx @@ -85,6 +85,7 @@ const ApplicationMaterial: React.FC = (props) => { })?.label ?? "未命名文件" ); }; + console.log("mode", mode); const downloadAll = () => { let canDownload = detail?.reportContents?.filter((v: any) => { @@ -100,6 +101,10 @@ const ApplicationMaterial: React.FC = (props) => { downloadFile(composeImgUrl(v.content), findName(v.contentId)); }); }; + + const update = () => { + init(); + }; return ( = (props) => { } > - + diff --git a/src/pages/ApplicationMaterial/timeLine.tsx b/src/pages/ApplicationMaterial/timeLine.tsx index 842495e9f80c0e7ab7e5c241d1c99b2b8512be4c..a3bb3574535b5676b4cd0d1343b2d1f1c84f9775 100644 --- a/src/pages/ApplicationMaterial/timeLine.tsx +++ b/src/pages/ApplicationMaterial/timeLine.tsx @@ -2,7 +2,7 @@ import { Flex, Timeline, Image, Tag } from "antd"; import DecoratePoint from "./components/decoratePoint"; import styles from "./timeLine.module.css"; import service from "@/service"; -import { useEffect, useMemo, useState } from "react"; +import React, { useEffect, useMemo, useState } from "react"; import { composeImgUrl, downloadFile } from "@/utils"; import { FileUnknownOutlined } from "@ant-design/icons"; @@ -14,6 +14,8 @@ const ProcessTimeLine = (props: ProcessTimeLineProps) => { const [dataSource, setDataSource] = useState([]); + const [nextNodeUser, setNextNodeUser] = useState([]); + const getData = () => { if (detail?.id) { service.managementService.getExamineHistory(detail.id).then((res) => { @@ -78,6 +80,7 @@ const ProcessTimeLine = (props: ProcessTimeLineProps) => { if (extra === "pdf") { fileType = "pdf"; } + if ( extra === "jpg" || extra === "png" || @@ -134,13 +137,47 @@ const ProcessTimeLine = (props: ProcessTimeLineProps) => { }); }, [dataSource]); + const getNextNodeReviewUser = () => { + if (detail?.id) { + service.managementService.getNextNodeReviewUser(detail.id).then((res) => { + if (res.code === 200) { + setNextNodeUser(res?.data ?? []); + } + }); + } + }; + useEffect(() => { getData(); + getNextNodeReviewUser(); }, [detail]); return (
+ {location.href.includes("management") && ( +
+ {nextNodeUser.length === 0 ? ( +
审批已结束
+ ) : ( + + 等待以下用户审批: +
+ {nextNodeUser?.map((v) => ( +
{v.realName + "(" + v.mobile + ")"}
+ ))} +
+
+ )} +
+ )}
); }; diff --git a/src/pages/Management/Main/index.tsx b/src/pages/Management/Main/index.tsx index ec78bd3cd3977f2ece7ecd0fd4201f4840231eed..a8f133dec3a768d7cd4bb656d5ddd8ad22763950 100644 --- a/src/pages/Management/Main/index.tsx +++ b/src/pages/Management/Main/index.tsx @@ -63,8 +63,8 @@ const ManagementMain = () => { }); }; - const [approveShow,setApproveShow] = useState(false) - const [subjectDataShow,setSubjectDataShow] = useState(false) + const [approveShow, setApproveShow] = useState(false); + const [subjectDataShow, setSubjectDataShow] = useState(false); return (
@@ -77,8 +77,12 @@ const ManagementMain = () => { {isSuperAdmin && ( <> - - + +
setApproveShow(false)} + onClose={() => setApproveShow(false)} /> setSubjectDataShow(false)} + onClose={() => setSubjectDataShow(false)} /> ); diff --git a/src/pages/Setting/Flow/index.tsx b/src/pages/Setting/Flow/index.tsx index 0a282bfa8cd1d0a803fdb166280ac4bd0af3a3b6..f837ec85811962e305aee42c33b761d6ba0b3274 100644 --- a/src/pages/Setting/Flow/index.tsx +++ b/src/pages/Setting/Flow/index.tsx @@ -447,7 +447,7 @@ const Flow = () => { const onSave = () => { const metaData = - mode === "edit" + mode === "view" ? { ...flowMetaData.current, originalData: JSON.stringify(originalXNodesData.current), @@ -757,7 +757,7 @@ const Flow = () => {