diff --git a/src/pages/DemandNote/Search_Public/SearchForm.js b/src/pages/DemandNote/Search_Public/SearchForm.js
index 0e36399..2d54619 100644
--- a/src/pages/DemandNote/Search_Public/SearchForm.js
+++ b/src/pages/DemandNote/Search_Public/SearchForm.js
@@ -12,37 +12,37 @@ import * as React from "react";
import * as ComboData from "utils/ComboData";
import * as DateUtils from "utils/DateUtils";
import * as FormatUtils from "utils/FormatUtils";
-import {FormattedMessage, useIntl} from "react-intl";
-import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst";
-import {ThemeProvider} from "@emotion/react";
+import { FormattedMessage, useIntl } from "react-intl";
+import { PNSPS_BUTTON_THEME } from "../../../themes/buttonConst";
+import { ThemeProvider } from "@emotion/react";
import { makeStyles } from '@mui/styles';
// ==============================|| DASHBOARD - DEFAULT ||============================== //
const useStyles = makeStyles(() => ({
root: {
- position: "relative"
+ position: "relative"
},
display: {
- position: "absolute",
- top: 2,
- left: 12,
- bottom: 2,
- background: "white",
- pointerEvents: "none",
- right: 50,
- display: "flex",
- alignItems: "center"
+ position: "absolute",
+ top: 2,
+ left: 12,
+ bottom: 2,
+ background: "white",
+ pointerEvents: "none",
+ right: 50,
+ display: "flex",
+ alignItems: "center"
},
- }));
+}));
const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
}) => {
const intl = useIntl();
const { locale } = intl;
-
+
const [type, setType] = React.useState([]);
- const [issueSelected, setIssueSelected] = React.useState({ key: 0, i18nLabel: 'all', labelCht: '全部', label: 'All', type: 'all' });
+ const [issueSelected, setIssueSelected] = React.useState({ key: 0, i18nLabel: 'all', labelCht: '全部', label: 'All', type: 'all' });
const [issueCombo, setIssueCombo] = React.useState([]);
const [selectedStatus, setSelectedStatus] = React.useState(ComboData.denmandNoteStatus_Public[0]);
@@ -53,58 +53,58 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
React.useEffect(() => {
console.log(minDate)
- if (minDate != searchCriteria.dateFrom){
+ if (minDate != searchCriteria.dateFrom) {
setFromDateValue(minDate);
}
}, [minDate]);
-
+
React.useEffect(() => {
console.log(maxDate)
- if (maxDate != searchCriteria.dateTo){
+ if (maxDate != searchCriteria.dateTo) {
setToDateValue(maxDate);
}
}, [maxDate]);
- function FormDateInputComponent({inputRef, ...props }) {
+ function FormDateInputComponent({ inputRef, ...props }) {
const classes = useStyles();
return (
<>
-
- {DateUtils.dateStr(fromDateValue)=="Invalid Date"?
- fromDateValue
- :
- DateUtils.dateStr(fromDateValue)}
-
-
+
+ {DateUtils.dateStr(fromDateValue) == "Invalid Date" ?
+ fromDateValue
+ :
+ DateUtils.dateStr(fromDateValue)}
+
+
>
);
}
- function ToDateInputComponent({inputRef, ...props }) {
+ function ToDateInputComponent({ inputRef, ...props }) {
const classes = useStyles();
return (
<>
-
- {DateUtils.dateStr(toDateValue)=="Invalid Date"?
- toDateValue
- :
- DateUtils.dateStr(toDateValue)}
-
-
+
+ {DateUtils.dateStr(toDateValue) == "Invalid Date" ?
+ toDateValue
+ :
+ DateUtils.dateStr(toDateValue)}
+
+
>
);
}
@@ -119,7 +119,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
typeArray.push(type[i].label);
}
- if( fromDateValue!="dd / mm / yyyy"&&toDateValue!="dd / mm / yyyy"){
+ if (fromDateValue != "dd / mm / yyyy" && toDateValue != "dd / mm / yyyy") {
sentDateFrom = DateUtils.dateValue(fromDateValue)
sentDateTo = DateUtils.dateValue(toDateValue)
}
@@ -188,7 +188,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
-
+
@@ -212,7 +212,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
}}
renderInput={(params) => (
{
@@ -284,7 +285,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
}}
id="dateTo"
type="date"
- label={intl.formatMessage({id: 'sendDateTo'})}
+ label={intl.formatMessage({ id: 'sendDateTo' })}
defaultValue={searchCriteria.dateTo}
/>
@@ -296,8 +297,8 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
id="status"
size="small"
options={ComboData.denmandNoteStatus_Public}
- getOptionLabel={(option) => option?.i18nLabel? intl.formatMessage({ id: option.i18nLabel }) : ""}
- inputValue={selectedStatus?.i18nLabel? intl.formatMessage({ id: selectedStatus.i18nLabel }) : ""}
+ getOptionLabel={(option) => option?.i18nLabel ? intl.formatMessage({ id: option.i18nLabel }) : ""}
+ inputValue={selectedStatus?.i18nLabel ? intl.formatMessage({ id: selectedStatus.i18nLabel }) : ""}
value={selectedStatus}
onChange={(event, newValue) => {
if (newValue !== null) {
@@ -307,7 +308,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
renderInput={(params) => (
)}
InputLabelProps={{
@@ -323,13 +324,13 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData
{/*last row*/}
-
+
diff --git a/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js b/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js
index cb67bbb..64565ef 100644
--- a/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js
+++ b/src/pages/User/DetailsPage_Organization/UserInformationCard_Organization.js
@@ -98,7 +98,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
contactPerson: values.contactPerson,
// enCompanyName: values.enCompanyName,
// chCompanyName: values.chCompanyName,
- orgId: values.orgId,
+ orgId: values.orgId?.id,
// brNo: values.brNo,
// brExpiryDate: values.brExpiryDate,
preferLocale: values.preferLocale.type
@@ -303,6 +303,14 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
{FieldUtils.getComboField({
+ label: "Organisation:",
+ valueName: "orgId",
+ getOptionLabel: (option) => option.brNo? option.brNo : "",
+ dataList: orgData,
+ disabled: (!editMode),
+ form: formik
+ })}
+ {/* {FieldUtils.getComboField({
label: "Organisation:",
valueName: "orgId",
disabled: (!editMode),
@@ -343,7 +351,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) =>
formik.setFieldValue("orgId", newValue.id);
},
form: formik
- })}
+ })} */}
diff --git a/src/pages/User/DetailsPage_Organization/index.js b/src/pages/User/DetailsPage_Organization/index.js
index 8bb1905..bca1c70 100644
--- a/src/pages/User/DetailsPage_Organization/index.js
+++ b/src/pages/User/DetailsPage_Organization/index.js
@@ -90,6 +90,12 @@ const UserMaintainPage_Organization = () => {
loadData();
}
}, []);
+
+ useEffect(() => {
+ if (orgData.length > 0 && userData["orgId"] != null){
+ userData["orgId"] = getObjectByType(orgData, "id", userData["orgId"]);
+ }
+ }, [orgData, userData]);
useEffect(() => {
// console.log(userData);