diff --git a/package.json b/package.json index 90314da..d584509 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-to-print": "^3.2.0", - "zy-react-library": "^1.1.23" + "zy-react-library": "^1.1.30" }, "devDependencies": { "@antfu/eslint-config": "^5.4.1", diff --git a/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js b/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js index 10f716d..361666b 100644 --- a/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js @@ -16,9 +16,9 @@ import useGetFile from "zy-react-library/hooks/useGetFile"; import useTable from "zy-react-library/hooks/useTable"; import useUploadFile from "zy-react-library/hooks/useUploadFile"; import { getFileUrl } from "zy-react-library/utils"; -import { formatDate } from "~/utils/dateFormat"; import { INSPECTION_QUESTION_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; +import { formatDate } from "~/utils/dateFormat"; function List(props) { const [defenseHandlingModalOpen, setDefenseHandlingModalOpen] = useState(false); @@ -29,8 +29,8 @@ function List(props) { const { tableProps, getData } = useTable(props["inspectionList"], { form, transform: formData => ({ - checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "", - checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "", + checkStartTime: formData.checkTime?.[0] ? (`${formData.checkTime[0]} 00:00:00`) : "", + checkEndTime: formData.checkTime?.[1] ? (`${formData.checkTime[1]} 23:59:59`) : "", }), params: { status: "700" }, }); @@ -135,9 +135,24 @@ function List(props) { } function DefenseHandlingModalComponent(props) { + const [signature, setSignature] = useState(""); + const [form] = Form.useForm(); const { loading: uploadFileLoading, uploadFile } = useUploadFile(); + const getData = async () => { + const { data } = await props["defenseRecordList"]({ id: props.inspectionId, pageIndex: 1, pageSize: 999 }); + setSignature(data.at(-1).signature); + form.setFieldsValue({ + createTime: data.at(-1).createTime, + content: data.at(-1).content, + }); + }; + + useEffect(() => { + getData(); + }, []); + const onSubmit = async (values) => { if (values.status === "1") { props.history.push(`./edit?id=${props.id}&inspectionId=${props.inspectionId}`); @@ -180,6 +195,22 @@ function DefenseHandlingModalComponent(props) { }} onFinish={onSubmit} options={[ + { + name: "defendantSignature", + label: "申辩人", + render: (signature && ), + componentProps: { disabled: true }, + }, + { + name: "createTime", + label: "申请时间", + componentProps: { disabled: true }, + }, + { + name: "content", + label: "申请说明", + componentProps: { disabled: true }, + }, { name: "status", label: "申辩是否成立", @@ -265,18 +296,22 @@ function DefenseRecordModalComponent(props) { { title: "申辩时间", dataIndex: "createTime", width: 200 }, { title: "申辩描述", dataIndex: "content" }, { - title: "申辩状态", dataIndex: "isPass", render: (_, record) => ( + title: "申辩状态", + dataIndex: "isPass", + render: (_, record) => ( <>
{record.isPass === 0 && "未审批"}
{record.isPass === 1 && "通过"}
{record.isPass === 2 && "未通过"}
- ) + ), }, { title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && ) }, { title: "申辩附件名称", dataIndex: "name", width: 200, render: (_, record) => record.files?.[0]?.fileName || "无" }, { - title: "申辩附件", dataIndex: "url", render: (_, record) => ( + title: "申辩附件", + dataIndex: "url", + render: (_, record) => ( record.files?.[0]?.filePath && (