|
|
|
@ -1,5 +1,3 @@
|
|
|
|
|
import * as yup from 'yup'; |
|
|
|
|
import classnames from 'classnames'; |
|
|
|
|
import React, { useEffect, useState } from 'react'; |
|
|
|
|
import { |
|
|
|
|
Card, |
|
|
|
@ -9,8 +7,7 @@ import {
|
|
|
|
|
Input, |
|
|
|
|
Label, |
|
|
|
|
Row, |
|
|
|
|
Button, |
|
|
|
|
FormFeedback |
|
|
|
|
Button |
|
|
|
|
} from 'reactstrap'; |
|
|
|
|
import Flatpickr from 'react-flatpickr'; |
|
|
|
|
import '@styles/react/libs/flatpickr/flatpickr.scss'; |
|
|
|
@ -35,24 +32,11 @@ const FlightPlanForm = ({
|
|
|
|
|
handleDelete, |
|
|
|
|
modal, |
|
|
|
|
handleDeleteArray, |
|
|
|
|
isDone |
|
|
|
|
isDone, |
|
|
|
|
isDisabled |
|
|
|
|
}) => { |
|
|
|
|
const { areaList, pilotList, arcrftList } = data; |
|
|
|
|
|
|
|
|
|
const [test, setTest] = useState(); |
|
|
|
|
const { user } = useSelector(state => state.authState, shallowEqual); |
|
|
|
|
const { detail } = useSelector(state => state.flightState); |
|
|
|
|
|
|
|
|
|
// const schema = yup.object().shape({});
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (detail?.cstmrSno == user?.cstmrSno || user.authId === 'SUPER') { |
|
|
|
|
setTest(false); |
|
|
|
|
} else { |
|
|
|
|
setTest(true); |
|
|
|
|
} |
|
|
|
|
}, [detail]); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Row> |
|
|
|
|
<Col sm='12'> |
|
|
|
@ -80,7 +64,6 @@ const FlightPlanForm = ({
|
|
|
|
|
<span className='necessary'>*</span>성명 |
|
|
|
|
</Label> |
|
|
|
|
<Input |
|
|
|
|
// readOnly={test}
|
|
|
|
|
type='text' |
|
|
|
|
id='memberName' |
|
|
|
|
name='memberName' |
|
|
|
@ -96,7 +79,7 @@ const FlightPlanForm = ({
|
|
|
|
|
}} |
|
|
|
|
bsSize='sm' |
|
|
|
|
placeholder='' |
|
|
|
|
disabled={isDone || test} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
@ -128,7 +111,6 @@ const FlightPlanForm = ({
|
|
|
|
|
</div> |
|
|
|
|
<div className='m_ft_box'> |
|
|
|
|
<Input |
|
|
|
|
// readOnly={test}
|
|
|
|
|
type='text' |
|
|
|
|
id='hpno' |
|
|
|
|
name='hpno' |
|
|
|
@ -144,7 +126,7 @@ const FlightPlanForm = ({
|
|
|
|
|
}); |
|
|
|
|
}} |
|
|
|
|
placeholder='010-0000-0000' |
|
|
|
|
disabled={isDone || test} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</FormGroup> |
|
|
|
@ -155,7 +137,6 @@ const FlightPlanForm = ({
|
|
|
|
|
<span className='necessary'>*</span>이메일 |
|
|
|
|
</Label> |
|
|
|
|
<Input |
|
|
|
|
// readOnly={test}
|
|
|
|
|
type='text' |
|
|
|
|
id='email' |
|
|
|
|
name='email' |
|
|
|
@ -172,7 +153,7 @@ const FlightPlanForm = ({
|
|
|
|
|
}} |
|
|
|
|
// innerRef={props.data}
|
|
|
|
|
placeholder='' |
|
|
|
|
disabled={isDone || test} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Col> |
|
|
|
@ -192,7 +173,6 @@ const FlightPlanForm = ({
|
|
|
|
|
비행시작일자 |
|
|
|
|
</Label> |
|
|
|
|
<Flatpickr |
|
|
|
|
// disabled={test}
|
|
|
|
|
className='form-control form-control-sm' |
|
|
|
|
type='text' |
|
|
|
|
id='schFltStDt' |
|
|
|
@ -212,7 +192,7 @@ const FlightPlanForm = ({
|
|
|
|
|
}); |
|
|
|
|
}} |
|
|
|
|
placeholder='비행 시작일자 선택(클릭)' |
|
|
|
|
disabled={isDone || test} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
// {...{options:{minDate: "today"}}}
|
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
@ -224,7 +204,6 @@ const FlightPlanForm = ({
|
|
|
|
|
비행종료일자 |
|
|
|
|
</Label> |
|
|
|
|
<Flatpickr |
|
|
|
|
// disabled={test}
|
|
|
|
|
className='form-control form-control-sm' |
|
|
|
|
type='text' |
|
|
|
|
id='schFltEndDt' |
|
|
|
@ -244,7 +223,7 @@ const FlightPlanForm = ({
|
|
|
|
|
}); |
|
|
|
|
}} |
|
|
|
|
placeholder='비행 종료일자 선택(클릭)' |
|
|
|
|
disabled={isDone || test} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
// {...{options:{minDate: "today"}}}
|
|
|
|
|
/> |
|
|
|
|
</FormGroup> |
|
|
|
@ -256,7 +235,6 @@ const FlightPlanForm = ({
|
|
|
|
|
목적 |
|
|
|
|
</Label> |
|
|
|
|
<Input |
|
|
|
|
// disabled={test}
|
|
|
|
|
type='select' |
|
|
|
|
id='fltPurpose' |
|
|
|
|
name='fltPurpose' |
|
|
|
@ -270,7 +248,7 @@ const FlightPlanForm = ({
|
|
|
|
|
value |
|
|
|
|
}); |
|
|
|
|
}} |
|
|
|
|
disabled={isDone || test} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
// innerRef={props.data}
|
|
|
|
|
// className={classnames({
|
|
|
|
|
// 'is-invalid': props.errors.arcrftTypeCd
|
|
|
|
@ -335,7 +313,7 @@ const FlightPlanForm = ({
|
|
|
|
|
<div className='search-info-ti d-flex justify-content-between'> |
|
|
|
|
<h4 className='ti'>조종사 정보</h4> |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test || isDone} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
color='primary' |
|
|
|
|
onClick={e => { |
|
|
|
|
handleModal({ target: 'pilot', isOpen: true }); |
|
|
|
@ -353,6 +331,7 @@ const FlightPlanForm = ({
|
|
|
|
|
handleChange={handleChange} |
|
|
|
|
handleDeleteArray={handleDeleteArray} |
|
|
|
|
isDone={isDone} |
|
|
|
|
isDisabled={isDisabled} |
|
|
|
|
/> |
|
|
|
|
)) |
|
|
|
|
) : ( |
|
|
|
@ -366,7 +345,7 @@ const FlightPlanForm = ({
|
|
|
|
|
<div className='search-info-ti d-flex justify-content-between'> |
|
|
|
|
<h4 className='ti'>기체 정보</h4> |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test || isDone} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
color='primary' |
|
|
|
|
onClick={e => { |
|
|
|
|
handleModal({ target: 'arcrft', isOpen: true }); |
|
|
|
@ -384,6 +363,7 @@ const FlightPlanForm = ({
|
|
|
|
|
handleChange={handleChange} |
|
|
|
|
handleDeleteArray={handleDeleteArray} |
|
|
|
|
isDone={isDone} |
|
|
|
|
isDisabled={isDisabled} |
|
|
|
|
/> |
|
|
|
|
)) |
|
|
|
|
) : ( |
|
|
|
@ -396,7 +376,7 @@ const FlightPlanForm = ({
|
|
|
|
|
|
|
|
|
|
<div className='d-flex align-items-center'> |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test || isDone} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
className='mr-1' |
|
|
|
|
color='primary' |
|
|
|
|
size='sm' |
|
|
|
@ -406,7 +386,7 @@ const FlightPlanForm = ({
|
|
|
|
|
</Button.Ripple> |
|
|
|
|
{data.planSno ? ( |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test || isDone} |
|
|
|
|
disabled={isDone || isDisabled} |
|
|
|
|
color='danger' |
|
|
|
|
size='sm' |
|
|
|
|
onClick={handleDelete} |
|
|
|
@ -427,8 +407,8 @@ const FlightPlanForm = ({
|
|
|
|
|
<SelectModal |
|
|
|
|
modal={modal} |
|
|
|
|
handleModal={handleModal} |
|
|
|
|
test={test} |
|
|
|
|
isDone={isDone} |
|
|
|
|
isDisabled={isDisabled} |
|
|
|
|
/> |
|
|
|
|
</Row> |
|
|
|
|
); |
|
|
|
@ -436,7 +416,7 @@ const FlightPlanForm = ({
|
|
|
|
|
|
|
|
|
|
export default FlightPlanForm; |
|
|
|
|
|
|
|
|
|
const SelectModal = ({ handleModal, modal, test, isDone }) => { |
|
|
|
|
const SelectModal = ({ handleModal, modal, isDone, isDisabled }) => { |
|
|
|
|
let title = ''; |
|
|
|
|
let description = ''; |
|
|
|
|
let type = ''; |
|
|
|
@ -468,8 +448,8 @@ const SelectModal = ({ handleModal, modal, test, isDone }) => {
|
|
|
|
|
<FlightPlanAreaContainer |
|
|
|
|
handleModal={handleModal} |
|
|
|
|
type={type} |
|
|
|
|
test={test} |
|
|
|
|
isDone={isDone} |
|
|
|
|
isDisabled={isDisabled} |
|
|
|
|
/> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
@ -632,19 +612,20 @@ const PilotForm = ({
|
|
|
|
|
handleChange, |
|
|
|
|
index, |
|
|
|
|
handleDeleteArray, |
|
|
|
|
isDone |
|
|
|
|
isDone, |
|
|
|
|
isDisabled |
|
|
|
|
}) => { |
|
|
|
|
const [test, setTest] = useState(); |
|
|
|
|
const { user } = useSelector(state => state.authState, shallowEqual); |
|
|
|
|
const { detail } = useSelector(state => state.flightState); |
|
|
|
|
// const [test, setTest] = useState();
|
|
|
|
|
// const { user } = useSelector(state => state.authState, shallowEqual);
|
|
|
|
|
// const { detail } = useSelector(state => state.flightState);
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (detail?.cstmrSno == user?.cstmrSno || user.authId === 'SUPER') { |
|
|
|
|
setTest(false); |
|
|
|
|
} else { |
|
|
|
|
setTest(true); |
|
|
|
|
} |
|
|
|
|
}, [detail]); |
|
|
|
|
// useEffect(() => {
|
|
|
|
|
// if (detail?.cstmrSno == user?.cstmrSno || user.authId === 'SUPER') {
|
|
|
|
|
// setTest(false);
|
|
|
|
|
// } else {
|
|
|
|
|
// setTest(true);
|
|
|
|
|
// }
|
|
|
|
|
// }, [detail]);
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className='search-info-box'> |
|
|
|
@ -753,7 +734,7 @@ const PilotForm = ({
|
|
|
|
|
<Col className='search-info-box-del-btn' lg={1} md={6} sm={12}> |
|
|
|
|
{data.groupNm ? ( |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test || isDone} |
|
|
|
|
disabled={isDisabled || isDone} |
|
|
|
|
color='danger' |
|
|
|
|
className='btn-icon' |
|
|
|
|
onClick={() => handleDeleteArray({ type: 'pilot', index })} |
|
|
|
@ -774,19 +755,20 @@ const ArcrftForm = ({
|
|
|
|
|
handleChange, |
|
|
|
|
index, |
|
|
|
|
handleDeleteArray, |
|
|
|
|
isDone |
|
|
|
|
isDone, |
|
|
|
|
isDisabled |
|
|
|
|
}) => { |
|
|
|
|
const [test, setTest] = useState(); |
|
|
|
|
const { user } = useSelector(state => state.authState, shallowEqual); |
|
|
|
|
const { detail } = useSelector(state => state.flightState); |
|
|
|
|
// const [test, setTest] = useState();
|
|
|
|
|
// const { user } = useSelector(state => state.authState, shallowEqual);
|
|
|
|
|
// const { detail } = useSelector(state => state.flightState);
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (detail?.cstmrSno == user?.cstmrSno || user.authId === 'SUPER') { |
|
|
|
|
setTest(false); |
|
|
|
|
} else { |
|
|
|
|
setTest(true); |
|
|
|
|
} |
|
|
|
|
}, [detail]); |
|
|
|
|
// useEffect(() => {
|
|
|
|
|
// if (detail?.cstmrSno == user?.cstmrSno || user.authId === 'SUPER') {
|
|
|
|
|
// setTest(false);
|
|
|
|
|
// } else {
|
|
|
|
|
// setTest(true);
|
|
|
|
|
// }
|
|
|
|
|
// }, [detail]);
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className='search-info-box'> |
|
|
|
@ -898,7 +880,7 @@ const ArcrftForm = ({
|
|
|
|
|
{data.groupNm ? ( |
|
|
|
|
<Col className='search-info-box-del-btn' lg={1} md={6} sm={12}> |
|
|
|
|
<Button.Ripple |
|
|
|
|
disabled={test || isDone} |
|
|
|
|
disabled={isDisabled || isDone} |
|
|
|
|
color='danger' |
|
|
|
|
className='btn-icon' |
|
|
|
|
onClick={() => handleDeleteArray({ type: 'arcrft', index })} |
|
|
|
|