From 0818548f785159bab71b62d5c0908795ccd281d4 Mon Sep 17 00:00:00 2001 From: JANGHYUNn Date: Thu, 25 Jul 2024 14:33:39 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EC=A0=9C=EA=B3=BC=20=EA=B2=80?= =?UTF-8?q?=ED=86=A0=EC=83=81=ED=83=9C=EA=B0=92=20=EC=9D=B4=EC=8A=88=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flight/ControlApprovalsTable.js | 17 +++++----- .../flight/OperationApprovalsTable.js | 33 ++++++++++++------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/components/flight/ControlApprovalsTable.js b/src/components/flight/ControlApprovalsTable.js index 2382d3c8..27654f5f 100644 --- a/src/components/flight/ControlApprovalsTable.js +++ b/src/components/flight/ControlApprovalsTable.js @@ -1195,16 +1195,17 @@ export default function ControlApprovalsTable(props) { .map(item => item.split('_').pop()) // 마지막 언더바 이후의 숫자 추출 ) ]; - await dispatch( + dispatch( updateLaancAprvReview({ planAreaSnoList, reviewedType: 'R' }) - ); + ).then(() => { + dispatch( + getLaancAprvList({ + searchStDt: props.startDate, + searchEndDt: props.endDate + }) + ); + }); setCheckList([]); - await dispatch( - getLaancAprvList({ - searchStDt: props.startDate, - searchEndDt: props.endDate - }) - ); } catch (error) { return handlerErrorModal( '검토 실패', diff --git a/src/components/flight/OperationApprovalsTable.js b/src/components/flight/OperationApprovalsTable.js index 1f7b2f24..54e15477 100644 --- a/src/components/flight/OperationApprovalsTable.js +++ b/src/components/flight/OperationApprovalsTable.js @@ -81,6 +81,23 @@ export default function OperationApprovalsTable(props) { } }, [laancAprvList]); + const handlerReviewed = type => { + let text = '검토대기'; + if (!type) { + text = '검토대기'; + } else { + if (type === 'R') { + text = '검토완료'; + } else if (type === 'W') { + text = '검토대기'; + } else if (type === 'C') { + text = '검토취소'; + } + } + + return text; + }; + // 데이터 const columns = [ { @@ -461,11 +478,11 @@ export default function OperationApprovalsTable(props) { render: areaList => { const approvalCounts = areaList.reduce( (counts, item) => { - if (item.approvalCd === 'R') { + if (item.reviewedType === 'R') { counts.reviewed += 1; - } else if (item.approvalCd === 'W') { + } else if (item.reviewedType === 'W') { counts.wait += 1; - } else if (item.approvalCd === 'C') { + } else if (item.reviewedType === 'C') { counts.cancel += 1; } return counts; @@ -483,15 +500,7 @@ export default function OperationApprovalsTable(props) { {approvalCounts.cancel}건 ) : ( - <> - {areaList[0].reviewed === 'R' - ? '검토완료' - : areaList[0].wait === 'W' - ? '검토대기' - : areaList[0].cancel === 'C' - ? '검토취소' - : '검토취소'} - + <>{handlerReviewed(areaList[0].reviewedType)} )} );