fix: 주정차 심의대상 저장

main
Lim Jonguk 3 years ago
parent 7e334e54a3
commit 8ccd9eb0a5

@ -97,6 +97,7 @@ const ParkingRegister = () => {
};
alert(JSON.stringify(param));
setOpen(false);
// return false;
opstBizService.saveSimsaTargetList(param).then((response) => {
console.log(response);

@ -2,6 +2,7 @@ import { useState } from 'react';
import NumberFormat from 'react-number-format';
import format from 'date-fns/format';
import getHours from 'date-fns/getHours';
import koLocale from 'date-fns/locale/ko';
import { Checkbox, FormControlLabel, Grid, Typography, TextField, MenuItem, Select, FormControl, InputLabel } from '@mui/material';
@ -20,15 +21,16 @@ const teams = [
{ code: '003', value: '3팀' },
{ code: '004', value: '4팀' }
];
const toDate = new Date();
const SaveParkingSimsaForm = ({ handleModalSave }) => {
const [msuTeam, setMsuTeam] = useState(teams[0].code);
const [msSdate, setMsSdate] = useState(new Date());
const [msStartsi, setMsStartsi] = useState('09');
const [msEdate, setMsEdate] = useState(new Date());
const [msSdate, setMsSdate] = useState(format(toDate, 'yyyy-MM-dd'));
const [msStartsi, setMsStartsi] = useState(getHours(toDate));
const [msEdate, setMsEdate] = useState(format(toDate, 'yyyy-MM-dd'));
const [msChasu, setMsChasu] = useState();
const [msCdate, setMsCdate] = useState(new Date());
const [msClosesi, setMsClosesi] = useState('09');
const [msCdate, setMsCdate] = useState(format(toDate, 'yyyy-MM-dd'));
const [msClosesi, setMsClosesi] = useState(getHours(toDate));
const onSave = () => {
handleModalSave({
@ -36,7 +38,7 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => {
msSdate,
msStartsi,
msEdate,
msChasu: 99,
msChasu,
msCdate,
msClosesi
});
@ -72,7 +74,8 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => {
inputFormat="HH"
mask="__"
onChange={(newValue) => {
setMsStartsi(format(newValue, 'HH'));
// setMsStartsi(format(newValue, 'HH'));
setMsStartsi(getHours(newValue));
}}
/>
</LocalizationProvider>
@ -96,7 +99,7 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => {
<Grid item xs={12} sm={2}>
<FormControl fullWidth>
<InputLabel required></InputLabel>
<Select size="small" name="reviewYear" defaultValue={msuTeam} onChange={(e) => setMsuTeam(e.target.value)}>
<Select name="reviewYear" defaultValue={msuTeam} onChange={(e) => setMsuTeam(e.target.value)}>
{teams.map((team, idx) => (
<MenuItem key={team.code} value={team.code}>
{team.value}
@ -108,7 +111,6 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => {
<Grid item xs={12} sm={2}>
<NumberFormat
customInput={TextField}
size="small"
required
id="msChasu"
name="msChasu"
@ -116,7 +118,7 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => {
format="######"
fullWidth
value={msChasu}
// onChange={setMsChasu}
onValueChange={(values) => setMsChasu(values.value)}
/>
</Grid>
<Grid item xs={12} sm={4}>
@ -146,7 +148,7 @@ const SaveParkingSimsaForm = ({ handleModalSave }) => {
inputFormat="HH"
mask="__"
onChange={(newValue) => {
setMsClosesi(format(newValue, 'HH'));
setMsClosesi(getHours(newValue));
}}
/>
</LocalizationProvider>

Loading…
Cancel
Save