Merge remote-tracking branch 'origin/master'

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

View File

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