From 4640dcd68a549c51b0256d1a6693efe6128f8af3 Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Tue, 3 Feb 2026 09:33:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(inspection):=20=E8=A7=A3=E5=86=B3=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E6=A8=A1=E5=9D=97=E4=B8=AD=E7=9A=84=E4=BC=81=E4=B8=9A?= =?UTF-8?q?ID=E4=BC=A0=E9=80=92=E5=92=8C=E9=83=A8=E9=97=A8=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在隐患提交方法中添加corpId参数传递 - 修复partAdd接口调用的数据结构问题 - 为隐患数据添加corpId和tenantId字段 - 更新被检查单位负责人选择逻辑,使用正确的字段名 - 添加被检查单位企业ID必填验证 - 清空隐患列表时同时清除已删除隐患ID - 限制被检查单位部门选择只显示企业类型为2的单位 - 统一监督端检查列表搜索类型从all改为inType - 升级zy-react-library依赖版本 --- package.json | 2 +- .../Inspection/Inspection/Add/index.js | 25 +++++++++++++------ .../Inspection/Inspection/List/index.js | 2 +- .../Inspection/Inspector/List/index.js | 2 +- .../Inspection/Records/List/index.js | 2 +- .../Plan/Management/List/index.js | 2 +- .../Inspection/Inspection/List/index.js | 2 +- .../Inspection/Inspector/List/index.js | 2 +- .../Inspection/Records/List/index.js | 2 +- 9 files changed, 25 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index ad2d6c0..d48d1ff 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-to-print": "^3.2.0", - "zy-react-library": "^1.1.34" + "zy-react-library": "^1.1.36" }, "devDependencies": { "@antfu/eslint-config": "^5.4.1", diff --git a/src/pages/Container/BranchCompany/Inspection/Inspection/Add/index.js b/src/pages/Container/BranchCompany/Inspection/Inspection/Add/index.js index 322b647..bc4cccf 100644 --- a/src/pages/Container/BranchCompany/Inspection/Inspection/Add/index.js +++ b/src/pages/Container/BranchCompany/Inspection/Inspection/Add/index.js @@ -200,7 +200,7 @@ function Add(props) { }; // 保存隐患 - const handleHiddenSubmit = async (traceId, isDraft, index) => { + const handleHiddenSubmit = async (traceId, isDraft, index, corpId) => { await deleteFile({ single: false, files: hiddenList[index].deleteHiddenImageFiles, @@ -230,7 +230,7 @@ function Add(props) { }); if (hiddenList[index].hiddenPartType === "input") { - const { data } = await props["partAdd"]({hiddenregion: hiddenList[index].hiddenPart}); + const {data} = await props["partAdd"]({hiddenregion: hiddenList[index].hiddenPart}); hiddenList[index].hiddenPart = data } @@ -245,6 +245,8 @@ function Add(props) { hiddenId: id, state: isDraft === 0 ? 102 : 98, foreignKey: traceId, + corpId: corpId, + tenantId: corpId, hiddenJson: JSON.stringify({ confirm: 1, rectify: 1, @@ -258,7 +260,7 @@ function Add(props) { }; // 处理隐患数据 - const handleHiddenData = async (traceId, isDraft) => { + const handleHiddenData = async (traceId, isDraft, corpId) => { // 删除隐患 if (deleteHiddenIds.current.length > 0) { props["hiddenDelete"]({ids: deleteHiddenIds.current.join(",")}); @@ -281,7 +283,7 @@ function Add(props) { // 新增/更新隐患 for (let i = 0; i < hiddenList.length; i++) { - await handleHiddenSubmit(traceId, isDraft, i); + await handleHiddenSubmit(traceId, isDraft, i, corpId); } }; @@ -301,8 +303,8 @@ function Add(props) { // 提交主表单数据 const {traceId} = await submitInspectionData(values, situationList, inspectorList, signatureResult, isDraft); - // 处理隐患数据 - await handleHiddenData(traceId, isDraft); + // 处理隐患数据 {name: ["personUnderInspection", "corpId"], label: "被检查单位现场负责人企业id", onlyForLabel: true}, + await handleHiddenData(traceId, isDraft, values.personUnderInspection?.corpId); message.success("操作成功"); props.history.goBack(); @@ -377,6 +379,9 @@ function Add(props) { form.setFieldValue(["personUnderInspection", "userName"], ""); form.setFieldValue(["personUnderInspection", "corpId"], ""); form.setFieldValue(["personUnderInspection", "corpName"], ""); + + deleteHiddenIds.current.push(...hiddenList.map(item => item.id).filter(Boolean)) + setHiddenList([]) }} /> ), @@ -390,8 +395,8 @@ function Add(props) { params={{departmentId: personUnderInspectionDepartmentId}} onGetLabel={label => form.setFieldValue(["personUnderInspection", "userName"], label)} onGetOption={(option) => { - form.setFieldValue(["personUnderInspection", "corpId"], option.corpId); - form.setFieldValue(["personUnderInspection", "corpName"], option.corpName); + form.setFieldValue(["personUnderInspection", "corpId"], option.corpinfoId); + form.setFieldValue(["personUnderInspection", "corpName"], option.corpinfoName); }} /> ), @@ -517,6 +522,10 @@ function Add(props) {