fix(inspection): 修复检查模块中的数据传递和状态显示问题

- 修复隐患指派页面中获取确认用户列表的数据源错误
- 在多个页面路由跳转时添加被检查现场负责人ID参数传递
- 修正防御申辩流程中提交后的页面跳转逻辑位置
- 更新检查记录列表中的状态字段映射和显示文本
- 完善检查添加页面中被检查人员的公司信息清空和设置功能
- 优化检查记录列表页面的代码格式化和导出功能参数传递
master
fangjiakai 2026-01-28 09:03:53 +08:00
parent 29e237a477
commit a73fa6598e
6 changed files with 76 additions and 53 deletions

View File

@ -30,8 +30,8 @@ function Assign(props) {
<HiddenInfo
hiddenId={query.hiddenUUId}
id={query.hiddenId}
onGetData={(data) => {
getConfirmUserList(data.creatorId);
onGetData={() => {
getConfirmUserList(query.inspectedSiteManagerId);
}}
/>
<Divider orientation="left">隐患确认</Divider>

View File

@ -36,7 +36,7 @@ function HiddenList(props) {
<Button
type="link"
onClick={() => {
props.history.push(`./assign?inspectionId=${query.inspectionId}&id=${query.id}&hiddenUUId=${record.hiddenId}&hiddenId=${record.id}`);
props.history.push(`./assign?inspectionId=${query.inspectionId}&id=${query.id}&hiddenUUId=${record.hiddenId}&hiddenId=${record.id}&inspectedSiteManagerId=${query.inspectedSiteManagerId}`);
}}
>
指派

View File

@ -73,7 +73,7 @@ function List(props) {
<Button
type="link"
onClick={() => {
props.history.push(`./hiddenList?id=${record.id}&inspectionId=${record.inspectionId}`);
props.history.push(`./hiddenList?id=${record.id}&inspectionId=${record.inspectionId}&inspectedSiteManagerId=${record.inspectedSiteManagerId}`);
}}
>
指派

View File

@ -154,10 +154,6 @@ function DefenseHandlingModalComponent(props) {
}, []);
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({
@ -168,6 +164,10 @@ function DefenseHandlingModalComponent(props) {
}
const { success } = await props["defenseSubmit"]({ ...values, signature, inspectionId: props.inspectionId });
if (success) {
if (values.status === "1") {
props.history.push(`./edit?id=${props.id}&inspectionId=${props.inspectionId}`);
return;
}
message.success("操作成功");
props.onCancel();
props.getData();
@ -303,9 +303,9 @@ function DefenseRecordModalComponent(props) {
dataIndex: "isPass",
render: (_, record) => (
<>
<div>{record.isPass === 0 && "未审批"}</div>
<div>{record.isPass === 1 && "通过"}</div>
<div>{record.isPass === 2 && "未通过"}</div>
<div>{record.status === 0 && "待审核"}</div>
<div>{record.status === 1 && "申辩成功"}</div>
<div>{record.status === 2 && "申辩驳回"}</div>
</>
),
},

View File

@ -375,6 +375,8 @@ function Add(props) {
onChange={() => {
form.setFieldValue(["personUnderInspection", "userId"], "");
form.setFieldValue(["personUnderInspection", "userName"], "");
form.setFieldValue(["personUnderInspection", "corpId"], "");
form.setFieldValue(["personUnderInspection", "corpName"], "");
}}
/>
),
@ -387,6 +389,10 @@ function Add(props) {
<PersonnelSelect
params={{departmentId: personUnderInspectionDepartmentId}}
onGetLabel={label => form.setFieldValue(["personUnderInspection", "userName"], label)}
onGetOption={(option) => {
form.setFieldValue(["personUnderInspection", "corpId"], option.corpId);
form.setFieldValue(["personUnderInspection", "corpName"], option.corpName);
}}
/>
),
formItemProps: {labelCol: {span: 6}},

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 {formatDate} from "~/utils/dateFormat";
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 "@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`) : "",
@ -51,7 +51,7 @@ function List(props) {
}
});
const getCount = async () => {
const { data } = await props["inspectionCount"]({
const {data} = await props["inspectionCount"]({
status: "",
entrance: "0",
corpId: query.corpId,
@ -71,7 +71,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();
@ -83,7 +83,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,
@ -95,16 +95,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: "inspectedDepartmentId", label: "被检查单位", render: <DepartmentSelectTree searchType={props.searchType} /> },
{ 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: "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}/>
},
{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}
@ -125,19 +129,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>
@ -149,11 +153,16 @@ 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} });
await downloadBlob("/inspection/safetyEnvironmentalInspection/exportList", {
params: {
...exportParams,
menuPath: window.location.pathname
}
});
}}
>
导出
@ -162,21 +171,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: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `${formatDate(record.timeStart)}${formatDate(record.timeEnd)}` : "") },
{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)}` : "")
},
{
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 }) },
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
{
title: "计划属性",
dataIndex: "planType",
render: (_, record) => getLabelName({list: PLAN_ENUM, status: record.planType})
},
{title: "发现隐患数", dataIndex: "hiddenNumber"},
{
title: "操作",
fixed: "right",