|
|
@ -28,7 +28,6 @@ const initSearchData = { |
|
|
|
|
|
|
|
|
|
|
|
const FlightPlanAprvContainer = () => { |
|
|
|
const FlightPlanAprvContainer = () => { |
|
|
|
const dispatch = useDispatch(); |
|
|
|
const dispatch = useDispatch(); |
|
|
|
const history = useHistory(); |
|
|
|
|
|
|
|
const [searchData, setSearchData] = useState(initSearchData); |
|
|
|
const [searchData, setSearchData] = useState(initSearchData); |
|
|
|
const [selPlanSnoList, setSelPlanSnoList] = useState([]); |
|
|
|
const [selPlanSnoList, setSelPlanSnoList] = useState([]); |
|
|
|
const { |
|
|
|
const { |
|
|
@ -47,10 +46,14 @@ const FlightPlanAprvContainer = () => { |
|
|
|
desc: '', |
|
|
|
desc: '', |
|
|
|
color: '' |
|
|
|
color: '' |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//승인/미승인버튼 활성/비활성 제어
|
|
|
|
|
|
|
|
const [isMyGroup, setIsMyGroup] = useState(); |
|
|
|
|
|
|
|
|
|
|
|
const columns = [ |
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
// id: 'groupNm',
|
|
|
|
// id: 'groupNm',
|
|
|
|
name: '그룹 명', |
|
|
|
name: '그룹명', |
|
|
|
selector: row => row.groupNm, |
|
|
|
selector: row => row.groupNm, |
|
|
|
minWidth: '102px', |
|
|
|
minWidth: '102px', |
|
|
|
sortable: true, |
|
|
|
sortable: true, |
|
|
@ -104,7 +107,8 @@ const FlightPlanAprvContainer = () => { |
|
|
|
handleGroupSelect({ |
|
|
|
handleGroupSelect({ |
|
|
|
groupId: row?.groupId, |
|
|
|
groupId: row?.groupId, |
|
|
|
groupNm: row?.groupNm, |
|
|
|
groupNm: row?.groupNm, |
|
|
|
groupAuthCd: row?.groupAuthCd |
|
|
|
groupAuthCd: row?.groupAuthCd, |
|
|
|
|
|
|
|
myGroupAuthCd: row?.myGroupAuthCd |
|
|
|
}); |
|
|
|
}); |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
@ -115,47 +119,51 @@ const FlightPlanAprvContainer = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
const handleGroupSelect = ({ groupId, groupNm, groupAuthCd }) => { |
|
|
|
const handleGroupSelect = ({ |
|
|
|
|
|
|
|
groupId, |
|
|
|
|
|
|
|
groupNm, |
|
|
|
|
|
|
|
groupAuthCd, |
|
|
|
|
|
|
|
myGroupAuthCd |
|
|
|
|
|
|
|
}) => { |
|
|
|
const param = searchData; |
|
|
|
const param = searchData; |
|
|
|
|
|
|
|
|
|
|
|
param.cstmrSno = user.cstmrSno; |
|
|
|
param.cstmrSno = user.cstmrSno; |
|
|
|
param.groupId = groupId; |
|
|
|
param.groupId = groupId; |
|
|
|
// if (groupAuthCd === 'CREATER' || groupAuthCd === 'ADMIN') {
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
groupAuthCd === 'MASTER' || |
|
|
|
|
|
|
|
groupAuthCd === 'LEADER' || |
|
|
|
|
|
|
|
user.authId === 'SUPER' || |
|
|
|
|
|
|
|
user.authId === 'ADMIN' |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
dispatch( |
|
|
|
|
|
|
|
FlightAction.FLIGHT_PLAN_GROUP_SELECT({ |
|
|
|
|
|
|
|
cstmrSno: user.cstmrSno, |
|
|
|
|
|
|
|
groupId: groupId, |
|
|
|
|
|
|
|
groupNm: groupNm |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// groupId sessionStorage에 보관 (1 브라우저 1 tab에만 유효)
|
|
|
|
dispatch( |
|
|
|
sessionStorage.setItem('groupId', groupId); |
|
|
|
FlightAction.FLIGHT_PLAN_GROUP_SELECT({ |
|
|
|
sessionStorage.setItem('cstmrSno', user.cstmrSno); |
|
|
|
cstmrSno: user.cstmrSno, |
|
|
|
|
|
|
|
groupId: groupId, |
|
|
|
|
|
|
|
groupNm: groupNm |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
setSearchData(prevState => { |
|
|
|
// groupId sessionStorage에 보관 (1 브라우저 1 tab에만 유효)
|
|
|
|
return { |
|
|
|
sessionStorage.setItem('groupId', groupId); |
|
|
|
...prevState, |
|
|
|
sessionStorage.setItem('cstmrSno', user.cstmrSno); |
|
|
|
cstmrSno: user.cstmrSno, |
|
|
|
|
|
|
|
groupId: groupId |
|
|
|
setSearchData(prevState => { |
|
|
|
}; |
|
|
|
return { |
|
|
|
}); |
|
|
|
...prevState, |
|
|
|
dispatch(FlightAction.FLIGHT_APRV_LIST.request({ ...param, page: 1 })); |
|
|
|
cstmrSno: user.cstmrSno, |
|
|
|
} else { |
|
|
|
groupId: groupId |
|
|
|
setModal({ |
|
|
|
}; |
|
|
|
isOpen: true, |
|
|
|
}); |
|
|
|
title: '권한 확인', |
|
|
|
dispatch(FlightAction.FLIGHT_APRV_LIST.request({ ...param, page: 1 })); |
|
|
|
desc: '승인정보 확인을 위해서는 운영자 권한이 필요합니다. 운영자에게 권한을 부여받고 다시 시도해 주세요.', |
|
|
|
|
|
|
|
color: 'info' |
|
|
|
//승인/미승인버튼 활성/비활성 제어
|
|
|
|
}); |
|
|
|
let my = false; |
|
|
|
return; |
|
|
|
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); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const handlerGroupCancel = () => { |
|
|
|
const handlerGroupCancel = () => { |
|
|
@ -252,39 +260,9 @@ const FlightPlanAprvContainer = () => { |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<CustomMainLayout title={'비행계획서 승인'}> |
|
|
|
<CustomMainLayout title={'비행계획서 승인'}> |
|
|
|
{/* <div className='pal-card-box'> */} |
|
|
|
<div className='pal-card-box'> |
|
|
|
<div className='mt-2 pal-card-box'> |
|
|
|
|
|
|
|
<Row> |
|
|
|
<Row> |
|
|
|
{/* <Col sm='12'> |
|
|
|
|
|
|
|
<FlightPlanAprvSearch |
|
|
|
|
|
|
|
searchData={searchData} |
|
|
|
|
|
|
|
handleChangeSearchData={handleChangeSearchData} |
|
|
|
|
|
|
|
handleSearch={handleSearch} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<FlightPlanAprvGrid |
|
|
|
|
|
|
|
data={aprvList} |
|
|
|
|
|
|
|
columns={columns} |
|
|
|
|
|
|
|
handleChangeSelected={handleChangeSelected} |
|
|
|
|
|
|
|
handleClickAprv={handleClickAprv} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<FlightPlanGrid |
|
|
|
|
|
|
|
planListData={aprvList} |
|
|
|
|
|
|
|
handleMoveDetail={handleMoveDetail} |
|
|
|
|
|
|
|
handleChangeSelected={handleChangeSelected} |
|
|
|
|
|
|
|
handleClickAprv={handleClickAprv} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Col> */} |
|
|
|
|
|
|
|
{/* <Col sm='4'> |
|
|
|
|
|
|
|
<FlightPlanAprvGroupGrid |
|
|
|
|
|
|
|
data={joinList} |
|
|
|
|
|
|
|
count={joinListCount} |
|
|
|
|
|
|
|
columns={columns} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Col> */} |
|
|
|
|
|
|
|
{/* <Col sm='4'> */} |
|
|
|
|
|
|
|
<Col sm='12' lg='12'> |
|
|
|
<Col sm='12' lg='12'> |
|
|
|
|
|
|
|
|
|
|
|
{user ? ( |
|
|
|
{user ? ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<FlightPlanAprvGroupGrid |
|
|
|
<FlightPlanAprvGroupGrid |
|
|
@ -317,7 +295,6 @@ const FlightPlanAprvContainer = () => { |
|
|
|
handlerPageChange={onChangePage} |
|
|
|
handlerPageChange={onChangePage} |
|
|
|
data={aprvList} |
|
|
|
data={aprvList} |
|
|
|
handleClickAprv={handleClickAprv} |
|
|
|
handleClickAprv={handleClickAprv} |
|
|
|
// joinList={joinList}
|
|
|
|
|
|
|
|
{...(user?.authId === 'SUPER' || user?.authId === 'ADMIN' |
|
|
|
{...(user?.authId === 'SUPER' || user?.authId === 'ADMIN' |
|
|
|
? { joinList: groupList } |
|
|
|
? { joinList: groupList } |
|
|
|
: { joinList: joinList })} |
|
|
|
: { joinList: joinList })} |
|
|
@ -329,11 +306,11 @@ const FlightPlanAprvContainer = () => { |
|
|
|
paginationPerPage={10} |
|
|
|
paginationPerPage={10} |
|
|
|
paginationRowsPerPageOptions={[10, 20, 30, 40]} |
|
|
|
paginationRowsPerPageOptions={[10, 20, 30, 40]} |
|
|
|
total={total} |
|
|
|
total={total} |
|
|
|
// handleChangeCheckbox={handleChangeCheckbox}
|
|
|
|
isMyGroup={isMyGroup} |
|
|
|
|
|
|
|
// handleChangeCheckbox={handleChangeCheckbox}
|
|
|
|
/> |
|
|
|
/> |
|
|
|
</> |
|
|
|
</> |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
// <div className='no-dataTable'>
|
|
|
|
|
|
|
|
<div className='mt-2 no-dataTable'> |
|
|
|
<div className='mt-2 no-dataTable'> |
|
|
|
그룹 목록에서 상세보기를 클릭하세요. |
|
|
|
그룹 목록에서 상세보기를 클릭하세요. |
|
|
|
</div> |
|
|
|
</div> |
|
|
|