|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
import { useState } from 'react';
|
|
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
import NumberFormat from 'react-number-format';
|
|
|
|
@ -9,22 +9,19 @@ import { Grid, TextField, MenuItem, Select, FormControl, InputLabel, InputAdornm
|
|
|
|
|
import Button from '@mui/material/Button';
|
|
|
|
|
import { IconSearch } from '@tabler/icons';
|
|
|
|
|
|
|
|
|
|
import { getComboCodeList } from 'apis/common';
|
|
|
|
|
import FileInputForms from 'views/cmm/FileInputForms';
|
|
|
|
|
|
|
|
|
|
// const toDate = new Date();
|
|
|
|
|
|
|
|
|
|
const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
const JudgeDataModifyForm = ({ rowData, contDocs, ingbs, setOpen, handleModalSave }) => {
|
|
|
|
|
const alert = useAlert();
|
|
|
|
|
|
|
|
|
|
const [scCarnum, setScCarnum] = useState(rowData.scCarnum);
|
|
|
|
|
const [scName, setScName] = useState(rowData.scName);
|
|
|
|
|
const [scDong, setScDong] = useState(rowData.scDong);
|
|
|
|
|
const [scContDoc, setScContDoc] = useState();
|
|
|
|
|
const [selectedContDoc, setSelectedContDoc] = useState(rowData.scContDoc);
|
|
|
|
|
const [scIngb, setScIngb] = useState();
|
|
|
|
|
const [selectedIngb, setSelectedIngb] = useState(rowData.scIngb);
|
|
|
|
|
const [zippost1, setZippost1] = useState(`${rowData.zippost1}${rowData.zippost2}`);
|
|
|
|
|
const [zipcode1, setZipcode1] = useState((rowData.zipcode1 ?? '') + (rowData.zipcode2 ?? ''));
|
|
|
|
|
const [scJuso, setScJuso] = useState(rowData.scJuso);
|
|
|
|
|
const [scBunji, setScBunji] = useState(rowData.scBunji);
|
|
|
|
|
const [scWdate, setScWdate] = useState(rowData.scWdate);
|
|
|
|
@ -48,7 +45,7 @@ const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
formData.append('scWdate', scWdate);
|
|
|
|
|
formData.append('scJbtime', scJbtime);
|
|
|
|
|
formData.append('scPos', scPos);
|
|
|
|
|
formData.append('zippost1', zippost1);
|
|
|
|
|
formData.append('zipcode1', zipcode1);
|
|
|
|
|
formData.append('scJuso', scJuso);
|
|
|
|
|
formData.append('scBunji', scBunji);
|
|
|
|
|
|
|
|
|
@ -67,19 +64,6 @@ const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
handleModalSave(formData);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// setSelectedContDoc('11');
|
|
|
|
|
setScContDoc([]);
|
|
|
|
|
getComboCodeList({ codeMcd: 'SC_CONT_DOC' }).then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
setScContDoc(res.data);
|
|
|
|
|
});
|
|
|
|
|
getComboCodeList({ codeMcd: 'RC_INGB' }).then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
setScIngb(res.data);
|
|
|
|
|
});
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const handleChangeFile = (e) => {
|
|
|
|
|
const fileKey = e.target.name;
|
|
|
|
|
const fileArrKey = fileKey + e.target.dataset.index;
|
|
|
|
@ -129,9 +113,14 @@ const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
<Grid item sm={3}>
|
|
|
|
|
<FormControl fullWidth>
|
|
|
|
|
<InputLabel required>진술유형</InputLabel>
|
|
|
|
|
<Select size="small" defaultValue="11" onChange={(e) => setSelectedContDoc(e?.target?.value)}>
|
|
|
|
|
{scContDoc &&
|
|
|
|
|
scContDoc.map((contDoc) => (
|
|
|
|
|
<Select
|
|
|
|
|
size="small"
|
|
|
|
|
defaultValue={selectedContDoc}
|
|
|
|
|
value={selectedContDoc}
|
|
|
|
|
onChange={(e) => setSelectedContDoc(e?.target?.value)}
|
|
|
|
|
>
|
|
|
|
|
{contDocs &&
|
|
|
|
|
contDocs.map((contDoc) => (
|
|
|
|
|
<MenuItem key={contDoc.code} value={contDoc.code}>
|
|
|
|
|
{contDoc.value}
|
|
|
|
|
</MenuItem>
|
|
|
|
@ -156,9 +145,9 @@ const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
<Grid item sm={3}>
|
|
|
|
|
<FormControl fullWidth>
|
|
|
|
|
<InputLabel required>접수방법</InputLabel>
|
|
|
|
|
<Select size="small" defaultValue="1" onChange={(e) => setSelectedIngb(e?.target?.value)}>
|
|
|
|
|
{scIngb &&
|
|
|
|
|
scIngb.map((ingb) => (
|
|
|
|
|
<Select size="small" defaultValue={selectedIngb} value={selectedIngb} onChange={(e) => setSelectedIngb(e?.target?.value)}>
|
|
|
|
|
{ingbs &&
|
|
|
|
|
ingbs.map((ingb) => (
|
|
|
|
|
<MenuItem key={ingb.code} value={ingb.code}>
|
|
|
|
|
{ingb.value}
|
|
|
|
|
</MenuItem>
|
|
|
|
@ -192,7 +181,7 @@ const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
<Grid container spacing={0.5} item xs={12} mb={2}>
|
|
|
|
|
<Grid item sm={12}>
|
|
|
|
|
<Grid item sm={6}>
|
|
|
|
|
<TextField
|
|
|
|
|
size="small"
|
|
|
|
|
required
|
|
|
|
@ -202,6 +191,12 @@ const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
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}>
|
|
|
|
@ -210,8 +205,8 @@ const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
fullWidth
|
|
|
|
|
required
|
|
|
|
|
label="우편번호"
|
|
|
|
|
value={zippost1}
|
|
|
|
|
onChange={(e) => setZippost1(e?.target?.value)}
|
|
|
|
|
value={zipcode1 ?? ''}
|
|
|
|
|
onChange={(e) => setZipcode1(e?.target?.value)}
|
|
|
|
|
InputProps={{
|
|
|
|
|
display: 'none',
|
|
|
|
|
readOnly: true,
|
|
|
|
@ -456,6 +451,9 @@ const JudgeDataModifyForm = ({ rowData, handleModalSave }) => {
|
|
|
|
|
};
|
|
|
|
|
JudgeDataModifyForm.propTypes = {
|
|
|
|
|
rowData: PropTypes.object.isRequired,
|
|
|
|
|
handleModalSave: PropTypes.func.isRequired
|
|
|
|
|
contDocs: PropTypes.array.isRequired,
|
|
|
|
|
ingbs: PropTypes.array.isRequired,
|
|
|
|
|
handleModalSave: PropTypes.func.isRequired,
|
|
|
|
|
setOpen: PropTypes.func.isRequired
|
|
|
|
|
};
|
|
|
|
|
export default JudgeDataModifyForm;
|
|
|
|
|