add form create inquiryPrivacyFencing

This commit is contained in:
Amirhossein Mahmoodi
2024-07-13 07:20:02 +03:30
parent cdff6458aa
commit 56fbe67483
2 changed files with 44 additions and 43 deletions

View File

@@ -1,13 +1,13 @@
import LtrTextField from "@/core/components/LtrTextField";
import { Autocomplete, Button, Chip, DialogActions, DialogContent, Grid, InputAdornment, Stack, TextField, Typography } from "@mui/material";
import StyledForm from "@/core/components/StyledForm";
import { SET_INQUIRE_PRIVACY_FENCING } from "@/core/utils/routes";
import useRequest from "@/lib/hooks/useRequest";
import { Autocomplete, Button, Chip, DialogActions, DialogContent, Fade, Grid, InputAdornment, Stack, TextField, Typography } from "@mui/material";
import { DatePicker, LocalizationProvider, faIR } from "@mui/x-date-pickers";
import { AdapterDateFnsJalali } from "@mui/x-date-pickers/AdapterDateFnsJalali";
import LocationOnMap from "./LocationOnMap";
import { Formik } from "formik";
import StyledForm from "@/core/components/StyledForm";
import moment from "jalali-moment";
import useRequest from "@/lib/hooks/useRequest";
import { SET_INQUIRE_PRIVACY_FENCING } from "@/core/utils/routes";
import LocationOnMap from "./LocationOnMap";
const CreateForm = ({ handleClose }) => {
const request = useRequest()
@@ -118,23 +118,27 @@ const CreateForm = ({ handleClose }) => {
/>
</Grid>
<Grid item xs={1}>
<Autocomplete
size="small"
disablePortal
value={formik.values.motaghazi_type_id}
onChange={(event, newValue) => {
formik.setFieldValue('motaghazi_type_id', newValue)
}}
options={["دولتی", "خصوصی"]}
renderInput={(params) => <TextField fullWidth {...params} label="نوع متقاضی" required />}
/>
<Fade in={formik.values.motaghazi_is_legal_id === 'حقوقی'} mountOnEnter={true} unmountOnExit={true}>
<Autocomplete
size="small"
disablePortal
value={formik.values.motaghazi_type_id}
onChange={(event, newValue) => {
formik.setFieldValue('motaghazi_type_id', newValue)
}}
options={["دولتی", "خصوصی"]}
renderInput={(params) => <TextField fullWidth {...params} label="نوع متقاضی" required />}
/>
</Fade>
</Grid>
<Grid item xs={1}></Grid>
<Grid item xs={1}>
<TextField name="motaghazi_firstname" value={formik.values.motaghazi_firstname} onChange={formik.handleChange} label="نام متقاضی" size="small" fullWidth required />
</Grid>
<Grid item xs={1}>
<TextField name="motaghazi_lastname" value={formik.values.motaghazi_lastname} onChange={formik.handleChange} label="نام خانوادگی متقاضی" size="small" fullWidth required />
<Fade in={formik.values.motaghazi_is_legal_id === 'حقیقی'} mountOnEnter={true} unmountOnExit={true}>
<TextField name="motaghazi_lastname" value={formik.values.motaghazi_lastname} onChange={formik.handleChange} label="نام خانوادگی متقاضی" size="small" fullWidth required />
</Fade>
</Grid>
<Grid item xs={1}>
<LtrTextField name="national_id" value={formik.values.national_id} onChange={formik.handleChange} required label="کد ملی/شناسه ملی" size="small" fullWidth type="tel" />
@@ -143,7 +147,9 @@ const CreateForm = ({ handleClose }) => {
<LtrTextField name="tel_number" value={formik.values.tel_number} onChange={formik.handleChange} label="تلفن" size="small" fullWidth type="tel" />
</Grid>
<Grid item xs={1}>
<LtrTextField name="mobile_number" value={formik.values.mobile_number} onChange={formik.handleChange} label="تلفن همراه" size="small" fullWidth type="tel" />
<Fade in={formik.values.motaghazi_type_id !== 'دولتی'} mountOnEnter={true} unmountOnExit={true}>
<LtrTextField name="mobile_number" value={formik.values.mobile_number} onChange={formik.handleChange} label="تلفن همراه" size="small" fullWidth type="tel" />
</Fade>
</Grid>
<Grid item xs={1}>
<TextField name="address" value={formik.values.address} onChange={formik.handleChange} label="آدرس" size="small" fullWidth required />
@@ -187,7 +193,7 @@ const CreateForm = ({ handleClose }) => {
onChange={(event, newValue) => {
formik.setFieldValue('rah_type_id', newValue)
}}
options={["آزاد راه", "بزرگراه"]}
options={["آزاد راه", "بزرگراه", 'راه فرعی درجه 3']}
renderInput={(params) => <TextField fullWidth {...params} label="نوع راه" required />}
/>
</Grid>
@@ -199,12 +205,14 @@ const CreateForm = ({ handleClose }) => {
onChange={(event, newValue) => {
formik.setFieldValue('name_mehvar_id', newValue)
}}
options={["تست"]}
options={["سایر"]}
renderInput={(params) => <TextField fullWidth {...params} label="نام محور" required />}
/>
</Grid>
<Grid item xs={1}>
{/* <TextField label="سایر محورها" size="small" fullWidth /> */}
<Fade in={formik.values.name_mehvar_id === "سایر"} mountOnEnter={true} unmountOnExit={true}>
<TextField label="سایر محورها" size="small" fullWidth />
</Fade>
</Grid>
<Grid item xs={1}>
<Autocomplete
@@ -231,16 +239,18 @@ const CreateForm = ({ handleClose }) => {
/>
</Grid>
<Grid item xs={1}>
<Autocomplete
size="small"
disablePortal
value={formik.values.arze_navar}
onChange={(event, newValue) => {
formik.setFieldValue('arze_navar', newValue)
}}
options={["15", "30"]}
renderInput={(params) => <TextField fullWidth {...params} label="عرض نوار تاسیساتی زیربنایی" required />}
/>
<Fade in={formik.values.rah_type_id !== 'راه فرعی درجه 3'} mountOnEnter={true} unmountOnExit={true}>
<Autocomplete
size="small"
disablePortal
value={formik.values.arze_navar}
onChange={(event, newValue) => {
formik.setFieldValue('arze_navar', newValue)
}}
options={["15", "30"]}
renderInput={(params) => <TextField fullWidth {...params} label="عرض نوار تاسیساتی زیربنایی" required />}
/>
</Fade>
</Grid>
<Grid item xs={1}>
<LtrTextField name="kilometr" value={formik.values.kilometr} onChange={formik.handleChange} label="كيلومتر" size="small" fullWidth type="tel" />

View File

@@ -1,20 +1,11 @@
"use client";
import { Close } from "@mui/icons-material";
import { Dialog, DialogTitle, IconButton, Slide } from "@mui/material";
import { useState } from "react";
import CreateForm from "./Form";
import DialogTransition from "@/core/components/DialogTransition";
import { Close } from "@mui/icons-material";
import { Dialog, DialogTitle, IconButton } from "@mui/material";
import CreateForm from "./Form";
const InquiryPrivacyFencingCreate = () => {
const [open, setOpen] = useState(true);
const InquiryPrivacyFencingCreate = ({ open, handleClose }) => {
const handleClickOpen = () => {
setOpen(true);
};
const handleClose = (value) => {
setOpen(false);
};
return (
<>
<Dialog open={open} fullScreen TransitionComponent={DialogTransition}>