diff --git a/.changeset/cold-ravens-applaud.md b/.changeset/cold-ravens-applaud.md new file mode 100644 index 0000000000..6ad0321b71 --- /dev/null +++ b/.changeset/cold-ravens-applaud.md @@ -0,0 +1,5 @@ +--- +"@scow/mis-web": patch +--- + +修改充值页面时间筛选与账户/租户筛选交互不一致问题。修改为只有当点击搜索时才发起查询请求。 diff --git a/apps/mis-web/src/pageComponents/common/PaymentTable.tsx b/apps/mis-web/src/pageComponents/common/PaymentTable.tsx index 7f77c30aa8..6975031a87 100644 --- a/apps/mis-web/src/pageComponents/common/PaymentTable.tsx +++ b/apps/mis-web/src/pageComponents/common/PaymentTable.tsx @@ -74,6 +74,8 @@ export const PaymentTable: React.FC = ({ const [form] = Form.useForm(); + const [selectedName, setSelectedName] = useState(accountName); + const [query, setQuery] = useState(() => ({ name: accountName, time: [today.subtract(1, "year"), today], @@ -107,6 +109,7 @@ export const PaymentTable: React.FC = ({ useDidUpdateEffect(() => { setQuery((q) => ({ ...q, name: accountName })); + setSelectedName(accountName); }, [accountName]); return ( @@ -118,7 +121,7 @@ export const PaymentTable: React.FC = ({ initialValues={query} onFinish={async () => { const { name, time } = await form.validateFields(); - setQuery({ name: accountName ?? name, time }); + setQuery({ name: selectedName ?? name, time }); }} > {searchType ? ( @@ -130,14 +133,14 @@ export const PaymentTable: React.FC = ({ {searchType === SearchType.account ? ( { - setQuery({ ...query, name:item }); + setSelectedName(item); }} placeholder={t(pCommon("selectAccount"))} /> ) : ( { - setQuery({ ...query, name:item }); + setSelectedName(item); }} placeholder={t(pCommon("selectTenant"))}