Browse Source

비행승인 검색영역 수정

master
김장현 1 month ago
parent
commit
3b737c09f0
  1. 20
      src/components/flight/NewFlightApprovalsReport.js
  2. 77
      src/containers/flight/ControlApprovalsContainer.js

20
src/components/flight/NewFlightApprovalsReport.js

@ -134,7 +134,9 @@ export default function NewFlightApprovalsReport(props) {
<div className='list-input'>
<div className='layer-content'>
<FormGroup>
<Label for='searchDate'>안전운항과</Label>
<Label for='searchDate'>
{props.pageName === 'control' ? '관제통신과' : '안전운항과'}
</Label>
<CustomInput
type='select'
bsSize='sm'
@ -143,7 +145,11 @@ export default function NewFlightApprovalsReport(props) {
onChange={e => props.setReviewedType(e.target.value)}
onKeyPress={handleKeyDown}
>
{Object.values(FlightCategory.Operation).map(item => (
{Object.values(
props.pageName === 'control'
? FlightCategory.Control
: FlightCategory.Operation
).map(item => (
<option key={item} value={item}>
{item}
</option>
@ -155,7 +161,9 @@ export default function NewFlightApprovalsReport(props) {
<div className='list-input'>
<div className='layer-content'>
<FormGroup>
<Label for='searchDate'>관제통신과</Label>
<Label for='searchDate'>
{props.pageName === 'control' ? '안전운항과' : '관제통신과'}
</Label>
<CustomInput
type='select'
bsSize='sm'
@ -164,7 +172,11 @@ export default function NewFlightApprovalsReport(props) {
onChange={e => props.setReviewedType(e.target.value)}
onKeyPress={handleKeyDown}
>
{Object.values(FlightCategory.Control).map(item => (
{Object.values(
props.pageName === 'control'
? FlightCategory.Operation
: FlightCategory.Control
).map(item => (
<option key={item} value={item}>
{item}
</option>

77
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);
};

Loading…
Cancel
Save