diff --git a/src/views/OrderFollow.jsx b/src/views/OrderFollow.jsx index d45f784..921f4a9 100644 --- a/src/views/OrderFollow.jsx +++ b/src/views/OrderFollow.jsx @@ -8,6 +8,7 @@ import dayjs from 'dayjs' import { Conditional } from '@/components/Conditional' import useOrderStore from '@/stores/OrderStore' import useAuthStore from '@/stores/AuthStore' +import { copy } from '@/utils/commons' const { RangePicker } = DatePicker @@ -206,17 +207,38 @@ function OrderGroupTable({ formValues }) { const { loginUser } = useAuthStore() useEffect(() => { - setLoading(true) - fetchOrderList(formValues, loginUser) - .finally(() => setLoading(false)) - .catch(reason => { - notification.error({ - message: '查询出错', - description: reason.message, + let canSearch = true + + if (formValues.type === 'advance') { + const copyObject = copy(formValues) + delete copyObject.type + const allEmpty = Object.values(copyObject).every(val => { + return val === null || val === '' || val === undefined + }) + if (allEmpty) { + canSearch = false + notification.warning({ + message: '温馨提示', + description: '请输入至少一个条件', placement: 'top', duration: 60, }) - }) + } + } + + if (canSearch) { + setLoading(true) + fetchOrderList(formValues, loginUser) + .finally(() => setLoading(false)) + .catch(reason => { + notification.error({ + message: '查询出错', + description: reason.message, + placement: 'top', + duration: 60, + }) + }) + } }, [formValues]) const paginationProps = {