需求变更:申辩成立重新走修改

master
LiuJiaNan 2026-01-05 14:19:43 +08:00
parent d4ca975869
commit d21c39108f
5 changed files with 50 additions and 19 deletions

View File

@ -0,0 +1,7 @@
import Add from "~/pages/Container/BranchCompany/Inspection/Inspection/Add";
function Edit(props) {
return (<Add useTemporaryStorage={false} {...props} />);
}
export default Edit;

View File

@ -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 && (
<DefenseHandlingModal
id={currentId}
inspectionId={currentInspectionId}
history={props.history}
onCancel={() => {
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) {
>
<Spin spinning={downloadFileLoading || getFileLoading}>
<Table
options={false}
disabledResizer={true}
columns={[
{ title: "申辩时间", dataIndex: "createTime", width: 200 },
{ title: "申辩描述", dataIndex: "content" },
@ -258,7 +271,7 @@ function DefenseRecordModalComponent(props) {
</>
) },
{ title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && <Image src={getFileUrl() + record.signature} width={100} height={100} />) },
{ 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 && (
<Button

View File

@ -309,9 +309,9 @@ function Add(props) {
};
useEffect(() => {
if (isIdle)
if (isIdle && props.useTemporaryStorage !== false)
onSubmit(form.getFieldsValue(), 1);
}, [isIdle]);
}, [isIdle, props.useTemporaryStorage]);
return (
<Page headerTitle={query.id ? "编辑" : "新增"} isShowFooter={false}>
@ -325,14 +325,16 @@ function Add(props) {
loading={deleteFileLoading || getFileLoading || uploadFileLoading || props.inspection.inspectionLoading}
onFinish={values => onSubmit(values, 0)}
extraActionButtons={[
<Button
key="temporaryStorage"
onClick={() => {
onSubmit(form.getFieldsValue(), 1);
}}
>
暂存
</Button>,
props.useTemporaryStorage !== false && (
<Button
key="temporaryStorage"
onClick={() => {
onSubmit(form.getFieldsValue(), 1);
}}
>
暂存
</Button>
),
]}
options={[
{

View File

@ -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) {
<Descriptions
column={2}
bordered
styles={{ label: { width: 200 } }}
styles={{ label: { width: 200 }, content: { width: 500 } }}
items={[
{ label: "被检查单位", children: info.inspectedPartyConfirmation?.departmentName },
{ label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation?.userName },
@ -98,7 +100,7 @@ function InspectionView(props) {
<Descriptions
column={2}
bordered
styles={{ label: { width: 200 } }}
styles={{ label: { width: 200 }, content: { width: 500 } }}
items={
info.content.map(item =>
[

View File

@ -0,0 +1,7 @@
import Add from "~/pages/Container/BranchCompany/Inspection/Inspection/Add";
function Edit(props) {
return <Add searchType="all" source="4" useTemporaryStorage={false} {...props} />;
}
export default Edit;