从检查统计点击检查执行情况进入的,被检查单位只查询点击的部门

master
LiuJiaNan 2026-03-03 10:24:58 +08:00
parent a2914444e8
commit 589dbbe3ef
2 changed files with 46 additions and 46 deletions

View File

@ -1,24 +1,24 @@
import {Permission} from "@cqsjjb/jjb-common-decorator/permission"; import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
import {Connect} from "@cqsjjb/jjb-dva-runtime"; import { Connect } from "@cqsjjb/jjb-dva-runtime";
import {Button, Form, message, Modal, Space, Spin} from "antd"; import { Button, Form, message, Modal, Space, Spin } from "antd";
import {useEffect, useState} from "react"; import { useEffect, useState } from "react";
import ExportIcon from "zy-react-library/components/Icon/ExportIcon"; import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
import Page from "zy-react-library/components/Page"; import Page from "zy-react-library/components/Page";
import Search from "zy-react-library/components/Search"; import Search from "zy-react-library/components/Search";
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary"; import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary";
import Table from "zy-react-library/components/Table"; import Table from "zy-react-library/components/Table";
import {FORM_ITEM_RENDER_ENUM} from "zy-react-library/enum/formItemRender"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob"; import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useTable from "zy-react-library/hooks/useTable"; import useTable from "zy-react-library/hooks/useTable";
import useUrlQueryCriteria from "zy-react-library/hooks/useUrlQueryCriteria"; import useUrlQueryCriteria from "zy-react-library/hooks/useUrlQueryCriteria";
import {getLabelName} from "zy-react-library/utils"; import { getLabelName } from "zy-react-library/utils";
import {formatDate} from "~/utils/dateFormat";
import InspectionFlowModal from "~/components/InspectionFlowModal"; import InspectionFlowModal from "~/components/InspectionFlowModal";
import {INSPECTION_QUESTION_ENUM, INSPECTION_STATE_ENUM, PLAN_ENUM} from "~/enumerate/constant"; import { INSPECTION_QUESTION_ENUM, INSPECTION_STATE_ENUM, PLAN_ENUM } from "~/enumerate/constant";
import {NS_INSPECTION} from "~/enumerate/namespace"; import { NS_INSPECTION } from "~/enumerate/namespace";
import { formatDate } from "~/utils/dateFormat";
import "@xyflow/react/dist/style.css"; import "@xyflow/react/dist/style.css";
function List(props) { function List(props) {
@ -26,8 +26,8 @@ function List(props) {
const [flowModalOpen, setFlowModalOpen] = useState(false); const [flowModalOpen, setFlowModalOpen] = useState(false);
const [currentId, setCurrentId] = useState(""); const [currentId, setCurrentId] = useState("");
const {getUrlCriteriaQuery} = useUrlQueryCriteria(); const { getUrlCriteriaQuery } = useUrlQueryCriteria();
const {loading, downloadBlob} = useDownloadBlob(); const { loading, downloadBlob } = useDownloadBlob();
const [count, setCount] = useState({ const [count, setCount] = useState({
inspectCount: 0, inspectCount: 0,
hiddenCount: 0, hiddenCount: 0,
@ -36,7 +36,7 @@ function List(props) {
}); });
const [form] = Form.useForm(); const [form] = Form.useForm();
const {tableProps, getData} = useTable(props["inspectionList"], { const { tableProps, getData } = useTable(props["inspectionList"], {
form, form,
transform: formData => ({ transform: formData => ({
checkStartTime: formData.checkTime?.[0] ? (`${formData.checkTime[0]} 00:00:00`) : "", checkStartTime: formData.checkTime?.[0] ? (`${formData.checkTime[0]} 00:00:00`) : "",
@ -48,10 +48,10 @@ function List(props) {
}, },
onSuccess: () => { onSuccess: () => {
getCount(); getCount();
} },
}); });
const getCount = async () => { const getCount = async () => {
const {data} = await props["inspectionCount"]({ const { data } = await props["inspectionCount"]({
menuPath: window.location.pathname, menuPath: window.location.pathname,
status: "", status: "",
entrance: "0", entrance: "0",
@ -59,7 +59,7 @@ function List(props) {
checkStartTime: query.checkStartTime || form.getFieldValue("checkTime")?.[0], checkStartTime: query.checkStartTime || form.getFieldValue("checkTime")?.[0],
checkEndTime: query.checkEndTime || form.getFieldValue("checkTime").checkTime?.[1], checkEndTime: query.checkEndTime || form.getFieldValue("checkTime").checkTime?.[1],
planType: query.planType, planType: query.planType,
...form.getFieldsValue() ...form.getFieldsValue(),
}); });
setCount(data); setCount(data);
}; };
@ -72,7 +72,7 @@ function List(props) {
title: "删除确认", title: "删除确认",
content: "是否确认删除?删除后连带隐患同时删除。", content: "是否确认删除?删除后连带隐患同时删除。",
onOk: async () => { onOk: async () => {
const {success} = await props["inspectionDelete"]({id}); const { success } = await props["inspectionDelete"]({ id });
if (success) { if (success) {
message.success("删除成功"); message.success("删除成功");
getData(); getData();
@ -84,7 +84,7 @@ function List(props) {
return ( return (
<Page isShowAllAction={!!query.headerTitle} headerTitle={query.headerTitle}> <Page isShowAllAction={!!query.headerTitle} headerTitle={query.headerTitle}>
<Search <Search
labelCol={{span: 8}} labelCol={{ span: 8 }}
values={{ values={{
checkTime: query.checkStartTime ? [query.checkStartTime, query.checkEndTime] : [], checkTime: query.checkStartTime ? [query.checkStartTime, query.checkEndTime] : [],
planType: query.planType, planType: query.planType,
@ -96,20 +96,20 @@ function List(props) {
render: FORM_ITEM_RENDER_ENUM.SELECT, render: FORM_ITEM_RENDER_ENUM.SELECT,
items: INSPECTION_QUESTION_ENUM, items: INSPECTION_QUESTION_ENUM,
}, },
{name: "inspectionOriginatorUserName", label: "检查发起人"}, { name: "inspectionOriginatorUserName", label: "检查发起人" },
{name: "inspectionDeptId", label: "检查部门", render: <DepartmentSelectTree/>}, { name: "inspectionDeptId", label: "检查部门", render: <DepartmentSelectTree /> },
{name: "inspectionUserName", label: "检查人"}, { name: "inspectionUserName", label: "检查人" },
{name: "type", label: "检查类型", render: <DictionarySelectTree dictValue="inspectionType" onlyLastLevel/>}, { name: "type", label: "检查类型", render: <DictionarySelectTree dictValue="inspectionType" onlyLastLevel /> },
{ {
name: "inspectedDepartmentId", name: "inspectedDepartmentId",
label: "被检查单位", label: "被检查单位",
render: <DepartmentSelectTree searchType={props.searchType} params={{enterpriseType: [2]}}/> render: <DepartmentSelectTree searchType={props.searchType} params={{ enterpriseType: [2], eqCorpinfoId: query.corpId }} />,
}, },
{name: "inspectedUserName", label: "被检查单位现场负责人"}, { name: "inspectedUserName", label: "被检查单位现场负责人" },
{name: "status", label: "检查状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: INSPECTION_STATE_ENUM}, { name: "status", label: "检查状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: INSPECTION_STATE_ENUM },
{name: "checkYear", label: "检查年度", render: FORM_ITEM_RENDER_ENUM.DATE_YEAR}, { name: "checkYear", label: "检查年度", render: FORM_ITEM_RENDER_ENUM.DATE_YEAR },
{name: "checkTime", label: "检查时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE}, { name: "checkTime", label: "检查时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
{name: "planType", label: "计划属性", render: FORM_ITEM_RENDER_ENUM.SELECT, items: PLAN_ENUM}, { name: "planType", label: "计划属性", render: FORM_ITEM_RENDER_ENUM.SELECT, items: PLAN_ENUM },
]} ]}
form={form} form={form}
onFinish={getData} onFinish={getData}
@ -130,19 +130,19 @@ function List(props) {
> >
<div> <div>
安全检查总数 安全检查总数
<span style={{color: "#2d8cf0", fontWeight: 700}}>{count.safetyCount}</span> <span style={{ color: "#2d8cf0", fontWeight: 700 }}>{count.safetyCount}</span>
</div> </div>
<div> <div>
环保检查总数 环保检查总数
<span style={{color: "#2d8cf0", fontWeight: 700}}>{count.environmentalCount}</span> <span style={{ color: "#2d8cf0", fontWeight: 700 }}>{count.environmentalCount}</span>
</div> </div>
<div> <div>
综合检查总数 综合检查总数
<span style={{color: "#2d8cf0", fontWeight: 700}}>{count.comprehensiveCount}</span> <span style={{ color: "#2d8cf0", fontWeight: 700 }}>{count.comprehensiveCount}</span>
</div> </div>
<div> <div>
涉及隐患总数 涉及隐患总数
<span style={{color: "#2d8cf0", fontWeight: 700}}>{count.hiddenCount}</span> <span style={{ color: "#2d8cf0", fontWeight: 700 }}>{count.hiddenCount}</span>
</div> </div>
</Space> </Space>
</Spin> </Spin>
@ -154,15 +154,15 @@ function List(props) {
type="primary" type="primary"
ghost ghost
loading={loading} loading={loading}
icon={<ExportIcon/>} icon={<ExportIcon />}
onClick={async () => { onClick={async () => {
const exportParams = getUrlCriteriaQuery("searchFormKeys", "searchFormValues"); const exportParams = getUrlCriteriaQuery("searchFormKeys", "searchFormValues");
await downloadBlob("/inspection/safetyEnvironmentalInspection/exportList", { await downloadBlob("/inspection/safetyEnvironmentalInspection/exportList", {
params: { params: {
...exportParams, ...exportParams,
menuPath: window.location.pathname menuPath: window.location.pathname,
} },
}); });
}} }}
> >
@ -172,29 +172,29 @@ function List(props) {
</Space> </Space>
)} )}
columns={[ columns={[
{title: "检查题目", dataIndex: "subject"}, { title: "检查题目", dataIndex: "subject" },
{title: "检查发起人", dataIndex: "inspectionOriginatorUserName"}, { title: "检查发起人", dataIndex: "inspectionOriginatorUserName" },
{title: "检查部门", dataIndex: "inspectionDepartmentName"}, { title: "检查部门", dataIndex: "inspectionDepartmentName" },
{title: "检查人", dataIndex: "inspectionInspectorUserName"}, { title: "检查人", dataIndex: "inspectionInspectorUserName" },
{title: "被检查单位", dataIndex: "inspectionSiteDepartmentName"}, { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
{title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200}, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
{title: "检查类型", dataIndex: "typeName"}, { title: "检查类型", dataIndex: "typeName" },
{ {
title: "检查时间", title: "检查时间",
width: 200, width: 200,
render: (_, record) => (record.timeStart ? `${formatDate(record.timeStart)}${formatDate(record.timeEnd)}` : "") render: (_, record) => (record.timeStart ? `${formatDate(record.timeStart)}${formatDate(record.timeEnd)}` : ""),
}, },
{ {
title: "检查状态", title: "检查状态",
dataIndex: "status", dataIndex: "status",
render: (_, record) => (getLabelName({list: INSPECTION_STATE_ENUM, status: record.status})), render: (_, record) => (getLabelName({ list: INSPECTION_STATE_ENUM, status: record.status })),
}, },
{ {
title: "计划属性", title: "计划属性",
dataIndex: "planType", dataIndex: "planType",
render: (_, record) => getLabelName({list: PLAN_ENUM, status: record.planType}) render: (_, record) => getLabelName({ list: PLAN_ENUM, status: record.planType }),
}, },
{title: "发现隐患数", dataIndex: "hiddenNumber"}, { title: "发现隐患数", dataIndex: "hiddenNumber" },
{ {
title: "操作", title: "操作",
fixed: "right", fixed: "right",

View File

@ -1,7 +1,7 @@
import RecordsList from "~/pages/Container/Supervision/Inspection/Records/List"; import RecordsList from "~/pages/Container/Supervision/Inspection/Records/List";
function InspectionRecordsList(props) { function InspectionRecordsList(props) {
return <RecordsList {...props} />; return <RecordsList searchType="current" {...props} />;
} }
export default InspectionRecordsList; export default InspectionRecordsList;