From f31826beb2245d23f8b5266469b8d5e12edbd108 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 24 Sep 2025 16:02:27 +0800 Subject: [PATCH] update --- src/pages/GFMIS/DataGrid.js | 12 ++++++++---- src/pages/GFMIS/index.js | 12 ++++++++++-- src/utils/Utils.js | 8 ++++---- src/utils/statusUtils/PublicNoteStatusUtils.js | 2 -- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/pages/GFMIS/DataGrid.js b/src/pages/GFMIS/DataGrid.js index 635b98a..faab8fa 100644 --- a/src/pages/GFMIS/DataGrid.js +++ b/src/pages/GFMIS/DataGrid.js @@ -68,11 +68,15 @@ export default function SearchTable({ previewSearchCriteria, onPreviewGridOnRead customPageSize={10} onRowDoubleClick={handleEditClick} applyGridOnReady={onPreviewGridOnReady} - doLoad={React.useMemo(() => ({ + doLoad={React.useMemo(() => { + if (!selectedIds?.length) { + return undefined; // ⬅️ will keep grid empty + } + return { url: GFIMIS_LIST, - params: { ..._searchCriteria, paymentId: selectedIds.join(',') } - }), [_searchCriteria])} - + params: { ..._searchCriteria, paymentId: selectedIds.join(',') }, + }; + }, [_searchCriteria, selectedIds])} /> ); diff --git a/src/pages/GFMIS/index.js b/src/pages/GFMIS/index.js index f45b4d8..d9892ad 100644 --- a/src/pages/GFMIS/index.js +++ b/src/pages/GFMIS/index.js @@ -66,6 +66,12 @@ const Index = () => { setOnReady(true); }, [searchCriteria]); + React.useEffect(() => { + if (selectedIds.length > 0) { + const withToken = { ...searchCriteria, __ts: Date.now() }; + setPreviewSearchCriteria(withToken); + } + }, [selectedIds, searchCriteria]); function downloadXML() { console.log(selectedIds.join(',')) @@ -131,9 +137,11 @@ const Index = () => { function applySearch(input) { - setGridOnReady(true) + setGridOnReady(true); + setSelectedIds([]); + setPreviewSearchCriteria({}); setSearchCriteria(input); - setInputDate(input.dateFrom) + setInputDate(input.dateFrom); } function previewSearch() { diff --git a/src/utils/Utils.js b/src/utils/Utils.js index c142f49..50e948c 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -194,8 +194,8 @@ export const isPasswordExpiry = () =>{ } export const checkIsOnlyOnlinePaymentByIssueDate = (date) => { - const targetDate = new Date(2026, 1, 6, 0, 0, 0); // 6 Feb 2026, 00:00:00 - // const targetDate = new Date(2025, 6, 13, 8, 0, 0); //2025-07-13T08:00:00.000Z + // const targetDate = new Date(2025, 7, 1, 0, 0, 0) //2026-01-28T08:00:00.000Z hardcode + const targetDate = new Date(2025, 9, 17, 8, 0, 0) //2025-10-17T08:00:00.000Z const checkDate = DateUtils.convertToDate(date) if (isDummyLoggedIn()){ return false; @@ -210,7 +210,7 @@ export const checkIsOnlyOnlinePaymentByIssueDate = (date) => { } export const checkIsOnlyOnlinePayment = () => { - const targetDate = new Date(2025, 7, 1, 0, 0, 0) // hardcode + const targetDate = new Date(2025, 9, 17, 8, 0, 0) // hardcode const checkDate = DateUtils.convertToDate(new Date()) if (isDummyLoggedIn()){ return false; @@ -225,7 +225,7 @@ export const checkIsOnlyOnlinePayment = () => { } export const checkMarkAsCreditClient = () => { - const targetDate = new Date(2025, 6, 15, 0, 0, 0) // hardcode + const targetDate = new Date(2025, 9, 17, 8, 0, 0) // hardcode const checkDate = DateUtils.convertToDate(new Date()) // console.log(targetDate) // console.log(checkDate >= targetDate) diff --git a/src/utils/statusUtils/PublicNoteStatusUtils.js b/src/utils/statusUtils/PublicNoteStatusUtils.js index ba8eab9..adcdf16 100644 --- a/src/utils/statusUtils/PublicNoteStatusUtils.js +++ b/src/utils/statusUtils/PublicNoteStatusUtils.js @@ -124,8 +124,6 @@ export function getModeByTextIntl(mode, intl) { switch (mode) { case "offline": return intl.formatMessage({id: 'applicationModeOffline'}) - case "online": - return intl.formatMessage({id: 'applicationModeOnline'}) default: return "" }