@@ -72,71 +43,30 @@ function List(props) {
render: FORM_ITEM_RENDER_ENUM.SELECT,
items: INSPECTION_QUESTION_ENUM,
},
- { name: "inspectionOriginatorUserName", label: "检查发起人" },
{ name: "inspectionDeptId", label: "检查部门", render:
},
- { name: "inspectionUserName", label: "检查人员" },
+ { name: "inspectionUserName", label: "检查人" },
{ name: "type", label: "检查类型", render:
},
+ { name: "checkTime", label: "检查时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
{ name: "inspectedDepartmentId", label: "被检查单位", render:
},
{ name: "inspectedUserName", label: "被检查单位现场负责人" },
- { name: "status", label: "检查状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: INSPECTION_STATE_ENUM },
- { name: "checkYear", label: "检查年度", render: FORM_ITEM_RENDER_ENUM.DATE_YEAR },
- { name: "checkTime", label: "检查时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
]}
form={form}
onFinish={getData}
/>
-
-
- 安全检查总数:
- {count.safetyCount}
-
-
- 环保检查总数:
- {count.environmentalCount}
-
-
- 综合检查总数:
- {count.comprehensiveCount}
-
-
- 涉及隐患总数:
- {count.hiddenCount}
-
-
-
- )}
toolBarRender={() => (
- }
- onClick={() => {
- props.history.push("./add");
- }}
- >
- 新增
-
- }
- onClick={() => {
- }}
- >
- 导出
-
+ {query.edit !== "0" && (
+ }
+ onClick={() => {
+ props.history.push("./add");
+ }}
+ >
+ 新增
+
+ )}
)}
columns={[
@@ -153,7 +83,7 @@ function List(props) {
dataIndex: "status",
render: (_, record) => (getLabelName({ list: INSPECTION_STATE_ENUM, status: record.status })),
},
- { title: "计划属性", dataIndex: "todo", render: (_, record) => getLabelName({ list: PLAN_ENUM, status: record.todo }) },
+ { title: "计划属性", dataIndex: "planType", render: (_, record) => getLabelName({ list: PLAN_ENUM, status: record.planType }) },
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
{
title: "操作",
@@ -171,8 +101,16 @@ function List(props) {
编辑
)}
+
{
- record.status !== -1 && (
+ (query.edit === "0" && record.status !== -1) && (
)
}
-
-
),
},
@@ -207,7 +130,7 @@ function List(props) {
/>
{
flowModalOpen && (
- {
setFlowModalOpen(false);
@@ -220,74 +143,4 @@ function List(props) {
);
}
-function FlowModalComponent(props) {
- const [nodes, setNodes] = useState([]);
- const [edges, setEdges] = useState([]);
-
- const getData = async () => {
- const { data } = await props["inspectionFlowchart"]({ id: props.id });
-
- // 定义type的顺序
- const typeOrder = [100, 200, 300, 600, 700, 400, 500];
-
- // 根据type顺序对flowCOList进行排序
- const sortedFlowList = [...data.flowCOList].sort((a, b) => {
- const indexA = typeOrder.indexOf(a.type);
- const indexB = typeOrder.indexOf(b.type);
- // 如果type不在预定义顺序中,放到最后
- return (indexA === -1 ? Infinity : indexA) - (indexB === -1 ? Infinity : indexB);
- });
-
- const { nodes, edges } = getFlowData(sortedFlowList, data.thisFlow);
- setNodes(nodes);
- setEdges(edges);
- };
-
- useEffect(() => {
- getData();
- }, []);
-
- return (
- 取消,
- ]}
- >
-
-
-
-
-
-
-
-
- );
-}
-
-const FlowModal = Connect([NS_INSPECTION], true)(FlowModalComponent);
export default Connect([NS_INSPECTION], true)(List);
diff --git a/src/pages/Container/BranchCompany/Inspection/Records/List/index.js b/src/pages/Container/BranchCompany/Inspection/Records/List/index.js
new file mode 100644
index 0000000..f0b320e
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Inspection/Records/List/index.js
@@ -0,0 +1,226 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+
+import { Button, Form, message, Modal, Space, Spin } from "antd";
+import { useEffect, useState } from "react";
+import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
+import Search from "zy-react-library/components/Search";
+import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
+import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary";
+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 InspectionFlowModal from "~/components/InspectionFlowModal";
+import { INSPECTION_QUESTION_ENUM, INSPECTION_STATE_ENUM, PLAN_ENUM } from "~/enumerate/constant";
+import { NS_INSPECTION } from "~/enumerate/namespace";
+import "@xyflow/react/dist/style.css";
+
+function List(props) {
+ const query = useGetUrlQuery();
+
+ const [flowModalOpen, setFlowModalOpen] = useState(false);
+ const [currentId, setCurrentId] = useState("");
+ const [count, setCount] = useState({
+ inspectCount: 0,
+ hiddenCount: 0,
+ safetyCount: 0,
+ environmentalCount: 0,
+ });
+
+ const [form] = Form.useForm();
+
+ const { tableProps, getData } = useTable(props["inspectionList"], {
+ form,
+ transform: formData => ({
+ checkStartTime: formData.checkTime?.[0],
+ checkEndTime: formData.checkTime?.[1],
+ }),
+ params: {
+ status: "",
+ entrance: "0",
+ corpId: query.corpId,
+ checkStartTime: query.checkStartTime,
+ checkEndTime: query.checkEndTime,
+ planType: query.planType,
+ },
+ });
+ const getCount = async () => {
+ const { data } = await props["inspectionCount"]({
+ status: "",
+ entrance: "0",
+ corpId: query.corpId,
+ checkStartTime: query.checkStartTime || form.getFieldValue("checkTime")?.[0],
+ checkEndTime: query.checkEndTime || form.getFieldValue("checkTime").checkTime?.[1],
+ planType: query.planType,
+ });
+ setCount(data);
+ };
+ useEffect(() => {
+ getCount();
+ }, []);
+
+ const onDelete = (id) => {
+ Modal.confirm({
+ title: "删除确认",
+ content: "是否确认删除?删除后连带隐患同时删除。",
+ onOk: async () => {
+ const { success } = await props["inspectionDelete"]({ id });
+ if (success) {
+ message.success("删除成功");
+ getData();
+ }
+ },
+ });
+ };
+
+ return (
+
+
},
+ { name: "inspectionUserName", label: "检查人" },
+ { name: "type", label: "检查类型", render:
},
+ { name: "inspectedDepartmentId", label: "被检查单位", render:
},
+ { name: "inspectedUserName", label: "被检查单位现场负责人" },
+ { name: "status", label: "检查状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: INSPECTION_STATE_ENUM },
+ { name: "checkYear", label: "检查年度", render: FORM_ITEM_RENDER_ENUM.DATE_YEAR },
+ { name: "checkTime", label: "检查时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
+ { name: "planType", label: "计划属性", render: FORM_ITEM_RENDER_ENUM.SELECT, items: PLAN_ENUM },
+ ]}
+ form={form}
+ onFinish={getData}
+ />
+
+
+
+ 安全检查总数:
+ {count.safetyCount}
+
+
+ 环保检查总数:
+ {count.environmentalCount}
+
+
+ 综合检查总数:
+ {count.comprehensiveCount}
+
+
+ 涉及隐患总数:
+ {count.hiddenCount}
+
+
+
+ )}
+ toolBarRender={() => (
+
+ {query.entrance !== "statistics" && (
+ }
+ onClick={() => {
+ }}
+ >
+ 导出
+
+ )}
+
+ )}
+ columns={[
+ { title: "检查题目", dataIndex: "subject" },
+ { title: "检查发起人", dataIndex: "inspectionOriginatorUserName" },
+ { title: "检查部门", dataIndex: "inspectionDepartmentName" },
+ { title: "检查人", dataIndex: "inspectionInspectorUserName" },
+ { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
+ { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
+ { title: "检查类型", dataIndex: "typeName" },
+ { title: "检查时间", width: 200, render: (_, record) => (`${record.timeStart}至${record.timeEnd}`) },
+ {
+ title: "检查状态",
+ dataIndex: "status",
+ render: (_, record) => (getLabelName({ list: INSPECTION_STATE_ENUM, status: record.status })),
+ },
+ { title: "计划属性", dataIndex: "planType", render: (_, record) => getLabelName({ list: PLAN_ENUM, status: record.planType }) },
+ { title: "发现隐患数", dataIndex: "hiddenNumber" },
+ {
+ title: "操作",
+ fixed: "right",
+ width: 200,
+ render: (_, record) => (
+
+ {
+ record.status !== -1 && (
+
+ )
+ }
+
+ {query.entrance !== "statistics" && (
+
+ )}
+
+ ),
+ },
+ ]}
+ {...tableProps}
+ />
+ {
+ flowModalOpen && (
+ {
+ setFlowModalOpen(false);
+ setCurrentId("");
+ }}
+ />
+ )
+ }
+
+ );
+}
+
+export default Connect([NS_INSPECTION], true)(List);
diff --git a/src/pages/Container/BranchCompany/Inspection/Records/index.js b/src/pages/Container/BranchCompany/Inspection/Records/index.js
new file mode 100644
index 0000000..21aae43
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Inspection/Records/index.js
@@ -0,0 +1,9 @@
+function Records(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Records;
diff --git a/src/pages/Container/BranchCompany/InspectionView/index.js b/src/pages/Container/BranchCompany/InspectionView/index.js
index cf7fd1c..8d160ee 100644
--- a/src/pages/Container/BranchCompany/InspectionView/index.js
+++ b/src/pages/Container/BranchCompany/InspectionView/index.js
@@ -1,6 +1,5 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime";
-import { ReactFlow, ReactFlowProvider } from "@xyflow/react";
-import { Button, Descriptions, Divider, message, Modal, Space, Spin } from "antd";
+import { Button, Descriptions, Divider, Modal, Space, Spin } from "antd";
import { useEffect, useRef, useState } from "react";
import { useReactToPrint } from "react-to-print";
import HeaderBack from "zy-react-library/components/HeaderBack";
@@ -12,9 +11,9 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
import { getFileUrl, getLabelName } from "zy-react-library/utils";
+import HiddenFlowModal from "~/components/HiddenFlowModal";
import { PLAN_ENUM } from "~/enumerate/constant";
import { NS_INSPECTION } from "~/enumerate/namespace";
-import { getFlowData } from "~/utils/flow";
import "./index.less";
function InspectionView(props) {
@@ -84,15 +83,15 @@ function InspectionView(props) {
bordered
styles={{ label: { width: 200 } }}
items={[
- { label: "被检查单位", children: info.inspectedPartyConfirmation.departmentName },
- { label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation.userName },
- { label: "牵头检查部门", children: info.currentInspectorUser.departmentName },
- { label: "检查人", children: info.currentInspectorUser.userName },
+ { label: "被检查单位", children: info.inspectedPartyConfirmation?.departmentName },
+ { label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation?.userName },
+ { label: "牵头检查部门", children: info.currentInspectorUser?.departmentName },
+ { label: "检查人", children: info.currentInspectorUser?.userName },
{ label: "检查类型", children: info.typeName },
{ label: "检查时间", children: `${info.timeStart}至${info.timeEnd}` },
{ label: "检查场所", children: info.place, span: 2 },
- { label: "计划属性", children: getLabelName({ list: PLAN_ENUM, status: info.todo1 }), span: 2 },
- { label: "计划名称", children: info.todo2, span: 2 },
+ { label: "计划属性", children: getLabelName({ list: PLAN_ENUM, status: info.planType }), span: 2 },
+ ...(info.planType === 1 ? [{ label: "计划名称", children: info.planName, span: 2 }] : []),
{ label: "记录填写时间", children: info.createTime, span: 2 },
]}
/>
@@ -229,7 +228,7 @@ function InspectionView(props) {
/>
)}
{flowModalOpen && (
- {
setFlowModalOpen(false);
@@ -258,68 +257,4 @@ function HiddenViewModal(props) {
);
}
-function FlowModalComponent(props) {
- const [nodes, setNodes] = useState([]);
- const [edges, setEdges] = useState([]);
-
- const getData = async () => {
- const { success, data } = await props["hiddenFlowchart"]({ id: props.id });
- if (success) {
- const { nodes, edges } = getFlowData(data.flowCOList, data.thisFlow);
- setNodes(nodes);
- setEdges(edges);
- }
- else {
- message.error("获取数据失败");
- props.onCancel();
- }
- };
- useEffect(() => {
- getData();
- }, []);
-
- return (
- 取消,
- ]}
- >
-
-
-
-
-
-
-
-
- );
-}
-
-const FlowModal = Connect([NS_INSPECTION], true)(FlowModalComponent);
-
export default Connect([NS_INSPECTION], true)(InspectionView);
diff --git a/src/pages/Container/BranchCompany/Plan/Execute/List/index.js b/src/pages/Container/BranchCompany/Plan/Execute/List/index.js
new file mode 100644
index 0000000..25a027f
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/Execute/List/index.js
@@ -0,0 +1,176 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, Form, Modal, Space } from "antd";
+import dayjs from "dayjs";
+import { useState } from "react";
+import Search from "zy-react-library/components/Search";
+import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
+import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary";
+import Table from "zy-react-library/components/Table";
+import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
+import useTable from "zy-react-library/hooks/useTable";
+import { NS_PLAN } from "~/enumerate/namespace";
+
+function List(props) {
+ const [planExecutionPersonnelModalOpen, setPlanExecutionPersonnelModalOpen] = useState(false);
+ const [currentId, setCurrentId] = useState("");
+
+ const [form] = Form.useForm();
+ const { tableProps, getData } = useTable(props["planList"], {
+ form,
+ });
+
+ return (
+
+
),
+ },
+ { name: "planName", label: "计划名称" },
+ { name: "startTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE },
+ { name: "endTime", label: "计划结束时间", render: FORM_ITEM_RENDER_ENUM.DATE },
+ ]}
+ form={form}
+ onFinish={getData}
+ />
+
(
+
+ ),
+ },
+ {
+ title: "计划状态",
+ dataIndex: "status",
+ render: (_, record) => {
+ const { planExecuteTotal, userExecuteNum, planStartTime, planEndTime } = record;
+ const currentTime = dayjs();
+
+ let statusText = "";
+
+ if (planExecuteTotal === userExecuteNum && planExecuteTotal > 0) {
+ statusText = "已完成";
+ }
+ else if (currentTime.isBefore(planStartTime, "day")) {
+ statusText = "未开始";
+ }
+ else if ((currentTime.isAfter(planStartTime, "day") || currentTime.isSame(planStartTime, "day"))
+ && (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) {
+ statusText = "执行中";
+ }
+
+ return statusText;
+ },
+ },
+ {
+ title: "操作",
+ fixed: "right",
+ width: 200,
+ render: (_, record) => {
+ const { planStartTime, planEndTime } = record;
+ const currentTime = dayjs();
+ const isInProgress = (currentTime.isAfter(planStartTime, "day") || currentTime.isSame(planStartTime, "day"))
+ && (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"));
+ return (
+
+ {isInProgress && (
+
+ )}
+
+
+ );
+ },
+ },
+ ]}
+ {...tableProps}
+ />
+ {
+ planExecutionPersonnelModalOpen && (
+ {
+ setPlanExecutionPersonnelModalOpen(false);
+ setCurrentId("");
+ }}
+ />
+ )
+ }
+
+ );
+}
+
+const PlanExecutionPersonnelModalComponent = (props) => {
+ const [form] = Form.useForm();
+ const { tableProps, getData } = useTable(props["planUserList"], {
+ form,
+ params: { planId: props.id },
+ useStorageQueryCriteria: false,
+ });
+
+ return (
+ 取消,
+ ]}
+ >
+ },
+ { name: "userName", label: "人员" },
+ ]}
+ form={form}
+ onFinish={getData}
+ />
+
+
+ );
+};
+
+const PlanExecutionPersonnelModal = Connect([NS_PLAN], true)(PlanExecutionPersonnelModalComponent);
+export default Connect([NS_PLAN], true)(List);
diff --git a/src/pages/Container/BranchCompany/Plan/Execute/index.js b/src/pages/Container/BranchCompany/Plan/Execute/index.js
new file mode 100644
index 0000000..d7f1f91
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/Execute/index.js
@@ -0,0 +1,9 @@
+function Execute(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Execute;
diff --git a/src/pages/Container/BranchCompany/Plan/Management/List/index.js b/src/pages/Container/BranchCompany/Plan/Management/List/index.js
new file mode 100644
index 0000000..29fd3df
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/Management/List/index.js
@@ -0,0 +1,402 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, Form, message, Modal, Space } from "antd";
+import dayjs from "dayjs";
+import { useEffect, useState } from "react";
+import FormBuilder from "zy-react-library/components/FormBuilder";
+import AddIcon from "zy-react-library/components/Icon/AddIcon";
+import Search from "zy-react-library/components/Search";
+import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
+import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary";
+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 useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
+import useTable from "zy-react-library/hooks/useTable";
+import { getLabelName, validatorEndTime } from "zy-react-library/utils";
+import { NS_PLAN } from "~/enumerate/namespace";
+import ViewInfo from "~/pages/Container/BranchCompany/Plan/ViewInfo";
+
+function List(props) {
+ const query = useGetUrlQuery();
+ const [form] = Form.useForm();
+ const { tableProps, getData } = useTable(props["planList"], {
+ form,
+ params: {
+ corpId: query.corpId,
+ startTime: query.startTime,
+ endTime: query.endTime,
+ completedOnly: query.completedOnly,
+ },
+ });
+
+ const [addModalOpen, setAddModalOpen] = useState(false);
+ const [viewModalOpen, setViewModalOpen] = useState(false);
+ const [currentId, setCurrentId] = useState("");
+
+ const onDelete = (id) => {
+ Modal.confirm({
+ title: "删除确认",
+ content: "确定要删除吗?",
+ onOk: async () => {
+ const { success } = await props["planDelete"]({ id });
+ if (success) {
+ message.success("删除成功");
+ getData();
+ }
+ },
+ });
+ };
+
+ return (
+
+
),
+ },
+ { name: "planName", label: "计划名称" },
+ { name: "startTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE },
+ { name: "endTime", label: "计划结束时间", render: FORM_ITEM_RENDER_ENUM.DATE },
+ ]}
+ form={form}
+ onFinish={getData}
+ />
+
(
+ <>
+ {query.entrance !== "statistics" && (
+ }
+ onClick={() => {
+ setAddModalOpen(true);
+ setCurrentId("");
+ }}
+ >
+ 新增
+
+ )}
+ >
+ )}
+ columns={[
+ { title: "计划名称", dataIndex: "planName" },
+ { title: "计划类型", dataIndex: "planTypeName" },
+ { title: "计划开始时间", dataIndex: "planStartTime" },
+ { title: "计划结束时间", dataIndex: "planEndTime" },
+ {
+ title: "计划执行总次数",
+ dataIndex: "planExecuteTotal",
+ render: (_, record) => (
+
+ ),
+ },
+ {
+ title: "人员执行情况",
+ dataIndex: "userExecuteNum",
+ render: (_, record) => (
+
+ ),
+ },
+ {
+ title: "计划状态",
+ dataIndex: "status",
+ render: (_, record) => {
+ const { planExecuteTotal, userExecuteNum, planStartTime, planEndTime } = record;
+ const currentTime = dayjs();
+
+ let statusText = "";
+
+ if (planExecuteTotal === userExecuteNum && planExecuteTotal > 0) {
+ statusText = "已完成";
+ }
+ else if (currentTime.isBefore(planStartTime, "day")) {
+ statusText = "未开始";
+ }
+ else if ((currentTime.isAfter(planStartTime, "day") || currentTime.isSame(planStartTime, "day"))
+ && (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) {
+ statusText = "执行中";
+ }
+
+ return statusText;
+ },
+ },
+ {
+ title: "操作",
+ fixed: "right",
+ width: 200,
+ render: (_, record) => {
+ const isBeforeStart = dayjs().isBefore(record.planStartTime, "day");
+ return (
+
+
+ {
+ (isBeforeStart && query.entrance !== "statistics") && (
+
+ )
+ }
+ {
+ (isBeforeStart && query.entrance !== "statistics") && (
+
+ )
+ }
+
+ );
+ },
+ },
+ ]}
+ {...tableProps}
+ />
+ {addModalOpen && (
+ {
+ setAddModalOpen(false);
+ setCurrentId("");
+ }}
+ supervision={props.supervision}
+ getData={getData}
+ />
+ )}
+ {viewModalOpen && (
+ {
+ setViewModalOpen(false);
+ setCurrentId("");
+ }}
+ />
+ )}
+
+ );
+}
+
+const AddModalComponent = (props) => {
+ const [userInfo, setUserInfo] = useState({});
+ const [corpInfoList, setCorpInfoList] = useState([]);
+
+ const [form] = Form.useForm();
+ const planStartTime = Form.useWatch("planStartTime", form);
+ const corpId = Form.useWatch("corpId", form);
+ const { getUserInfo } = useGetUserInfo();
+
+ const getCorpInfoList = async () => {
+ const { data } = await props["corpInfoList"]({ pageSize: 9999, pageIndex: 1, enterpriseType: 2 });
+ setCorpInfoList(data);
+ };
+
+ const getData = async () => {
+ if (props.supervision !== "1") {
+ const userInfo = await getUserInfo();
+ setUserInfo(userInfo);
+ }
+ if (props.id) {
+ const { data } = await props["planView"]({ id: props.id });
+ form.setFieldsValue({
+ ...data,
+ userId: data.userId.split(","),
+ userName: data.userName.split(","),
+ departmentId: data.departmentId.split(","),
+ departmentName: data.departmentName.split(","),
+ postId: data.postId.split(","),
+ postName: data.postName.split(","),
+ });
+ }
+ };
+
+ useEffect(() => {
+ getData();
+ props.supervision === "1" && getCorpInfoList();
+ }, []);
+
+ const onSubmit = async (values) => {
+ const { success } = await props[!props.id ? "planAdd" : "planUpdate"]({
+ ...values,
+ id: props.id,
+ userId: values.userId.join(","),
+ userName: values.userName.join(","),
+ departmentId: values.departmentId.join(","),
+ departmentName: values.departmentName.join(","),
+ postId: values.postId.join(","),
+ postName: values.postName.join(","),
+ });
+ if (success) {
+ message.success("操作成功");
+ props.onCancel();
+ props.getData();
+ }
+ };
+
+ return (
+
+ form.setFieldValue("planTypeName", label)}
+ />
+ ),
+ },
+ { name: "planTypeName", label: "计划类型", onlyForLabel: true },
+ { name: "planStartTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE },
+ {
+ name: "planEndTime",
+ label: "计划结束时间",
+ render: FORM_ITEM_RENDER_ENUM.DATE,
+ rules: [validatorEndTime(planStartTime)],
+ },
+ {
+ name: "corpId",
+ label: "计划执行单位",
+ render: FORM_ITEM_RENDER_ENUM.SELECT,
+ items: corpInfoList,
+ itemsField: { labelKey: "corpName", valueKey: "id" },
+ hidden: !(props.supervision === "1"),
+ componentProps: {
+ onChange: (event) => {
+ form.setFieldValue("corpName", getLabelName({ list: corpInfoList, status: event, idKey: "id", nameKey: "corpName" }));
+ form.setFieldValue("userId", []);
+ form.setFieldValue("userName", []);
+ form.setFieldValue("departmentId", []);
+ form.setFieldValue("departmentName", []);
+ form.setFieldValue("postId", []);
+ form.setFieldValue("postName", []);
+ },
+ },
+ },
+ { name: "corpName", label: "计划执行单位名称", onlyForLabel: true },
+ {
+ name: "userId",
+ label: "计划执行人员",
+ render: (() => {
+ const commonProps = {
+ mode: "multiple",
+ labelRender: item => `${item.name}(${[item.departmentName, item.postName].filter(Boolean).join("-")})`,
+ onGetLabel: (label) => {
+ form.setFieldValue("userName", label);
+ },
+ onGetOption: (option) => {
+ const departmentId = [];
+ const departmentName = [];
+ const postId = [];
+ const postName = [];
+ for (let i = 0; i < option.length; i++) {
+ departmentId.push(option[i].departmentId);
+ departmentName.push(option[i].departmentName);
+ postId.push(option[i].postId);
+ postName.push(option[i].postName);
+ }
+ form.setFieldValue("departmentId", departmentId);
+ form.setFieldValue("departmentName", departmentName);
+ form.setFieldValue("postId", postId);
+ form.setFieldValue("postName", postName);
+ },
+ };
+ return props.supervision === "1"
+ ? (
+
+ )
+ : (
+
+ );
+ })(),
+ },
+ { name: "userName", label: "计划执行人员名称", onlyForLabel: true },
+ { name: "departmentId", label: "计划执行人员部门", onlyForLabel: true },
+ { name: "departmentName", label: "计划执行人员部门名称", onlyForLabel: true },
+ { name: "postId", label: "计划执行人员岗位", onlyForLabel: true },
+ { name: "postName", label: "计划执行人员岗位名称", onlyForLabel: true },
+ { name: "planExecuteNum", label: "计划执行次数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
+ { name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
+ ]}
+ />
+
+ );
+};
+
+const ViewModal = (props) => {
+ return (
+ 取消,
+ ]}
+ >
+
+
+ );
+};
+
+const AddModal = Connect([NS_PLAN], true)(AddModalComponent);
+export default Connect([NS_PLAN], true)(List);
diff --git a/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails/index.js b/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails/index.js
new file mode 100644
index 0000000..4774851
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails/index.js
@@ -0,0 +1,67 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, Divider, Space } from "antd";
+import HeaderBack from "zy-react-library/components/HeaderBack";
+import Table from "zy-react-library/components/Table";
+import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
+import useTable from "zy-react-library/hooks/useTable";
+import { getLabelName } from "zy-react-library/utils";
+import { INSPECTION_STATE_ENUM } from "~/enumerate/constant";
+import { NS_INSPECTION } from "~/enumerate/namespace";
+import ViewInfo from "~/pages/Container/BranchCompany/Plan/ViewInfo";
+
+function PersonnelExecutionDetails(props) {
+ const query = useGetUrlQuery();
+ const { tableProps } = useTable(props["inspectionList"], { params: { status: "", entrance: "2", checkUserId: query.userId } });
+
+ return (
+
+
+
+
计划信息
+
+
人员执行详情
+
(`${record.timeStart}至${record.timeEnd}`) },
+ {
+ title: "检查状态",
+ dataIndex: "status",
+ render: (_, record) => (getLabelName({ list: INSPECTION_STATE_ENUM, status: record.status })),
+ },
+ { title: "发现隐患数", dataIndex: "hiddenNumber" },
+ {
+ title: "操作",
+ fixed: "right",
+ width: 100,
+ render: (_, record) => (
+
+
+
+ ),
+ },
+ ]}
+ disabledResizer={true}
+ options={false}
+ {...tableProps}
+ />
+
+
+ );
+}
+
+export default Connect([NS_INSPECTION], true)(PersonnelExecutionDetails);
diff --git a/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionRecords/index.js b/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionRecords/index.js
new file mode 100644
index 0000000..4da9d35
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionRecords/index.js
@@ -0,0 +1,65 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, Form } from "antd";
+import HeaderBack from "zy-react-library/components/HeaderBack";
+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 useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
+import useTable from "zy-react-library/hooks/useTable";
+import { NS_PLAN } from "~/enumerate/namespace";
+
+function PersonnelExecutionRecords(props) {
+ const query = useGetUrlQuery();
+ const [form] = Form.useForm();
+ const { tableProps, getData } = useTable(props["planUserList"], {
+ form,
+ params: { planId: query.planId },
+ });
+
+ return (
+
+
+
+
},
+ { name: "userName", label: "人员" },
+ ]}
+ form={form}
+ onFinish={getData}
+ />
+
(`${record.actualExecCount}/${record.planExecuteNum}`),
+ },
+ {
+ title: "操作",
+ fixed: "right",
+ width: 150,
+ render: (_, record) => (
+
+ ),
+ },
+ ]}
+ {...tableProps}
+ />
+
+
+ );
+}
+
+export default Connect([NS_PLAN], true)(PersonnelExecutionRecords);
diff --git a/src/pages/Container/BranchCompany/Plan/Management/PlanExecutionDetails/index.js b/src/pages/Container/BranchCompany/Plan/Management/PlanExecutionDetails/index.js
new file mode 100644
index 0000000..278fe51
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/Management/PlanExecutionDetails/index.js
@@ -0,0 +1,68 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, Divider, Space } from "antd";
+import HeaderBack from "zy-react-library/components/HeaderBack";
+import Table from "zy-react-library/components/Table";
+import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
+import useTable from "zy-react-library/hooks/useTable";
+import { getLabelName } from "zy-react-library/utils";
+import { INSPECTION_STATE_ENUM } from "~/enumerate/constant";
+import { NS_INSPECTION } from "~/enumerate/namespace";
+import ViewInfo from "~/pages/Container/BranchCompany/Plan/ViewInfo";
+
+function PlanExecutionDetails(props) {
+ const query = useGetUrlQuery();
+ const { tableProps } = useTable(props["inspectionList"], {
+ params: { status: "", planId: query.planId, entrance: "2" },
+ });
+
+ return (
+
+
+
+
计划信息
+
+
计划执行详情
+
(`${record.timeStart}至${record.timeEnd}`) },
+ {
+ title: "检查状态",
+ dataIndex: "status",
+ render: (_, record) => (getLabelName({ list: INSPECTION_STATE_ENUM, status: record.status })),
+ },
+ { title: "发现隐患数", dataIndex: "hiddenNumber" },
+ {
+ title: "操作",
+ fixed: "right",
+ width: 100,
+ render: (_, record) => (
+
+
+
+ ),
+ },
+ ]}
+ disabledResizer={true}
+ options={false}
+ {...tableProps}
+ />
+
+
+ );
+}
+
+export default Connect([NS_INSPECTION], true)(PlanExecutionDetails);
diff --git a/src/pages/Container/BranchCompany/Plan/Management/index.js b/src/pages/Container/BranchCompany/Plan/Management/index.js
new file mode 100644
index 0000000..8b3bfcb
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/Management/index.js
@@ -0,0 +1,9 @@
+function Management(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Management;
diff --git a/src/pages/Container/BranchCompany/Plan/ViewInfo/index.js b/src/pages/Container/BranchCompany/Plan/ViewInfo/index.js
new file mode 100644
index 0000000..2d30cbe
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/ViewInfo/index.js
@@ -0,0 +1,38 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Descriptions, Spin } from "antd";
+import { useEffect, useState } from "react";
+import { NS_PLAN } from "~/enumerate/namespace";
+
+function ViewInfo(props) {
+ const [info, setInfo] = useState({});
+ const getData = async () => {
+ const { data } = await props["planView"]({ id: props.id });
+ setInfo(data);
+ };
+
+ useEffect(() => {
+ getData();
+ }, []);
+
+ return (
+
+
+
+ );
+}
+
+export default Connect([NS_PLAN], true)(ViewInfo);
diff --git a/src/pages/Container/BranchCompany/Plan/index.js b/src/pages/Container/BranchCompany/Plan/index.js
new file mode 100644
index 0000000..f9daf3d
--- /dev/null
+++ b/src/pages/Container/BranchCompany/Plan/index.js
@@ -0,0 +1,9 @@
+function Plan(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Plan;
diff --git a/src/pages/Container/Supervision/HiddenView/index.js b/src/pages/Container/Supervision/HiddenView/index.js
new file mode 100644
index 0000000..41db77d
--- /dev/null
+++ b/src/pages/Container/Supervision/HiddenView/index.js
@@ -0,0 +1,11 @@
+import HiddenInfo from "zy-react-library/components/HiddenInfo/gwj";
+
+function HiddenView() {
+ return (
+
+
+
+ );
+}
+
+export default HiddenView;
diff --git a/src/pages/Container/Supervision/Inspection/Records/List/index.js b/src/pages/Container/Supervision/Inspection/Records/List/index.js
new file mode 100644
index 0000000..89d3999
--- /dev/null
+++ b/src/pages/Container/Supervision/Inspection/Records/List/index.js
@@ -0,0 +1,7 @@
+import RecordsList from "~/pages/Container/BranchCompany/Inspection/Records/List";
+
+function List(props) {
+ return ;
+}
+
+export default List;
diff --git a/src/pages/Container/Supervision/Inspection/Records/index.js b/src/pages/Container/Supervision/Inspection/Records/index.js
new file mode 100644
index 0000000..21aae43
--- /dev/null
+++ b/src/pages/Container/Supervision/Inspection/Records/index.js
@@ -0,0 +1,9 @@
+function Records(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Records;
diff --git a/src/pages/Container/Supervision/InspectionView/index.js b/src/pages/Container/Supervision/InspectionView/index.js
index 9e8d94a..bbc5bb8 100644
--- a/src/pages/Container/Supervision/InspectionView/index.js
+++ b/src/pages/Container/Supervision/InspectionView/index.js
@@ -1,4 +1,4 @@
-import InspectionViewA from "../../BranchCompany/InspectionView";
+import InspectionViewA from "~/pages/Container/BranchCompany/InspectionView";
function InspectionView() {
return ;
diff --git a/src/pages/Container/Supervision/Plan/Execute/List/index.js b/src/pages/Container/Supervision/Plan/Execute/List/index.js
new file mode 100644
index 0000000..cb21afe
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/Execute/List/index.js
@@ -0,0 +1,7 @@
+import ExecuteList from "~/pages/Container/BranchCompany/Plan/Execute/List";
+
+function List(props) {
+ return ;
+}
+
+export default List;
diff --git a/src/pages/Container/Supervision/Plan/Execute/index.js b/src/pages/Container/Supervision/Plan/Execute/index.js
new file mode 100644
index 0000000..d7f1f91
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/Execute/index.js
@@ -0,0 +1,9 @@
+function Execute(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Execute;
diff --git a/src/pages/Container/Supervision/Plan/Management/List/index.js b/src/pages/Container/Supervision/Plan/Management/List/index.js
new file mode 100644
index 0000000..903b49a
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/Management/List/index.js
@@ -0,0 +1,7 @@
+import ManagementList from "~/pages/Container/BranchCompany/Plan/Management/List";
+
+function List(props) {
+ return ;
+}
+
+export default List;
diff --git a/src/pages/Container/Supervision/Plan/Management/PersonnelExecutionDetails/index.js b/src/pages/Container/Supervision/Plan/Management/PersonnelExecutionDetails/index.js
new file mode 100644
index 0000000..902958a
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/Management/PersonnelExecutionDetails/index.js
@@ -0,0 +1,7 @@
+import PersonnelExecutionDetailsA from "~/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails";
+
+function PersonnelExecutionDetails(props) {
+ return ;
+}
+
+export default PersonnelExecutionDetails;
diff --git a/src/pages/Container/Supervision/Plan/Management/PersonnelExecutionRecords/index.js b/src/pages/Container/Supervision/Plan/Management/PersonnelExecutionRecords/index.js
new file mode 100644
index 0000000..b6bce4c
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/Management/PersonnelExecutionRecords/index.js
@@ -0,0 +1,7 @@
+import PersonnelExecutionRecordsA from "~/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionRecords";
+
+function PersonnelExecutionRecords(props) {
+ return ;
+}
+
+export default PersonnelExecutionRecords;
diff --git a/src/pages/Container/Supervision/Plan/Management/PlanExecutionDetails/index.js b/src/pages/Container/Supervision/Plan/Management/PlanExecutionDetails/index.js
new file mode 100644
index 0000000..1297141
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/Management/PlanExecutionDetails/index.js
@@ -0,0 +1,7 @@
+import PlanExecutionDetailsA from "~/pages/Container/BranchCompany/Plan/Management/PlanExecutionDetails";
+
+function PlanExecutionDetails(props) {
+ return ;
+}
+
+export default PlanExecutionDetails;
diff --git a/src/pages/Container/Supervision/Plan/Management/index.js b/src/pages/Container/Supervision/Plan/Management/index.js
new file mode 100644
index 0000000..8b3bfcb
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/Management/index.js
@@ -0,0 +1,9 @@
+function Management(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Management;
diff --git a/src/pages/Container/Supervision/Plan/ViewInfo/index.js b/src/pages/Container/Supervision/Plan/ViewInfo/index.js
new file mode 100644
index 0000000..a4c514d
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/ViewInfo/index.js
@@ -0,0 +1,9 @@
+import ViewInfoA from "~/pages/Container/BranchCompany/Plan/ViewInfo";
+
+function ViewInfo(props) {
+ return (
+
+ );
+}
+
+export default ViewInfo;
diff --git a/src/pages/Container/Supervision/Plan/index.js b/src/pages/Container/Supervision/Plan/index.js
new file mode 100644
index 0000000..f9daf3d
--- /dev/null
+++ b/src/pages/Container/Supervision/Plan/index.js
@@ -0,0 +1,9 @@
+function Plan(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Plan;
diff --git a/src/pages/Container/Supervision/Statistics/List/index.js b/src/pages/Container/Supervision/Statistics/List/index.js
new file mode 100644
index 0000000..886cf98
--- /dev/null
+++ b/src/pages/Container/Supervision/Statistics/List/index.js
@@ -0,0 +1,155 @@
+import { Connect } from "@cqsjjb/jjb-dva-runtime";
+import { Button, Form } from "antd";
+import dayjs from "dayjs";
+import Search from "zy-react-library/components/Search";
+import Table from "zy-react-library/components/Table";
+import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
+import useTable from "zy-react-library/hooks/useTable";
+import { NS_STATISTICS } from "~/enumerate/namespace";
+
+function List(props) {
+ const [form] = Form.useForm();
+ const dateType = Form.useWatch("dateType", form);
+
+ const getDate = () => {
+ const formData = form.getFieldsValue();
+ let startTime = "";
+ let endTime = "";
+ if (formData.dateType === "1") {
+ startTime = formData.dateYear ? dayjs(formData.dateYear).startOf("year").format("YYYY-MM-DD") : "";
+ endTime = formData.dateYear ? dayjs(formData.dateYear).endOf("year").format("YYYY-MM-DD") : "";
+ }
+ else if (formData.dateType === "2") {
+ startTime = formData.dateMonth ? dayjs(formData.dateMonth).startOf("month").format("YYYY-MM-DD") : "";
+ endTime = formData.dateMonth ? dayjs(formData.dateMonth).endOf("month").format("YYYY-MM-DD") : "";
+ }
+ else {
+ startTime = dayjs(formData.dates?.[0]);
+ endTime = dayjs(formData.dates?.[1]);
+ }
+ return {
+ startTime,
+ endTime,
+ };
+ };
+
+ const { tableProps, getData } = useTable(props["statisticsList"], {
+ form,
+ transform: () => getDate(),
+ });
+
+ return (
+
+
+
(
+
+ ),
+ },
+ {
+ title: "已完成计划数",
+ dataIndex: "completedPlanCount",
+ render: (_, record) => (
+
+ ),
+ },
+ ],
+ },
+ {
+ title: "检查执行情况",
+ children: [
+ {
+ title: "检查总数",
+ dataIndex: "inspectionTotal",
+ render: (_, record) => (
+
+ ),
+ },
+ {
+ title: "计划内检查数",
+ dataIndex: "planInCount",
+ render: (_, record) => (
+
+ ),
+ },
+ {
+ title: "计划外检查数",
+ dataIndex: "planOutCount",
+ render: (_, record) => (
+
+ ),
+ },
+ ],
+ },
+ ]}
+ {...tableProps}
+ />
+
+ );
+}
+
+export default Connect([NS_STATISTICS], true)(List);
diff --git a/src/pages/Container/Supervision/Statistics/index.js b/src/pages/Container/Supervision/Statistics/index.js
new file mode 100644
index 0000000..687dbf1
--- /dev/null
+++ b/src/pages/Container/Supervision/Statistics/index.js
@@ -0,0 +1,9 @@
+function Statistics(props) {
+ return (
+
+ {props.children}
+
+ );
+}
+
+export default Statistics;