|
|
@@ -26,11 +26,17 @@ import {ThemeProvider} from "@emotion/react"; |
|
|
|
const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { |
|
|
|
|
|
|
|
const intl = useIntl(); |
|
|
|
const [currentUserData, setCurrentUserData] = useState(formData); |
|
|
|
const [currentUserData, setCurrentUserData] = useState({}); |
|
|
|
const [editMode, setEditMode] = useState(false); |
|
|
|
const [onReady, setOnReady] = useState(false); |
|
|
|
const [errorMsg, setErrorMsg] = useState(""); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (Object.keys(formData).length > 0) { |
|
|
|
setCurrentUserData(formData); |
|
|
|
} |
|
|
|
}, [formData]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
//if state data are ready and assign to different field |
|
|
|
// console.log(currentApplicationDetailData) |
|
|
@@ -91,7 +97,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { |
|
|
|
}, |
|
|
|
onSuccess: function () { |
|
|
|
notifySaveSuccess(); |
|
|
|
loadDataFun(); |
|
|
|
window.location.reload(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@@ -99,18 +105,6 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
if (Object.keys(formData).length > 0) { |
|
|
|
setCurrentUserData(formData); |
|
|
|
} |
|
|
|
}, [formData]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
}, [currentUserData]); |
|
|
|
|
|
|
|
const onEditClick = () => { |
|
|
|
setEditMode(true); |
|
|
|
}; |
|
|
@@ -216,24 +210,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { |
|
|
|
valueName: "idDocType", |
|
|
|
disabled: true, |
|
|
|
dataList: ComboData.idDocType, |
|
|
|
filterOptions: (options) => options, |
|
|
|
getOptionLabel: (item) => item ? typeof item === 'string' ? item : (item["type"] ? item["type"] + "-" + item["label"] : "") : "", |
|
|
|
onInputChange: (event, newValue, setInputValue) => { |
|
|
|
if (newValue == null) { |
|
|
|
setInputValue(""); |
|
|
|
} |
|
|
|
let _val = newValue.split("-"); |
|
|
|
if (_val[0]) { |
|
|
|
setInputValue(_val[0]); |
|
|
|
} |
|
|
|
}, |
|
|
|
onChange: (event, newValue) => { |
|
|
|
if (newValue == null) { |
|
|
|
formik.setFieldValue("idDocType", ""); |
|
|
|
return; |
|
|
|
} |
|
|
|
formik.setFieldValue("idDocType", newValue.type); |
|
|
|
}, |
|
|
|
getOptionLabel: (option) => option? intl.formatMessage({ id: option }) : "", |
|
|
|
form: formik |
|
|
|
})} |
|
|
|
</Grid> |
|
|
|