| @@ -1,7 +1,8 @@ | |||
| // material-ui | |||
| import { | |||
| Grid, Typography, Button | |||
| Grid, Typography, Button, Checkbox | |||
| } from '@mui/material'; | |||
| import { FormControlLabel } from '@material-ui/core'; | |||
| import MainCard from "../../components/MainCard"; | |||
| import * as React from "react"; | |||
| import { useFormik } from 'formik'; | |||
| @@ -26,16 +27,16 @@ const OrganizationCard = ({ userData, loadDataFun, id }) => { | |||
| initialValues: currentUserData, | |||
| validationSchema: yup.object().shape({ | |||
| enCompanyName: yup.string().max(255).required('請輸入英文名稱'), | |||
| chCompanyName: yup.string().max(255,'請輸入中文名稱').nullable(), | |||
| chCompanyName: yup.string().max(255, '請輸入中文名稱').nullable(), | |||
| addressLine1: yup.string().max(255).required('請輸入第一行地址'), | |||
| addressLine2: yup.string().max(255, "length must <= 255"), | |||
| addressLine3: yup.string().max(255, "length must <= 255"), | |||
| fax_countryCode: yup.string().min(3, '請輸入國際區號').nullable(), | |||
| tel_countryCode: yup.string().min(3, '請輸入國際區號'), | |||
| phoneNumber: yup.string().min(8).required('請輸入聯絡電話'), | |||
| faxNumber: yup.string().min(8,'請輸入8位數字').nullable(), | |||
| faxNumber: yup.string().min(8, '請輸入8位數字').nullable(), | |||
| brExpiryDate: yup.string().min(8).required('請輸入商業登記證有效日期'), | |||
| brNo: yup.string().min(8, '請輸入有效商業登記證號碼').max(8,'請輸入有效商業登記證號碼').required('請輸入商業登記證號碼'), | |||
| brNo: yup.string().min(8, '請輸入有效商業登記證號碼').max(8, '請輸入有效商業登記證號碼').required('請輸入商業登記證號碼'), | |||
| }), | |||
| onSubmit: vaule => { | |||
| console.log(vaule) | |||
| @@ -65,7 +66,8 @@ const OrganizationCard = ({ userData, loadDataFun, id }) => { | |||
| addressLine1: vaule.addressLine1, | |||
| addressLine2: vaule.addressLine2, | |||
| addressLine3: vaule.addressLine3, | |||
| } | |||
| }, | |||
| creditor: vaule.creditor, | |||
| }, | |||
| onSuccess: function () { | |||
| loadDataFun(); | |||
| @@ -181,7 +183,25 @@ const OrganizationCard = ({ userData, loadDataFun, id }) => { | |||
| form: formik | |||
| })} | |||
| <Grid item lg={8} ></Grid> | |||
| <Grid item lg={4} > | |||
| {/* <Checkbox | |||
| name="creditor" | |||
| label="is Creditor" | |||
| checked={formik.values.creditor} | |||
| onChange={formik.handleChange} | |||
| disabled={!editMode && !createMode} | |||
| /> */} | |||
| <FormControlLabel | |||
| control={<Checkbox checked={formik.values.creditor}/>} | |||
| label="is Creditor" | |||
| name="creditor" | |||
| onChange={formik.handleChange} | |||
| disabled={!editMode && !createMode} | |||
| /> | |||
| </Grid> | |||
| <Grid item lg={4} ></Grid> | |||
| {FieldUtils.getTextField({ | |||
| label: FieldUtils.notNullFieldLabel("Name (Eng):"), | |||