Merge branch 'feature/amin_sakht_tanafos_select' into 'develop'

replace select box instead of text field sakht and tanafos periode"

See merge request witel-front-end/loan-facilities/expert!144
This commit is contained in:
AmirHossein Mahmoodi
2024-01-20 11:55:51 +00:00
2 changed files with 135 additions and 35 deletions

View File

@@ -7,7 +7,6 @@ import {
DialogContent,
FormHelperText,
Grid,
InputAdornment,
LinearProgress,
Stack,
TextField,
@@ -21,6 +20,7 @@ import PriceField from "@/core/components/PriceField";
import * as Yup from "yup";
import CustomAccordion from "@/core/components/CustomAccordion";
import ImageContent from "@/core/components/ImageContent";
import SelectBox from "@/core/components/SelectBox";
const vehicle_amount = {
"اتوبوس": 7000,
@@ -232,51 +232,93 @@ const ConfirmContent = ({mutate, setOpenConfirmDialog, rowId, vehicle_type, hand
/>
</Stack>
<Stack>
<TextField
<SelectBox
name="sakht_period"
label={t("ConfirmDialog.sakht_period")}
type={'number'}
size="small"
value={formik.values.sakht_period}
onChange={formik.handleChange}
fullWidth
variant="outlined"
sx={{mt: 1}}
onBlur={formik.handleBlur("sakht_period")}
error={
formik.touched.sakht_period &&
Boolean(formik.errors.sakht_period)
}
helperText={
formik.touched.sakht_period && formik.errors.sakht_period
}
InputProps={{
endAdornment: <InputAdornment
position="end">{t("ConfirmDialog.sakht_period_day")}</InputAdornment>,
selectType="sakht_period"
selectors={[
{
id: 1,
value: "30",
name: "1 ماه - 30 روز"
},
{
id: 2,
value: "60",
name: "2 ماه - 60 روز"
},
{
id: 3,
value: "90",
name: "3 ماه - 90 روز"
},
{
id: 4,
value: "120",
name: "4 ماه - 120 روز"
},
{
id: 5,
value: "150",
name: "5 ماه - 150 روز"
},
{
id: 6,
value: "180",
name: "6 ماه - 180 روز"
}
]}
schema={{value: 'value', name: 'name'}}
select={formik.values.sakht_period}
handleChange={(event) => {
formik.setFieldValue('sakht_period', event.target.value)
}}
setFieldTouched={formik.setFieldTouched}
error={formik.touched.sakht_period && Boolean(formik.errors.sakht_period)}
helperText={formik.touched.sakht_period && formik.errors.sakht_period}
onBlur={formik.handleBlur("sakht_period")}
/>
</Stack>
<Stack>
<TextField
<SelectBox
name="tanafos_period"
label={t("ConfirmDialog.tanafos_period")}
type={'number'}
size="small"
value={formik.values.tanafos_period}
onChange={formik.handleChange}
fullWidth
variant="outlined"
sx={{mt: 1}}
onBlur={formik.handleBlur("tanafos_period")}
error={
formik.touched.tanafos_period &&
Boolean(formik.errors.tanafos_period)
}
helperText={
formik.touched.tanafos_period && formik.errors.tanafos_period
}
InputProps={{
endAdornment: <InputAdornment
position="end">{t("ConfirmDialog.tanafos_period_month")}</InputAdornment>,
selectType="tanafos_period"
selectors={[
{
id: 1,
value: "1",
name: "1 ماه"
},
{
id: 2,
value: "2",
name: "2 ماه"
},
{
id: 3,
value: "3",
name: "3 ماه"
},
{
id: 4,
value: "4",
name: "4 ماه"
}
]}
schema={{value: 'value', name: 'name'}}
select={formik.values.tanafos_period}
handleChange={(event) => {
formik.setFieldValue('tanafos_period', event.target.value)
}}
setFieldTouched={formik.setFieldTouched}
error={formik.touched.tanafos_period && Boolean(formik.errors.tanafos_period)}
helperText={formik.touched.tanafos_period && formik.errors.tanafos_period}
onBlur={formik.handleBlur("tanafos_period")}
/>
</Stack>
<Stack>