优化存在下一步的页面按钮位置
parent
082be2d4e3
commit
af59333709
|
|
@ -2,7 +2,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { Button, Divider, Form, message, Modal, Space, Spin } from "antd";
|
import { Button, Divider, Form, message, Modal, Space, Spin } from "antd";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { cloneDeep } from "lodash-es";
|
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 FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
import Page from "zy-react-library/components/Page";
|
import Page from "zy-react-library/components/Page";
|
||||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||||
|
|
@ -26,6 +26,9 @@ function Add(props) {
|
||||||
const [formValues, setFormValues] = useState({});
|
const [formValues, setFormValues] = useState({});
|
||||||
const [specialList, setSpecialList] = useState([]);
|
const [specialList, setSpecialList] = useState([]);
|
||||||
const [qualificationsId, setQualificationsId] = useState("");
|
const [qualificationsId, setQualificationsId] = useState("");
|
||||||
|
const [stepTwoLoading, setStepTwoLoading] = useState(false);
|
||||||
|
|
||||||
|
const stepTwoRef = useRef(null);
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const { data } = await props["qualificationApplyInfo"]({ id: query.id });
|
const { data } = await props["qualificationApplyInfo"]({ id: query.id });
|
||||||
|
|
@ -46,18 +49,55 @@ function Add(props) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerTitle={query.resubmit ? "重新提交" : (query.id ? "编辑" : "新增")} isShowFooter={false}>
|
<Page
|
||||||
|
headerTitle={query.resubmit ? "重新提交" : (query.id ? "编辑" : "新增")}
|
||||||
|
isShowFooter={currentStep === 2}
|
||||||
|
customActionButtons={(
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
loading={stepTwoLoading}
|
||||||
|
onClick={() => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "提示",
|
||||||
|
content: "填写的信息将被清除,确定要返回吗?",
|
||||||
|
onOk: () => setCurrentStep(1),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
上一步
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
loading={stepTwoLoading}
|
||||||
|
onClick={() => {
|
||||||
|
stepTwoRef.current?.onSubmit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
提交审核
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
>
|
||||||
{currentStep === 1
|
{currentStep === 1
|
||||||
&& <StepOne setFormValues={setFormValues} setCurrentStep={setCurrentStep} setQualificationsId={setQualificationsId} formValues={formValues} form={form} />}
|
&& (
|
||||||
|
<StepOne
|
||||||
|
setFormValues={setFormValues}
|
||||||
|
setCurrentStep={setCurrentStep}
|
||||||
|
setQualificationsId={setQualificationsId}
|
||||||
|
formValues={formValues}
|
||||||
|
form={form}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{currentStep === 2
|
{currentStep === 2
|
||||||
&& (
|
&& (
|
||||||
<StepTwo
|
<StepTwo
|
||||||
setCurrentStep={setCurrentStep}
|
ref={stepTwoRef}
|
||||||
formValues={formValues}
|
formValues={formValues}
|
||||||
query={query}
|
query={query}
|
||||||
setSpecialList={setSpecialList}
|
setSpecialList={setSpecialList}
|
||||||
qualificationsId={qualificationsId}
|
qualificationsId={qualificationsId}
|
||||||
specialList={specialList}
|
specialList={specialList}
|
||||||
|
setLoading={setStepTwoLoading}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Page>
|
</Page>
|
||||||
|
|
@ -122,16 +162,16 @@ const StepOneComponent = (props) => {
|
||||||
form.setFieldValue("qualificationsTypeName", label);
|
form.setFieldValue("qualificationsTypeName", label);
|
||||||
}}
|
}}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
// if (value === "wzgll") {
|
// if (value === "wzgll") {
|
||||||
// await getCorpInfoList(1);
|
// await getCorpInfoList(1);
|
||||||
// }
|
// }
|
||||||
// else {
|
// else {
|
||||||
// await getCorpInfoList(1);
|
// await getCorpInfoList(1);
|
||||||
// }
|
// }
|
||||||
// form.setFieldValue("groupUnitName", "");
|
// form.setFieldValue("groupUnitName", "");
|
||||||
// form.setFieldValue("groupUnitName", "");
|
// form.setFieldValue("groupUnitName", "");
|
||||||
// form.setFieldValue("groupUnitDeptName", "");
|
// form.setFieldValue("groupUnitDeptName", "");
|
||||||
// form.setFieldValue("groupUnitUserName", "");
|
// form.setFieldValue("groupUnitUserName", "");
|
||||||
form.setFieldValue("qualificationsId", "");
|
form.setFieldValue("qualificationsId", "");
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
@ -228,7 +268,7 @@ const StepOneComponent = (props) => {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
const StepTwoComponent = (props) => {
|
const StepTwoComponent = forwardRef((props, ref) => {
|
||||||
const query = props.query;
|
const query = props.query;
|
||||||
|
|
||||||
const specialList = props.specialList;
|
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 (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Spin
|
<Spin spinning={isLoading}>
|
||||||
spinning={props.qualificationApply.qualificationApplyLoading || uploadFileLoading || deleteFileLoading || getFileLoading}
|
|
||||||
>
|
|
||||||
{typeGroup.map(item => (
|
{typeGroup.map(item => (
|
||||||
<div key={item.dataType}>
|
<div key={item.dataType}>
|
||||||
<Divider orientation="left">{`${item.dataTypeName}信息`}</Divider>
|
<Divider orientation="left">{`${item.dataTypeName}信息`}</Divider>
|
||||||
|
|
@ -418,21 +466,6 @@ const StepTwoComponent = (props) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
<div style={{ textAlign: "center", marginTop: 20 }}>
|
|
||||||
<Space>
|
|
||||||
<Button onClick={() => {
|
|
||||||
Modal.confirm({
|
|
||||||
title: "提示",
|
|
||||||
content: "填写的信息将被清除,确定要返回吗?",
|
|
||||||
onOk: () => props.setCurrentStep(1),
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
上一步
|
|
||||||
</Button>
|
|
||||||
<Button type="primary" onClick={onSubmit}>提交审核</Button>
|
|
||||||
</Space>
|
|
||||||
</div>
|
|
||||||
</Spin>
|
</Spin>
|
||||||
{uploadFileModalOpen && (
|
{uploadFileModalOpen && (
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
|
@ -448,7 +481,7 @@ const StepTwoComponent = (props) => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
|
|
||||||
const FileUpload = (props) => {
|
const FileUpload = (props) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { Button, Divider, Form, message, Modal, Space, Spin } from "antd";
|
import { Button, Divider, Form, message, Modal, Space, Spin } from "antd";
|
||||||
import dayjs from "dayjs";
|
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 FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/Gwj";
|
import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/Gwj";
|
||||||
|
|
@ -39,6 +39,10 @@ function Add(props) {
|
||||||
const [projectApprovalFlowAddCmdList, setProjectApprovalFlowAddCmdList] = useState([]); // 项目审核流程
|
const [projectApprovalFlowAddCmdList, setProjectApprovalFlowAddCmdList] = useState([]); // 项目审核流程
|
||||||
const [qualificationsTypeId, setQualificationsTypeId] = useState(); // 资质类型
|
const [qualificationsTypeId, setQualificationsTypeId] = useState(); // 资质类型
|
||||||
const [corpinfoId, setCorpinfoId] = useState(); // 项目id
|
const [corpinfoId, setCorpinfoId] = useState(); // 项目id
|
||||||
|
const [stepTwoLoading, setStepTwoLoading] = useState(false);
|
||||||
|
|
||||||
|
const stepTwoRef = useRef(null);
|
||||||
|
|
||||||
const { getFile } = useGetFile();
|
const { getFile } = useGetFile();
|
||||||
// 获取详情数据
|
// 获取详情数据
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
|
|
@ -84,7 +88,31 @@ function Add(props) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerTitle={query.id ? "编辑" : "项目备案申请"} isShowFooter={false}>
|
<Page
|
||||||
|
headerTitle={query.id ? "编辑" : "项目备案申请"}
|
||||||
|
isShowFooter={currentStep === 2}
|
||||||
|
customActionButtons={(
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
loading={stepTwoLoading}
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentStep(1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
上一步
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
loading={stepTwoLoading}
|
||||||
|
onClick={() => {
|
||||||
|
stepTwoRef.current?.onSubmit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
提交审核
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
>
|
||||||
<>
|
<>
|
||||||
{currentStep === 1
|
{currentStep === 1
|
||||||
&& (
|
&& (
|
||||||
|
|
@ -104,7 +132,7 @@ function Add(props) {
|
||||||
{currentStep === 2
|
{currentStep === 2
|
||||||
&& (
|
&& (
|
||||||
<StepTwo
|
<StepTwo
|
||||||
setCurrentStep={setCurrentStep}
|
ref={stepTwoRef}
|
||||||
formValues={formValues}
|
formValues={formValues}
|
||||||
query={query}
|
query={query}
|
||||||
setUsercontentAddCmdList={setUsercontentAddCmdList}
|
setUsercontentAddCmdList={setUsercontentAddCmdList}
|
||||||
|
|
@ -116,6 +144,7 @@ function Add(props) {
|
||||||
projectApprovalFlowAddCmdList={projectApprovalFlowAddCmdList}
|
projectApprovalFlowAddCmdList={projectApprovalFlowAddCmdList}
|
||||||
corpinfoId={corpinfoId}
|
corpinfoId={corpinfoId}
|
||||||
qualificationsTypeId={qualificationsTypeId}
|
qualificationsTypeId={qualificationsTypeId}
|
||||||
|
setLoading={setStepTwoLoading}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
@ -285,13 +314,51 @@ const StepOneComponent = (props) => {
|
||||||
{ name: "userName", label: "项目负责人", onlyForLabel: true },
|
{ name: "userName", label: "项目负责人", onlyForLabel: true },
|
||||||
{ name: "initiationTime", label: "立项时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
{ name: "initiationTime", label: "立项时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||||
{ name: "startProjectTime", 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: <DictionarySelect dictValue="project_choose_form" onGetLabel={label => form.setFieldValue("chooseFormName", label)} /> },
|
name: "endProjectTime",
|
||||||
|
label: "计划竣工时间",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||||
|
rules: [validatorEndTime(startProjectTime)],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "chooseForm",
|
||||||
|
label: "项目选取形式",
|
||||||
|
render: (
|
||||||
|
<DictionarySelect
|
||||||
|
dictValue="project_choose_form"
|
||||||
|
onGetLabel={label => form.setFieldValue("chooseFormName", label)}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
{ name: "chooseFormName", label: "项目选取形式名称", onlyForLabel: true },
|
{ 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: "fourNewFlag",
|
||||||
{ name: "nightWorkFlag", label: "是否涉及夜间作业", labelCol: { span: 8 }, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] },
|
label: "是否涉及四新工作内容",
|
||||||
{ name: "specialFlag", label: "是否包含特殊作业", labelCol: { span: 8 }, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }] },
|
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 },
|
{ label: "项目审核信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||||
{
|
{
|
||||||
name: "qualificationsTypeId",
|
name: "qualificationsTypeId",
|
||||||
|
|
@ -341,7 +408,13 @@ const StepOneComponent = (props) => {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// { name: "qualificationsTypeName", label: "项目类别名称", onlyForLabel: true },
|
// { 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",
|
name: "isLocalCompany",
|
||||||
label: "是否为属地公司推荐",
|
label: "是否为属地公司推荐",
|
||||||
|
|
@ -441,9 +514,12 @@ const StepOneComponent = (props) => {
|
||||||
label: "选择主管部门",
|
label: "选择主管部门",
|
||||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
items: deptList,
|
items: deptList,
|
||||||
itemsField: { valueKey: "deptId", labelKey: (item) => {
|
itemsField: {
|
||||||
return `${item.deptName}(${item.corpName})`;
|
valueKey: "deptId",
|
||||||
} },
|
labelKey: (item) => {
|
||||||
|
return `${item.deptName}(${item.corpName})`;
|
||||||
|
},
|
||||||
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
onChange: (event) => {
|
onChange: (event) => {
|
||||||
const label2 = deptList.find(item => item.deptId === 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 query = props.query;
|
||||||
const projectFileList = props.projectFileAddCmdList || []; // 项目资料
|
const projectFileList = props.projectFileAddCmdList || []; // 项目资料
|
||||||
const usercontentList = props.usercontentAddCmdList || []; // 项目审核人员
|
const usercontentList = props.usercontentAddCmdList || []; // 项目审核人员
|
||||||
|
|
@ -597,7 +673,10 @@ const StepTwoComponent = (props) => {
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
for (let i = 0; i < projectFileList.length; i++) {
|
for (let i = 0; i < projectFileList.length; i++) {
|
||||||
if (projectFileList[i].projectFileId) {
|
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;
|
projectFileList[i].files = files;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -723,7 +802,15 @@ const StepTwoComponent = (props) => {
|
||||||
userPostName: item.postName,
|
userPostName: item.postName,
|
||||||
projectLeader: item.projectLeader,
|
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"]({
|
const { success } = await props[!query.id ? "projectAdd" : "projectUpdate"]({
|
||||||
...data,
|
...data,
|
||||||
id: query.id,
|
id: query.id,
|
||||||
|
|
@ -745,11 +832,19 @@ const StepTwoComponent = (props) => {
|
||||||
setChooseFilsListModalOpen(false);
|
setChooseFilsListModalOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isLoading = props.qualificationStatistics.qualificationStatisticsLoading || uploadFileLoading || deleteFileLoading || getFileLoading;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
props.setLoading(isLoading);
|
||||||
|
}, [isLoading]);
|
||||||
|
|
||||||
|
useImperativeHandle(ref, () => ({
|
||||||
|
onSubmit,
|
||||||
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Spin
|
<Spin spinning={isLoading}>
|
||||||
spinning={props.qualificationStatistics.qualificationStatisticsLoading || uploadFileLoading || deleteFileLoading || getFileLoading}
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<Divider orientation="left">项目相关资料</Divider>
|
<Divider orientation="left">项目相关资料</Divider>
|
||||||
<Table
|
<Table
|
||||||
|
|
@ -783,7 +878,12 @@ const StepTwoComponent = (props) => {
|
||||||
rowKey={record => record.id || record.detailId}
|
rowKey={record => record.id || record.detailId}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "材料名称", key: "dataName", dataIndex: "dataName" },
|
{ title: "材料名称", key: "dataName", dataIndex: "dataName" },
|
||||||
{ title: "上传时间", key: "createTime", dataIndex: "createTime", render: (_, record) => record.createTime || "-" },
|
{
|
||||||
|
title: "上传时间",
|
||||||
|
key: "createTime",
|
||||||
|
dataIndex: "createTime",
|
||||||
|
render: (_, record) => record.createTime || "-",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "时效性",
|
title: "时效性",
|
||||||
key: "validityPeriod",
|
key: "validityPeriod",
|
||||||
|
|
@ -859,17 +959,6 @@ const StepTwoComponent = (props) => {
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ textAlign: "center", marginTop: 20 }}>
|
|
||||||
<Space>
|
|
||||||
<Button onClick={() => {
|
|
||||||
props.setCurrentStep(1);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
上一步
|
|
||||||
</Button>
|
|
||||||
<Button type="primary" onClick={onSubmit}>提交审核</Button>
|
|
||||||
</Space>
|
|
||||||
</div>
|
|
||||||
</Spin>
|
</Spin>
|
||||||
{uploadFileModalOpen && (
|
{uploadFileModalOpen && (
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
|
@ -894,7 +983,12 @@ const StepTwoComponent = (props) => {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{viewProjectReviewUserModalOpen
|
{viewProjectReviewUserModalOpen
|
||||||
&& <ViewProjectReviewUserModal onCancel={() => setViewProjectReviewUserModalOpen(false)} data={viewProjectReviewUserModalData} />}
|
&& (
|
||||||
|
<ViewProjectReviewUserModal
|
||||||
|
onCancel={() => setViewProjectReviewUserModalOpen(false)}
|
||||||
|
data={viewProjectReviewUserModalData}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{chooseFilsListModalOpen && (
|
{chooseFilsListModalOpen && (
|
||||||
<ChooseFilsList
|
<ChooseFilsList
|
||||||
data={projectFileList}
|
data={projectFileList}
|
||||||
|
|
@ -907,7 +1001,7 @@ const StepTwoComponent = (props) => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
const ChooseFilsComponent = (props) => {
|
const ChooseFilsComponent = (props) => {
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 存储选中的行键
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 存储选中的行键
|
||||||
const [selectedRows, setSelectedRows] = useState([]); // 存储选中行的完整数据
|
const [selectedRows, setSelectedRows] = useState([]); // 存储选中行的完整数据
|
||||||
|
|
@ -955,7 +1049,12 @@ const ChooseFilsComponent = (props) => {
|
||||||
rowKey="detailId"
|
rowKey="detailId"
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "材料名称", dataIndex: "dataName" },
|
{ title: "材料名称", dataIndex: "dataName" },
|
||||||
{ title: "上传时间", key: "createTime", dataIndex: "createTime", render: (_, record) => record.createTime || "-" },
|
{
|
||||||
|
title: "上传时间",
|
||||||
|
key: "createTime",
|
||||||
|
dataIndex: "createTime",
|
||||||
|
render: (_, record) => record.createTime || "-",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "时效性",
|
title: "时效性",
|
||||||
key: "validityPeriod",
|
key: "validityPeriod",
|
||||||
|
|
@ -1080,7 +1179,11 @@ const UserSelectComponent = (props) => {
|
||||||
{ title: "姓名", dataIndex: "name" },
|
{ title: "姓名", dataIndex: "name" },
|
||||||
{ title: "所属部门", dataIndex: "departmentName" },
|
{ title: "所属部门", dataIndex: "departmentName" },
|
||||||
{ title: "所属岗位", dataIndex: "postName" },
|
{ title: "所属岗位", dataIndex: "postName" },
|
||||||
{ title: "是否存在人资系统", dataIndex: "rzFlag", render: (_, record) => record.rzFlag === 1 ? "是" : "否" },
|
{
|
||||||
|
title: "是否存在人资系统",
|
||||||
|
dataIndex: "rzFlag",
|
||||||
|
render: (_, record) => record.rzFlag === 1 ? "是" : "否",
|
||||||
|
},
|
||||||
]}
|
]}
|
||||||
{...tableProps}
|
{...tableProps}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { Button, Divider, Form, message, Modal, Space, Spin } from "antd";
|
import { Button, Divider, Form, message, Modal, Space, Spin } from "antd";
|
||||||
import dayjs from "dayjs";
|
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 FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/Gwj";
|
import DepartmentLeftTree from "zy-react-library/components/LeftTree/Department/Gwj";
|
||||||
|
|
@ -38,6 +38,10 @@ function Add(props) {
|
||||||
const [projectApprovalFlowAddCmdList, setProjectApprovalFlowAddCmdList] = useState([]); // 项目审核流程
|
const [projectApprovalFlowAddCmdList, setProjectApprovalFlowAddCmdList] = useState([]); // 项目审核流程
|
||||||
const [qualificationsTypeId, setQualificationsTypeId] = useState(); // 资质类型
|
const [qualificationsTypeId, setQualificationsTypeId] = useState(); // 资质类型
|
||||||
const [corpinfoId, setCorpinfoId] = useState(); // 项目id
|
const [corpinfoId, setCorpinfoId] = useState(); // 项目id
|
||||||
|
const [stepTwoLoading, setStepTwoLoading] = useState(false);
|
||||||
|
|
||||||
|
const stepTwoRef = useRef(null);
|
||||||
|
|
||||||
const { getFile } = useGetFile();
|
const { getFile } = useGetFile();
|
||||||
|
|
||||||
const getCurrentUserInfo = async () => {
|
const getCurrentUserInfo = async () => {
|
||||||
|
|
@ -83,7 +87,31 @@ function Add(props) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerTitle={query.id ? "编辑" : "新增"} isShowFooter={false}>
|
<Page
|
||||||
|
headerTitle={query.id ? "编辑" : "新增"}
|
||||||
|
isShowFooter={currentStep === 2}
|
||||||
|
customActionButtons={(
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
loading={stepTwoLoading}
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentStep(1);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
上一步
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
loading={stepTwoLoading}
|
||||||
|
onClick={() => {
|
||||||
|
stepTwoRef.current?.onSubmit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
提交审核
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
>
|
||||||
{currentStep === 1
|
{currentStep === 1
|
||||||
&& (
|
&& (
|
||||||
<StepOne
|
<StepOne
|
||||||
|
|
@ -101,7 +129,7 @@ function Add(props) {
|
||||||
{currentStep === 2
|
{currentStep === 2
|
||||||
&& (
|
&& (
|
||||||
<StepTwo
|
<StepTwo
|
||||||
setCurrentStep={setCurrentStep}
|
ref={stepTwoRef}
|
||||||
formValues={formValues}
|
formValues={formValues}
|
||||||
query={query}
|
query={query}
|
||||||
setUsercontentAddCmdList={setUsercontentAddCmdList}
|
setUsercontentAddCmdList={setUsercontentAddCmdList}
|
||||||
|
|
@ -113,6 +141,7 @@ function Add(props) {
|
||||||
projectApprovalFlowAddCmdList={projectApprovalFlowAddCmdList}
|
projectApprovalFlowAddCmdList={projectApprovalFlowAddCmdList}
|
||||||
corpinfoId={corpinfoId}
|
corpinfoId={corpinfoId}
|
||||||
qualificationsTypeId={qualificationsTypeId}
|
qualificationsTypeId={qualificationsTypeId}
|
||||||
|
setLoading={setStepTwoLoading}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Page>
|
</Page>
|
||||||
|
|
@ -373,7 +402,7 @@ const StepOneComponent = (props) => {
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
const StepTwoComponent = (props) => {
|
const StepTwoComponent = forwardRef((props, ref) => {
|
||||||
const query = props.query;
|
const query = props.query;
|
||||||
const projectFileList = props.projectFileAddCmdList || []; // 项目资料
|
const projectFileList = props.projectFileAddCmdList || []; // 项目资料
|
||||||
const usercontentList = props.usercontentAddCmdList || []; // 项目审核人员
|
const usercontentList = props.usercontentAddCmdList || []; // 项目审核人员
|
||||||
|
|
@ -550,11 +579,20 @@ const StepTwoComponent = (props) => {
|
||||||
setProjectFileList([...enterList, ...formattedRows]);
|
setProjectFileList([...enterList, ...formattedRows]);
|
||||||
setChooseFilsListModalOpen(false);
|
setChooseFilsListModalOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isLoading = props.qualificationStatistics.qualificationStatisticsLoading || uploadFileLoading || deleteFileLoading || getFileLoading;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
props.setLoading(isLoading);
|
||||||
|
}, [isLoading]);
|
||||||
|
|
||||||
|
useImperativeHandle(ref, () => ({
|
||||||
|
onSubmit,
|
||||||
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Spin
|
<Spin spinning={isLoading}>
|
||||||
spinning={props.qualificationStatistics.qualificationStatisticsLoading || uploadFileLoading || deleteFileLoading || getFileLoading}
|
|
||||||
>
|
|
||||||
<div>
|
<div>
|
||||||
<Divider orientation="left">项目相关资料</Divider>
|
<Divider orientation="left">项目相关资料</Divider>
|
||||||
<Table
|
<Table
|
||||||
|
|
@ -663,17 +701,6 @@ const StepTwoComponent = (props) => {
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ textAlign: "center", marginTop: 20 }}>
|
|
||||||
<Space>
|
|
||||||
<Button onClick={() => {
|
|
||||||
props.setCurrentStep(1);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
上一步
|
|
||||||
</Button>
|
|
||||||
<Button type="primary" onClick={onSubmit}>提交审核</Button>
|
|
||||||
</Space>
|
|
||||||
</div>
|
|
||||||
</Spin>
|
</Spin>
|
||||||
{uploadFileModalOpen && (
|
{uploadFileModalOpen && (
|
||||||
<FileUpload
|
<FileUpload
|
||||||
|
|
@ -711,7 +738,7 @@ const StepTwoComponent = (props) => {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
});
|
||||||
const ChooseFilsComponent = (props) => {
|
const ChooseFilsComponent = (props) => {
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 存储选中的行键
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 存储选中的行键
|
||||||
const [selectedRows, setSelectedRows] = useState([]); // 存储选中行的完整数据
|
const [selectedRows, setSelectedRows] = useState([]); // 存储选中行的完整数据
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue