feat: 다음 우편번호 검색 추가 적용

main
minuk926 3 years ago
parent c6339c9bc7
commit 5f9aa4b1b2

@ -50,6 +50,7 @@
"react-beautiful-dnd": "^13.1.0",
"react-copy-to-clipboard": "^5.0.4",
"react-currency-format": "^1.1.0",
"react-daum-postcode": "^3.0.1",
"react-dom": "^17.0.2",
"react-draft-wysiwyg": "^1.14.7",
"react-draggable": "^4.4.4",

@ -10,7 +10,7 @@ import { IconSearch } from '@tabler/icons';
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/MuiDataGrid';
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import { findBoards, modifyBoardHitCount, removeBoard, saveBoard } from 'apis/board';
import { useAlert } from 'react-alert';
import CmmModal from 'views/cmm/CmmModal';

@ -10,7 +10,7 @@ import { IconFileText } from '@tabler/icons';
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/MuiDataGrid';
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import CmmModal from 'views/cmm/CmmModal';
import PublicBoardForm from './PublicBoardForm';
import { removePublicBoard, findPublicBoards, modifyPublicBoardHitCount, savePublicBoard } from 'apis/public';

@ -15,7 +15,7 @@ import InputLabel from 'ui-component/extended/Form/InputLabel';
import { Delete, List, Save } from '@mui/icons-material';
import { fileDownload } from 'apis/common';
import FileForm from 'views/cmm/FileForm';
import FileForm from 'views/cmm/file-ctl/FileForm';
const PublicBoardForm = (props) => {
// eslint-disable-next-line react/prop-types

@ -4,13 +4,12 @@ import PropTypes from 'prop-types';
import NumberFormat from 'react-number-format';
import { useAlert } from 'react-alert';
import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornment, Divider } from '@mui/material';
import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, Divider } from '@mui/material';
import Button from '@mui/material/Button';
import { IconSearch } from '@tabler/icons';
import { Delete, List } from '@mui/icons-material';
import { judgeFileDownload } from 'apis/judge';
import ImageFileTextForm from '../../cmm/ImageFileTextForm';
import ImageFileTextForm from '../../cmm/file-ctl/ImageFileTextForm';
const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave, onModify }) => {
const showAlert = useAlert();
@ -39,11 +38,22 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
return (
<>
<Grid mt={2}>
<Grid mt={1}>
<Grid container spacing={0.5} item xs={12} mb={1.5}>
<Grid item sm={3}>
<TextField disabled size="small" required label="접수번호" fullWidth value={rowData.scSeq} />
</Grid>
<Grid item sm={3}>
<TextField disabled size="small" required label="전송상태" fullWidth value={rowData.scTransferNm} />
</Grid>
<Grid item sm={3}>
<TextField disabled size="small" required label="자료상태" fullWidth value={rowData.scStateNm} />
</Grid>
<Grid item sm={3}>
<TextField disabled required label="차량번호" size="small" fullWidth value={rowData.scCarnum} autoFocus />
</Grid>
</Grid>
<Grid container spacing={1} xs={12} mt={1}>
<Grid item sm={3}>
<TextField disabled required label="성명" size="small" fullWidth value={rowData.scName} />
</Grid>
@ -71,20 +81,6 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
</Select>
</FormControl>
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={1.5}>
<Grid item sm={3}>
<NumberFormat
disabled
size="small"
customInput={TextField}
required
label="접수일자"
format="####-##-##"
fullWidth
value={rowData.scCdate}
/>
</Grid>
<Grid item sm={3}>
<FormControl fullWidth>
<InputLabel disabled required>
@ -100,7 +96,21 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
</Select>
</FormControl>
</Grid>
</Grid>
<Grid container spacing={1} xs={12} mt={1}>
<Grid item sm={3}>
<NumberFormat
disabled
size="small"
customInput={TextField}
required
label="접수일자"
format="####-##-##"
fullWidth
value={rowData.scCdate}
/>
</Grid>
<Grid item sm={2}>
<NumberFormat
disabled
size="small"
@ -112,7 +122,7 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
value={rowData.scWdate}
/>
</Grid>
<Grid item sm={3}>
<Grid item sm={1}>
<NumberFormat
disabled
size="small"
@ -124,37 +134,13 @@ const ModifyJudgeDataForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
value={rowData.scJbtime}
/>
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={2}>
<Grid item sm={6}>
<TextField disabled size="small" required label="위반장소" fullWidth value={rowData.scPos} />
</Grid>
<Grid item sm={3}>
<TextField disabled size="small" required label="전송상태" fullWidth value={rowData.scTransferNm} />
</Grid>
<Grid item sm={3}>
<TextField disabled size="small" required label="자료상태" fullWidth value={rowData.scStateNm} />
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={2}>
<Grid container spacing={1} xs={12} mt={1}>
<Grid item sm={1.7}>
<TextField
disabled
size="small"
fullWidth
required
label="우편번호"
value={rowData.zipcode1}
InputProps={{
display: 'none',
readOnly: true,
endAdornment: (
<InputAdornment position="end">
<IconSearch stroke={1.5} size="1rem" cursor="pointer" />
</InputAdornment>
)
}}
/>
<TextField disabled size="small" fullWidth required label="우편번호" value={rowData.zipcode1} />
</Grid>
<Grid item sm={7}>
<TextField disabled size="small" required label="주소" fullWidth value={rowData.scJuso} />

@ -8,12 +8,14 @@ import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornm
import Button from '@mui/material/Button';
import { IconSearch } from '@tabler/icons';
import FileInputForms from 'views/cmm/FileInputForms';
import FileInputForms from 'views/cmm/file-ctl/FileInputForms';
import DaumPost from '../../cmm/DaumPost';
// const toDate = new Date();
const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave }) => {
const alert = useAlert();
const [isPostOpen, setIsPostOpen] = useState(false);
const [scCarnum, setScCarnum] = useState(rowData.scCarnum);
const [scName, setScName] = useState(rowData.scName);
@ -59,8 +61,8 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
Object.values(contads).forEach((v) => {
formData.append('contadFiles', v);
});
handleModalSave(formData);
console.log(picads, frecads, contads);
// handleModalSave(formData);
};
const handleChangeFile = (e) => {
@ -88,10 +90,37 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
}
};
const onCancel = () => {
setOpen(false);
};
const openPostCode = (e) => {
e.preventDefault();
setIsPostOpen(true);
};
const handlePostAddr = (data) => {
if (data) {
setZipcode1(data.zipCode);
setScJuso(data.addr);
setScBunji(data.dtlAddr);
}
setIsPostOpen(false);
};
return (
<>
<Grid mt={2}>
<Grid container spacing={0.5} item xs={12} mb={1.5}>
<Grid item sm={3}>
<TextField disabled size="small" required label="접수번호" fullWidth value={rowData.scSeq} />
</Grid>
<Grid item sm={3}>
<TextField disabled size="small" required label="전송상태" fullWidth value={rowData.scTransferNm} />
</Grid>
<Grid item sm={3}>
<TextField disabled size="small" required label="자료상태" fullWidth value={rowData.scStateNm} />
</Grid>
<Grid item sm={3}>
<TextField
required
@ -103,6 +132,8 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
autoFocus
/>
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={1.5}>
<Grid item sm={3}>
<TextField required label="성명" size="small" fullWidth value={scName} onChange={(e) => setScName(e?.target?.value)} />
</Grid>
@ -127,20 +158,6 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
</Select>
</FormControl>
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={1.5}>
<Grid item sm={3}>
<NumberFormat
size="small"
customInput={TextField}
required
label="접수일자"
format="####-##-##"
fullWidth
value={scCdate}
onChange={(e) => setScCdate(e?.target?.value)}
/>
</Grid>
<Grid item sm={3}>
<FormControl fullWidth>
<InputLabel required>접수방법</InputLabel>
@ -154,7 +171,21 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
</Select>
</FormControl>
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={2}>
<Grid item sm={3}>
<NumberFormat
size="small"
customInput={TextField}
required
label="접수일자"
format="####-##-##"
fullWidth
value={scCdate}
onChange={(e) => setScCdate(e?.target?.value)}
/>
</Grid>
<Grid item sm={2}>
<NumberFormat
size="small"
customInput={TextField}
@ -166,7 +197,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
onChange={(e) => setScWdate(e?.target?.value)}
/>
</Grid>
<Grid item sm={3}>
<Grid item sm={1}>
<NumberFormat
size="small"
customInput={TextField}
@ -178,8 +209,6 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
onChange={(e) => setScJbtime(e?.target?.value)}
/>
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={2}>
<Grid item sm={6}>
<TextField
size="small"
@ -190,12 +219,6 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
onChange={(e) => setScPos(e?.target?.value)}
/>
</Grid>
<Grid item sm={3}>
<TextField disabled size="small" required label="전송상태" fullWidth value={rowData.scTransferNm} />
</Grid>
<Grid item sm={3}>
<TextField disabled size="small" required label="자료상태" fullWidth value={rowData.scStateNm} />
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={2}>
<Grid item sm={1.7}>
@ -206,6 +229,7 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
label="우편번호"
value={zipcode1 ?? ''}
onChange={(e) => setZipcode1(e?.target?.value)}
onClick={openPostCode}
InputProps={{
display: 'none',
readOnly: true,
@ -438,13 +462,18 @@ const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSav
</Grid>
</Grid>
<Grid item container spacing={0.5} xs={12} mt={1}>
<Grid item>
<Button variant="contained" color="error" size="small" onClick={onCancel}>
취소
</Button>
</Grid>
<Grid item style={{ marginLeft: 'auto' }}>
{/* <Button variant="contained" color="primary" size="small" startIcon={<IconFileExport />} onClick={onSave}> */}
<Button disabled variant="contained" color="primary" size="small" onClick={onSave}>
<Button variant="contained" color="primary" size="small" onClick={onSave}>
저장
</Button>
</Grid>
</Grid>
<DaumPost isOpen={isPostOpen} handlePostAddress={handlePostAddr} />
</>
);
};

@ -9,7 +9,8 @@ import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornm
import Button from '@mui/material/Button';
import { IconSearch } from '@tabler/icons';
import FileInputForms from 'views/cmm/FileInputForms';
import FileInputForms from 'views/cmm/file-ctl/FileInputForms';
import DaumPost from '../../cmm/DaumPost';
const toDate = new Date();
@ -33,6 +34,8 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
const [frecads, setFrecads] = useState({});
const [contads, setContads] = useState({});
const [isPostOpen, setIsPostOpen] = useState(false);
const onSave = () => {
// TODO : validation check
const formData = new FormData();
@ -61,7 +64,7 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
Object.values(contads).forEach((v) => {
formData.append('contadFiles', v);
});
console.log(picads, frecads, contads);
handleModalSave('SAVE', formData);
};
@ -90,6 +93,20 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
}
};
const openPostCode = (e) => {
e.preventDefault();
setIsPostOpen(true);
};
const handlePostAddr = (data) => {
if (data) {
setZipcode1(data.zipCode);
setScJuso(data.addr);
setScBunji(data.dtlAddr);
}
setIsPostOpen(false);
};
return (
<>
<Grid mt={2}>
@ -111,6 +128,20 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
<Grid item sm={3}>
<TextField required label="동명" size="small" fullWidth value={scDong} onChange={(e) => setScDong(e?.target?.value)} />
</Grid>
<Grid item sm={3}>
<NumberFormat
size="small"
customInput={TextField}
required
label="접수일자"
format="####-##-##"
fullWidth
value={scCdate}
onChange={(e) => setScCdate(e?.target?.value)}
/>
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={1.5}>
<Grid item sm={3}>
<FormControl fullWidth>
<InputLabel required>진술유형</InputLabel>
@ -129,20 +160,6 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
</Select>
</FormControl>
</Grid>
</Grid>
<Grid container spacing={0.5} item xs={12} mb={1.5}>
<Grid item sm={3}>
<NumberFormat
size="small"
customInput={TextField}
required
label="접수일자"
format="####-##-##"
fullWidth
value={scCdate}
onChange={(e) => setScCdate(e?.target?.value)}
/>
</Grid>
<Grid item sm={3}>
<FormControl fullWidth>
<InputLabel required>접수방법</InputLabel>
@ -195,6 +212,7 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
label="우편번호"
value={zipcode1}
onChange={(e) => setZipcode1(e?.target?.value)}
onClick={openPostCode}
InputProps={{
display: 'none',
readOnly: true,
@ -206,18 +224,10 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
}}
/>
</Grid>
<Grid item sm={7}>
<TextField
size="small"
required
label="주소"
fullWidth
value={scJuso}
onChange={(e) => setScJuso(e?.target?.value)}
InputProps={{ readOnly: true }}
/>
<Grid item sm={5}>
<TextField size="small" required disabled label="주소" fullWidth value={scJuso} onChange={(e) => setScJuso(e?.target?.value)} />
</Grid>
<Grid item sm={3.3}>
<Grid item sm={5.3}>
<TextField size="small" required label="번지" fullWidth value={scBunji} onChange={(e) => setScBunji(e?.target?.value)} />
</Grid>
</Grid>
@ -426,6 +436,8 @@ const JudgeDataNewForm = ({ scDatagb, contDocs, ingbs, handleModalSave }) => {
</Button>
</Grid>
</Grid>
<DaumPost isOpen={isPostOpen} handlePostAddress={handlePostAddr} />
</>
);
};

