diff --git a/src/pages/Container/BranchCompany/Inspection/Defense/Edit/index.js b/src/pages/Container/BranchCompany/Inspection/Defense/Edit/index.js new file mode 100644 index 0000000..e5dcbea --- /dev/null +++ b/src/pages/Container/BranchCompany/Inspection/Defense/Edit/index.js @@ -0,0 +1,7 @@ +import Add from "~/pages/Container/BranchCompany/Inspection/Inspection/Add"; + +function Edit(props) { + return (); +} + +export default Edit; diff --git a/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js b/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js index 15651e3..237be35 100644 --- a/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js @@ -23,6 +23,7 @@ function List(props) { const [defenseHandlingModalOpen, setDefenseHandlingModalOpen] = useState(false); const [defenseRecordModalOpen, setDefenseRecordModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); + const [currentInspectionId, setCurrentInspectionId] = useState(""); const [form] = Form.useForm(); const { tableProps, getData } = useTable(props["inspectionList"], { form, @@ -86,6 +87,7 @@ function List(props) { onClick={() => { setDefenseHandlingModalOpen(true); setCurrentId(record.id); + setCurrentInspectionId(record.inspectionId); }} > 申辩处理 @@ -109,6 +111,8 @@ function List(props) { {defenseHandlingModalOpen && ( { setDefenseHandlingModalOpen(false); setCurrentId(""); @@ -134,6 +138,10 @@ function DefenseHandlingModalComponent(props) { const { loading: uploadFileLoading, uploadFile } = useUploadFile(); const onSubmit = async (values) => { + if (values.status === "1") { + props.history.push(`./edit?id=${props.id}&inspectionId=${props.inspectionId}`); + return; + } let signature = ""; if (values.signature) { const { filePath } = await uploadFile({ @@ -164,8 +172,11 @@ function DefenseHandlingModalComponent(props) { loading={uploadFileLoading || props.inspection.defenseLoading} form={form} span={24} - labelCol={{ span: 10 }} + labelCol={{ span: 12 }} showActionButtons={false} + values={{ + status: "2", + }} onFinish={onSubmit} options={[ { @@ -247,6 +258,8 @@ function DefenseRecordModalComponent(props) { > ) }, { title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && ) }, - { title: "申辩附件名称", dataIndex: "name", width: 200,render: (_, record) => record.files?.[0]?.fileName || "无" }, + { title: "申辩附件名称", dataIndex: "name", width: 200, render: (_, record) => record.files?.[0]?.fileName || "无" }, { title: "申辩附件", dataIndex: "url", render: (_, record) => ( record.files?.[0]?.filePath && ( , + props.useTemporaryStorage !== false && ( + + ), ]} options={[ { diff --git a/src/pages/Container/BranchCompany/InspectionView/index.js b/src/pages/Container/BranchCompany/InspectionView/index.js index 0a23a66..bbd4f5a 100644 --- a/src/pages/Container/BranchCompany/InspectionView/index.js +++ b/src/pages/Container/BranchCompany/InspectionView/index.js @@ -52,11 +52,13 @@ function InspectionView(props) { const getData = async () => { const { data } = await props["inspectionView"]({ inspectionId: query.id }); for (let i = 0; i < data.content.length; i++) { - const files = await getFile({ - eqType: UPLOAD_FILE_TYPE_ENUM["140"], - eqForeignKey: data.content[i].contentId, - }); - data.content[i].files = files; + if (data.content[i].contentId) { + const files = await getFile({ + eqType: UPLOAD_FILE_TYPE_ENUM["140"], + eqForeignKey: data.content[i].contentId, + }); + data.content[i].files = files; + } } data.inspectorVerificationList.forEach((item) => { setCurrentInspectorUserName(prev => [...prev, item.userName || ""]); @@ -80,7 +82,7 @@ function InspectionView(props) { [ diff --git a/src/pages/Container/Supervision/Inspection/Defense/Edit/index.js b/src/pages/Container/Supervision/Inspection/Defense/Edit/index.js new file mode 100644 index 0000000..7594843 --- /dev/null +++ b/src/pages/Container/Supervision/Inspection/Defense/Edit/index.js @@ -0,0 +1,7 @@ +import Add from "~/pages/Container/BranchCompany/Inspection/Inspection/Add"; + +function Edit(props) { + return ; +} + +export default Edit;