|
|
@@ -32,6 +32,7 @@ const BackgroundHead = { |
|
|
|
import { |
|
|
|
isGLDLoggedIn, |
|
|
|
isORGLoggedIn, |
|
|
|
isINDLoggedIn |
|
|
|
} from "utils/Utils"; |
|
|
|
import {useIntl} from "react-intl"; |
|
|
|
|
|
|
@@ -72,7 +73,11 @@ const UserMaintainPage_Organization = () => { |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
// console.log(userData); |
|
|
|
loadData(); |
|
|
|
if (isINDLoggedIn()){ |
|
|
|
navigate('/dashboard'); |
|
|
|
}else{ |
|
|
|
loadData(); |
|
|
|
} |
|
|
|
}, []); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
@@ -92,6 +97,7 @@ const UserMaintainPage_Organization = () => { |
|
|
|
onSuccess: function (response) { |
|
|
|
// console.log(response) |
|
|
|
if (response.data.orgId != null) { |
|
|
|
console.log("1a") |
|
|
|
response.data["addressBus"] = response.orgDetail.data["addressTemp"]; |
|
|
|
response.data["contactTel"] = response.orgDetail.data["contactTel"]; |
|
|
|
response.data["faxNo"] = response.orgDetail.data["faxNo"]; |
|
|
@@ -102,12 +108,14 @@ const UserMaintainPage_Organization = () => { |
|
|
|
response.data["chCompanyName"] = response.orgDetail.data.chCompanyName; |
|
|
|
response.data["chCompanyName"] = response.orgDetail.data.chCompanyName; |
|
|
|
} else { |
|
|
|
console.log("1b") |
|
|
|
response.data["addressBus"] = JSON.parse(response.data["addressBus"]); |
|
|
|
response.data["contactTel"] = JSON.parse(response.data["contactTel"]); |
|
|
|
response.data["faxNo"] = JSON.parse(response.data["faxNo"]); |
|
|
|
|
|
|
|
response.data["brExpiryDate"] = response.data.brExpiryDate ? DateUtils.dateStr(response.data.brExpiryDate) : ""; |
|
|
|
} |
|
|
|
console.log("2") |
|
|
|
console.log(response.data) |
|
|
|
|
|
|
|
let createDate = DateUtils.datetimeStr(response.data.created); |
|
|
|
let modifiedBy = DateUtils.datetimeStr(response.data.modified) + ", " + response.data.modifiedBy; |
|
|
@@ -117,9 +125,6 @@ const UserMaintainPage_Organization = () => { |
|
|
|
|
|
|
|
response.data["lastLoginDate"] = response.data.lastLogin ? DateUtils.datetimeStr(response.data.lastLoginDate) : ""; |
|
|
|
|
|
|
|
response.data["mobileNumber"] = JSON.parse(response.data["mobileNumber"]); |
|
|
|
response.data["faxNo"] = JSON.parse(response.data["faxNo"]); |
|
|
|
|
|
|
|
response.data["country"] = response.data.addressBus?.country; |
|
|
|
response.data["district"] = response.data.addressBus?.district; |
|
|
|
response.data["addressLine1"] = response.data.addressBus?.addressLine1; |
|
|
@@ -134,7 +139,8 @@ const UserMaintainPage_Organization = () => { |
|
|
|
|
|
|
|
//response.data["orgId"] = response.data.brExpiryDate?DateUtils.dateStr(response.data.brExpiryDate):""; |
|
|
|
|
|
|
|
|
|
|
|
console.log("3") |
|
|
|
console.log(response.data) |
|
|
|
setUserData(response.data); |
|
|
|
setOrgData(response.orgList); |
|
|
|
} |
|
|
|