diff --git a/src/containers/flight/popup/ControlApprovalsPopupContainer.js b/src/containers/flight/popup/ControlApprovalsPopupContainer.js index fd80608f..e56af22a 100644 --- a/src/containers/flight/popup/ControlApprovalsPopupContainer.js +++ b/src/containers/flight/popup/ControlApprovalsPopupContainer.js @@ -22,6 +22,8 @@ function ControlApprovalsPopupContainer() { // 검토 상태값 const [reviewedType, setReviewedType] = useState('전체'); + const [reviewedProcType, setReviewedProcType] = useState('전체'); + const [approvalCd, setApprovalCd] = useState([ { name: '전체', value: '', select: false }, { name: '승인', value: 'S', select: false }, @@ -81,84 +83,27 @@ function ControlApprovalsPopupContainer() { } }; - const checkSearch = text => { - switch (text) { - case '승인': - return 'S'; - case '미승인': - return 'F'; - case '비대상': - return 'U'; - case '조건부승인': - return 'C'; - case '조건부 승인': - return 'C'; - case '검토완료': - return 'R'; - case '재검토': - return 'A'; - case '검토대기': - return 'W'; - case '검토불필요': - return 'U'; - } - }; - const handlerSearch = (search, searchDate, filterArea) => { setStartDate(searchDate.startDate); setEndDate(searchDate.endDate); setFilter(search); - 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: reviewedType } : {}), + ...(reviewedProcType !== '전체' + ? { reviewedProcType: reviewedProcType } + : {}), + ...(approvalCd.filter(i => i.select).length > 0 + ? { approvalCd: approvalCd.filter(i => i.select)[0].value } + : {}) + }) + ); localStorage.setItem( 'popupState', JSON.stringify({ @@ -167,7 +112,9 @@ function ControlApprovalsPopupContainer() { sig: filterArea.sig === '전체' ? '' : filterArea.sig, address: filterArea.address, startDate: searchDate.startDate, - endDate: searchDate.endDate + endDate: searchDate.endDate, + reviewedType, + reviewedProcType }) ); handlerOpnerPostMessage('search', { search, searchDate, filterArea }); @@ -222,6 +169,8 @@ function ControlApprovalsPopupContainer() { reviewedType={reviewedType} setReviewedType={setReviewedType} approvalCd={approvalCd} + reviewedProcType={reviewedProcType} + setReviewedProcType={setReviewedProcType} handlerApprovalCd={handlerApprovalCd} pageName='control' /> diff --git a/src/containers/flight/popup/OperationApprovalsPopupContainer.js b/src/containers/flight/popup/OperationApprovalsPopupContainer.js index 084d4c2f..27bd9676 100644 --- a/src/containers/flight/popup/OperationApprovalsPopupContainer.js +++ b/src/containers/flight/popup/OperationApprovalsPopupContainer.js @@ -22,8 +22,11 @@ function OperationApprovalsPopupContainer() { address: '' }); - // 검토 상태값 + // 운항과 검토 상태값 const [reviewedType, setReviewedType] = useState('전체'); + // 관제과 검토 상태값 + const [reviewedProcType, setReviewedProcType] = useState('전체'); + const [approvalCd, setApprovalCd] = useState([ { name: '전체', value: '', select: false }, { name: '승인', value: 'S', select: false }, @@ -134,8 +137,9 @@ function OperationApprovalsPopupContainer() { sig: filterArea.sig === '전체' ? '' : filterArea.sig, address: filterArea.address, ...(search !== '' ? { applyNo: search } : {}), - ...(reviewedType !== '전체' - ? { reviewedType: checkSearch(reviewedType) } + ...(reviewedType !== '전체' ? { reviewedType: reviewedType } : {}), + ...(reviewedProcType !== '전체' + ? { reviewedProcType: reviewedProcType } : {}), ...(approvalCd.filter(i => i.select).length > 0 ? { approvalCd: approvalCd.filter(i => i.select)[0].value } @@ -150,7 +154,9 @@ function OperationApprovalsPopupContainer() { sig: filterArea.sig === '전체' ? '' : filterArea.sig, address: filterArea.address, startDate: searchDate.startDate, - endDate: searchDate.endDate + endDate: searchDate.endDate, + reviewedType, + reviewedProcType }) ); handlerOpnerPostMessage('search', { search, searchDate, filterArea }); @@ -216,6 +222,8 @@ function OperationApprovalsPopupContainer() { reviewedType={reviewedType} setReviewedType={setReviewedType} approvalCd={approvalCd} + reviewedProcType={reviewedProcType} + setReviewedProcType={setReviewedProcType} handlerApprovalCd={handlerApprovalCd} pageName='operation' />