diff --git a/src/components/HiddenInfo/gwj/index.js b/src/components/HiddenInfo/gwj/index.js index b46c6fb..84618b0 100644 --- a/src/components/HiddenInfo/gwj/index.js +++ b/src/components/HiddenInfo/gwj/index.js @@ -31,6 +31,8 @@ function HiddenInfo(props) { hiddenRectifyUserCO: [], hiddenConfirmUserCO: [], hiddenAcceptUserCO: [], + hiddenAcceptQualifiedUserCO: [], + hiddenAcceptUnqualifiedUserCO: [], hiddenInspecCO: {}, hiddenSpecialList: [], hiddenExtensionList: [], @@ -81,13 +83,15 @@ 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++) { - const acceptImageFiles = await getFile({ - eqType: UPLOAD_FILE_TYPE_ENUM["5"], - eqForeignKey: hiddenId || query[hiddenIdKey], - }); - setAcceptImageFiles(prevState => [...prevState, acceptImageFiles]); + if (info.hiddenAcceptUserCO[i].hiddenUserId) { + const acceptImageFiles = await getFile({ + eqType: UPLOAD_FILE_TYPE_ENUM["5"], + eqForeignKey: info.hiddenAcceptUserCO[i].hiddenUserId, + }); + setAcceptImageFiles(prevState => [...prevState, acceptImageFiles]); + } } } @@ -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,31 +268,27 @@ 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 - ? [{ - label: "处置方案附件", - children: ( - getFileSuffix(item.disposalFile) === "pdf" - ? - : ( - - {getFileName(item.disposalFile)} - - - ) - ), - }] - : []), - ] + ...(item.disposalPlan ? [{ label: "处置方案", children: item.disposalPlan }] : []), + ...(item.disposalFile + ? [{ + label: "处置方案附件", + children: ( + getFileSuffix(item.disposalFile) === "pdf" + ? + : ( + + {getFileName(item.disposalFile)} + + + ) + ), + }] : []), { label: "延期审核状态", @@ -426,54 +438,55 @@ function HiddenInfo(props) { ) } { - (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0) + info.hiddenAcceptQualifiedUserCO.length > 0 ? ( - info.isQualified === 1 - ? ( - <> - 验收信息 - { - info.hiddenAcceptUserCO.map((item, index) => ( - 0) ? [{ label: "验收图片", children: }] : []), - ]} - /> - )) - } - - ) - : ( - <> - 验收打回信息 - { - info.hiddenAcceptUserCO.map(item => ( - - )) - } - - ) + <> + 验收信息 + { + info.hiddenAcceptQualifiedUserCO.map((item, index) => ( + 0) ? [{ label: "验收图片", children: }] : []), + ]} + /> + )) + } + + ) + : null + } + { + info.hiddenAcceptUnqualifiedUserCO.length > 0 + ? ( + <> + 验收打回信息 + { + info.hiddenAcceptUnqualifiedUserCO.map(item => ( + + )) + } + ) : null }