add form create inquiryPrivacyFencing

This commit is contained in:
Amirhossein Mahmoodi
2024-07-13 11:49:14 +03:30
parent 4efc228d31
commit 5183fddcdf
2 changed files with 44 additions and 45 deletions

View File

@@ -12,7 +12,7 @@ const MapLayer = dynamic(() => import("@/core/components/MapLayer"), {
const LocationOnMap = ({ setValue }) => {
return (
<Stack sx={{ height: "100%", position: "relative" }}>
<Paper sx={{ flexGrow: 1 }} elevation={0}>
<Paper sx={{ flexGrow: 1, border: 1, borderRadius: 1, borderColor: 'divider' }} elevation={0}>
<MapLayer style={{ borderRadius: '4px' }}>
<MarkerLocation setValue={setValue} />
</MapLayer>

View File

@@ -144,7 +144,7 @@ const CreateForm = ({ handleClose }) => {
<StyledForm onSubmit={handleSubmit(onSubmit)} id={'InquiryPrivacyFencingCreateForm'}>
<Grid container columns={{ xs: 1, sm: 2, md: 3 }} spacing={4}>
<Grid item xs={1}>
<LtrTextField {...register('dabirkhaneh_number')} required label="شماره دبیرخانه درخواست" size="small" fullWidth type="tel" />
<LtrTextField autoComplete="off" {...register('dabirkhaneh_number')} label="شماره دبیرخانه درخواست *" size="small" fullWidth type="tel" />
</Grid>
<Grid item xs={1}>
<Controller
@@ -154,16 +154,16 @@ const CreateForm = ({ handleClose }) => {
<DatePicker
value={value.toDate()}
onChange={(newValue) => onChange(moment(newValue))}
label="تاریخ نامه درخواست"
label="تاریخ نامه درخواست *"
slotProps={{
textField: { fullWidth: true, size: "small" },
textField: { fullWidth: true, size: "small", autoComplete: 'off' },
}}
/>
)}
/>
</Grid>
<Grid item xs={1}>
<TextField {...register('marjae_pasokh')} label="مرجع درخواست کننده پاسخ به استعلام" size="small" fullWidth />
<TextField autoComplete="off" {...register('marjae_pasokh')} label="مرجع درخواست کننده پاسخ به استعلام" size="small" fullWidth />
</Grid>
<Grid item xs={1}>
<Controller
@@ -178,7 +178,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["حقوقی", "حقیقی"]}
renderInput={(params) => <TextField fullWidth {...params} label="متقاضی" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="متقاضی *" />}
/>
)}
/>
@@ -198,7 +198,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["دولتی", "خصوصی"]}
renderInput={(params) => <TextField fullWidth {...params} label="نوع متقاضی" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="نوع متقاضی *" />}
/>
)}
/>
@@ -207,26 +207,26 @@ const CreateForm = ({ handleClose }) => {
</Grid>
<Grid item xs={1}></Grid>
<Grid item xs={1}>
<TextField {...register('motaghazi_firstname')} label="نام متقاضی" size="small" fullWidth required />
<TextField autoComplete="off" {...register('motaghazi_firstname')} label="نام متقاضی *" size="small" fullWidth />
</Grid>
<Grid item xs={1}>
<Fade in={watch('motaghazi_is_legal_id') === 'حقیقی'} mountOnEnter={true} unmountOnExit={true}>
<TextField {...register('motaghazi_lastname')} label="نام خانوادگی متقاضی" size="small" fullWidth required />
<TextField autoComplete="off" {...register('motaghazi_lastname')} label="نام خانوادگی متقاضی *" size="small" fullWidth />
</Fade>
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('national_id')} required label="کد ملی/شناسه ملی" size="small" fullWidth type="tel" />
<LtrTextField autoComplete="off" {...register('national_id')} label="کد ملی/شناسه ملی *" size="small" fullWidth type="tel" />
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('tel_number')} label="تلفن" size="small" fullWidth type="tel" />
<LtrTextField autoComplete="off" {...register('tel_number')} label="تلفن" size="small" fullWidth type="tel" />
</Grid>
<Grid item xs={1}>
<Fade in={watch('motaghazi_type') !== 'دولتی' || watch('formik.values.motaghazi_is_legal_id') === 'حقیقی'} mountOnEnter={true} unmountOnExit={true}>
<LtrTextField {...register('mobile_number')} label="تلفن همراه" size="small" fullWidth type="tel" />
<LtrTextField autoComplete="off" {...register('mobile_number')} label="تلفن همراه *" size="small" fullWidth type="tel" />
</Fade>
</Grid>
<Grid item xs={1}>
<TextField {...register('address')} label="آدرس" size="small" fullWidth required />
<TextField autoComplete="off" {...register('address')} label="آدرس *" size="small" fullWidth />
</Grid>
<Grid item xs={1}>
<Controller
@@ -242,11 +242,10 @@ const CreateForm = ({ handleClose }) => {
}}
options={["تهران"]}
renderInput={(params) => (
<TextField
<TextField autoComplete="off"
fullWidth
{...params}
label="اداره كل راهداری و حمل و نقل جاده ای"
required
label="اداره كل راهداری و حمل و نقل جاده ای *"
/>
)}
/>
@@ -266,7 +265,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["تهران"]}
renderInput={(params) => <TextField fullWidth {...params} label="اداره شهرستان" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="اداره شهرستان *" />}
/>
)}
/>
@@ -284,7 +283,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["آزاد راه", "بزرگراه", 'راه فرعی درجه 3']}
renderInput={(params) => <TextField fullWidth {...params} label="نوع راه" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="نوع راه *" />}
/>
)}
/>
@@ -302,14 +301,14 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["سایر"]}
renderInput={(params) => <TextField fullWidth {...params} label="نام محور" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="نام محور *" />}
/>
)}
/>
</Grid>
<Grid item xs={1}>
<Fade in={watch('name_mehvar_fa') === "سایر"} mountOnEnter={true} unmountOnExit={true}>
<TextField label="سایر محورها" size="small" fullWidth />
<TextField autoComplete="off" label="سایر محورها" size="small" fullWidth />
</Fade>
</Grid>
<Grid item xs={1}>
@@ -325,7 +324,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["چپ", "راست"]}
renderInput={(params) => <TextField fullWidth {...params} label="سمت" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="سمت *" />}
/>
)}
/>
@@ -343,7 +342,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["12.5", "17.5"]}
renderInput={(params) => <TextField fullWidth {...params} label="میزان حریم" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="میزان حریم *" />}
/>
)}
/>
@@ -363,7 +362,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["15", "30"]}
renderInput={(params) => <TextField fullWidth {...params} label="عرض نوار تاسیساتی زیربنایی" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="عرض نوار تاسیساتی زیربنایی *" />}
/>
)}
/>
@@ -371,15 +370,15 @@ const CreateForm = ({ handleClose }) => {
</Fade>
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('kilometr')} label="كيلومتر" size="small" fullWidth type="tel" />
<LtrTextField autoComplete="off" {...register('kilometr')} label="كيلومتر *" size="small" fullWidth type="tel" />
</Grid>
<Grid item xs={1} sm={2} sx={{ height: 300 }}>
<LocationOnMap setValue={setValue} />
</Grid>
<Grid item xs={1}>
<Stack spacing={3}>
<LtrTextField {...register('lat')} label="عرض جغرافیایی" size="small" fullWidth disabled={true} />
<LtrTextField {...register('lon')} label="طول جغرافیایی" size="small" fullWidth disabled={true} />
<LtrTextField autoComplete="off" {...register('lat')} label="عرض جغرافیایی" size="small" fullWidth disabled={true} />
<LtrTextField autoComplete="off" {...register('lon')} label="طول جغرافیایی" size="small" fullWidth disabled={true} />
<Controller
name="zone"
control={control}
@@ -392,7 +391,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["38", "39"]}
renderInput={(params) => <TextField fullWidth {...params} label="Zone" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="Zone *" />}
/>
)}
/>
@@ -411,16 +410,16 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["اتاقک نگهبانی", "دولتی"]}
renderInput={(params) => <TextField fullWidth {...params} label="نوع کاربری" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="نوع کاربری *" />}
/>
)}
/>
</Grid>
<Grid item xs={1}>
<TextField {...register('tarh_title')} label="عنوان طرح" size="small" fullWidth />
<TextField autoComplete="off" {...register('tarh_title')} label="عنوان طرح *" size="small" fullWidth />
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('masahat_zirbana')} label="مساحت زیربنا" size="small" fullWidth type="tel" InputProps={{
<LtrTextField autoComplete="off" {...register('masahat_zirbana')} label="مساحت زیربنا" size="small" fullWidth type="tel" InputProps={{
endAdornment: <InputAdornment position="end">
مترمربع</InputAdornment>,
}} />
@@ -447,18 +446,18 @@ const CreateForm = ({ handleClose }) => {
})
}
options={["تعمیرات", "احداث بنا"]}
renderInput={(params) => <TextField fullWidth {...params} label="نوع احداثات" />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="نوع احداثات *" />}
/>
)}
/>
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('divarkeshi_distance')} label="فاصله دیوارکشی از آکس محور" size="small" fullWidth type="tel" InputProps={{
<LtrTextField autoComplete="off" {...register('divarkeshi_distance')} label="فاصله دیوارکشی از آکس محور" size="small" fullWidth type="tel" InputProps={{
endAdornment: <InputAdornment position="end">متر</InputAdornment>,
}} />
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('mostahadesat_distance')} label="فاصله مستحدثات از آکس محور" size="small" fullWidth type="tel" InputProps={{
<LtrTextField autoComplete="off" {...register('mostahadesat_distance')} label="فاصله مستحدثات از آکس محور" size="small" fullWidth type="tel" InputProps={{
endAdornment: <InputAdornment position="end">متر</InputAdornment>,
}} />
</Grid>
@@ -475,7 +474,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["داخل حریم"]}
renderInput={(params) => <TextField fullWidth {...params} label="محل اجرا" />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="محل اجرا" />}
/>
)}
/>
@@ -493,7 +492,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["سبک (ضریب ۱)"]}
renderInput={(params) => <TextField fullWidth {...params} label="میزان ترافیک" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="میزان ترافیک *" />}
/>
)}
/>
@@ -511,7 +510,7 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["تست"]}
renderInput={(params) => <TextField fullWidth {...params} label="وضعیت اقتصادی" />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="وضعیت اقتصادی" />}
/>
)}
/>
@@ -529,33 +528,33 @@ const CreateForm = ({ handleClose }) => {
onChange(newValue)
}}
options={["بله", "خیر"]}
renderInput={(params) => <TextField fullWidth {...params} label="آیا راه دسترسی از قبل وجود دارد؟" required />}
renderInput={(params) => <TextField autoComplete="off" fullWidth {...params} label="آیا راه دسترسی از قبل وجود دارد؟ *" />}
/>
)}
/>
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('shomare_estelam_harim')} label="شماره استعلام دفتر ایمنی و حریم" size="small" fullWidth type="tel" />
<LtrTextField autoComplete="off" {...register('shomare_estelam_harim')} label="شماره استعلام دفتر ایمنی و حریم" size="small" fullWidth type="tel" />
</Grid>
<Grid item xs={1}>
<Stack direction={'row'} spacing={1} alignItems={'center'}>
<Typography sx={{ flex: 2 }} variant="body2">حداکثر مدت زمان شروع عملیات:</Typography>
<LtrTextField {...register('max_month')} sx={{ width: 60 }} label="ماه" size="small" type="tel" />
<LtrTextField {...register('max_day')} sx={{ width: 60 }} label="روز" size="small" type="tel" />
<Typography sx={{ flex: 2 }} variant="body2">حداکثر مدت زمان شروع عملیات: *</Typography>
<LtrTextField autoComplete="off" {...register('max_month')} sx={{ width: 60 }} label="ماه" size="small" type="tel" />
<LtrTextField autoComplete="off" {...register('max_day')} sx={{ width: 60 }} label="روز" size="small" type="tel" />
</Stack>
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('shomare_tahaodname')} label="شماره تعهدنامه" size="small" fullWidth type="tel" />
<LtrTextField autoComplete="off" {...register('shomare_tahaodname')} label="شماره تعهدنامه" size="small" fullWidth type="tel" />
</Grid>
<Grid item xs={1}>
<LtrTextField {...register('shomare_daftarkhaneh')} label="شماره دفترخانه" size="small" fullWidth type="tel" />
<LtrTextField autoComplete="off" {...register('shomare_daftarkhaneh')} label="شماره دفترخانه" size="small" fullWidth type="tel" />
</Grid>
<Grid item xs={1}></Grid>
<Grid item xs={1}>
<TextField {...register('description')} multiline rows={2} label="توضیحات" size="small" fullWidth />
<TextField autoComplete="off" {...register('description')} multiline rows={2} label="توضیحات" size="small" fullWidth />
</Grid>
<Grid item xs={1}>
<TextField {...register('ronevesht')} multiline rows={2} label="رونوشت" size="small" fullWidth />
<TextField autoComplete="off" {...register('ronevesht')} multiline rows={2} label="رونوشت" size="small" fullWidth />
</Grid>
<Grid item xs={1}></Grid>
</Grid>