bug:
parent
fa38164a47
commit
994dc3d26b
|
|
@ -30,7 +30,7 @@
|
|||
"lodash-es": "^4.17.21",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zy-react-library": "^1.2.0"
|
||||
"zy-react-library": "^1.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { setJJBCommonAntdMessage } from "@cqsjjb/jjb-common-lib";
|
|||
import { setup } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { message } from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import { getFileUrlFromServer } from "zy-react-library/utils";
|
||||
import "dayjs/locale/zh-cn";
|
||||
import "../blessed_by_buddha";
|
||||
|
||||
|
|
@ -13,6 +14,7 @@ setJJBCommonAntdMessage(message);
|
|||
|
||||
const app = setup();
|
||||
|
||||
getFileUrlFromServer();
|
||||
// 非底座环境运行
|
||||
if (!window.__POWERED_BY_QIANKUN__) {
|
||||
// 云组件默认依赖
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
import ReViewPage from "~/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/ReView";
|
||||
|
||||
function ReView(props) {
|
||||
return (<ReViewPage view="0" {...props} />);
|
||||
}
|
||||
|
||||
export default ReView;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
function ProjectFilingApplicationTwo(props) {
|
||||
return (<div>{props.children}</div>);
|
||||
}
|
||||
|
||||
export default ProjectFilingApplicationTwo;
|
||||
|
|
@ -25,6 +25,7 @@ function Add(props) {
|
|||
const [currentStep, setCurrentStep] = useState(1);
|
||||
const [formValues, setFormValues] = useState({});
|
||||
const [specialList, setSpecialList] = useState([]);
|
||||
const [qualificationsId, setQualificationsId] = useState("");
|
||||
|
||||
const getData = async () => {
|
||||
const { data } = await props["qualificationApplyInfo"]({ id: query.id });
|
||||
|
|
@ -47,7 +48,7 @@ function Add(props) {
|
|||
return (
|
||||
<Page headerTitle={query.resubmit ? "重新提交" : (query.id ? "编辑" : "新增")} isShowFooter={false}>
|
||||
{currentStep === 1
|
||||
&& <StepOne setFormValues={setFormValues} setCurrentStep={setCurrentStep} formValues={formValues} form={form} />}
|
||||
&& <StepOne setFormValues={setFormValues} setCurrentStep={setCurrentStep} setQualificationsId={setQualificationsId} formValues={formValues} form={form} />}
|
||||
{currentStep === 2
|
||||
&& (
|
||||
<StepTwo
|
||||
|
|
@ -55,6 +56,7 @@ function Add(props) {
|
|||
formValues={formValues}
|
||||
query={query}
|
||||
setSpecialList={setSpecialList}
|
||||
qualificationsId={qualificationsId}
|
||||
specialList={specialList}
|
||||
/>
|
||||
)}
|
||||
|
|
@ -68,6 +70,7 @@ const StepOneComponent = (props) => {
|
|||
const stakeholderLevel = Form.useWatch("stakeholderLevel", form);
|
||||
const groupUnitId = Form.useWatch("groupUnitId", form);
|
||||
const groupUnitDept = Form.useWatch("groupUnitDept", form);
|
||||
const qualificationsId = Form.useWatch("qualificationsId", form);
|
||||
// const [corpTypeList, setCorpTypeList] = useState([2]);
|
||||
|
||||
const [corpInfoList, setCorpInfoList] = useState([]);
|
||||
|
|
@ -94,6 +97,10 @@ const StepOneComponent = (props) => {
|
|||
else setQualificationsListAll([]);
|
||||
}, [qualificationsTypeId, stakeholderLevel]);
|
||||
|
||||
useEffect(() => {
|
||||
props.setQualificationsId(qualificationsId);
|
||||
}, [qualificationsId]);
|
||||
|
||||
return (
|
||||
<FormBuilder
|
||||
form={form}
|
||||
|
|
@ -251,15 +258,15 @@ const StepTwoComponent = (props) => {
|
|||
setTypeGroup(Array.from(typeMap.values()));
|
||||
};
|
||||
const getData = async () => {
|
||||
if (!props.formValues.qualificationsId)
|
||||
if (!props.qualificationsId)
|
||||
return;
|
||||
if (specialList.length === 0) {
|
||||
const { data } = await props["qualificationMaintenanceInfo"]({ id: props.formValues.qualificationsId });
|
||||
const { data } = await props["qualificationMaintenanceInfo"]({ id: props.qualificationsId });
|
||||
await getTypeGroup(data.details);
|
||||
setSpecialList(data.details || []);
|
||||
}
|
||||
else {
|
||||
const { data } = await props["qualificationMaintenanceInfo"]({ id: props.formValues.qualificationsId });
|
||||
const { data } = await props["qualificationMaintenanceInfo"]({ id: props.qualificationsId });
|
||||
const newSpecialList = data.details.map((item) => {
|
||||
const existsItem = specialList.find(specialItem => specialItem.qualificationsDetailId === item.id);
|
||||
if (existsItem) {
|
||||
|
|
@ -284,7 +291,7 @@ const StepTwoComponent = (props) => {
|
|||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, [props.formValues.qualificationsId]);
|
||||
}, [props.qualificationsId]);
|
||||
|
||||
const onUploadFileOpen = (record, id, files) => {
|
||||
setUploadFileModalData({
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function List(props) {
|
|||
label: "资质类别",
|
||||
render: (<DictionarySelect dictValue="qualificationsType" />),
|
||||
},
|
||||
{ name: "stakeholderLevel", label: "资质等级", render: (<DictionarySelect dictValue="stakeholderLevel" />) },
|
||||
// { name: "stakeholderLevel", label: "资质等级", render: (<DictionarySelect dictValue="stakeholderLevel" />) },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
|
|
@ -35,7 +35,7 @@ function List(props) {
|
|||
{ title: "相关方名称", dataIndex: "corpName" },
|
||||
{ title: "资质名称", dataIndex: "qualificationsName" },
|
||||
{ title: "资质类别", dataIndex: "qualificationsTypeName" },
|
||||
{ title: "资质等级", dataIndex: "stakeholderLevelName" },
|
||||
// { title: "资质等级", dataIndex: "stakeholderLevelName" },
|
||||
{ title: "材料数", dataIndex: "materialNum" },
|
||||
// {
|
||||
// title: "资质状态",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
import ReViewPage from "~/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/ReView";
|
||||
|
||||
function ReView(props) {
|
||||
return (<ReViewPage view="0" {...props} />);
|
||||
}
|
||||
|
||||
export default ReView;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
function ProjectFilingApplicationTwo(props) {
|
||||
return (<div>{props.children}</div>);
|
||||
}
|
||||
|
||||
export default ProjectFilingApplicationTwo;
|
||||
|
|
@ -227,6 +227,9 @@ const StepOneComponent = (props) => {
|
|||
}
|
||||
}
|
||||
}, [props.formValues]);
|
||||
useEffect(() => {
|
||||
props.setQualificationsTypeId(qualificationsTypeId);
|
||||
}, [qualificationsTypeId]);
|
||||
return (
|
||||
<FormBuilder
|
||||
labelCol={{ span: 6 }}
|
||||
|
|
@ -309,7 +312,6 @@ const StepOneComponent = (props) => {
|
|||
if (form.getFieldValue("isLocalCompany") === 0) {
|
||||
getDeptList(event);
|
||||
}
|
||||
props.setQualificationsTypeId(event);
|
||||
form.setFieldsValue({
|
||||
recommendCorpId: "",
|
||||
recommendCorpName: "",
|
||||
|
|
@ -622,7 +624,7 @@ const StepTwoComponent = (props) => {
|
|||
deleteFiles: values.deleteFiles || [],
|
||||
startValidityPeriod: values.startValidityPeriod,
|
||||
endValidityPeriod: values.endValidityPeriod,
|
||||
createTime: dayjs().format("YYYY-MM-DD hh:mm:ss"),
|
||||
createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||
existingFlag: 2,
|
||||
};
|
||||
if (values.type === "add") {
|
||||
|
|
@ -732,19 +734,14 @@ const StepTwoComponent = (props) => {
|
|||
}
|
||||
};
|
||||
const handleChooseFilsSubmit = (selectedRows) => {
|
||||
const existingIds = projectFileList
|
||||
.filter(item => item.detailId)
|
||||
.map(item => item.detailId);
|
||||
const newRows = selectedRows.filter(row =>
|
||||
row.detailId && !existingIds.includes(row.detailId),
|
||||
);
|
||||
const formattedRows = newRows.map(row => ({
|
||||
const enterList = projectFileList.filter(item => !item.detailId);
|
||||
const formattedRows = selectedRows.map(row => ({
|
||||
...row,
|
||||
existingFlag: 1,
|
||||
}));
|
||||
|
||||
// 合并到现有列表中
|
||||
setProjectFileList(prev => [...prev, ...formattedRows]);
|
||||
setProjectFileList([...enterList, ...formattedRows]);
|
||||
setChooseFilsListModalOpen(false);
|
||||
};
|
||||
|
||||
|
|
@ -791,7 +788,7 @@ const StepTwoComponent = (props) => {
|
|||
title: "时效性",
|
||||
key: "validityPeriod",
|
||||
dataIndex: "startValidityPeriod",
|
||||
render: (_, record) => record.startValidityPeriod ? `${record.startValidityPeriod}至${record.endValidityPeriod}` : "-",
|
||||
render: (_, record) => record.startValidityPeriod ? `${dayjs(record.startValidityPeriod).format("YYYY-MM-DD")}至${dayjs(record.endValidityPeriod).format("YYYY-MM-DD")}` : "-",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
|
@ -963,7 +960,7 @@ const ChooseFilsComponent = (props) => {
|
|||
title: "时效性",
|
||||
key: "validityPeriod",
|
||||
dataIndex: "startValidityPeriod",
|
||||
render: (_, record) => record.startValidityPeriod ? `${record.startValidityPeriod}至${record.endValidityPeriod}` : "-",
|
||||
render: (_, record) => record.startValidityPeriod ? `${dayjs(record.startValidityPeriod).format("YYYY-MM-DD")}至${dayjs(record.endValidityPeriod).format("YYYY-MM-DD")}` : "-",
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ import { useEffect, useState } from "react";
|
|||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
import PreviewPdf from "zy-react-library/components/PreviewPdf";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { getFileSuffix, getLabelName } from "zy-react-library/utils";
|
||||
import ViewProjectReviewDetailsModal from "~/components/ViewProjectReviewDetailsModal";
|
||||
import ViewProjectReviewUserModal from "~/components/ViewProjectReviewUserModal";
|
||||
import { PROJECT_STATUS_MAP } from "~/enumerate/constant";
|
||||
|
|
@ -48,7 +49,8 @@ function Review(props) {
|
|||
eqType: UPLOAD_FILE_TYPE_ENUM["156"],
|
||||
eqForeignKey: projectData.agreementFileUuid,
|
||||
});
|
||||
projectData.files = file;
|
||||
projectData.imgFiles = file.filter(item => getFileSuffix(item.name) !== "pdf");
|
||||
projectData.pdfFiles = file.filter(item => getFileSuffix(item.name) === "pdf");
|
||||
}
|
||||
setProjectFileAddCmdList(projectData.projectFileAddCmdList || []);
|
||||
setProjectUserAddCmdList(projectData.projectUserAddCmdList || []);
|
||||
|
|
@ -240,7 +242,7 @@ function Review(props) {
|
|||
)}
|
||||
>
|
||||
<div>
|
||||
{info.relatedProjectId && (
|
||||
{(info.relatedProjectId && props.view !== "0") && (
|
||||
<div style={{ "font-size": "16px" }}>
|
||||
<Divider orientation="left">一级项目信息</Divider>
|
||||
<p>
|
||||
|
|
@ -284,7 +286,12 @@ function Review(props) {
|
|||
{ label: "项目类别", children: info.qualificationsTypeName },
|
||||
{ label: "是否存在分包项目", children: info.subcontractFlag === 1 ? "是" : "否" },
|
||||
{ label: "是否为属地公司推荐", children: info.isLocalCompany === 1 ? "是" : "否" },
|
||||
{ label: "安全管理协议", children: <PreviewImg files={info.files} /> },
|
||||
{ label: "安全管理协议", children: (
|
||||
<>
|
||||
<PreviewImg files={info.imgFiles} />
|
||||
<PreviewPdf files={info.pdfFiles} />
|
||||
</>
|
||||
) },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -199,6 +199,9 @@ const StepOneComponent = (props) => {
|
|||
}
|
||||
}
|
||||
}, [props.formValues]);
|
||||
useEffect(() => {
|
||||
props.setQualificationsTypeId(qualificationsTypeId);
|
||||
}, [qualificationsTypeId]);
|
||||
return (
|
||||
<FormBuilder
|
||||
labelCol={{ span: 6 }}
|
||||
|
|
@ -284,7 +287,6 @@ const StepOneComponent = (props) => {
|
|||
itemsField: { valueKey: "qualificationsTypeId", labelKey: "qualificationsTypeName" },
|
||||
componentProps: {
|
||||
onChange: (event) => {
|
||||
props.setQualificationsTypeId(event);
|
||||
form.setFieldValue("qualificationsTypeName", getLabelName({
|
||||
list: qualificationsTypeList,
|
||||
status: event,
|
||||
|
|
@ -428,7 +430,7 @@ const StepTwoComponent = (props) => {
|
|||
deleteFiles: values.deleteFiles || [],
|
||||
startValidityPeriod: values.startValidityPeriod,
|
||||
endValidityPeriod: values.endValidityPeriod,
|
||||
createTime: dayjs().format("YYYY-MM-DD hh:mm:ss"),
|
||||
createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
|
||||
existingFlag: 2,
|
||||
};
|
||||
if (values.type === "add") {
|
||||
|
|
@ -538,19 +540,14 @@ const StepTwoComponent = (props) => {
|
|||
}
|
||||
};
|
||||
const handleChooseFilsSubmit = (selectedRows) => {
|
||||
const existingIds = projectFileList
|
||||
.filter(item => item.detailId)
|
||||
.map(item => item.detailId);
|
||||
const newRows = selectedRows.filter(row =>
|
||||
row.detailId && !existingIds.includes(row.detailId),
|
||||
);
|
||||
const formattedRows = newRows.map(row => ({
|
||||
const enterList = projectFileList.filter(item => !item.detailId);
|
||||
const formattedRows = selectedRows.map(row => ({
|
||||
...row,
|
||||
existingFlag: 1,
|
||||
}));
|
||||
|
||||
// 合并到现有列表中
|
||||
setProjectFileList(prev => [...prev, ...formattedRows]);
|
||||
setProjectFileList([...enterList, ...formattedRows]);
|
||||
setChooseFilsListModalOpen(false);
|
||||
};
|
||||
return (
|
||||
|
|
@ -588,7 +585,7 @@ const StepTwoComponent = (props) => {
|
|||
pagination={false}
|
||||
options={false}
|
||||
disabledResizer={true}
|
||||
rowKey={record => record.id || record.dataName}
|
||||
rowKey={record => record.id || record.detailId}
|
||||
columns={[
|
||||
{ title: "材料名称", key: "dataName", dataIndex: "dataName" },
|
||||
{ title: "上传时间", key: "createTime", dataIndex: "createTime", render: (_, record) => record.createTime || "-" },
|
||||
|
|
@ -596,7 +593,7 @@ const StepTwoComponent = (props) => {
|
|||
title: "时效性",
|
||||
key: "validityPeriod",
|
||||
dataIndex: "startValidityPeriod",
|
||||
render: (_, record) => record.startValidityPeriod ? `${record.startValidityPeriod}至${record.endValidityPeriod}` : "-",
|
||||
render: (_, record) => record.startValidityPeriod ? `${dayjs(record.startValidityPeriod).format("YYYY-MM-DD")}至${dayjs(record.endValidityPeriod).format("YYYY-MM-DD")}` : "-",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
|
@ -669,11 +666,7 @@ const StepTwoComponent = (props) => {
|
|||
<div style={{ textAlign: "center", marginTop: 20 }}>
|
||||
<Space>
|
||||
<Button onClick={() => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "填写的信息将被清除,确定要返回吗?",
|
||||
onOk: () => props.setCurrentStep(1),
|
||||
});
|
||||
props.setCurrentStep(1);
|
||||
}}
|
||||
>
|
||||
上一步
|
||||
|
|
@ -771,7 +764,7 @@ const ChooseFilsComponent = (props) => {
|
|||
title: "时效性",
|
||||
key: "validityPeriod",
|
||||
dataIndex: "startValidityPeriod",
|
||||
render: (_, record) => record.startValidityPeriod ? `${record.startValidityPeriod}至${record.endValidityPeriod}` : "-",
|
||||
render: (_, record) => record.startValidityPeriod ? `${dayjs(record.startValidityPeriod).format("YYYY-MM-DD")}至${dayjs(record.endValidityPeriod).format("YYYY-MM-DD")}` : "-",
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
import ReViewPage from "~/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/ReView";
|
||||
|
||||
function ReView(props) {
|
||||
return (<ReViewPage view="0" {...props} />);
|
||||
}
|
||||
|
||||
export default ReView;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
function ProjectFilingApplicationTwo(props) {
|
||||
return (<div>{props.children}</div>);
|
||||
}
|
||||
|
||||
export default ProjectFilingApplicationTwo;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import ReViewPage from "~/pages/Container/Stakeholder/ProjectReview/ProjectFilingApplicationTwo/ReView";
|
||||
|
||||
function ReView(props) {
|
||||
return (<ReViewPage view="0" {...props} />);
|
||||
}
|
||||
|
||||
export default ReView;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
function ProjectFilingApplicationTwo(props) {
|
||||
return (<div>{props.children}</div>);
|
||||
}
|
||||
|
||||
export default ProjectFilingApplicationTwo;
|
||||
Loading…
Reference in New Issue