fix(branch-company): 解决资质申请详情加载问题
- 修复了特殊资质列表数据加载逻辑 - 添加了从资质维护信息中获取最新详情的功能 - 优化了文件上传关联逻辑,确保正确绑定到申请详情ID - 改进了数据合并策略,保留现有数据并更新最新信息master
parent
b9a2be1eb9
commit
1e9595a4ff
|
|
@ -16,7 +16,7 @@ import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||||
import { getLabelName,validatorEndTime, validatorTimeGTCurrentDay } from "zy-react-library/utils";
|
import { getLabelName, validatorEndTime, validatorTimeGTCurrentDay } from "zy-react-library/utils";
|
||||||
import { NS_QUALIFICATION_APPLY, NS_QUALIFICATION_MAINTENANCE } from "~/enumerate/namespace";
|
import { NS_QUALIFICATION_APPLY, NS_QUALIFICATION_MAINTENANCE } from "~/enumerate/namespace";
|
||||||
|
|
||||||
function Add(props) {
|
function Add(props) {
|
||||||
|
|
@ -233,13 +233,26 @@ const StepTwoComponent = (props) => {
|
||||||
await getTypeGroup(data.details)
|
await getTypeGroup(data.details)
|
||||||
setSpecialList(data.details || []);
|
setSpecialList(data.details || []);
|
||||||
} else {
|
} else {
|
||||||
await getTypeGroup(specialList)
|
const { data } = await props["qualificationMaintenanceInfo"]({ id: props.formValues.qualificationsId });
|
||||||
for (let i = 0; i < specialList.length; i++) {
|
const newSpecialList = data.details.map(item => {
|
||||||
specialList[i].files = await getFile({
|
const existsItem = specialList.find(specialItem => specialItem.qualificationsDetailId === item.id);
|
||||||
eqType: UPLOAD_FILE_TYPE_ENUM["148"],
|
if (existsItem) {
|
||||||
eqForeignKey: specialList[i].applyDetailId
|
return { ...item, ...existsItem };
|
||||||
});
|
}
|
||||||
|
return item;
|
||||||
|
})
|
||||||
|
|
||||||
|
await getTypeGroup(newSpecialList)
|
||||||
|
for (let i = 0; i < newSpecialList.length; i++) {
|
||||||
|
if (newSpecialList[i].applyDetailId) {
|
||||||
|
newSpecialList[i].files = await getFile({
|
||||||
|
eqType: UPLOAD_FILE_TYPE_ENUM["148"],
|
||||||
|
eqForeignKey: newSpecialList[i].applyDetailId
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setSpecialList(newSpecialList);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue