|
|
|
@ -1,149 +1,23 @@
|
|
|
|
|
import { Conditional } from '@/components/Conditional'
|
|
|
|
|
import useAuthStore from '@/stores/AuthStore'
|
|
|
|
|
import useFormStore from '@/stores/FormStore'
|
|
|
|
|
import { useOrderStore, OrderLabelDefaultOptions, OrderStatusDefaultOptions, RemindStateDefaultOptions } from '@/stores/OrderStore'
|
|
|
|
|
import { useOrderStore } from '@/stores/OrderStore'
|
|
|
|
|
import { copy, isNotEmpty, isEmpty } from '@/utils/commons'
|
|
|
|
|
import { WhatsAppOutlined } from '@ant-design/icons'
|
|
|
|
|
import {
|
|
|
|
|
App, Badge, Button,
|
|
|
|
|
Col,
|
|
|
|
|
DatePicker,
|
|
|
|
|
App, Badge,
|
|
|
|
|
Empty,
|
|
|
|
|
Flex, Form, Input,
|
|
|
|
|
Radio, Row, Select, Space, Switch, Table,
|
|
|
|
|
Flex,
|
|
|
|
|
Radio, Space, Switch, Table,
|
|
|
|
|
Tabs, Divider,
|
|
|
|
|
Tag, Tooltip
|
|
|
|
|
} from 'antd'
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import { memo, useCallback, useEffect, useState } from 'react'
|
|
|
|
|
import { useCallback, useEffect, useState } from 'react'
|
|
|
|
|
import { Link } from 'react-router-dom'
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow'
|
|
|
|
|
import { UNREAD_MARK } from '@/actions/ConversationActions';
|
|
|
|
|
|
|
|
|
|
const { RangePicker } = DatePicker
|
|
|
|
|
|
|
|
|
|
const AdvanceSearchForm = memo(function noName({ initialValues, onSubmit }) {
|
|
|
|
|
|
|
|
|
|
const DATE_RANGE_PRESETS = [
|
|
|
|
|
{
|
|
|
|
|
label: '本周',
|
|
|
|
|
value: [dayjs().startOf('w'), dayjs().endOf('w')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '上周',
|
|
|
|
|
value: [dayjs().startOf('w').subtract(7, 'days'), dayjs().endOf('w').subtract(7, 'days')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '本月',
|
|
|
|
|
value: [dayjs().startOf('M'), dayjs().endOf('M')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '上月',
|
|
|
|
|
value: [dayjs().subtract(1, 'M').startOf('M'), dayjs().subtract(1, 'M').endOf('M')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '前三月',
|
|
|
|
|
value: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '本年',
|
|
|
|
|
value: [dayjs().startOf('y'), dayjs().endOf('y')],
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const orderLabelOptions = copy(OrderLabelDefaultOptions)
|
|
|
|
|
orderLabelOptions.unshift({ value: '', label: '全部' })
|
|
|
|
|
|
|
|
|
|
const orderStatusOptions = copy(OrderStatusDefaultOptions)
|
|
|
|
|
orderStatusOptions.unshift({ value: '', label: '全部' })
|
|
|
|
|
|
|
|
|
|
const remindStateOptions = copy(RemindStateDefaultOptions)
|
|
|
|
|
remindStateOptions.unshift({ value: '', label: '全部' })
|
|
|
|
|
|
|
|
|
|
const [form] = Form.useForm()
|
|
|
|
|
|
|
|
|
|
function handleSubmit(values) {
|
|
|
|
|
onSubmit?.(values)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Form
|
|
|
|
|
layout={'vertical'}
|
|
|
|
|
form={form}
|
|
|
|
|
initialValues={{
|
|
|
|
|
orderLabel: '', orderStatus: '', remindState: '', ...initialValues
|
|
|
|
|
}}
|
|
|
|
|
onFinish={handleSubmit}
|
|
|
|
|
>
|
|
|
|
|
<Row justify='start' gutter={16}>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Form.Item label='订单号' name='orderNumber'>
|
|
|
|
|
<Input placeholder='订单号' allowClear />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Form.Item label='邮件地址/客人电话' name='emailOrPhone'>
|
|
|
|
|
<Input placeholder='邮件地址/客人电话' allowClear />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Form.Item label='First name' name='firstName'>
|
|
|
|
|
<Input placeholder='First name' allowClear />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Form.Item label='Last name' name='lastName'>
|
|
|
|
|
<Input placeholder='Last name' allowClear />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row justify='start' align='middle' gutter={16}>
|
|
|
|
|
<Col span={2}>
|
|
|
|
|
<Form.Item label='标签' name='orderLabel'>
|
|
|
|
|
<Select
|
|
|
|
|
options={orderLabelOptions}
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={2}>
|
|
|
|
|
<Form.Item label='状态' name='orderStatus'>
|
|
|
|
|
<Select
|
|
|
|
|
options={orderStatusOptions}
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={2}>
|
|
|
|
|
<Form.Item label='催信' name='remindState'>
|
|
|
|
|
<Select
|
|
|
|
|
options={remindStateOptions}
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Form.Item label='出发日期' name='startDateRange'>
|
|
|
|
|
<RangePicker
|
|
|
|
|
allowClear={true}
|
|
|
|
|
inputReadOnly={true}
|
|
|
|
|
presets={DATE_RANGE_PRESETS}
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Form.Item label='确认日期' name='confirmDateRange'>
|
|
|
|
|
<RangePicker
|
|
|
|
|
allowClear={true}
|
|
|
|
|
inputReadOnly={true}
|
|
|
|
|
presets={DATE_RANGE_PRESETS}
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={1} offset={1}>
|
|
|
|
|
<Button type='primary' htmlType='submit'>搜索</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Form>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
import AdvanceSearchForm from './AdvanceSearchForm';
|
|
|
|
|
|
|
|
|
|
function OrderGroupTable({ formValues }) {
|
|
|
|
|
|
|
|
|
|