|
|
|
@ -39,7 +39,7 @@ const StyledTableRow = styled(TableRow)(({ theme }) => ({
|
|
|
|
|
|
|
|
|
|
const totLabel = ['부과', '서손', '미부과', '계'];
|
|
|
|
|
|
|
|
|
|
const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUserData, selectedRow, judgeTeam }) => {
|
|
|
|
|
const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUserData, selectedRow, judgeTeam, judgeData }) => {
|
|
|
|
|
const alert = useAlert();
|
|
|
|
|
const [judgeResult, setJudgeResult] = useState({
|
|
|
|
|
totJudgeUsers,
|
|
|
|
@ -47,10 +47,10 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
judgeCars,
|
|
|
|
|
judgeUserData
|
|
|
|
|
});
|
|
|
|
|
const [judgeDatas, setJudgeDatas] = useState(judgeData ?? []);
|
|
|
|
|
const [msuTeam, setMsuTeam] = useState(judgeTeam ?? '001');
|
|
|
|
|
|
|
|
|
|
const onSearch = async () => {
|
|
|
|
|
// setAlertOpen(false);
|
|
|
|
|
if (msuTeam) {
|
|
|
|
|
const params = {
|
|
|
|
|
msDatagb: selectedRow.msDatagb ?? '',
|
|
|
|
@ -60,8 +60,17 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
msuTeam
|
|
|
|
|
};
|
|
|
|
|
const res = await findJudgeResults(params, params.msDatagb === '');
|
|
|
|
|
|
|
|
|
|
const arrJudgeData = [];
|
|
|
|
|
if (res && res?.success) {
|
|
|
|
|
// eslint-disable-next-line no-plusplus
|
|
|
|
|
for (let idx = 0; idx < res.data.judgeCars.length; idx++) {
|
|
|
|
|
console.log(idx);
|
|
|
|
|
if (res.data.judgeUserData[idx].msResult === '0') {
|
|
|
|
|
arrJudgeData.push({ msMaincode: res.data.judgeUserData[idx].msMaincode, msSeq: res.data.judgeUserData[idx].msSeq });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
setJudgeDatas(arrJudgeData);
|
|
|
|
|
|
|
|
|
|
setJudgeResult({
|
|
|
|
|
...judgeResult,
|
|
|
|
|
totJudgeUsers: res.data?.totJudgeUsers,
|
|
|
|
@ -93,29 +102,41 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Grid container spacing={1} alignItems="center" mb={1}>
|
|
|
|
|
<Grid item xs={12}>
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
<Grid item sm={5}>
|
|
|
|
|
<Typography variant="subtitle1">
|
|
|
|
|
심의차수: {selectedRow.msChasu}차 ㅣ 심의기간: {selectedRow.msSdate} ~ {selectedRow.msEdate}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item sm={2}>
|
|
|
|
|
<FormControl fullWidth>
|
|
|
|
|
<InputLabel required>팀</InputLabel>
|
|
|
|
|
<Select defaultValue={msuTeam} value={msuTeam} onChange={(e) => setMsuTeam(e.target.value)}>
|
|
|
|
|
{combo.teams.map((team) => (
|
|
|
|
|
<MenuItem key={team.code} value={team.code}>
|
|
|
|
|
{team.value}
|
|
|
|
|
</MenuItem>
|
|
|
|
|
))}
|
|
|
|
|
</Select>
|
|
|
|
|
</FormControl>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item sm={2} sx={{ marginTop: 1 }}>
|
|
|
|
|
<Button variant="contained" color="primary" size="small" startIcon={<IconSearch />} onClick={onSearch}>
|
|
|
|
|
조회
|
|
|
|
|
</Button>
|
|
|
|
|
<Grid container spacing={1}>
|
|
|
|
|
<Grid item xs={7}>
|
|
|
|
|
<Typography variant="subtitle1">
|
|
|
|
|
심의차수: {selectedRow.msChasu}차 ㅣ 심의기간: {selectedRow.msSdate} ~ {selectedRow.msEdate}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={5}>
|
|
|
|
|
<Grid container spacing={0.5} alignItems="center" mb={1}>
|
|
|
|
|
<Grid item xs={6} style={{ marginLeft: 'auto' }}>
|
|
|
|
|
<FormControl fullWidth>
|
|
|
|
|
<InputLabel required>팀</InputLabel>
|
|
|
|
|
<Select defaultValue={msuTeam} value={msuTeam} onChange={(e) => setMsuTeam(e.target.value)}>
|
|
|
|
|
{combo.teams.map((team, idx) => (
|
|
|
|
|
<MenuItem key={idx} value={team.code}>
|
|
|
|
|
{team.value}
|
|
|
|
|
</MenuItem>
|
|
|
|
|
))}
|
|
|
|
|
</Select>
|
|
|
|
|
</FormControl>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid item xs={6} sx={{ marginTop: 1 }}>
|
|
|
|
|
<Button variant="contained" color="primary" size="small" startIcon={<IconSearch />} onClick={onSearch}>
|
|
|
|
|
조회
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
disabled={judgeDatas.length === 0}
|
|
|
|
|
variant="contained"
|
|
|
|
|
color="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
startIcon={<IconSearch />}
|
|
|
|
|
onClick={onSearch}
|
|
|
|
|
>
|
|
|
|
|
일괄처리
|
|
|
|
|
</Button>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
@ -134,14 +155,17 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
<StyledTableCell align="center" style={{ width: 130 }}>
|
|
|
|
|
차량번호
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
{judgeResult?.totJudgeUsers.map((u) => (
|
|
|
|
|
<StyledTableCell align="center" key={u.NAME} style={{ width: 80 }}>
|
|
|
|
|
{judgeResult?.totJudgeUsers.map((u, idx) => (
|
|
|
|
|
<StyledTableCell align="center" key={idx} style={{ width: 80 }}>
|
|
|
|
|
{u.NAME}
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
))}
|
|
|
|
|
<StyledTableCell align="center" style={{ width: 80 }}>
|
|
|
|
|
결과
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
<StyledTableCell align="center" style={{ width: 80 }}>
|
|
|
|
|
처리
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
</TableRow>
|
|
|
|
|
</TableHead>
|
|
|
|
|
<TableBody>
|
|
|
|
@ -152,11 +176,12 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
{totLabel[idx]}
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
<StyledTableCell align="center" style={{ width: 130 }} />
|
|
|
|
|
{totData.map((data) => (
|
|
|
|
|
<StyledTableCell align="center" style={{ width: 80 }}>
|
|
|
|
|
{totData.map((data, totIdx) => (
|
|
|
|
|
<StyledTableCell key={`${idx}${totIdx}`} align="center" style={{ width: 80 }}>
|
|
|
|
|
{data}
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
))}
|
|
|
|
|
<StyledTableCell />
|
|
|
|
|
</StyledTableRow>
|
|
|
|
|
))}
|
|
|
|
|
</TableBody>
|
|
|
|
@ -177,14 +202,17 @@ const ModalJudgeResult = ({ totJudgeUsers, totJudgeUserData, judgeCars, judgeUse
|
|
|
|
|
|
|
|
|
|
{/* /!* 심사위원별 심사결과 *!/ */}
|
|
|
|
|
{_.range(carIdx, judgeResult.judgeUserData.length, judgeResult.judgeCars.length).map((userIdx) => (
|
|
|
|
|
<StyledTableCell align="center" key={carIdx + userIdx} style={{ width: 80 }}>
|
|
|
|
|
<StyledTableCell align="center" key={userIdx} style={{ width: 80 }}>
|
|
|
|
|
{judgeResult.judgeUserData[userIdx].msuResult}
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
|
|
{/* 최종심사결과 */}
|
|
|
|
|
<StyledTableCell align="center" style={{ width: 80 }}>
|
|
|
|
|
{judgeResult.judgeUserData[carIdx].msResult}
|
|
|
|
|
{judgeResult.judgeUserData[carIdx].msResultNm}
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
<StyledTableCell align="center" style={{ width: 80 }}>
|
|
|
|
|
{judgeResult.judgeUserData[carIdx].msResult === '0' ? '처리' : ''}
|
|
|
|
|
</StyledTableCell>
|
|
|
|
|
</StyledTableRow>
|
|
|
|
|
))}
|
|
|
|
|