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