Browse Source

관제과 검토상태값 이슈 수정

master
김장현 2 months ago
parent
commit
0818548f78
  1. 17
      src/components/flight/ControlApprovalsTable.js
  2. 33
      src/components/flight/OperationApprovalsTable.js

17
src/components/flight/ControlApprovalsTable.js

@ -1195,16 +1195,17 @@ export default function ControlApprovalsTable(props) {
.map(item => item.split('_').pop()) // 마지막 언더바 이후의 숫자 추출 .map(item => item.split('_').pop()) // 마지막 언더바 이후의 숫자 추출
) )
]; ];
await dispatch( dispatch(
updateLaancAprvReview({ planAreaSnoList, reviewedType: 'R' }) updateLaancAprvReview({ planAreaSnoList, reviewedType: 'R' })
); ).then(() => {
dispatch(
getLaancAprvList({
searchStDt: props.startDate,
searchEndDt: props.endDate
})
);
});
setCheckList([]); setCheckList([]);
await dispatch(
getLaancAprvList({
searchStDt: props.startDate,
searchEndDt: props.endDate
})
);
} catch (error) { } catch (error) {
return handlerErrorModal( return handlerErrorModal(
'검토 실패', '검토 실패',

33
src/components/flight/OperationApprovalsTable.js

@ -81,6 +81,23 @@ export default function OperationApprovalsTable(props) {
} }
}, [laancAprvList]); }, [laancAprvList]);
const handlerReviewed = type => {
let text = '검토대기';
if (!type) {
text = '검토대기';
} else {
if (type === 'R') {
text = '검토완료';
} else if (type === 'W') {
text = '검토대기';
} else if (type === 'C') {
text = '검토취소';
}
}
return text;
};
// 데이터 // 데이터
const columns = [ const columns = [
{ {
@ -461,11 +478,11 @@ export default function OperationApprovalsTable(props) {
render: areaList => { render: areaList => {
const approvalCounts = areaList.reduce( const approvalCounts = areaList.reduce(
(counts, item) => { (counts, item) => {
if (item.approvalCd === 'R') { if (item.reviewedType === 'R') {
counts.reviewed += 1; counts.reviewed += 1;
} else if (item.approvalCd === 'W') { } else if (item.reviewedType === 'W') {
counts.wait += 1; counts.wait += 1;
} else if (item.approvalCd === 'C') { } else if (item.reviewedType === 'C') {
counts.cancel += 1; counts.cancel += 1;
} }
return counts; return counts;
@ -483,15 +500,7 @@ export default function OperationApprovalsTable(props) {
{approvalCounts.cancel} {approvalCounts.cancel}
</> </>
) : ( ) : (
<> <>{handlerReviewed(areaList[0].reviewedType)}</>
{areaList[0].reviewed === 'R'
? '검토완료'
: areaList[0].wait === 'W'
? '검토대기'
: areaList[0].cancel === 'C'
? '검토취소'
: '검토취소'}
</>
)} )}
</> </>
); );

Loading…
Cancel
Save