@ -7,7 +7,7 @@ import { Button, Divider, Grid, Link } from '@mui/material';
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/MuiDataGrid';
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import CmmModal from 'views/cmm/CmmModal';
import { findJudge, findJudgeDatas, removeJudgeData, saveJudgeData } from 'apis/judge';
import JudgeDataNewForm from 'views/biz/judge/JudgeDataNewForm';
@ -103,6 +103,8 @@ const JudgeDataReview = ({ scDatagb, menuName }) => {
}, []);
const handleCreate = () => {
// setIsPostOpen(true);
setModify(false);
setDetail(false);
setCreate(true);

@ -11,13 +11,13 @@ import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone';
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/MuiDataGrid';
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import xitCmm from 'commons/XitCmm';
import CmmModal from 'views/cmm/CmmModal';
import JudgeTargetSaveForm from 'views/biz/judge/JudgeTargetSaveForm';
import NumberFormat from 'react-number-format';
import ExcelDownload from 'views/cmm/ExcelDownload';
import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload';
import { findJudgeTargets, saveJudgeTargets } from 'apis/judge';
import PropTypes from 'prop-types';

@ -14,7 +14,7 @@ import { IconSearch } from '@tabler/icons';
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/MuiDataGrid';
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import InputLabel from 'ui-component/extended/Form/InputLabel';
import { findJudgeResults, findJudges, removeJudge } from 'apis/judge';
import CmmModal from 'views/cmm/CmmModal';

@ -11,13 +11,13 @@ import PersonAddTwoToneIcon from '@mui/icons-material/PersonAddTwoTone';
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/MuiDataGrid';
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import xitCmm from 'commons/XitCmm';
import CmmModal from 'views/cmm/CmmModal';
import SaveParkingTargetForm from './SaveParkingTargetForm';
import NumberFormat from 'react-number-format';
import ExcelDownload from 'views/cmm/ExcelDownload';
import ExcelDownload from 'views/cmm/file-ctl/ExcelDownload';
import { findParkingJudgeTargets, saveParkingJudgeTargets } from 'apis/parking';
const ParkingRegister = () => {

@ -15,7 +15,7 @@ import { IconSearch } from '@tabler/icons';
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/MuiDataGrid';
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import { findParkings, removeParkingJudge } from 'apis/parking';
import { findJudgeResults } from 'apis/judge';
import InputLabel from '../../../ui-component/extended/Form/InputLabel';

@ -10,7 +10,7 @@ import { IconSearch } from '@tabler/icons';
import MainCard from 'ui-component/cards/MainCard';
// project imports
import MuiDataGrid from 'views/cmm/MuiDataGrid';
import MuiDataGrid from 'views/cmm/mui-grid/MuiDataGrid';
import CmmModal from '../../cmm/CmmModal';
import UserManagerForm from './UserManagerForm';
import { findUsers, removeUser, saveUser } from 'apis/user';

@ -0,0 +1,62 @@
import DaumPostcode from 'react-daum-postcode';
import PropTypes from 'prop-types';
/*
호출하는 곳에서 사용
const [isPostOpen, setIsPostOpen] = useState(false);
const openPostCode = () => {
setIsPostOpen(true);
};
const handlePostAddr = (data) => {
console.log(data);
};
*/
const DaumPost = ({ isOpen, handlePostAddress }) => {
const onCompletePost = (data) => {
let fullAddr = data.address;
let extraAddr = '';
if (data.addressType === 'R') {
if (data.bname !== '') {
extraAddr += data.bname;
}
if (data.buildingName !== '') {
extraAddr += extraAddr !== '' ? `, ${data.buildingName}` : data.buildingName;
}
fullAddr += extraAddr !== '' ? ` (${extraAddr})` : '';
}
handlePostAddress({
zipCode: data.zonecode,
addr: data.address,
dtlAddr: extraAddr,
fullAddr
});
};
const postCodeStyle = {
display: 'block',
position: 'absolute',
top: '10%',
left: '15%',
zIndex: '999999999',
border: '1px solid #000000',
width: '600px',
height: '500px',
// padding: '7px'
overflow: 'hidden'
};
// autoClose={false} -> default : true dom ->
return <>{isOpen ? <DaumPostcode style={postCodeStyle} autoClose={false} onComplete={onCompletePost} /> : null}</>;
};
DaumPost.propTypes = {
isOpen: PropTypes.bool.isRequired,
handlePostAddress: PropTypes.func.isRequired
};
export default DaumPost;

@ -14,7 +14,14 @@ const FileInputForms = ({ fieldName, index, labelName, selectedFile, fileName, h
return (
<Grid container item spacing={0.5}>
<Grid item xs={12} sm={7.5}>
<TextField placeholder={labelName} value={fileName ?? selectedFile} size="small" startIcon={<FileUpload />} onClick={() => {}} />
<TextField
placeholder={labelName}
// label={labelName}
value={fileName ?? selectedFile}
size="small"
startIcon={<FileUpload />}
onClick={() => {}}
/>
</Grid>
<Grid item xs={12} sm={4.5}>
<Button disabled={isDisabled} variant="contained" component="label" color="primary" size="small" startIcon={<FileUpload />}>

@ -4,7 +4,7 @@ import MainCard from 'ui-component/cards/MainCard';
import SecondaryAction from 'ui-component/cards/CardSecondaryAction';
import NestedModal from './NestedModal';
import BasicModal from './BasicModal';
import UseGridSelector from '../../cmm/DataGridPaging';
import UseGridSelector from '../../cmm/mui-grid/DataGridPaging';
// ==============================|| MODAL PAGE ||============================== //

Loading…
Cancel
Save