Browse Source

승인 - 상세보기 추가

pull/2/head
junh_eee 2 years ago
parent
commit
cc3043d5df
  1. 48
      src/containers/basis/flight/aprv/FlightPlanAprvContainer.js

48
src/containers/basis/flight/aprv/FlightPlanAprvContainer.js

@ -1,11 +1,13 @@
import React, {useEffect, useState} from 'react';
import {Col, Row} from 'reactstrap';
import {Col, Row, Button} from 'reactstrap';
import {CustomMainLayout} from '../../../../components/layout/CustomMainLayout';
import moment from 'moment/moment';
import FlightPlanAprvSearch from '../../../../components/basis/flight/aprv/FlightPlanAprvSearch';
import FlightPlanAprvGrid from '../../../../components/basis/flight/aprv/FlightPlanAprvGrid';
import FlightPlanGrid from '../../../../components/basis/flight/plan/FlightPlanGrid';
import {useDispatch, useSelector} from 'react-redux';
import * as FlightAction from '../../../../modules/basis/flight/actions/basisFlightAction';
import {useHistory} from 'react-router-dom';
const initSearchData = {
schFltStDt: moment().set({'date': 1, 'h': 0, 'm': 0, 's': 0}).format('YYYY-MM-DD HH:mm:ss'),
@ -14,24 +16,37 @@ const initSearchData = {
cstmrSno: 0,
};
const columns = [
{id: 'planSno', name: '번호', cell: (row, i) => (<div>{i + 1}</div>)},
{id: 'fltPurpose', name: '비행목적', cell: row => (<div>{row.fltPurpose}</div>)},
{
id: 'fltMethod', name: '비행방식', cell: row => {
const displayName = row.areaList && row.areaList.length > 0 && row.areaList[0].fltMethod || '-';
return <div>{displayName}</div>
}
},
{id: 'schFltStDt', name: '출발일', cell: row => (<div>{row.schFltStDt}</div>)},
{id: 'aprvlYn', name: '승인여부', cell: row => (<div>{row.aprvlYn}</div>)}
];
const FlightPlanAprvContainer = () => {
const dispatch = useDispatch();
const [searchData, setSearchData] = useState(initSearchData);
const [selPlanSnoList, setSelPlanSnoList] = useState([]);
const {aprvList, aprvProc} = useSelector(state => state.flightState);
const history = useHistory();
const handleMoveDetail = (id) => {
history.push(`/basis/flight/plan/detail/${id}`)
}
const columns = [
{id: 'planSno', name: '번호', cell: (row, i) => (<div>{i + 1}</div>)},
{id: 'fltPurpose', name: '비행목적', cell: row => (<div>{row.fltPurpose}</div>)},
{
id: 'fltMethod', name: '비행방식', cell: row => {
const displayName = row.areaList && row.areaList.length > 0 && row.areaList[0].fltMethod || '-';
return <div>{displayName}</div>
}
},
{id: 'schFltStDt', name: '출발일', cell: row => (<div>{row.schFltStDt}</div>)},
{id: 'aprvlYn', name: '승인여부', cell: row => (<div>{row.aprvlYn}</div>)},
{
id: 'moveDetail', name: '상세보기', cell: row => {
return <Button.Ripple color='primary' size='sm' onClick={() => {
handleMoveDetail(row.planSno)}
}>상세</Button.Ripple>;
}
}
];
// 최초 비행계획서 목록 조회
useEffect(() => {
@ -87,6 +102,13 @@ const FlightPlanAprvContainer = () => {
handleChangeSelected={handleChangeSelected}
handleClickAprv={handleClickAprv}
/>
{/* <FlightPlanGrid
planListData={aprvList}
handleMoveDetail={handleMoveDetail}
handleChangeSelected={handleChangeSelected}
handleClickAprv={handleClickAprv}
/> */}
</Col>
</Row>
</div>

Loading…
Cancel
Save