|
|
@ -6,7 +6,8 @@ import { FaAngleDown, FaAngleUp } from 'react-icons/fa'; |
|
|
|
import { Form, Input, Table, Typography } from 'antd'; |
|
|
|
import { Form, Input, Table, Typography } from 'antd'; |
|
|
|
import { |
|
|
|
import { |
|
|
|
updateLaancAprv, |
|
|
|
updateLaancAprv, |
|
|
|
getLaancAprvList |
|
|
|
getLaancAprvList, |
|
|
|
|
|
|
|
updateLaancAprvReview |
|
|
|
} from '@src/redux/features/laanc/laancThunk'; |
|
|
|
} from '@src/redux/features/laanc/laancThunk'; |
|
|
|
import { ERROR_MESSAGE, ERROR_TITLE } from '@src/configs/msgConst'; |
|
|
|
import { ERROR_MESSAGE, ERROR_TITLE } from '@src/configs/msgConst'; |
|
|
|
import OperationModal from './OperationModal'; |
|
|
|
import OperationModal from './OperationModal'; |
|
|
@ -322,6 +323,22 @@ export default function OperationApprovalsTable(props) { |
|
|
|
return text ? text : '-'; |
|
|
|
return text ? text : '-'; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
title: ( |
|
|
|
|
|
|
|
<> |
|
|
|
|
|
|
|
요청 고도 |
|
|
|
|
|
|
|
<br /> |
|
|
|
|
|
|
|
(m이하) |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
dataIndex: 'reqElev', |
|
|
|
|
|
|
|
align: 'center', |
|
|
|
|
|
|
|
width: '80px', |
|
|
|
|
|
|
|
editable: true, |
|
|
|
|
|
|
|
render: (text, record) => { |
|
|
|
|
|
|
|
return text ? text : '-'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: ( |
|
|
|
title: ( |
|
|
|
<> |
|
|
|
<> |
|
|
@ -659,6 +676,14 @@ export default function OperationApprovalsTable(props) { |
|
|
|
return text ? text : <>-</>; |
|
|
|
return text ? text : <>-</>; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dataIndex: 'reqElev', |
|
|
|
|
|
|
|
align: 'center', |
|
|
|
|
|
|
|
width: '80px', |
|
|
|
|
|
|
|
render: text => { |
|
|
|
|
|
|
|
return text ? text : <>-</>; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
dataIndex: 'fltElevMax', |
|
|
|
dataIndex: 'fltElevMax', |
|
|
|
align: 'center', |
|
|
|
align: 'center', |
|
|
@ -788,6 +813,7 @@ export default function OperationApprovalsTable(props) { |
|
|
|
approvalCd: item.approvalCd, |
|
|
|
approvalCd: item.approvalCd, |
|
|
|
planAreaSno: item.planAreaSno, |
|
|
|
planAreaSno: item.planAreaSno, |
|
|
|
planSno: item.planSno, |
|
|
|
planSno: item.planSno, |
|
|
|
|
|
|
|
reqElev: item.reqElev, |
|
|
|
addr1: item.addr1, |
|
|
|
addr1: item.addr1, |
|
|
|
addr2: item.addr2, |
|
|
|
addr2: item.addr2, |
|
|
|
addr3: item.addr3, |
|
|
|
addr3: item.addr3, |
|
|
@ -1083,15 +1109,12 @@ export default function OperationApprovalsTable(props) { |
|
|
|
setIsModal(!ismodal); |
|
|
|
setIsModal(!ismodal); |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 부모 체크박스
|
|
|
|
// 부모 체크박스
|
|
|
|
const rowSelection = { |
|
|
|
const rowSelection = { |
|
|
|
selectedRowKeys: checkList, |
|
|
|
selectedRowKeys: checkList, |
|
|
|
getCheckboxProps: record => { |
|
|
|
getCheckboxProps: record => { |
|
|
|
const allChildrenReviewed = record.areaList.every( |
|
|
|
|
|
|
|
child => child.reviewedType !== 'R' |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
disabled: allChildrenReviewed, |
|
|
|
|
|
|
|
name: record.key |
|
|
|
name: record.key |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -1100,9 +1123,9 @@ export default function OperationApprovalsTable(props) { |
|
|
|
const key = record.key; |
|
|
|
const key = record.key; |
|
|
|
|
|
|
|
|
|
|
|
if (key.startsWith('parent_')) { |
|
|
|
if (key.startsWith('parent_')) { |
|
|
|
const childKeys = record.areaList |
|
|
|
const childKeys = record.areaList.map( |
|
|
|
.filter(child => child.reviewedType === 'R') |
|
|
|
child => `child_${record.planSno}_${child.planAreaSno}` |
|
|
|
.map(child => `child_${record.planSno}_${child.planAreaSno}`); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (selected) { |
|
|
|
if (selected) { |
|
|
|
newCheckList.push(key, ...childKeys); |
|
|
|
newCheckList.push(key, ...childKeys); |
|
|
@ -1119,16 +1142,12 @@ export default function OperationApprovalsTable(props) { |
|
|
|
const newCheckList = selected |
|
|
|
const newCheckList = selected |
|
|
|
? laancAprvList.flatMap(parent => { |
|
|
|
? laancAprvList.flatMap(parent => { |
|
|
|
const parentKey = `parent_${parent.planSno}`; |
|
|
|
const parentKey = `parent_${parent.planSno}`; |
|
|
|
const selectableChildren = parent.areaList.filter( |
|
|
|
|
|
|
|
child => child.reviewedType === 'R' |
|
|
|
const childKeys = parent.areaList.map( |
|
|
|
); |
|
|
|
|
|
|
|
const childKeys = selectableChildren.map( |
|
|
|
|
|
|
|
child => `child_${parent.planSno}_${child.planAreaSno}` |
|
|
|
child => `child_${parent.planSno}_${child.planAreaSno}` |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return selectableChildren.length > 0 |
|
|
|
return parent.areaList.length > 0 ? [parentKey, ...childKeys] : []; |
|
|
|
? [parentKey, ...childKeys] |
|
|
|
|
|
|
|
: []; |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
: []; |
|
|
|
: []; |
|
|
|
|
|
|
|
|
|
|
@ -1143,10 +1162,8 @@ export default function OperationApprovalsTable(props) { |
|
|
|
// 부모 키 업데이트
|
|
|
|
// 부모 키 업데이트
|
|
|
|
laancAprvList.forEach(parent => { |
|
|
|
laancAprvList.forEach(parent => { |
|
|
|
const parentKey = `parent_${parent.planSno}`; |
|
|
|
const parentKey = `parent_${parent.planSno}`; |
|
|
|
const selectableChildren = parent.areaList.filter( |
|
|
|
|
|
|
|
child => child.reviewedType === 'R' |
|
|
|
const childKeys = parent.areaList.map( |
|
|
|
); |
|
|
|
|
|
|
|
const childKeys = selectableChildren.map( |
|
|
|
|
|
|
|
child => `child_${parent.planSno}_${child.planAreaSno}` |
|
|
|
child => `child_${parent.planSno}_${child.planAreaSno}` |
|
|
|
); |
|
|
|
); |
|
|
|
const allSelectableChildrenChecked = childKeys.every(key => |
|
|
|
const allSelectableChildrenChecked = childKeys.every(key => |
|
|
@ -1156,7 +1173,7 @@ export default function OperationApprovalsTable(props) { |
|
|
|
newList.includes(key) |
|
|
|
newList.includes(key) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (allSelectableChildrenChecked && selectableChildren.length > 0) { |
|
|
|
if (allSelectableChildrenChecked && parent.areaList.length > 0) { |
|
|
|
if (!newList.includes(parentKey)) { |
|
|
|
if (!newList.includes(parentKey)) { |
|
|
|
newList.push(parentKey); |
|
|
|
newList.push(parentKey); |
|
|
|
} |
|
|
|
} |
|
|
@ -1175,7 +1192,6 @@ export default function OperationApprovalsTable(props) { |
|
|
|
const childRowSelection = { |
|
|
|
const childRowSelection = { |
|
|
|
selectedRowKeys: checkList.filter(key => key.startsWith('child_')), |
|
|
|
selectedRowKeys: checkList.filter(key => key.startsWith('child_')), |
|
|
|
getCheckboxProps: record => ({ |
|
|
|
getCheckboxProps: record => ({ |
|
|
|
disabled: record.reviewedType !== 'R', |
|
|
|
|
|
|
|
name: record.key |
|
|
|
name: record.key |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
@ -1193,11 +1209,13 @@ export default function OperationApprovalsTable(props) { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 체크박스 업데이트 함수
|
|
|
|
// 체크박스 업데이트 함수
|
|
|
|
const handleCheckbox = async () => { |
|
|
|
const handleCheckbox = async type => { |
|
|
|
if (checkList.length === 0) { |
|
|
|
if (checkList.length === 0) { |
|
|
|
return handlerErrorModal( |
|
|
|
return handlerErrorModal( |
|
|
|
'재검토 요청 실패', |
|
|
|
type === 'R' ? '재 요청 요청 실패' : '검토 요청 실패', |
|
|
|
'재검토 항목을 선택해주세요.', |
|
|
|
type === 'R' |
|
|
|
|
|
|
|
? '재 요청 항목을 선택해주세요.' |
|
|
|
|
|
|
|
: '검토 항목을 선택해주세요.', |
|
|
|
false |
|
|
|
false |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
@ -1217,10 +1235,51 @@ export default function OperationApprovalsTable(props) { |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
setCheckData(res); |
|
|
|
if (type === 'A') { |
|
|
|
setIsCheckBoxModal(true); |
|
|
|
const check = !res.some(item => item.approvalCd !== 'R'); |
|
|
|
|
|
|
|
if (!check) { |
|
|
|
|
|
|
|
return handlerErrorModal( |
|
|
|
|
|
|
|
'재 요청 요청 실패', |
|
|
|
|
|
|
|
'검토결과 완료인 신청건만 재 요청이 가능합니다.' |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
setCheckData(res); |
|
|
|
|
|
|
|
setIsCheckBoxModal(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (type === 'R') { |
|
|
|
|
|
|
|
const check = res.some( |
|
|
|
|
|
|
|
item => item.approvalCd !== 'R' && item.approvalCd !== 'C' |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
if (!check) { |
|
|
|
|
|
|
|
return handlerErrorModal( |
|
|
|
|
|
|
|
'검토 요청 실패', |
|
|
|
|
|
|
|
'검토결과 대기인 신청건만 요청이 가능합니다.' |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
dispatch( |
|
|
|
|
|
|
|
updateLaancAprvReview({ planAreaSnoList, reviewedType: 'R' }) |
|
|
|
|
|
|
|
).then(() => { |
|
|
|
|
|
|
|
props.handlerSearch( |
|
|
|
|
|
|
|
props.filterId, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
startDate: props.startDate, |
|
|
|
|
|
|
|
endDate: props.endDate |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
props.filterArea |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
setCheckList([]); |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
return handlerErrorModal( |
|
|
|
|
|
|
|
'검토 실패', |
|
|
|
|
|
|
|
'검토를 요청을 실패하였습니다. 다시 시도해주세요.', |
|
|
|
|
|
|
|
false |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className='layer-content'> |
|
|
|
<div className='layer-content'> |
|
|
|
<div className='layer-ti'> |
|
|
|
<div className='layer-ti'> |
|
|
@ -1265,8 +1324,11 @@ export default function OperationApprovalsTable(props) { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className='download'> |
|
|
|
<div className='download'> |
|
|
|
<Button color='primary' size='sm' onClick={handleCheckbox}> |
|
|
|
<Button color='primary' size='sm' onClick={() => handleCheckbox('R')}> |
|
|
|
재검토 요청 |
|
|
|
검토 요청 |
|
|
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button color='primary' size='sm' onClick={() => handleCheckbox('A')}> |
|
|
|
|
|
|
|
재 요청 |
|
|
|
</Button> |
|
|
|
</Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|