From 3b737c09f0b94b7e30ee9ed385495ee7ceb842a4 Mon Sep 17 00:00:00 2001 From: JANGHYUNn Date: Wed, 21 Aug 2024 10:44:25 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=ED=96=89=EC=8A=B9=EC=9D=B8=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=EC=98=81=EC=97=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flight/NewFlightApprovalsReport.js | 20 ++++- .../flight/ControlApprovalsContainer.js | 77 ++++--------------- 2 files changed, 32 insertions(+), 65 deletions(-) diff --git a/src/components/flight/NewFlightApprovalsReport.js b/src/components/flight/NewFlightApprovalsReport.js index 0b004ebc..ee591a8a 100644 --- a/src/components/flight/NewFlightApprovalsReport.js +++ b/src/components/flight/NewFlightApprovalsReport.js @@ -134,7 +134,9 @@ export default function NewFlightApprovalsReport(props) {
- + props.setReviewedType(e.target.value)} onKeyPress={handleKeyDown} > - {Object.values(FlightCategory.Operation).map(item => ( + {Object.values( + props.pageName === 'control' + ? FlightCategory.Control + : FlightCategory.Operation + ).map(item => ( @@ -155,7 +161,9 @@ export default function NewFlightApprovalsReport(props) {
- + props.setReviewedType(e.target.value)} onKeyPress={handleKeyDown} > - {Object.values(FlightCategory.Control).map(item => ( + {Object.values( + props.pageName === 'control' + ? FlightCategory.Operation + : FlightCategory.Control + ).map(item => ( diff --git a/src/containers/flight/ControlApprovalsContainer.js b/src/containers/flight/ControlApprovalsContainer.js index 44b17a4b..66a2c912 100644 --- a/src/containers/flight/ControlApprovalsContainer.js +++ b/src/containers/flight/ControlApprovalsContainer.js @@ -233,16 +233,6 @@ export default function ControlApprovalsContainer({ mode }) { const checkSearch = text => { switch (text) { - case '승인': - return 'S'; - case '미승인': - return 'F'; - case '비대상': - return 'U'; - case '조건부승인': - return 'C'; - case '조건부 승인': - return 'C'; case '검토완료': return 'R'; case '검토재요청': @@ -258,57 +248,22 @@ export default function ControlApprovalsContainer({ mode }) { setStartDate(searchDate.startDate); setEndDate(searchDate.endDate); - if ( - search != '' && - (search === '승인' || - search === '미승인' || - search === '비대상' || - search === '조건부승인' || - search === '조건부 승인') - ) { - dispatch( - getLaancAprvList({ - searchStDt: searchDate.startDate, - searchEndDt: searchDate.endDate, - ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn, - sig: filterArea.sig === '전체' ? '' : filterArea.sig, - address: filterArea.address, - approvalCd: checkSearch(search) - }) - ); - } else if (reviewedType !== '전체') { - dispatch( - getLaancAprvList({ - searchStDt: searchDate.startDate, - searchEndDt: searchDate.endDate, - ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn, - sig: filterArea.sig === '전체' ? '' : filterArea.sig, - address: filterArea.address, - reviewedType: checkSearch(reviewedType) - }) - ); - } else if (search != '') { - dispatch( - getLaancAprvList({ - searchStDt: searchDate.startDate, - searchEndDt: searchDate.endDate, - ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn, - sig: filterArea.sig === '전체' ? '' : filterArea.sig, - address: filterArea.address, - applyNo: search - }) - ); - } else { - dispatch( - getLaancAprvList({ - searchStDt: searchDate.startDate, - searchEndDt: searchDate.endDate, - ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn, - sig: filterArea.sig === '전체' ? '' : filterArea.sig, - address: filterArea.address - }) - ); - } + dispatch( + getLaancAprvList({ + searchStDt: searchDate.startDate, + searchEndDt: searchDate.endDate, + ctprvn: filterArea.ctprvn === '전체' ? '' : filterArea.ctprvn, + sig: filterArea.sig === '전체' ? '' : filterArea.sig, + address: filterArea.address, + ...(search !== '' ? { applyNo: search } : {}), + ...(reviewedType !== '전체' + ? { reviewedType: checkSearch(reviewedType) } + : {}), + ...(approvalCd.filter(i => i.select).length > 0 + ? { approvalCd: approvalCd.filter(i => i.select)[0].value } + : {}) + }) + ); // ); setFilter(search); };