From a8537e42d14fa7079be58162a3547a691dc997f9 Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Tue, 31 Mar 2026 15:15:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=97=E9=99=90=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- router.md | 14 + src/api/confinedSpaceWorkLedger/index.js | 22 ++ .../HotWork/Homework/View => css}/index.less | 0 src/enumerate/constant/index.js | 4 +- src/enumerate/namespace/index.js | 1 + .../ConfinedSpaceWork/Archive/List/index.js | 7 + .../ConfinedSpaceWork/Archive/View/index.js | 7 + .../ConfinedSpaceWork/Archive/index.js | 5 + .../ForceClose/List/index.js | 7 + .../ForceClose/View/index.js | 7 + .../ConfinedSpaceWork/ForceClose/index.js | 5 + .../ConfinedSpaceWork/Homework/List/index.js | 161 +++++++++ .../ConfinedSpaceWork/Homework/View/index.js | 237 +++++++++++++ .../ConfinedSpaceWork/Homework/index.js | 5 + .../ConfinedSpaceWork/Ledger/List/index.js | 320 ++++++++++++++++++ .../ConfinedSpaceWork/Ledger/index.js | 5 + .../Enterprise/ConfinedSpaceWork/index.js | 5 + .../Enterprise/HotWork/Homework/List/index.js | 2 +- .../Enterprise/HotWork/Homework/View/index.js | 27 +- .../ConfinedSpaceWork/Archive/List/index.js | 7 + .../ConfinedSpaceWork/Archive/View/index.js | 7 + .../ConfinedSpaceWork/Archive/index.js | 5 + .../ConfinedSpaceWork/Homework/List/index.js | 7 + .../ConfinedSpaceWork/Homework/View/index.js | 7 + .../ConfinedSpaceWork/Homework/index.js | 5 + .../Stakeholder/ConfinedSpaceWork/index.js | 5 + .../ConfinedSpaceWork/List/index.js | 9 + .../ConfinedSpaceWork/RecordsList/index.js | 10 + .../Supervision/ConfinedSpaceWork/index.js | 5 + .../Supervision/HotWork/List/index.js | 2 +- 31 files changed, 893 insertions(+), 19 deletions(-) create mode 100644 src/api/confinedSpaceWorkLedger/index.js rename src/{pages/Container/Enterprise/HotWork/Homework/View => css}/index.less (100%) create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/List/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/View/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/List/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/View/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/List/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/View/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/Ledger/List/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/Ledger/index.js create mode 100644 src/pages/Container/Enterprise/ConfinedSpaceWork/index.js create mode 100644 src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/List/index.js create mode 100644 src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/View/index.js create mode 100644 src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/index.js create mode 100644 src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/List/index.js create mode 100644 src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/View/index.js create mode 100644 src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/index.js create mode 100644 src/pages/Container/Stakeholder/ConfinedSpaceWork/index.js create mode 100644 src/pages/Container/Supervision/ConfinedSpaceWork/List/index.js create mode 100644 src/pages/Container/Supervision/ConfinedSpaceWork/RecordsList/index.js create mode 100644 src/pages/Container/Supervision/ConfinedSpaceWork/index.js diff --git a/package.json b/package.json index df40b77..3ed85c2 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-to-print": "^3.3.0", - "zy-react-library": "1.2.6" + "zy-react-library": "^1.2.13" }, "devDependencies": { "@antfu/eslint-config": "^5.4.1", diff --git a/router.md b/router.md index e894032..db37e00 100644 --- a/router.md +++ b/router.md @@ -5,6 +5,14 @@ `/eightwork/container/enterprise/hotWork/archive/list` - 动火作业/关闭管理 `/eightwork/container/enterprise/hotWork/forceClose/list` +- 有限空间作业/台账管理 + `/eightwork/container/enterprise/confinedSpaceWork/ledger/list` +- 有限空间作业/作业管理 + `/eightwork/container/enterprise/confinedSpaceWork/homework/list` +- 有限空间作业/归档管理 + `/eightwork/container/enterprise/confinedSpaceWork/archive/list` +- 有限空间作业/关闭管理 + `/eightwork/container/enterprise/confinedSpaceWork/forceClose/list` ### 相关方端 @@ -12,8 +20,14 @@ `/eightwork/container/stakeholder/hotWork/homework/list` - 动火作业/归档管理 `/eightwork/container/stakeholder/hotWork/archive/list` +- 有限空间作业/作业管理 + `/eightwork/container/stakeholder/confinedSpaceWork/homework/list` +- 有限空间作业/归档管理 + `/eightwork/container/stakeholder/confinedSpaceWork/archive/list` ### 监管端 - 动火作业 `/eightwork/container/supervision/hotWork/list` +- 有限空间作业 + `/eightwork/container/supervision/confinedSpaceWork/list` diff --git a/src/api/confinedSpaceWorkLedger/index.js b/src/api/confinedSpaceWorkLedger/index.js new file mode 100644 index 0000000..00d101f --- /dev/null +++ b/src/api/confinedSpaceWorkLedger/index.js @@ -0,0 +1,22 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const confinedSpaceWorkLedgerList = declareRequest( + "confinedSpaceWorkLedgerLoading", + `Post > @/eightwork/confinedSpace/list`, +); +export const confinedSpaceWorkLedgerAdd = declareRequest( + "confinedSpaceWorkLedgerLoading", + `Post > @/eightwork/confinedSpace/save`, +); +export const confinedSpaceWorkLedgerUpdate = declareRequest( + "confinedSpaceWorkLedgerLoading", + `Put > @/eightwork/confinedSpace/edit`, +); +export const confinedSpaceWorkLedgerInfo = declareRequest( + "confinedSpaceWorkLedgerLoading", + `Get > /eightwork/confinedSpace/{id}`, +); +export const confinedSpaceWorkLedgerDelete = declareRequest( + "confinedSpaceWorkLedgerLoading", + `Delete > @/eightwork/confinedSpace/{id}`, +); diff --git a/src/pages/Container/Enterprise/HotWork/Homework/View/index.less b/src/css/index.less similarity index 100% rename from src/pages/Container/Enterprise/HotWork/Homework/View/index.less rename to src/css/index.less diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index ddd4dae..2478781 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -21,6 +21,6 @@ export const STATUS_ENUM = [ { name: "归档", bianma: "999" }, ]; export const WORK_TYPE_ENUM = [ - { name: "相关方", bianma: "1" }, - { name: "内部", bianma: "2" }, + { name: "相关方作业", bianma: "1" }, + { name: "内部作业", bianma: "2" }, ]; diff --git a/src/enumerate/namespace/index.js b/src/enumerate/namespace/index.js index 8caea58..6eeede4 100644 --- a/src/enumerate/namespace/index.js +++ b/src/enumerate/namespace/index.js @@ -6,3 +6,4 @@ import { defineNamespace } from "@cqsjjb/jjb-dva-runtime"; export const NS_GLOBAL = defineNamespace("global"); export const NS_EIGHTWORK = defineNamespace("eightwork"); +export const NS_CONFINED_SPACE_WORK_LEDGER = defineNamespace("confinedSpaceWorkLedger"); diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/List/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/List/index.js new file mode 100644 index 0000000..d004e42 --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/List/index.js @@ -0,0 +1,7 @@ +import ListPage from "../../Homework/List"; + +function List(props) { + return (); +} + +export default List; diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/View/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/View/index.js new file mode 100644 index 0000000..993dfb5 --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/View/index.js @@ -0,0 +1,7 @@ +import ViewPage from "../../Homework/View"; + +function View(props) { + return (); +} + +export default View; diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/index.js new file mode 100644 index 0000000..9050ce1 --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/Archive/index.js @@ -0,0 +1,5 @@ +function Archive(props) { + return props.children; +} + +export default Archive; diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/List/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/List/index.js new file mode 100644 index 0000000..e5348d8 --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/List/index.js @@ -0,0 +1,7 @@ +import ListPage from "../../Homework/List"; + +function List(props) { + return (); +} + +export default List; diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/View/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/View/index.js new file mode 100644 index 0000000..993dfb5 --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/View/index.js @@ -0,0 +1,7 @@ +import ViewPage from "../../Homework/View"; + +function View(props) { + return (); +} + +export default View; diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/index.js new file mode 100644 index 0000000..b345ac4 --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/ForceClose/index.js @@ -0,0 +1,5 @@ +function ForceClose(props) { + return props.children; +} + +export default ForceClose; diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/List/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/List/index.js new file mode 100644 index 0000000..05c345f --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/List/index.js @@ -0,0 +1,161 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Space } from "antd"; +import { useState } from "react"; +import Page from "zy-react-library/components/Page"; +import Search from "zy-react-library/components/Search"; +import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; +import Table from "zy-react-library/components/Table"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import useTable from "zy-react-library/hooks/useTable"; +import { getLabelName } from "zy-react-library/utils"; +import FlowModal from "~/components/FlowModal"; +import ForceTerminationModal from "~/components/ForceTerminationModal"; +import { STATUS_ENUM, WORK_TYPE_ENUM } from "~/enumerate/constant"; +import { NS_EIGHTWORK } from "~/enumerate/namespace"; +import "@xyflow/react/dist/style.css"; + +function List(props) { + // status 默认不传是作业管理,999 是归档管理,998 是强制关闭管理 + // entrance 默认不传是企业端,stakeholder 是相关方端,supervision 是监督端 + + const [form] = Search.useForm(); + const query = useGetUrlQuery(); + + const [forceTerminationModalOpen, setForceTerminationModalOpen] = useState(false); + const [flowModalOpen, setFlowModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + + const { tableProps, getData } = useTable(props["eightworkList"], { + form, + params: { eqWorkType: "confinedspace_work", corpinfoId: query.corpinfoId }, + transform: formData => ({ + geCreateTime: formData.createTime?.[0], + leCreateTime: formData.createTime?.[1], + eqStatus: props.status || formData.eqStatus, + }), + }); + + return ( + + }, + { + name: "todo", + label: "服务单位", + render: , + hidden: !(props.entrance === "stakeholder"), + }, + ]} + form={form} + onFinish={getData} + /> + getLabelName({ list: WORK_TYPE_ENUM, status: record.xgfFlag }), + }, + { title: "申请人", dataIndex: ["info", "applyUser"] }, + { title: "申请单位", dataIndex: ["info", "applyUnit"] }, + { title: "申请时间", dataIndex: ["info", "applyTime"] }, + // { title: "作业人", dataIndex: ["info", "step_1", "actUserName"] }, + // { title: "作业单位", dataIndex: ["info", "step_1", "actUserDepartmentName"] }, + { + title: "作业时间", + dataIndex: ["info", "workStartTime"], + render: (_, record) => `${record.info.workStartTime || ""}-${record.info.workEndTime || ""}`, + }, + { title: "作业内容", dataIndex: ["info", "workContent"] }, + { title: "有限空间名称", dataIndex: ["info", "limitedSpaceNameAndCode"] }, + { + title: "审核状态", + dataIndex: "status", + render: (_, record) => getLabelName({ list: STATUS_ENUM, status: record.status }), + }, + { title: "强制关闭原因", dataIndex: "todo", hidden: !(props.status === 998) }, + { + title: "操作", + fixed: "right", + width: 250, + render: (_, record) => ( + + + + {(!props.status && !props.entrance && ![998, 999].includes(record.status)) && ( + + )} + + ), + }, + ]} + {...tableProps} + /> + { + forceTerminationModalOpen && ( + { + setForceTerminationModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> + ) + } + { + flowModalOpen && ( + { + setFlowModalOpen(false); + setCurrentId(""); + }} + /> + ) + } + + ); +} + +export default Connect([NS_EIGHTWORK], true)(List); diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/View/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/View/index.js new file mode 100644 index 0000000..9d661f4 --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/View/index.js @@ -0,0 +1,237 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Divider, Image } from "antd"; +import { useEffect, useRef, useState } from "react"; +import { useReactToPrint } from "react-to-print"; +import Page from "zy-react-library/components/Page"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import { getFileUrl } from "zy-react-library/utils"; +import { NS_EIGHTWORK } from "~/enumerate/namespace"; +import "~/css/index.less"; + +function View(props) { + const query = useGetUrlQuery(); + const contentRef = useRef(null); + const handlePrint = useReactToPrint({ + contentRef, + pageStyle: `@page { + size: landscape; + margin: 0mm; + } + @media print { + body { + margin: 10px; + padding: 10px; + } + } + `, + documentTitle: "", + }); + + const [info, setInfo] = useState({}); + const [safetyMeasures, setSafetyMeasures] = useState([]); + const [otherSafetyMeasures, setOtherSafetyMeasures] = useState([]); + // const [delayedMonitoringRecord, setDelayedMonitoringRecord] = useState([]); + const [gasMonitoringRecord, setGasMonitoringRecord] = useState([]); + + const getData = async () => { + const { data: basicInfo } = await props["eightworkInfo"]({ id: query.id }); + setInfo(basicInfo); + const { data: supplementaryInfo } = await props["eightworkSupplementaryInfo"]({ eqWorkId: query.workId, pageSize: 999, pageIndex: 1 }); + // setDelayedMonitoringRecord(supplementaryInfo.filter(item => item.type === "delay")); + setGasMonitoringRecord(supplementaryInfo.filter(item => item.type === "gas")); + const { data: measuresLogs } = await props["eightworkMeasuresLogs"]({ workId: query.workId }); + setSafetyMeasures(measuresLogs.filter(item => item.type === 1)); + setOtherSafetyMeasures(measuresLogs.filter(item => item.type === 2)); + }; + + useEffect(() => { + getData(); + }, []); + + return ( + 打印 + )} + > +
+
+ + + + + + + + + + {props.entrance === "stakeholder" && ( + + + + + )} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/* */} + {/* */} + {/* */} + {/* */} + + + + + + + {gasMonitoringRecord.length > 0 && ( + + + + )} + + + + + + + + + +
+ 有限空间作业许可证 +
+ 编号: + {info.checkNo} +
服务单位{info.xx}
申请单位{info?.info?.applyUnit}作业单位{info?.info?.workUserDepartmentName}
有限空间名称及编号{info?.info?.limitedSpaceNameAndCode}作业内容{info?.info?.workContent}
主要介质{info?.info?.chooseLimitedSpace?.mediumInfo}应急装备{info?.info?.emergencyEquipment}
主要危险因素{info?.info?.chooseLimitedSpace?.hazards}
隔绝安全措施{info?.info?.isNeedWork === 1 ? "是" : "否"}
+
+
+ 作业负责人: + {info?.info?.workChargeUserName} +
+
+ 监护人: + {info?.info?.workGuardianUserName} +
+
+ 作业人: + {info?.info?.workUserName} +
+
+
预计作业时间{info?.info?.xx}
+ + + + + + + + + {safetyMeasures.map((item, index) => ( + + + + + + + ))} + +
序号主要安全措施是否涉及确认人
{index + 1}{item.content}符合 + {item.signPath && } +
+
+ + + + + + + + {otherSafetyMeasures.map((item, index) => ( + + + + + + ))} + +
序号其它安全措施确认人
{index + 1}{item.content} + {item.signPath ? : item.createName} +
+
+ + + + + + + + + + + + {gasMonitoringRecord.map((item, index) => ( + + {index === 0 && } + + + + + + + + ))} + +
作业前分析项目有毒有害物质含量可燃气含量氧气量取样时间取样位置取样人
作业前数据{item?.details?.toxicSubstanceContent}{item?.details?.combustibleGasContent}{item?.details?.oxygeAmount}{item?.details?.samplingTime}{item?.details?.samplingLocation} + {item?.details?.signImagePath && } +
+
作业单位负责人意见 +
+ {info?.info?.step_14?.signPath && } +
+
{info?.info?.step_14?.signTime}
+
管理单位发包部门意见 +
+ {info?.info?.step_15?.signPath && } +
+
{info?.info?.step_15?.signTime}
+
管理单位安监部门意见 +
+ {info?.info?.step_16?.signPath && } +
+
{info?.info?.step_16?.signTime}
+
+ +
+ ); +} + +export default Connect([NS_EIGHTWORK], true)(View); diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/index.js new file mode 100644 index 0000000..e0c86ef --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/Homework/index.js @@ -0,0 +1,5 @@ +function Homework(props) { + return props.children; +} + +export default Homework; diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/Ledger/List/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/Ledger/List/index.js new file mode 100644 index 0000000..0e6b181 --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/Ledger/List/index.js @@ -0,0 +1,320 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, message, Modal, Space } from "antd"; +import { useEffect, useRef, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import AddIcon from "zy-react-library/components/Icon/AddIcon"; +import Page from "zy-react-library/components/Page"; +import PreviewPdf from "zy-react-library/components/PreviewPdf"; +import Search from "zy-react-library/components/Search"; +import DictionarySelect from "zy-react-library/components/Select/Dictionary"; +import Table from "zy-react-library/components/Table"; +import Upload from "zy-react-library/components/Upload"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; +import useDeleteFile from "zy-react-library/hooks/useDeleteFile"; +import useDownloadFile from "zy-react-library/hooks/useDownloadFile"; +import useTable from "zy-react-library/hooks/useTable"; +import useUploadFile from "zy-react-library/hooks/useUploadFile"; +import { addingPrefixToFile, getFileName, getFileSuffix } from "zy-react-library/utils"; +import { NS_CONFINED_SPACE_WORK_LEDGER } from "~/enumerate/namespace"; + +function List(props) { + const [currentId, setCurrentId] = useState(""); + const [viewModalVisible, setViewModalVisible] = useState(false); + const [addModalVisible, setAddModalVisible] = useState(false); + + const [form] = Search.useForm(); + + const { tableProps, getData } = useTable(props["confinedSpaceWorkLedgerList"], { + form, + }); + + const onDelete = (id) => { + Modal.confirm({ + title: "删除确认", + content: "确定要删除吗?", + onOk: async () => { + const { success } = await props["confinedSpaceWorkLedgerDelete"]({ id }); + if (success) { + message.success("删除成功"); + getData(); + } + }, + }); + }; + + return ( + + ) }, + { name: "eqRiskLevel", label: "风险等级", render: () }, + ]} + form={form} + onFinish={getData} + /> + ( + + + + )} + columns={[ + { title: "有限空间名称", dataIndex: "name" }, + { title: "有限空间编号", dataIndex: "code" }, + { title: "类型", dataIndex: "typeName" }, + { title: "位置及范围", dataIndex: "positionAndRange" }, + { title: "主要介质", dataIndex: "mediumInfo" }, + { title: "主要危险及有害因素", dataIndex: "hazards" }, + { title: "风险等级", dataIndex: "riskLevelName" }, + { title: "最大作业人数", dataIndex: "maximumNumber" }, + { + title: "操作", + width: 200, + fixed: "right", + render: (_, record) => ( + + + + + + ), + }, + ]} + {...tableProps} + /> + {viewModalVisible && ( + { + setViewModalVisible(false); + setCurrentId(""); + }} + /> + )} + {addModalVisible && ( + { + setAddModalVisible(false); + setCurrentId(""); + }} + /> + )} + + ); +} + +const ViewModalComponent = (props) => { + const [info, setInfo] = useState({}); + const { downloadFile } = useDownloadFile(); + + const getData = async () => { + const { data } = await props["confinedSpaceWorkLedgerInfo"]({ id: props.id }); + setInfo(data); + }; + + useEffect(() => { + getData(); + }, []); + + return ( + 关闭, + ]} + loading={props.confinedSpaceWorkLedger.confinedSpaceWorkLedgerLoading} + > + + : ( + + {getFileName(info.emergencyBookFile)} + + + ) + : "否", + }, + ]} + /> + + ); +}; + +const AddModalComponent = (props) => { + const [form] = FormBuilder.useForm(); + + const { loading: uploadFileLoading, uploadFile } = useUploadFile(); + const { loading: deleteFileLoading, deleteFile } = useDeleteFile(); + + const infoRef = useRef({}); + + const getData = async () => { + const { data } = await props["confinedSpaceWorkLedgerInfo"]({ id: props.id }); + form.setFieldsValue({ + ...data, + emergencyBookFile: addingPrefixToFile([{ filePath: data.emergencyBookFile }]), + }); + infoRef.current = data; + }; + + useEffect(() => { + props.id && getData(); + }, []); + + const onSubmit = async (values) => { + await deleteFile({ files: values.deleteEmergencyBookFile }); + const { filePath } = await uploadFile({ files: values.emergencyBookFile, params: { type: UPLOAD_FILE_TYPE_ENUM[407] } }); + const { success } = await props[props.id ? "confinedSpaceWorkLedgerUpdate" : "confinedSpaceWorkLedgerAdd"]({ + ...infoRef.current, + ...values, + emergencyBookFile: filePath, + }); + if (success) { + message.success(`${props.id ? "编辑" : "新增"}成功`); + props.onCancel(); + props.getData(); + } + }; + + return ( + + form.setFieldValue("typeName", label)} + /> + ), + }, + { name: "typeName", label: "有限空间类型名称", onlyForLabel: true }, + { name: "positionAndRange", label: "位置及范围" }, + { name: "mediumInfo", label: "主要介质" }, + { name: "hazards", label: "主要危险及有害因素" }, + { + name: "riskLevel", + label: "风险等级", + render: ( + form.setFieldValue("riskLevelName", label)} + /> + ), + }, + { name: "riskLevelName", label: "风险等级名称", onlyForLabel: true }, + { name: "protectionRequirements", label: "防护要求" }, + { name: "separateSafetyMeasures", label: "隔绝安全措施" }, + { name: "maximumNumber", label: "最大作业人数", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { + name: "isEmergencyBook", + label: "是否有应急指导书", + render: FORM_ITEM_RENDER_ENUM.SELECT, + items: [{ bianma: 1, name: "是" }, { bianma: 2, name: "否" }], + }, + { + name: "emergencyBookFile", + label: "应急指导书", + render: ( + form.setFieldValue("deleteEmergencyBookFile", [...(form.getFieldValue("deleteEmergencyBookFile") || []), file])} + /> + ), + dependencies: ["isEmergencyBook"], + hidden: formValues => !(formValues.isEmergencyBook === 1), + }, + { name: "deleteEmergencyBookFile", label: "删除的应急指导书", onlyForLabel: true }, + ]} + form={form} + span={24} + labelCol={{ span: 10 }} + showActionButtons={false} + onFinish={onSubmit} + /> + + ); +}; + +const ViewModal = Connect([NS_CONFINED_SPACE_WORK_LEDGER], true)(ViewModalComponent); +const AddModal = Connect([NS_CONFINED_SPACE_WORK_LEDGER], true)(AddModalComponent); +export default Connect([NS_CONFINED_SPACE_WORK_LEDGER], true)(List); diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/Ledger/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/Ledger/index.js new file mode 100644 index 0000000..15b082d --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/Ledger/index.js @@ -0,0 +1,5 @@ +function Ledger(props) { + return props.children; +} + +export default Ledger; diff --git a/src/pages/Container/Enterprise/ConfinedSpaceWork/index.js b/src/pages/Container/Enterprise/ConfinedSpaceWork/index.js new file mode 100644 index 0000000..89db9ab --- /dev/null +++ b/src/pages/Container/Enterprise/ConfinedSpaceWork/index.js @@ -0,0 +1,5 @@ +function ConfinedSpaceWork(props) { + return props.children; +} + +export default ConfinedSpaceWork; diff --git a/src/pages/Container/Enterprise/HotWork/Homework/List/index.js b/src/pages/Container/Enterprise/HotWork/Homework/List/index.js index 17daf71..99a31f8 100644 --- a/src/pages/Container/Enterprise/HotWork/Homework/List/index.js +++ b/src/pages/Container/Enterprise/HotWork/Homework/List/index.js @@ -101,7 +101,7 @@ function List(props) { { title: "作业时间", dataIndex: ["info", "workStartTime"], - render: (_, record) => `${record.info.workStartTime}至${record.info.workEndTime}`, + render: (_, record) => `${record.info.workStartTime || ""}-${record.info.workEndTime || ""}`, }, { title: "作业内容", dataIndex: ["info", "workContent"] }, { diff --git a/src/pages/Container/Enterprise/HotWork/Homework/View/index.js b/src/pages/Container/Enterprise/HotWork/Homework/View/index.js index e476f1f..1ffd265 100644 --- a/src/pages/Container/Enterprise/HotWork/Homework/View/index.js +++ b/src/pages/Container/Enterprise/HotWork/Homework/View/index.js @@ -6,7 +6,7 @@ import Page from "zy-react-library/components/Page"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import { getFileUrl } from "zy-react-library/utils"; import { NS_EIGHTWORK } from "~/enumerate/namespace"; -import "./index.less"; +import "~/css/index.less"; function View(props) { const query = useGetUrlQuery(); @@ -30,17 +30,16 @@ function View(props) { const [info, setInfo] = useState({}); const [safetyMeasures, setSafetyMeasures] = useState([]); const [otherSafetyMeasures, setOtherSafetyMeasures] = useState([]); - const [delayedFireMonitoringRecord, setDelayedFireMonitoringRecord] = useState([]); - const [gasFireMonitoringRecord, setGasFireMonitoringRecord] = useState([]); + const [delayedMonitoringRecord, setDelayedMonitoringRecord] = useState([]); + const [gasMonitoringRecord, setGasMonitoringRecord] = useState([]); const getData = async () => { const { data: basicInfo } = await props["eightworkInfo"]({ id: query.id }); setInfo(basicInfo); const { data: supplementaryInfo } = await props["eightworkSupplementaryInfo"]({ eqWorkId: query.workId, pageSize: 999, pageIndex: 1 }); - setDelayedFireMonitoringRecord(supplementaryInfo.filter(item => item.type === "delay")); - setGasFireMonitoringRecord(supplementaryInfo.filter(item => item.type === "gas")); + setDelayedMonitoringRecord(supplementaryInfo.filter(item => item.type === "delay")); + setGasMonitoringRecord(supplementaryInfo.filter(item => item.type === "gas")); const { data: measuresLogs } = await props["eightworkMeasuresLogs"]({ workId: query.workId }); - console.log(measuresLogs); setSafetyMeasures(measuresLogs.filter(item => item.type === 1)); setOtherSafetyMeasures(measuresLogs.filter(item => item.type === 2)); }; @@ -111,13 +110,13 @@ function View(props) { - {gasFireMonitoringRecord.length > 0 && ( + {gasMonitoringRecord.length > 0 && ( )} { - gasFireMonitoringRecord.map(item => ( + gasMonitoringRecord.map(item => ( @@ -142,10 +141,10 @@ function View(props) {
动火监火人 {info?.info?.workMonitor}
可燃气体分析(运行的生产装置、罐区和具有火灾爆炸危险场所)
分析时间
- - - - + + + + {safetyMeasures.map((item, index) => ( @@ -164,7 +163,7 @@ function View(props) { otherSafetyMeasures.map((item, index) => (
- 其他安全措施: + 其它安全措施: {item.content}
@@ -240,7 +239,7 @@ function View(props) {
- {delayedFireMonitoringRecord.map((item, index) => ( + {delayedMonitoringRecord.map((item, index) => ( diff --git a/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/List/index.js b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/List/index.js new file mode 100644 index 0000000..cdad82e --- /dev/null +++ b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/List/index.js @@ -0,0 +1,7 @@ +import ListPage from "~/pages/Container/Enterprise/ConfinedSpaceWork/Homework/List"; + +function List(props) { + return (); +} + +export default List; diff --git a/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/View/index.js b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/View/index.js new file mode 100644 index 0000000..d628b6c --- /dev/null +++ b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/View/index.js @@ -0,0 +1,7 @@ +import ViewPage from "~/pages/Container/Enterprise/ConfinedSpaceWork/Homework/View"; + +function View(props) { + return (); +} + +export default View; diff --git a/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/index.js b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/index.js new file mode 100644 index 0000000..9050ce1 --- /dev/null +++ b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Archive/index.js @@ -0,0 +1,5 @@ +function Archive(props) { + return props.children; +} + +export default Archive; diff --git a/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/List/index.js b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/List/index.js new file mode 100644 index 0000000..bc7d00e --- /dev/null +++ b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/List/index.js @@ -0,0 +1,7 @@ +import ListPage from "~/pages/Container/Enterprise/ConfinedSpaceWork/Homework/List"; + +function List(props) { + return (); +} + +export default List; diff --git a/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/View/index.js b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/View/index.js new file mode 100644 index 0000000..d628b6c --- /dev/null +++ b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/View/index.js @@ -0,0 +1,7 @@ +import ViewPage from "~/pages/Container/Enterprise/ConfinedSpaceWork/Homework/View"; + +function View(props) { + return (); +} + +export default View; diff --git a/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/index.js b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/index.js new file mode 100644 index 0000000..e0c86ef --- /dev/null +++ b/src/pages/Container/Stakeholder/ConfinedSpaceWork/Homework/index.js @@ -0,0 +1,5 @@ +function Homework(props) { + return props.children; +} + +export default Homework; diff --git a/src/pages/Container/Stakeholder/ConfinedSpaceWork/index.js b/src/pages/Container/Stakeholder/ConfinedSpaceWork/index.js new file mode 100644 index 0000000..89db9ab --- /dev/null +++ b/src/pages/Container/Stakeholder/ConfinedSpaceWork/index.js @@ -0,0 +1,5 @@ +function ConfinedSpaceWork(props) { + return props.children; +} + +export default ConfinedSpaceWork; diff --git a/src/pages/Container/Supervision/ConfinedSpaceWork/List/index.js b/src/pages/Container/Supervision/ConfinedSpaceWork/List/index.js new file mode 100644 index 0000000..67c9d2b --- /dev/null +++ b/src/pages/Container/Supervision/ConfinedSpaceWork/List/index.js @@ -0,0 +1,9 @@ +import ListPage from "~/pages/Container/Supervision/HotWork/List"; + +function List(props) { + return ( + + ); +} + +export default List; diff --git a/src/pages/Container/Supervision/ConfinedSpaceWork/RecordsList/index.js b/src/pages/Container/Supervision/ConfinedSpaceWork/RecordsList/index.js new file mode 100644 index 0000000..ba74f5a --- /dev/null +++ b/src/pages/Container/Supervision/ConfinedSpaceWork/RecordsList/index.js @@ -0,0 +1,10 @@ +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import ListPage from "~/pages/Container/Enterprise/ConfinedSpaceWork/Homework/List"; + +function RecordsList(props) { + const query = useGetUrlQuery(); + + return (); +} + +export default RecordsList; diff --git a/src/pages/Container/Supervision/ConfinedSpaceWork/index.js b/src/pages/Container/Supervision/ConfinedSpaceWork/index.js new file mode 100644 index 0000000..89db9ab --- /dev/null +++ b/src/pages/Container/Supervision/ConfinedSpaceWork/index.js @@ -0,0 +1,5 @@ +function ConfinedSpaceWork(props) { + return props.children; +} + +export default ConfinedSpaceWork; diff --git a/src/pages/Container/Supervision/HotWork/List/index.js b/src/pages/Container/Supervision/HotWork/List/index.js index a009adb..10dca48 100644 --- a/src/pages/Container/Supervision/HotWork/List/index.js +++ b/src/pages/Container/Supervision/HotWork/List/index.js @@ -11,7 +11,7 @@ function List(props) { const { tableProps, getData } = useTable(props["eightworkRecordsList"], { form, - params: { eqWorkType: "hot_work" }, + params: { eqWorkType: props.eqWorkType || "hot_work" }, }); return (
序号安全措施是否涉及确认人序号安全措施是否涉及确认人
时间 签字照片
{item?.details?.actUserName} {item?.details?.delayHotTime}