From 4033fe34108017cfdd827bf57309bc02d2af6689 Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Wed, 7 Jan 2026 17:11:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(inspection):=20=E4=BF=AE=E5=A4=8D=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=B5=81=E7=A8=8B=E4=B8=AD=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E5=92=8C=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 InspectionFlowModal 中不再需要的流程类型排序逻辑 - 修正 INSPECTION_STATE_ENUM 中的状态码映射关系 - 在多个检查列表页面中添加日期格式化功能 - 更新部门选择组件的搜索参数配置 - 为流程节点添加红色状态颜色映射 - 修复 HiddenAddModal 组件中的 useEffect 依赖项问题 --- src/components/InspectionFlowModal/index.js | 13 +------------ src/enumerate/constant/index.js | 6 +++--- .../Inspection/Acceptance/List/index.js | 5 +++-- .../BranchCompany/Inspection/Assign/List/index.js | 3 ++- .../BranchCompany/Inspection/Defense/List/index.js | 3 ++- .../Inspection/Inspected/List/index.js | 3 ++- .../Inspection/Add/components/HiddenAdd/index.js | 3 +-- .../Inspection/Inspection/Add/index.js | 3 ++- .../Inspection/Inspection/List/index.js | 3 ++- .../Inspection/Inspector/List/index.js | 3 ++- .../BranchCompany/Inspection/Records/List/index.js | 3 ++- .../Management/PersonnelExecutionDetails/index.js | 3 ++- .../Plan/Management/PlanExecutionDetails/index.js | 3 ++- .../Supervision/Inspection/Acceptance/List/index.js | 2 +- .../Supervision/Inspection/Inspection/Add/index.js | 2 +- src/utils/flow.js | 1 + 16 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/components/InspectionFlowModal/index.js b/src/components/InspectionFlowModal/index.js index 17ba115..28ca559 100644 --- a/src/components/InspectionFlowModal/index.js +++ b/src/components/InspectionFlowModal/index.js @@ -12,18 +12,7 @@ function InspectionFlowModal(props) { 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); + const { nodes, edges } = getFlowData(data.flowCOList, data.thisFlow); setNodes(nodes); setEdges(edges); }; diff --git a/src/enumerate/constant/index.js b/src/enumerate/constant/index.js index 978c09c..4242407 100644 --- a/src/enumerate/constant/index.js +++ b/src/enumerate/constant/index.js @@ -11,9 +11,9 @@ export const INSPECTION_QUESTION_ENUM = [ ]; export const INSPECTION_STATE_ENUM = [ - { bianma: "100", name: "待核实" }, - { bianma: "200", name: "待确认" }, - { bianma: "300", name: "待指派" }, + { bianma: "200", name: "待核实" }, + { bianma: "300", name: "待确认" }, + { bianma: "301", name: "待指派" }, { bianma: "400", name: "待验收" }, { bianma: "500", name: "检查归档" }, { bianma: "600", name: "检查核实打回" }, diff --git a/src/pages/Container/BranchCompany/Inspection/Acceptance/List/index.js b/src/pages/Container/BranchCompany/Inspection/Acceptance/List/index.js index 8c42cba..fc5c579 100644 --- a/src/pages/Container/BranchCompany/Inspection/Acceptance/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Acceptance/List/index.js @@ -8,6 +8,7 @@ import DictionarySelectTree from "zy-react-library/components/SelectTree/Diction 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 { formatDate } from "~/utils/dateFormat"; import { INSPECTION_QUESTION_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; @@ -37,7 +38,7 @@ function List(props) { { name: "inspectionUserName", label: "检查人" }, { name: "type", label: "检查类型", render: }, { name: "checkTime", label: "检查时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE }, - { name: "inspectedDepartmentId", label: "被检查单位", render: }, + { name: "inspectedDepartmentId", label: "被检查单位", render: }, { name: "inspectedUserName", label: "被检查单位现场负责人" }, ]} form={form} @@ -51,7 +52,7 @@ function List(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", render: () => "待验收" }, { title: "发现隐患数", dataIndex: "hiddenNumber" }, { diff --git a/src/pages/Container/BranchCompany/Inspection/Assign/List/index.js b/src/pages/Container/BranchCompany/Inspection/Assign/List/index.js index b04f089..eae7dab 100644 --- a/src/pages/Container/BranchCompany/Inspection/Assign/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Assign/List/index.js @@ -8,6 +8,7 @@ import DictionarySelectTree from "zy-react-library/components/SelectTree/Diction 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 { formatDate } from "~/utils/dateFormat"; import { INSPECTION_QUESTION_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; @@ -51,7 +52,7 @@ function List(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", render: () => "待指派" }, { title: "发现隐患数", dataIndex: "hiddenNumber" }, { diff --git a/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js b/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js index f330607..234dabb 100644 --- a/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Defense/List/index.js @@ -16,6 +16,7 @@ import useGetFile from "zy-react-library/hooks/useGetFile"; import useTable from "zy-react-library/hooks/useTable"; import useUploadFile from "zy-react-library/hooks/useUploadFile"; import { getFileUrl } from "zy-react-library/utils"; +import { formatDate } from "~/utils/dateFormat"; import { INSPECTION_QUESTION_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; @@ -64,7 +65,7 @@ function List(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", render: () => "被检查单位负责人申辩" }, { title: "发现隐患数", dataIndex: "hiddenNumber" }, { diff --git a/src/pages/Container/BranchCompany/Inspection/Inspected/List/index.js b/src/pages/Container/BranchCompany/Inspection/Inspected/List/index.js index d965d5a..838de63 100644 --- a/src/pages/Container/BranchCompany/Inspection/Inspected/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Inspected/List/index.js @@ -14,6 +14,7 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; import useTable from "zy-react-library/hooks/useTable"; import useUploadFile from "zy-react-library/hooks/useUploadFile"; +import { formatDate } from "~/utils/dateFormat"; import { INSPECTION_QUESTION_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; @@ -60,7 +61,7 @@ function List(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", render: () => "待确认" }, { title: "发现隐患数", dataIndex: "hiddenNumber" }, { diff --git a/src/pages/Container/BranchCompany/Inspection/Inspection/Add/components/HiddenAdd/index.js b/src/pages/Container/BranchCompany/Inspection/Inspection/Add/components/HiddenAdd/index.js index 88e53eb..5446722 100644 --- a/src/pages/Container/BranchCompany/Inspection/Inspection/Add/components/HiddenAdd/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Inspection/Add/components/HiddenAdd/index.js @@ -12,10 +12,9 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; function HiddenAddModal(props) { const [form] = Form.useForm(); const [hiddenPartType, setHiddenPartType] = useState("select"); - useEffect(() => { form.setFieldsValue(props.hiddenInfo); - }, []); + }, [props.hiddenInfo]); const onSubmit = (values) => { props.onConfirm({ diff --git a/src/pages/Container/BranchCompany/Inspection/Inspection/Add/index.js b/src/pages/Container/BranchCompany/Inspection/Inspection/Add/index.js index a6327bc..1341a58 100644 --- a/src/pages/Container/BranchCompany/Inspection/Inspection/Add/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Inspection/Add/index.js @@ -369,7 +369,8 @@ function Add(props) { label: "被检查单位", render: ( form.setFieldValue(["personUnderInspection", "departmentName"], label)} onChange={() => { form.setFieldValue(["personUnderInspection", "userId"], ""); diff --git a/src/pages/Container/BranchCompany/Inspection/Inspection/List/index.js b/src/pages/Container/BranchCompany/Inspection/Inspection/List/index.js index 13d85c5..42dff24 100644 --- a/src/pages/Container/BranchCompany/Inspection/Inspection/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Inspection/List/index.js @@ -13,6 +13,7 @@ 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 { 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"; @@ -79,7 +80,7 @@ function List(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart && record.timeEnd ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart && record.timeEnd ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", diff --git a/src/pages/Container/BranchCompany/Inspection/Inspector/List/index.js b/src/pages/Container/BranchCompany/Inspection/Inspector/List/index.js index 2b4ddc6..710f82c 100644 --- a/src/pages/Container/BranchCompany/Inspection/Inspector/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Inspector/List/index.js @@ -13,6 +13,7 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; import useTable from "zy-react-library/hooks/useTable"; import useUploadFile from "zy-react-library/hooks/useUploadFile"; +import { formatDate } from "~/utils/dateFormat"; import { INSPECTION_QUESTION_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; @@ -58,7 +59,7 @@ function List(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", render: () => "待核实" }, { title: "发现隐患数", dataIndex: "hiddenNumber" }, { diff --git a/src/pages/Container/BranchCompany/Inspection/Records/List/index.js b/src/pages/Container/BranchCompany/Inspection/Records/List/index.js index 78820c0..fe0ca4a 100644 --- a/src/pages/Container/BranchCompany/Inspection/Records/List/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Records/List/index.js @@ -15,6 +15,7 @@ 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 InspectionFlowModal from "~/components/InspectionFlowModal"; import { INSPECTION_QUESTION_ENUM, INSPECTION_STATE_ENUM, PLAN_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; @@ -169,7 +170,7 @@ function List(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", diff --git a/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails/index.js b/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails/index.js index 78e87d6..0e9b4b5 100644 --- a/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails/index.js +++ b/src/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails/index.js @@ -5,6 +5,7 @@ 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 { formatDate } from "~/utils/dateFormat"; import { INSPECTION_STATE_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; import ViewInfo from "~/pages/Container/BranchCompany/Plan/ViewInfo"; @@ -28,7 +29,7 @@ function PersonnelExecutionDetails(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", diff --git a/src/pages/Container/BranchCompany/Plan/Management/PlanExecutionDetails/index.js b/src/pages/Container/BranchCompany/Plan/Management/PlanExecutionDetails/index.js index c0f828a..ed0a4a1 100644 --- a/src/pages/Container/BranchCompany/Plan/Management/PlanExecutionDetails/index.js +++ b/src/pages/Container/BranchCompany/Plan/Management/PlanExecutionDetails/index.js @@ -5,6 +5,7 @@ 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 { formatDate } from "~/utils/dateFormat"; import { INSPECTION_STATE_ENUM } from "~/enumerate/constant"; import { NS_INSPECTION } from "~/enumerate/namespace"; import ViewInfo from "~/pages/Container/BranchCompany/Plan/ViewInfo"; @@ -29,7 +30,7 @@ function PlanExecutionDetails(props) { { title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" }, { title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 }, { title: "检查类型", dataIndex: "typeName" }, - { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") }, + { title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${formatDate(record.timeStart)}至${formatDate(record.timeEnd)}止` : "") }, { title: "检查状态", dataIndex: "status", diff --git a/src/pages/Container/Supervision/Inspection/Acceptance/List/index.js b/src/pages/Container/Supervision/Inspection/Acceptance/List/index.js index 4aca892..cf014a9 100644 --- a/src/pages/Container/Supervision/Inspection/Acceptance/List/index.js +++ b/src/pages/Container/Supervision/Inspection/Acceptance/List/index.js @@ -1,7 +1,7 @@ import AcceptanceList from "~/pages/Container/BranchCompany/Inspection/Acceptance/List"; function List(props) { - return ; + return ; } export default List; diff --git a/src/pages/Container/Supervision/Inspection/Inspection/Add/index.js b/src/pages/Container/Supervision/Inspection/Inspection/Add/index.js index c0ae6cc..2f436f4 100644 --- a/src/pages/Container/Supervision/Inspection/Inspection/Add/index.js +++ b/src/pages/Container/Supervision/Inspection/Inspection/Add/index.js @@ -1,7 +1,7 @@ import InspectionAdd from "~/pages/Container/BranchCompany/Inspection/Inspection/Add"; function Add(props) { - return ; + return ; } export default Add; diff --git a/src/utils/flow.js b/src/utils/flow.js index ebc67a8..98aee54 100644 --- a/src/utils/flow.js +++ b/src/utils/flow.js @@ -10,6 +10,7 @@ export const getStatusColor = (status, type, thisFlow) => { case 0: return "#1890ff"; // 蓝色 case 1: return "#52c41a"; // 绿色 case 2: return "#52c41a"; // 绿色 + case 3: return "#ff4d4f"; // 红色 default: return "#1890ff"; } };