优化HiddenInfo
parent
43049705f2
commit
dcdff455e0
|
|
@ -31,6 +31,8 @@ function HiddenInfo(props) {
|
|||
hiddenRectifyUserCO: [],
|
||||
hiddenConfirmUserCO: [],
|
||||
hiddenAcceptUserCO: [],
|
||||
hiddenAcceptQualifiedUserCO: [],
|
||||
hiddenAcceptUnqualifiedUserCO: [],
|
||||
hiddenInspecCO: {},
|
||||
hiddenSpecialList: [],
|
||||
hiddenExtensionList: [],
|
||||
|
|
@ -81,15 +83,17 @@ function HiddenInfo(props) {
|
|||
}
|
||||
}
|
||||
|
||||
if (info.isQualified === 1 && (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0)) {
|
||||
if (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0) {
|
||||
for (let i = 0; i < info.hiddenAcceptUserCO.length; i++) {
|
||||
if (info.hiddenAcceptUserCO[i].hiddenUserId) {
|
||||
const acceptImageFiles = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["5"],
|
||||
eqForeignKey: hiddenId || query[hiddenIdKey],
|
||||
eqForeignKey: info.hiddenAcceptUserCO[i].hiddenUserId,
|
||||
});
|
||||
setAcceptImageFiles(prevState => [...prevState, acceptImageFiles]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (info.hiddenInspecCO && Object.keys(info.hiddenInspecCO).length > 0) {
|
||||
const inspectionAcceptImageFiles = await getFile({
|
||||
|
|
@ -102,6 +106,18 @@ function HiddenInfo(props) {
|
|||
|
||||
const getData = async () => {
|
||||
request(!history ? `/hidden/hidden/${id || query[idKey]}` : `/hidden/hidden/history/${id || query[idKey]}`, "get").then((res) => {
|
||||
res.data.hiddenAcceptQualifiedUserCO = [];
|
||||
res.data.hiddenAcceptUnqualifiedUserCO = [];
|
||||
if (res.data.hiddenAcceptUserCO && res.data.hiddenAcceptUserCO.length > 0) {
|
||||
for (let i = 0; i < res.data.hiddenAcceptUserCO.length; i++) {
|
||||
if (res.data.hiddenAcceptUserCO[i].status === 1) {
|
||||
res.data.hiddenAcceptQualifiedUserCO.push(res.data.hiddenAcceptUserCO[i]);
|
||||
}
|
||||
else {
|
||||
res.data.hiddenAcceptUnqualifiedUserCO.push(res.data.hiddenAcceptUserCO[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
setInfo(res.data);
|
||||
getFileData(res.data);
|
||||
setLoading(false);
|
||||
|
|
@ -189,7 +205,7 @@ function HiddenInfo(props) {
|
|||
? [
|
||||
{
|
||||
label: "整改期限",
|
||||
children: dayjs(info.hiddenUserPresetsCO.rectifyDeadline).format("YYYY-MM-DD"),
|
||||
children: info.hiddenUserPresetsCO.rectifyDeadline ? dayjs(info.hiddenUserPresetsCO.rectifyDeadline).format("YYYY-MM-DD") : "",
|
||||
},
|
||||
]
|
||||
: []),
|
||||
|
|
@ -252,8 +268,6 @@ function HiddenInfo(props) {
|
|||
...(item.createTime ? [{ label: "申请延期日期", children: item.createTime }] : []),
|
||||
...(item.delayTime ? [{ label: "延期日期", children: item.delayTime }] : []),
|
||||
...(item.updateName ? [{ label: "审核人", children: item.updateName }] : []),
|
||||
...(item.state === 3
|
||||
? [
|
||||
...(item.disposalPlan ? [{ label: "处置方案", children: item.disposalPlan }] : []),
|
||||
...(item.disposalFile
|
||||
? [{
|
||||
|
|
@ -276,8 +290,6 @@ function HiddenInfo(props) {
|
|||
),
|
||||
}]
|
||||
: []),
|
||||
]
|
||||
: []),
|
||||
{
|
||||
label: "延期审核状态",
|
||||
children: (
|
||||
|
|
@ -426,14 +438,12 @@ function HiddenInfo(props) {
|
|||
)
|
||||
}
|
||||
{
|
||||
(info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0)
|
||||
? (
|
||||
info.isQualified === 1
|
||||
info.hiddenAcceptQualifiedUserCO.length > 0
|
||||
? (
|
||||
<>
|
||||
<Divider orientation="left">验收信息</Divider>
|
||||
{
|
||||
info.hiddenAcceptUserCO.map((item, index) => (
|
||||
info.hiddenAcceptQualifiedUserCO.map((item, index) => (
|
||||
<Descriptions
|
||||
key={item.id}
|
||||
bordered
|
||||
|
|
@ -453,11 +463,15 @@ function HiddenInfo(props) {
|
|||
}
|
||||
</>
|
||||
)
|
||||
: (
|
||||
: null
|
||||
}
|
||||
{
|
||||
info.hiddenAcceptUnqualifiedUserCO.length > 0
|
||||
? (
|
||||
<>
|
||||
<Divider orientation="left">验收打回信息</Divider>
|
||||
{
|
||||
info.hiddenAcceptUserCO.map(item => (
|
||||
info.hiddenAcceptUnqualifiedUserCO.map(item => (
|
||||
<Descriptions
|
||||
key={item.id}
|
||||
bordered
|
||||
|
|
@ -474,7 +488,6 @@ function HiddenInfo(props) {
|
|||
}
|
||||
</>
|
||||
)
|
||||
)
|
||||
: null
|
||||
}
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue