|
|
|
@ -121,6 +121,57 @@ const FlightPlanAprvContainer = () => {
|
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
// useEffect(() => {
|
|
|
|
|
// handlerGroupCancel();
|
|
|
|
|
// }, []);
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (user?.cstmrSno) { |
|
|
|
|
if (user.authId === 'SUPER' || user.authId === 'ADMIN') { |
|
|
|
|
dispatch(GROUP_LIST.request({ cstmrSno: user?.cstmrSno })); |
|
|
|
|
} else { |
|
|
|
|
dispatch( |
|
|
|
|
JOIN_LIST.request({ |
|
|
|
|
cstmrSno: user?.cstmrSno |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, [user]); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (searchData?.groupId) { |
|
|
|
|
handleSearch(searchData); |
|
|
|
|
|
|
|
|
|
const group = groupList?.find( |
|
|
|
|
prev => prev.groupId === aprvSelect.groupId |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const join = joinList?.find(prev => prev.groupId === aprvSelect.groupId); |
|
|
|
|
|
|
|
|
|
const obj = { |
|
|
|
|
groupAuthCd: join?.groupAuthCd, |
|
|
|
|
myGroupAuthCd: group?.myGroupAuthCd |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
//승인/미승인버튼 활성/비활성 제어
|
|
|
|
|
let my = false; |
|
|
|
|
if (user.authId === 'SUPER') { |
|
|
|
|
my = true; |
|
|
|
|
} else if (user.authId === 'ADMIN') { |
|
|
|
|
my = obj?.myGroupAuthCd && true; |
|
|
|
|
} else if (user.authId === 'USER') { |
|
|
|
|
my = obj?.groupAuthCd && true; |
|
|
|
|
} |
|
|
|
|
setIsMyGroup(my); |
|
|
|
|
} |
|
|
|
|
}, [searchData]); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (aprvProc && aprvProc.result > 0) { |
|
|
|
|
handleSearch(searchData); |
|
|
|
|
} |
|
|
|
|
}, [aprvProc]); |
|
|
|
|
|
|
|
|
|
const handleGroupSelect = ({ |
|
|
|
|
groupId, |
|
|
|
|
groupNm, |
|
|
|
@ -184,53 +235,6 @@ const FlightPlanAprvContainer = () => {
|
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 최초 비행계획서 목록 조회
|
|
|
|
|
// useEffect(() => {
|
|
|
|
|
// handlerGroupCancel();
|
|
|
|
|
// // handleSearch(searchData);
|
|
|
|
|
// }, []);
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (searchData?.groupId) { |
|
|
|
|
handleSearch(searchData); |
|
|
|
|
|
|
|
|
|
//승인/미승인버튼 활성/비활성 제어
|
|
|
|
|
let my = false; |
|
|
|
|
if (user.authId === 'SUPER') { |
|
|
|
|
my = true; |
|
|
|
|
} else if (user.authId === 'ADMIN') { |
|
|
|
|
if (myGroupAuthCd) { |
|
|
|
|
my = true; |
|
|
|
|
} |
|
|
|
|
} else if (user.authId === 'USER') { |
|
|
|
|
if (groupAuthCd) { |
|
|
|
|
my = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
setIsMyGroup(my); |
|
|
|
|
} |
|
|
|
|
}, [searchData]); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (user?.cstmrSno) { |
|
|
|
|
if (user.authId === 'SUPER' || user.authId === 'ADMIN') { |
|
|
|
|
dispatch(GROUP_LIST.request({ cstmrSno: user?.cstmrSno })); |
|
|
|
|
} else { |
|
|
|
|
dispatch( |
|
|
|
|
JOIN_LIST.request({ |
|
|
|
|
cstmrSno: user?.cstmrSno |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, [user]); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (aprvProc && aprvProc.result > 0) { |
|
|
|
|
handleSearch(searchData); |
|
|
|
|
} |
|
|
|
|
}, [aprvProc]); |
|
|
|
|
|
|
|
|
|
const handleSearch = data => { |
|
|
|
|
dispatch(FlightAction.FLIGHT_APRV_LIST.request({ ...data, page: 1 })); |
|
|
|
|
}; |
|
|
|
|