From af59333709831ee8f93179d5efbcaf7444f8db7e Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Mon, 2 Mar 2026 13:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AD=98=E5=9C=A8=E4=B8=8B?= =?UTF-8?q?=E4=B8=80=E6=AD=A5=E7=9A=84=E9=A1=B5=E9=9D=A2=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Qualification/Apply/Add/index.js | 101 ++++++---- .../ProjectFilingApplication/Add/index.js | 173 ++++++++++++++---- .../ProjectFilingApplicationTwo/Add/index.js | 65 +++++-- 3 files changed, 251 insertions(+), 88 deletions(-) diff --git a/src/pages/Container/BranchCompany/Qualification/Apply/Add/index.js b/src/pages/Container/BranchCompany/Qualification/Apply/Add/index.js index 98ddb5e..f8fa506 100644 --- a/src/pages/Container/BranchCompany/Qualification/Apply/Add/index.js +++ b/src/pages/Container/BranchCompany/Qualification/Apply/Add/index.js @@ -2,7 +2,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Divider, Form, message, Modal, Space, Spin } from "antd"; import dayjs from "dayjs"; import { cloneDeep } from "lodash-es"; -import { useEffect, useState } from "react"; +import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import Page from "zy-react-library/components/Page"; import DictionarySelect from "zy-react-library/components/Select/Dictionary"; @@ -26,6 +26,9 @@ function Add(props) { const [formValues, setFormValues] = useState({}); const [specialList, setSpecialList] = useState([]); const [qualificationsId, setQualificationsId] = useState(""); + const [stepTwoLoading, setStepTwoLoading] = useState(false); + + const stepTwoRef = useRef(null); const getData = async () => { const { data } = await props["qualificationApplyInfo"]({ id: query.id }); @@ -46,18 +49,55 @@ function Add(props) { }, []); return ( - + + + + + )} + > {currentStep === 1 - && } + && ( + + )} {currentStep === 2 && ( )} @@ -122,16 +162,16 @@ const StepOneComponent = (props) => { form.setFieldValue("qualificationsTypeName", label); }} onChange={() => { - // if (value === "wzgll") { - // await getCorpInfoList(1); - // } - // else { - // await getCorpInfoList(1); - // } - // form.setFieldValue("groupUnitName", ""); - // form.setFieldValue("groupUnitName", ""); - // form.setFieldValue("groupUnitDeptName", ""); - // form.setFieldValue("groupUnitUserName", ""); + // if (value === "wzgll") { + // await getCorpInfoList(1); + // } + // else { + // await getCorpInfoList(1); + // } + // form.setFieldValue("groupUnitName", ""); + // form.setFieldValue("groupUnitName", ""); + // form.setFieldValue("groupUnitDeptName", ""); + // form.setFieldValue("groupUnitUserName", ""); form.setFieldValue("qualificationsId", ""); }} /> @@ -228,7 +268,7 @@ const StepOneComponent = (props) => { /> ); }; -const StepTwoComponent = (props) => { +const StepTwoComponent = forwardRef((props, ref) => { const query = props.query; const specialList = props.specialList; @@ -362,11 +402,19 @@ const StepTwoComponent = (props) => { } }; + const isLoading = props.qualificationApply.qualificationApplyLoading || uploadFileLoading || deleteFileLoading || getFileLoading; + + useEffect(() => { + props.setLoading(isLoading); + }, [isLoading]); + + useImperativeHandle(ref, () => ({ + onSubmit, + })); + return (
- + {typeGroup.map(item => (
{`${item.dataTypeName}信息`} @@ -418,21 +466,6 @@ const StepTwoComponent = (props) => { />
))} -
- - - - -
{uploadFileModalOpen && ( { )}
); -}; +}); const FileUpload = (props) => { const [form] = Form.useForm(); diff --git a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplication/Add/index.js b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplication/Add/index.js index e59dc48..3d472a9 100644 --- a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplication/Add/index.js +++ b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplication/Add/index.js @@ -1,7 +1,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Divider, Form, message, Modal, Space, Spin } from "antd"; import dayjs from "dayjs"; -import { useEffect, useMemo, useState } from "react"; +import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/Gwj"; @@ -39,6 +39,10 @@ function Add(props) { const [projectApprovalFlowAddCmdList, setProjectApprovalFlowAddCmdList] = useState([]); // 项目审核流程 const [qualificationsTypeId, setQualificationsTypeId] = useState(); // 资质类型 const [corpinfoId, setCorpinfoId] = useState(); // 项目id + const [stepTwoLoading, setStepTwoLoading] = useState(false); + + const stepTwoRef = useRef(null); + const { getFile } = useGetFile(); // 获取详情数据 const getData = async () => { @@ -84,7 +88,31 @@ function Add(props) { }, []); return ( - + + + + + )} + > <> {currentStep === 1 && ( @@ -104,7 +132,7 @@ function Add(props) { {currentStep === 2 && ( )} @@ -285,13 +314,51 @@ const StepOneComponent = (props) => { { name: "userName", label: "项目负责人", onlyForLabel: true }, { name: "initiationTime", label: "立项时间", render: FORM_ITEM_RENDER_ENUM.DATE }, { name: "startProjectTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE }, - { name: "endProjectTime", label: "计划竣工时间", render: FORM_ITEM_RENDER_ENUM.DATE, rules: [validatorEndTime(startProjectTime)] }, - { name: "chooseForm", label: "项目选取形式", render: form.setFieldValue("chooseFormName", label)} /> }, + { + name: "endProjectTime", + label: "计划竣工时间", + render: FORM_ITEM_RENDER_ENUM.DATE, + rules: [validatorEndTime(startProjectTime)], + }, + { + 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: 10 }, 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: "否" }] }, + { + name: "fourNewFlag", + label: "是否涉及四新工作内容", + labelCol: { span: 8 }, + render: FORM_ITEM_RENDER_ENUM.RADIO, + items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }], + }, + { + name: "threePeopleFlag", + label: "是否涉及三人及以上工作内容", + labelCol: { span: 10 }, + 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 }, { name: "qualificationsTypeId", @@ -341,7 +408,13 @@ const StepOneComponent = (props) => { ), }, // { name: "qualificationsTypeName", label: "项目类别名称", onlyForLabel: true }, - { name: "subcontractFlag", label: "是否存在分包项目", span: 24, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] }, + { + name: "subcontractFlag", + label: "是否存在分包项目", + span: 24, + render: FORM_ITEM_RENDER_ENUM.RADIO, + items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }], + }, { name: "isLocalCompany", label: "是否为属地公司推荐", @@ -441,9 +514,12 @@ const StepOneComponent = (props) => { label: "选择主管部门", render: FORM_ITEM_RENDER_ENUM.SELECT, items: deptList, - itemsField: { valueKey: "deptId", labelKey: (item) => { - return `${item.deptName}(${item.corpName})`; - } }, + itemsField: { + valueKey: "deptId", + labelKey: (item) => { + return `${item.deptName}(${item.corpName})`; + }, + }, componentProps: { onChange: (event) => { const label2 = deptList.find(item => item.deptId === event); @@ -567,7 +643,7 @@ const StepOneComponent = (props) => { /> ); }; -const StepTwoComponent = (props) => { +const StepTwoComponent = forwardRef((props, ref) => { const query = props.query; const projectFileList = props.projectFileAddCmdList || []; // 项目资料 const usercontentList = props.usercontentAddCmdList || []; // 项目审核人员 @@ -597,7 +673,10 @@ const StepTwoComponent = (props) => { const getData = async () => { for (let i = 0; i < projectFileList.length; i++) { if (projectFileList[i].projectFileId) { - const files = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["148"], eqForeignKey: projectFileList[i].projectFileId }); + const files = await getFile({ + eqType: UPLOAD_FILE_TYPE_ENUM["148"], + eqForeignKey: projectFileList[i].projectFileId, + }); projectFileList[i].files = files; } } @@ -723,7 +802,15 @@ const StepTwoComponent = (props) => { userPostName: item.postName, projectLeader: item.projectLeader, })); - const data = { ...props.formValues, projectUserAddCmdList: [...userList], projectFileAddCmdList: [...projectFileList], projectLocalCompanyAddCmdList: [...projectLocalCompanyAddCmdList], projectApprovalUserAddCmdList: [...projectApprovalUserAddCmdList], projectApprovalFlowAddCmdList: [...projectApprovalFlowAddCmdList], corpinfoId }; + const data = { + ...props.formValues, + projectUserAddCmdList: [...userList], + projectFileAddCmdList: [...projectFileList], + projectLocalCompanyAddCmdList: [...projectLocalCompanyAddCmdList], + projectApprovalUserAddCmdList: [...projectApprovalUserAddCmdList], + projectApprovalFlowAddCmdList: [...projectApprovalFlowAddCmdList], + corpinfoId, + }; const { success } = await props[!query.id ? "projectAdd" : "projectUpdate"]({ ...data, id: query.id, @@ -745,11 +832,19 @@ const StepTwoComponent = (props) => { setChooseFilsListModalOpen(false); }; + const isLoading = props.qualificationStatistics.qualificationStatisticsLoading || uploadFileLoading || deleteFileLoading || getFileLoading; + + useEffect(() => { + props.setLoading(isLoading); + }, [isLoading]); + + useImperativeHandle(ref, () => ({ + onSubmit, + })); + return (
- +
项目相关资料 { rowKey={record => record.id || record.detailId} columns={[ { title: "材料名称", key: "dataName", dataIndex: "dataName" }, - { title: "上传时间", key: "createTime", dataIndex: "createTime", render: (_, record) => record.createTime || "-" }, + { + title: "上传时间", + key: "createTime", + dataIndex: "createTime", + render: (_, record) => record.createTime || "-", + }, { title: "时效性", key: "validityPeriod", @@ -859,17 +959,6 @@ const StepTwoComponent = (props) => { ]} /> -
- - - - -
{uploadFileModalOpen && ( { /> )} {viewProjectReviewUserModalOpen - && setViewProjectReviewUserModalOpen(false)} data={viewProjectReviewUserModalData} />} + && ( + setViewProjectReviewUserModalOpen(false)} + data={viewProjectReviewUserModalData} + /> + )} {chooseFilsListModalOpen && ( { )} ); -}; +}); const ChooseFilsComponent = (props) => { const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 存储选中的行键 const [selectedRows, setSelectedRows] = useState([]); // 存储选中行的完整数据 @@ -955,7 +1049,12 @@ const ChooseFilsComponent = (props) => { rowKey="detailId" columns={[ { title: "材料名称", dataIndex: "dataName" }, - { title: "上传时间", key: "createTime", dataIndex: "createTime", render: (_, record) => record.createTime || "-" }, + { + title: "上传时间", + key: "createTime", + dataIndex: "createTime", + render: (_, record) => record.createTime || "-", + }, { title: "时效性", key: "validityPeriod", @@ -1080,7 +1179,11 @@ const UserSelectComponent = (props) => { { title: "姓名", dataIndex: "name" }, { title: "所属部门", dataIndex: "departmentName" }, { title: "所属岗位", dataIndex: "postName" }, - { title: "是否存在人资系统", dataIndex: "rzFlag", render: (_, record) => record.rzFlag === 1 ? "是" : "否" }, + { + title: "是否存在人资系统", + dataIndex: "rzFlag", + render: (_, record) => record.rzFlag === 1 ? "是" : "否", + }, ]} {...tableProps} /> diff --git a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/Add/index.js b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/Add/index.js index 74efdfa..d41e933 100644 --- a/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/Add/index.js +++ b/src/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/Add/index.js @@ -1,7 +1,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Divider, Form, message, Modal, Space, Spin } from "antd"; import dayjs from "dayjs"; -import { useEffect, useMemo, useState } from "react"; +import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/Gwj"; @@ -38,6 +38,10 @@ function Add(props) { const [projectApprovalFlowAddCmdList, setProjectApprovalFlowAddCmdList] = useState([]); // 项目审核流程 const [qualificationsTypeId, setQualificationsTypeId] = useState(); // 资质类型 const [corpinfoId, setCorpinfoId] = useState(); // 项目id + const [stepTwoLoading, setStepTwoLoading] = useState(false); + + const stepTwoRef = useRef(null); + const { getFile } = useGetFile(); const getCurrentUserInfo = async () => { @@ -83,7 +87,31 @@ function Add(props) { }, []); return ( - + + + + + )} + > {currentStep === 1 && ( )} @@ -373,7 +402,7 @@ const StepOneComponent = (props) => { /> ); }; -const StepTwoComponent = (props) => { +const StepTwoComponent = forwardRef((props, ref) => { const query = props.query; const projectFileList = props.projectFileAddCmdList || []; // 项目资料 const usercontentList = props.usercontentAddCmdList || []; // 项目审核人员 @@ -550,11 +579,20 @@ const StepTwoComponent = (props) => { setProjectFileList([...enterList, ...formattedRows]); setChooseFilsListModalOpen(false); }; + + const isLoading = props.qualificationStatistics.qualificationStatisticsLoading || uploadFileLoading || deleteFileLoading || getFileLoading; + + useEffect(() => { + props.setLoading(isLoading); + }, [isLoading]); + + useImperativeHandle(ref, () => ({ + onSubmit, + })); + return (
- +
项目相关资料
{ ]} /> -
- - - - -
{uploadFileModalOpen && ( { )} ); -}; +}); const ChooseFilsComponent = (props) => { const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 存储选中的行键 const [selectedRows, setSelectedRows] = useState([]); // 存储选中行的完整数据