|
@@ -2,16 +2,14 @@ |
|
|
import { |
|
|
import { |
|
|
Grid, TextField, Typography, Button |
|
|
Grid, TextField, Typography, Button |
|
|
} from '@mui/material'; |
|
|
} from '@mui/material'; |
|
|
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; |
|
|
|
|
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; |
|
|
|
|
|
import MainCard from "../../components/MainCard"; |
|
|
import MainCard from "../../components/MainCard"; |
|
|
import * as React from "react"; |
|
|
import * as React from "react"; |
|
|
import {useForm} from "react-hook-form"; |
|
|
|
|
|
import {useEffect, useState} from "react"; |
|
|
import {useEffect, useState} from "react"; |
|
|
import * as DateUtils from '../../utils/DateUtils'; |
|
|
import * as DateUtils from '../../utils/DateUtils'; |
|
|
import * as HttpUtils from '../../utils/HttpUtils'; |
|
|
import * as HttpUtils from '../../utils/HttpUtils'; |
|
|
import * as UrlUtils from "../../utils/ApiPathConst"; |
|
|
import * as UrlUtils from "../../utils/ApiPathConst"; |
|
|
import {useNavigate} from "react-router-dom"; |
|
|
import {useNavigate} from "react-router-dom"; |
|
|
|
|
|
import { useFormik } from 'formik'; |
|
|
|
|
|
|
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
|
|
|
|
|
@@ -19,11 +17,48 @@ import {useNavigate} from "react-router-dom"; |
|
|
const OrganizationCard_loadFromUser = ({userData, id}) => { |
|
|
const OrganizationCard_loadFromUser = ({userData, id}) => { |
|
|
|
|
|
|
|
|
const [currentUserData, setCurrentUserData] = useState(userData); |
|
|
const [currentUserData, setCurrentUserData] = useState(userData); |
|
|
const form = useForm({defaultValues: userData}); |
|
|
|
|
|
const {register,reset, handleSubmit} = form; |
|
|
|
|
|
|
|
|
|
|
|
const navigate = useNavigate(); |
|
|
const navigate = useNavigate(); |
|
|
|
|
|
|
|
|
|
|
|
const formik = useFormik({ |
|
|
|
|
|
enableReinitialize:true, |
|
|
|
|
|
initialValues:currentUserData, |
|
|
|
|
|
onSubmit: values =>{ |
|
|
|
|
|
HttpUtils.post({ |
|
|
|
|
|
url: UrlUtils.POST_ORG_SAVE_PATH, |
|
|
|
|
|
params: { |
|
|
|
|
|
id:null, |
|
|
|
|
|
enCompanyName: values.enCompanyName, |
|
|
|
|
|
chCompanyName: values.chCompanyName, |
|
|
|
|
|
brNo: values.brNo, |
|
|
|
|
|
brExpiryDate: values.brExpiryDate, |
|
|
|
|
|
enCompanyNameTemp: values.enCompanyNameTemp, |
|
|
|
|
|
chCompanyNameTemp: values.chCompanyNameTemp, |
|
|
|
|
|
brExpiryDateTemp: values.brExpiryDateTemp, |
|
|
|
|
|
contactPerson: values.contactPerson, |
|
|
|
|
|
contactTel: { |
|
|
|
|
|
countryCode: values.tel_countryCode, |
|
|
|
|
|
phoneNumber: values.phoneNumber |
|
|
|
|
|
}, |
|
|
|
|
|
faxNo: { |
|
|
|
|
|
countryCode: values.fax_countryCode, |
|
|
|
|
|
faxNumber: values.faxNumber |
|
|
|
|
|
}, |
|
|
|
|
|
addressTemp: { |
|
|
|
|
|
country: values.country, |
|
|
|
|
|
district: values.district, |
|
|
|
|
|
addressLine1: values.addressLine1, |
|
|
|
|
|
addressLine2: values.addressLine2, |
|
|
|
|
|
addressLine3: values.addressLine3, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onSuccess: function(responseData){ |
|
|
|
|
|
navigate('/org/'+responseData.id); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if(id>0){ |
|
|
if(id>0){ |
|
|
userData["country"] = userData.addressTemp?.country; |
|
|
userData["country"] = userData.addressTemp?.country; |
|
@@ -52,45 +87,9 @@ const OrganizationCard_loadFromUser = ({userData, id}) => { |
|
|
}, [userData]); |
|
|
}, [userData]); |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
reset(currentUserData); |
|
|
|
|
|
}, [currentUserData]); |
|
|
}, [currentUserData]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onSubmitForm=(_formData)=>{ |
|
|
|
|
|
console.log(_formData); |
|
|
|
|
|
HttpUtils.post({ |
|
|
|
|
|
url: UrlUtils.POST_ORG_SAVE_PATH, |
|
|
|
|
|
params: { |
|
|
|
|
|
id:id>0?id:null, |
|
|
|
|
|
enCompanyName: _formData.enCompanyName, |
|
|
|
|
|
chCompanyName: _formData.chCompanyName, |
|
|
|
|
|
brNo: _formData.brNo, |
|
|
|
|
|
brExpiryDate: _formData.brExpiryDate, |
|
|
|
|
|
enCompanyNameTemp: _formData.enCompanyNameTemp, |
|
|
|
|
|
chCompanyNameTemp: _formData.chCompanyNameTemp, |
|
|
|
|
|
brExpiryDateTemp: _formData.brExpiryDateTemp, |
|
|
|
|
|
contactPerson: _formData.contactPerson, |
|
|
|
|
|
contactTel: { |
|
|
|
|
|
countryCode: _formData.tel_countryCode, |
|
|
|
|
|
phoneNumber: _formData.phoneNumber |
|
|
|
|
|
}, |
|
|
|
|
|
faxNo: { |
|
|
|
|
|
countryCode: _formData.fax_countryCode, |
|
|
|
|
|
faxNumber: _formData.faxNumber |
|
|
|
|
|
}, |
|
|
|
|
|
addressTemp: { |
|
|
|
|
|
country: _formData.country, |
|
|
|
|
|
district: _formData.district, |
|
|
|
|
|
addressLine1: _formData.addressLine1, |
|
|
|
|
|
addressLine2: _formData.addressLine2, |
|
|
|
|
|
addressLine3: _formData.addressLine3, |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onSuccess: function(responseData){ |
|
|
|
|
|
navigate('/org/'+responseData.id); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<MainCard elevation={0} |
|
|
<MainCard elevation={0} |
|
@@ -101,266 +100,162 @@ const OrganizationCard_loadFromUser = ({userData, id}) => { |
|
|
Information |
|
|
Information |
|
|
</Typography> |
|
|
</Typography> |
|
|
|
|
|
|
|
|
<form onSubmit={handleSubmit(onSubmitForm)}> |
|
|
|
|
|
|
|
|
<form onSubmit={formik.handleSubmit}> |
|
|
|
|
|
|
|
|
<Grid container spacing={1}> |
|
|
<Grid container spacing={1}> |
|
|
{/*bottom top*/} |
|
|
|
|
|
<Grid item s={12} md={12} lg={12} sx={{mb: 3}} alignItems={"start"} justifyContent="center"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Grid item sx={{ml: 3, mr: 3}}> |
|
|
|
|
|
<Button |
|
|
|
|
|
size="large" |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
type="submit" |
|
|
|
|
|
sx={{ |
|
|
|
|
|
textTransform: 'capitalize', |
|
|
|
|
|
alignItems: 'end' |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Create |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
|
{/*bottom top*/} |
|
|
|
|
|
<Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
BR No.: |
|
|
|
|
|
|
|
|
{/*bottom top*/} |
|
|
|
|
|
<Grid item s={12} md={12} lg={12} sx={{mb: 3}} alignItems={"start"} justifyContent="center"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Grid item sx={{ml: 3, mr: 3}}> |
|
|
|
|
|
<Button |
|
|
|
|
|
size="large" |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
type="submit" |
|
|
|
|
|
sx={{ |
|
|
|
|
|
textTransform: 'capitalize', |
|
|
|
|
|
alignItems: 'end' |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
Create |
|
|
|
|
|
</Button> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
id='brNo' |
|
|
|
|
|
inputProps={{ maxLength: 8 }} |
|
|
|
|
|
|
|
|
|
|
|
{...register("brNo")} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item lg={8} > |
|
|
|
|
|
|
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
Name (Eng): |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("enCompanyName")} |
|
|
|
|
|
id='enCompanyName' |
|
|
|
|
|
|
|
|
|
|
|
inputProps={{ maxLength: 150 }} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
Name (Ch): |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("chCompanyName")} |
|
|
|
|
|
id='chCompanyName' |
|
|
|
|
|
inputProps={{ maxLength: 150 }} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
Expiry Date: |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<LocalizationProvider fullWidth dateAdapter={AdapterDayjs}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("brExpiryDate")} |
|
|
|
|
|
id='brExpiryDate' |
|
|
|
|
|
/> |
|
|
|
|
|
</LocalizationProvider> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
Contact Person: |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("contactPerson")} |
|
|
|
|
|
id='contactPerson' |
|
|
|
|
|
|
|
|
|
|
|
inputProps={{ maxLength: 150 }} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item lg={4}> |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
Contact Tel: |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={2}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
type="number" |
|
|
|
|
|
defaultValue="852" |
|
|
|
|
|
{...register("tel_countryCode")} |
|
|
|
|
|
id='tel_countryCode' |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={4}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
type="tel" |
|
|
|
|
|
inputProps={{ maxLength: 20 }} |
|
|
|
|
|
{...register("phoneNumber")} |
|
|
|
|
|
id='phoneNumber' |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item lg={4}> |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
Fax No: |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={2}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
type="number" |
|
|
|
|
|
defaultValue="852" |
|
|
|
|
|
{...register("fax_countryCode")} |
|
|
|
|
|
id='fax_countryCode' |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={4}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
inputProps={{ maxLength: 20 }} |
|
|
|
|
|
type="number" |
|
|
|
|
|
{...register("faxNumber")} |
|
|
|
|
|
id='faxNumber' |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
Country : |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("country")} |
|
|
|
|
|
id='country' |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
District : |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("district")} |
|
|
|
|
|
id='district' |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"top"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'top'}}> |
|
|
|
|
|
<Grid item lg={12} sx={{alignItems: 'center'}}>Address :</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item lg={6}> |
|
|
|
|
|
<Grid item lg={12}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("addressLine1")} |
|
|
|
|
|
id='addressLine1' |
|
|
|
|
|
|
|
|
|
|
|
inputProps={{ maxLength: 255 }} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item lg={12}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("addressLine2")} |
|
|
|
|
|
id='addressLine2' |
|
|
|
|
|
|
|
|
|
|
|
inputProps={{ maxLength: 255 }} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item lg={12}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
{...register("addressLine3")} |
|
|
|
|
|
id='addressLine3' |
|
|
|
|
|
|
|
|
|
|
|
inputProps={{ maxLength: 255 }} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*bottom top*/} |
|
|
|
|
|
|
|
|
|
|
|
{getTextField("BR No.:","brNo",formik)} |
|
|
|
|
|
<Grid item lg={8}></Grid> |
|
|
|
|
|
{getTextField("Name (Eng):","enCompanyName",formik)} |
|
|
|
|
|
{getTextField("Name (Ch):","chCompanyName",formik)} |
|
|
|
|
|
{getDateField("Expiry Date:","brExpiryDate",formik)} |
|
|
|
|
|
{getTextField("Contact Person:","contactPerson",formik)} |
|
|
|
|
|
{getPhoneField("Contact Tel:","tel_countryCode", "phoneNumber",formik)} |
|
|
|
|
|
{getPhoneField("Fax No.:","fax_countryCode", "faxNumber",formik)} |
|
|
|
|
|
{getTextField("Country:","country",formik)} |
|
|
|
|
|
{getTextField("District :","district", formik)} |
|
|
|
|
|
{getAddressField("Address:","addressLine1","addressLine2","addressLine3",formik)} |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</form> |
|
|
</form> |
|
|
</MainCard> |
|
|
</MainCard> |
|
|
); |
|
|
); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const getDateField=(label, key, form)=>{ |
|
|
|
|
|
return <Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
{label} |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
id={key} |
|
|
|
|
|
name={key} |
|
|
|
|
|
type="date" |
|
|
|
|
|
onChange={form.handleChange} |
|
|
|
|
|
value={form.values[key]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid>; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getTextField=(label, key, form)=>{ |
|
|
|
|
|
return <Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
{label} |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={7} s={7} md={7} lg={6}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
id={key} |
|
|
|
|
|
name={key} |
|
|
|
|
|
type="text" |
|
|
|
|
|
onChange={form.handleChange} |
|
|
|
|
|
value={form.values[key]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid>; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getPhoneField=(label, key, key2, form)=>{ |
|
|
|
|
|
return <Grid item lg={4}> |
|
|
|
|
|
<Grid container alignItems={"center"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'center'}}> |
|
|
|
|
|
{label} |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={2}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
id={key} |
|
|
|
|
|
name={key} |
|
|
|
|
|
type="number" |
|
|
|
|
|
onChange={form.handleChange} |
|
|
|
|
|
value={form.values[key]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item xs={4}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
id={key2} |
|
|
|
|
|
name={key2} |
|
|
|
|
|
type="number" |
|
|
|
|
|
onChange={form.handleChange} |
|
|
|
|
|
value={form.values[key2]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid>; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getAddressField=(label, key, key2, key3, form)=>{ |
|
|
|
|
|
return <Grid item lg={4} > |
|
|
|
|
|
<Grid container alignItems={"top"}> |
|
|
|
|
|
<Grid item xs={4} s={4} md={4} lg={4} |
|
|
|
|
|
sx={{ml: 3, mr: 3, display: 'flex', alignItems: 'top'}}> |
|
|
|
|
|
<Grid item lg={12} sx={{alignItems: 'center'}}>{label}</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item lg={6}> |
|
|
|
|
|
<Grid item lg={12}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
id={key} |
|
|
|
|
|
name={key} |
|
|
|
|
|
type="text" |
|
|
|
|
|
onChange={form.handleChange} |
|
|
|
|
|
value={form.values[key]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item lg={12}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
id={key2} |
|
|
|
|
|
name={key2} |
|
|
|
|
|
type="text" |
|
|
|
|
|
onChange={form.handleChange} |
|
|
|
|
|
value={form.values[key2]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item lg={12}> |
|
|
|
|
|
<TextField |
|
|
|
|
|
fullWidth |
|
|
|
|
|
id={key3} |
|
|
|
|
|
name={key3} |
|
|
|
|
|
type="text" |
|
|
|
|
|
onChange={form.handleChange} |
|
|
|
|
|
value={form.values[key3]} |
|
|
|
|
|
/> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</Grid>; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
export default OrganizationCard_loadFromUser; |
|
|
export default OrganizationCard_loadFromUser; |