From 16d266eef31a2a5cb8e1518bfdab5cf66714b903 Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Wed, 14 Jan 2026 10:06:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=E4=BF=AE=E5=A4=8D=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B7=AF=E5=BE=84=E5=92=8C=E5=AD=97=E6=AE=B5=E6=98=A0?= =?UTF-8?q?=E5=B0=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正了 qualificationsDetails 接口路径,去掉了末尾斜杠 - 更新了 qualificationsTypeList 接口路径为 getReviewedQualificationsTypeName - 将 parentProjectCorpName 字段映射更改为 groupCompanyName - 在多个组件中引入 getLabelName 工具函数 - 重构了资质类型选择的标签获取逻辑 - 修复了项目详情获取的数据传递方式 - 添加了路由监听以支持页面参数变化重新获取数据 - 调整了项目负责人表单项的布局结构 - 优化了安全管理协议上传组件的格式化代码 - 更新了列表页面的列配置,调整审核部门显示字段 --- src/api/qualificationStatistics/index.js | 4 +- .../Subcontract/List/index.js | 2 +- .../ProjectApprovalTwo/Submit/List/index.js | 2 +- .../ProjectFilingApplication/Add/index.js | 11 +- .../ProjectFilingApplication/ReView/index.js | 21 ++- .../ProjectFilingApplicationTwo/Add/index.js | 133 +++++++++--------- .../ProjectFilingApplicationTwo/List/index.js | 2 +- 7 files changed, 91 insertions(+), 84 deletions(-) diff --git a/src/api/qualificationStatistics/index.js b/src/api/qualificationStatistics/index.js index daad68e..9072fa8 100644 --- a/src/api/qualificationStatistics/index.js +++ b/src/api/qualificationStatistics/index.js @@ -49,7 +49,7 @@ export const userListByDeptId = declareRequest( ); export const qualificationsDetails = declareRequest( "qualificationStatisticsLoading", - `Post > @/xgfManager/qualifications/qualificationsDetails/`, + `Post > @/xgfManager/qualifications/qualificationsDetails`, ); export const projectAudit = declareRequest( "qualificationStatisticsLoading", @@ -85,5 +85,5 @@ export const projectUserChangeRecordList = declareRequest( ); export const qualificationsTypeList = declareRequest( "qualificationStatisticsLoading", - `Post > @/xgfManager/qualifications/projectUserChangeRecord/list`, + `Post > @/xgfManager/qualifications/getReviewedQualificationsTypeName`, ); diff --git a/src/pages/Container/Local/ProjectReview/ProjectApprovalTwo/Subcontract/List/index.js b/src/pages/Container/Local/ProjectReview/ProjectApprovalTwo/Subcontract/List/index.js index 255bf74..730f363 100644 --- a/src/pages/Container/Local/ProjectReview/ProjectApprovalTwo/Subcontract/List/index.js +++ b/src/pages/Container/Local/ProjectReview/ProjectApprovalTwo/Subcontract/List/index.js @@ -47,7 +47,7 @@ function List(props) { />
{ items: qualificationsTypeList, render: FORM_ITEM_RENDER_ENUM.SELECT, itemsField: { valueKey: "qualificationsTypeId", labelKey: "qualificationsTypeName" }, - onGetLabel: (label) => { - form.setFieldValue("qualificationsTypeName", label); - }, componentProps: { onChange: (event) => { + form.setFieldValue("qualificationsTypeName",getLabelName({ + list: qualificationsTypeList, + status: event, + idKey: "qualificationsTypeId", + nameKey: "qualificationsTypeName", + })) if (form.getFieldValue("isLocalCompany") === 0) { getDeptList(event); } diff --git a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplication/ReView/index.js b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplication/ReView/index.js index 140c312..7417546 100644 --- a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplication/ReView/index.js +++ b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplication/ReView/index.js @@ -36,8 +36,9 @@ function Review(props) { { bianma: "4", name: "货主单位" }, { bianma: "5", name: "驻港单位" }, ]; - const getData = async () => { - const projectDetailResult = await props["projectDetail"]({ id: query.id }); + + const getData = async (id = query.id) => { + const projectDetailResult = await props["projectDetail"]({ id }); if (!projectDetailResult || !projectDetailResult.data) { return; } @@ -74,6 +75,17 @@ function Review(props) { setInfo(projectData); }; + + useEffect(() => { + const unlisten = props.history.listen((location) => { + const searchParams = new URLSearchParams(location.search); + const newId = searchParams.get("id"); + console.log(newId); + + getData(newId); + }); + return unlisten; + }, []); const getProjectListAll = async () => { const { data } = await props["projectListAll"]({}); setProjectListAll(data); @@ -247,7 +259,7 @@ function Review(props) { style={{ marginLeft: "20px" }} type="primary" onClick={() => { - props.history.push(`../ProjectFilingApplication/reView?id=${info.relatedProjectId}`); + props.history.push(`./ReView?id=${info.relatedProjectId}`); }} > 查看一级项目资料 @@ -357,8 +369,7 @@ function Review(props) { onClick={() => { setViewProjectReviewUserModalOpen(true); setViewProjectReviewUserModalData({ - ...record, - eqQualificationinfoType: 1, + ...record }); }} > diff --git a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/Add/index.js b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/Add/index.js index 8c1af09..50d8d81 100644 --- a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/Add/index.js +++ b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/Add/index.js @@ -20,7 +20,7 @@ import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useTable from "zy-react-library/hooks/useTable"; import useUploadFile from "zy-react-library/hooks/useUploadFile"; -import { validatorEndTime } from "zy-react-library/utils"; +import { getLabelName,validatorEndTime } from "zy-react-library/utils"; import ViewProjectReviewUserModal from "~/components/ViewProjectReviewUserModal"; import { NS_QUALIFICATION_STATISTICS } from "~/enumerate/namespace"; @@ -128,7 +128,7 @@ const StepOneComponent = (props) => { const [qualificationsTypeList, setQualificationsTypeList] = useState([]); // 获取项目属地单位数据 const getCorpInfoList = async () => { - const { data } = await props["corpInfoList"]({ pageIndex: 1, pageSize: 1000, inType: [0] }); + const { data } = await props["corpInfoList"]({ pageIndex: 1, pageSize: 1000, inType: [1] }); setCorpInfoList(data); }; // 获取资质类型数据 @@ -213,28 +213,40 @@ const StepOneComponent = (props) => { options={[ { label: "项目基础信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER }, { name: "projectName", label: "项目名称" }, - { name: "userId", label: "项目负责人", render: ( - { - form.setFieldValue("userName", label); - }} - onGetOption={(option) => { - if (option) { - const extraInfo = { - name: option.name, - phone: option.phone || "", - postName: option.postName || "", - departmentId: option.departmentId || "", - departmentName: option.departmentName || "", - userId: option.id, - }; - handleProjectLeaderChange(option.name, extraInfo); - } - }} - onChange={(userId) => { + { + name: "userId", label: "项目负责人", render: ( + { + form.setFieldValue("userName", label); + }} + onGetOption={(option) => { + if (option) { + const extraInfo = { + name: option.name, + phone: option.phone || "", + postName: option.postName || "", + departmentId: option.departmentId || "", + departmentName: option.departmentName || "", + userId: option.id, + }; + handleProjectLeaderChange(option.name, extraInfo); + } + }} + onChange={(userId) => { + if (!userId) { + // 如果清空了项目负责人,从项目人员列表中移除 + const newUserList = props.usercontentAddCmdList.filter( + item => item.projectLeader !== 1, + ); + props.setUsercontentAddCmdList(newUserList); + } + }} + /> + ), componentProps: { + onChange: (userId) => { if (!userId) { // 如果清空了项目负责人,从项目人员列表中移除 const newUserList = props.usercontentAddCmdList.filter( @@ -242,19 +254,9 @@ const StepOneComponent = (props) => { ); props.setUsercontentAddCmdList(newUserList); } - }} - /> - ), componentProps: { - onChange: (userId) => { - if (!userId) { - // 如果清空了项目负责人,从项目人员列表中移除 - const newUserList = props.usercontentAddCmdList.filter( - item => item.projectLeader !== 1, - ); - props.setUsercontentAddCmdList(newUserList); - } - }, - } }, + }, + } + }, { name: "userName", label: "项目负责人", onlyForLabel: true }, { name: "initiationTime", label: "立项时间", render: FORM_ITEM_RENDER_ENUM.DATE }, { name: "startProjectTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE }, @@ -262,7 +264,7 @@ const StepOneComponent = (props) => { { name: "chooseForm", label: "项目选取形式", render: form.setFieldValue("chooseFormName", label)} /> }, { name: "chooseFormName", label: "项目选取形式名称", onlyForLabel: true }, { name: "fourNewFlag", label: "是否涉及四新工作内容", labelCol: { span: 8 }, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] }, - { name: "threePeopleFlag", label: "是否涉及三人及以上工作内容", labelCol: { span: 8 }, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] }, + { name: "threePeopleFlag", label: "是否涉及三人及以上工作内容", labelCol: { span: 9 }, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] }, { name: "nightWorkFlag", label: "是否涉及夜间作业", labelCol: { span: 8 }, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] }, { name: "specialFlag", label: "是否包含特殊作业", labelCol: { span: 8 }, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] }, { label: "项目审核信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER }, @@ -271,32 +273,21 @@ const StepOneComponent = (props) => { items: qualificationsTypeList, render: FORM_ITEM_RENDER_ENUM.SELECT, itemsField: { valueKey: "qualificationsTypeId", labelKey: "qualificationsTypeName" }, - onGetLabel: (label) => { - form.setFieldValue("qualificationsTypeName", label); - }, componentProps: { onChange: (event) => { - if (form.getFieldValue("isLocalCompany") === 0) { - getDeptList(event); - } props.setQualificationsTypeId(event); - form.setFieldsValue({ - recommendCorpId: "", - recommendCorpName: "", - recommendDeptId: "", - recommendDeptName: "", - recommendUserIds: [], - recommendUserNames: "", - manageDeptId: "", - manageDeptName: "", - manageUserIds: [], - manageUserNames: "", - }); + form.setFieldValue("qualificationsTypeName", getLabelName({ + list: qualificationsTypeList, + status: event, + idKey: "qualificationsTypeId", + nameKey: "qualificationsTypeName", + })) }, }, }, { name: "qualificationsTypeName", label: "项目类别名称", onlyForLabel: true }, - { name: "approvalCorpId", + { + name: "approvalCorpId", label: "集团公司审核", labelCol: { span: 5 }, items: corpInfoList, @@ -318,7 +309,7 @@ const StepOneComponent = (props) => { { name: "approvalCorpName", label: "集团公司审核名称", onlyForLabel: true }, { name: "approvalDeptId", - labelCol: { span: 5 }, + labelCol: { span: 6 }, label: "集团公司部门审核", render: ( { { name: "approvalUserIds", label: "集团公司人员审核", - labelCol: { span: 5 }, + labelCol: { span: 6 }, render: ( { ), }, { name: "approvalUserNames", label: "集团公司人员审核名称", onlyForLabel: true }, - { name: "projectFiles", label: "安全管理协议", span: 24, render: ( - { - form.setFieldValue("deleteProjectFileAddCmdList", [...(form.getFieldValue("deleteProjectFileAddCmdList") || []), file]); - }} - /> - ) }, + { + name: "projectFiles", label: "安全管理协议", span: 24, render: ( + { + form.setFieldValue("deleteProjectFileAddCmdList", [...(form.getFieldValue("deleteProjectFileAddCmdList") || []), file]); + }} + /> + ) + }, { name: "deleteProjectFileAddCmdList", label: "删除的安全管理协议", onlyForLabel: true }, { name: "agreementFileUuid", label: "安全协议uuid", onlyForLabel: true }, { name: "stakeholderLevel", onlyForLabel: true }, diff --git a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/List/index.js b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/List/index.js index 921af3b..a1875f1 100644 --- a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/List/index.js +++ b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/List/index.js @@ -69,10 +69,10 @@ function List(props) { )} columns={[ { title: "集团单位名称", dataIndex: "corpinfoName" }, + { title: "集团单位审核部门", dataIndex: "groupCompanyDeptName" }, { title: "一级项目名称", dataIndex: "parentProjectName" }, { title: "二级项目名称", dataIndex: "projectName" }, { title: "项目属地单位", dataIndex: "companyName" }, - { title: "上级审核主管部门", dataIndex: "manageDeptName" }, { title: "项目类别", dataIndex: "qualificationsTypeName" }, { title: "项目备案审核状态",