|
|
|
@ -1,143 +1,12 @@
|
|
|
|
|
import { useNavigate } from 'react-router-dom'
|
|
|
|
|
import { memo, useMemo, useCallback, useEffect, useState } from 'react'
|
|
|
|
|
import { memo, useCallback, useEffect, useState } from 'react'
|
|
|
|
|
import {
|
|
|
|
|
Row, Badge, Divider, Table, Card, Button, Input,
|
|
|
|
|
Space, Tag, Radio, Select, Flex, Spin, Form, Switch, DatePicker, List, Avatar
|
|
|
|
|
Badge, Divider, Table, Button, Input,
|
|
|
|
|
Space, Tag, Radio, Select, Flex, Form, Switch, DatePicker
|
|
|
|
|
} from 'antd'
|
|
|
|
|
import {
|
|
|
|
|
StarFilled, ZoomInOutlined, StarOutlined, BarsOutlined, AppstoreOutlined, SearchOutlined
|
|
|
|
|
} from '@ant-design/icons'
|
|
|
|
|
import { Conditional } from '@/components/Conditional'
|
|
|
|
|
import { useGetJson } from '@/hooks/userFetch'
|
|
|
|
|
|
|
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
|
|
|
|
|
|
const dataSource = [
|
|
|
|
|
{
|
|
|
|
|
key: '1',
|
|
|
|
|
orderNumber: 'LU231218115(3)',
|
|
|
|
|
fullname: 'Giacomo Guilizzoni(R1)',
|
|
|
|
|
orderStatus: '新订单',
|
|
|
|
|
trip: 'Itinerary2: Tkyoto tour',
|
|
|
|
|
lastMessage: '2024-03-25 16:02',
|
|
|
|
|
comment: '吃素、蜜月',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '2',
|
|
|
|
|
orderNumber: 'LU231218115(3)',
|
|
|
|
|
fullname: 'Giacomo Guilizzoni(R1)',
|
|
|
|
|
orderStatus: '新订单',
|
|
|
|
|
trip: 'Itinerary2: Tkyoto tour',
|
|
|
|
|
lastMessage: '2024-03-25 16:02',
|
|
|
|
|
comment: '吃素、蜜月',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '3',
|
|
|
|
|
orderNumber: 'LU231218115(3)',
|
|
|
|
|
fullname: 'Giacomo Guilizzoni(R1)',
|
|
|
|
|
orderStatus: '新订单',
|
|
|
|
|
trip: 'Itinerary2: Tkyoto tour',
|
|
|
|
|
lastMessage: '2024-03-25 16:02',
|
|
|
|
|
comment: '吃素、蜜月',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '4',
|
|
|
|
|
orderNumber: 'LU231218115(3)',
|
|
|
|
|
fullname: 'Giacomo Guilizzoni(R1)',
|
|
|
|
|
orderStatus: '新订单',
|
|
|
|
|
trip: 'Itinerary2: Tkyoto tour 超级无敌长的报价标题',
|
|
|
|
|
lastMessage: '2024-03-25 16:02',
|
|
|
|
|
comment: '吃素、蜜月',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '5',
|
|
|
|
|
orderNumber: 'LU231218115(3)',
|
|
|
|
|
fullname: 'Giacomo Guilizzoni(R1)',
|
|
|
|
|
orderStatus: '新订单',
|
|
|
|
|
trip: 'Itinerary2: Tkyoto tour',
|
|
|
|
|
lastMessage: '2024-03-25 16:02',
|
|
|
|
|
comment: '吃素、蜜月',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '6',
|
|
|
|
|
orderNumber: 'LU231218115(3)',
|
|
|
|
|
fullname: 'Giacomo Guilizzoni(R1)',
|
|
|
|
|
orderStatus: '新订单',
|
|
|
|
|
trip: 'Itinerary2: Tkyoto tour',
|
|
|
|
|
lastMessage: '2024-03-25 16:02',
|
|
|
|
|
comment: '吃素、蜜月',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '7',
|
|
|
|
|
orderNumber: 'LU231218115(3)',
|
|
|
|
|
fullname: 'Giacomo Guilizzoni(R1)',
|
|
|
|
|
orderStatus: '新订单',
|
|
|
|
|
trip: 'Itinerary2: Tkyoto tour',
|
|
|
|
|
lastMessage: '2024-03-25 16:02',
|
|
|
|
|
comment: '吃素、蜜月',
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
import { useAuthContext } from '@/stores/AuthContext'
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
|
title: '订单号',
|
|
|
|
|
dataIndex: 'orderNumber',
|
|
|
|
|
key: 'orderNumber',
|
|
|
|
|
width: 222,
|
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
if (index === 1) return <Space size='middle'>{text}<Tag color='red'>重点</Tag></Space>
|
|
|
|
|
else if (index === 2) return <Space size='middle'>{text}<Tag color='green'>潜力</Tag></Space>
|
|
|
|
|
else return <Space size='middle'>{text}<Tag color='blue'>休眠</Tag></Space>
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '客人姓名',
|
|
|
|
|
dataIndex: 'fullname',
|
|
|
|
|
key: 'fullname',
|
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
return (
|
|
|
|
|
<Space size='middle'>
|
|
|
|
|
<a>{text}</a>
|
|
|
|
|
<Badge
|
|
|
|
|
className="site-badge-count-109"
|
|
|
|
|
count={Math.floor(Math.random() * (100 - 2 + 1) + 2)}
|
|
|
|
|
style={{
|
|
|
|
|
backgroundColor: '#52c41a',
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Space>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '订单状态',
|
|
|
|
|
dataIndex: 'orderStatus',
|
|
|
|
|
key: 'orderStatus',
|
|
|
|
|
width: 120,
|
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
if (index === 1) return text + '(一催)'
|
|
|
|
|
else if (index === 2) return text + '(二催)'
|
|
|
|
|
else if (index === 3) return text + '(三催)'
|
|
|
|
|
else return text
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '报价title',
|
|
|
|
|
dataIndex: 'trip',
|
|
|
|
|
key: 'trip',
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '客人最后一次回复时间',
|
|
|
|
|
dataIndex: 'lastMessage',
|
|
|
|
|
key: 'lastMessage',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '附加信息',
|
|
|
|
|
dataIndex: 'comment',
|
|
|
|
|
key: 'comment',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
const { RangePicker } = DatePicker
|
|
|
|
|
|
|
|
|
|
const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
const [form] = Form.useForm()
|
|
|
|
@ -221,10 +90,99 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function OrderList({ formValues }) {
|
|
|
|
|
|
|
|
|
|
const orderColumns = [
|
|
|
|
|
{
|
|
|
|
|
title: '订单号',
|
|
|
|
|
dataIndex: 'COLI_ID',
|
|
|
|
|
key: 'COLI_ID',
|
|
|
|
|
width: 222,
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
if (record.COLI_LineGrade === 240003) return <Space size='middle'>{text}<Tag color='red'>重点</Tag></Space>
|
|
|
|
|
else if (record.COLI_LineGrade === 240002) return <Space size='middle'>{text}<Tag color='green'>潜力</Tag></Space>
|
|
|
|
|
else if (record.COLI_LineGrade === 240001) return <Space size='middle'>{text}<Tag color='blue'>休眠</Tag></Space>
|
|
|
|
|
else return <Space size='middle'>{text}</Space>
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '客人姓名',
|
|
|
|
|
dataIndex: 'coli_guest',
|
|
|
|
|
key: 'coli_guest',
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
let regularText = ''
|
|
|
|
|
if (record.buytime > 0) regularText = '(R' + record.buytime + ')'
|
|
|
|
|
return (
|
|
|
|
|
<Space size='middle'>
|
|
|
|
|
<a>{text + regularText}</a>
|
|
|
|
|
<Badge
|
|
|
|
|
count={record.unread_msg}
|
|
|
|
|
style={{
|
|
|
|
|
backgroundColor: '#52c41a',
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Space>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '订单状态',
|
|
|
|
|
dataIndex: 'COLI_State',
|
|
|
|
|
key: 'COLI_State',
|
|
|
|
|
width: 120,
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
let extra = ''
|
|
|
|
|
if (record.RemindState === 1) extra = '(一催)'
|
|
|
|
|
if (record.RemindState === 2) extra = '(二催)'
|
|
|
|
|
if (record.RemindState === 3) extra = '(三催)'
|
|
|
|
|
return text + extra
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '报价title',
|
|
|
|
|
dataIndex: 'lettertitle',
|
|
|
|
|
key: 'lettertitle',
|
|
|
|
|
ellipsis: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '客人最后一次回复时间',
|
|
|
|
|
dataIndex: 'last_received_time',
|
|
|
|
|
key: 'last_received_time',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '附加信息',
|
|
|
|
|
dataIndex: 'COLI_Introduction',
|
|
|
|
|
key: 'COLI_Introduction',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const [orderData, setOrderData] = useState([])
|
|
|
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
|
const { loginUser } = useAuthContext()
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setLoading(true)
|
|
|
|
|
fetch(`http://202.103.68.157:8888/gettodayorder?opisn=${loginUser.userId}`)
|
|
|
|
|
.then(response => response.json())
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode === 0) {
|
|
|
|
|
setOrderData([...json.result])
|
|
|
|
|
setLoading(false)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(reason => {
|
|
|
|
|
console.info(reason)
|
|
|
|
|
})
|
|
|
|
|
}, [formValues])
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Table loading={loading} dataSource={orderData} columns={orderColumns} />
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
function OrderFollow() {
|
|
|
|
|
|
|
|
|
|
const [advanceChecked, toggleAdvance] = useState(false)
|
|
|
|
|
const [searchCriteria, setSearchCriteria] = useState({
|
|
|
|
|
const [formValues, setFormValues] = useState({
|
|
|
|
|
type: 'today',
|
|
|
|
|
orderStatus: '新状态',
|
|
|
|
|
orderNumber: '订单号',
|
|
|
|
@ -232,16 +190,8 @@ function OrderFollow() {
|
|
|
|
|
startDate: '走团时间'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const orderListMemo = useMemo(() => <OrderList searchCriteria={searchCriteria} />, [searchCriteria])
|
|
|
|
|
|
|
|
|
|
const handleSubmit = useCallback((criteria) => {
|
|
|
|
|
setSearchCriteria({
|
|
|
|
|
...criteria,
|
|
|
|
|
type: 'advance'
|
|
|
|
|
})
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const handleSubmit = useCallback((values) => {
|
|
|
|
|
setFormValues({...values, type: 'advance'})
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
@ -257,10 +207,10 @@ function OrderFollow() {
|
|
|
|
|
{ label: '走团中', value: 'ing' },
|
|
|
|
|
{ label: '走团后一月', value: 'lastMonth' }
|
|
|
|
|
]}
|
|
|
|
|
value={searchCriteria.type}
|
|
|
|
|
value={formValues.type}
|
|
|
|
|
onChange={({ target: { value } }) => {
|
|
|
|
|
setSearchCriteria({
|
|
|
|
|
...searchCriteria,
|
|
|
|
|
setFormValues({
|
|
|
|
|
...formValues,
|
|
|
|
|
type: value
|
|
|
|
|
})
|
|
|
|
|
}}
|
|
|
|
@ -277,18 +227,9 @@ function OrderFollow() {
|
|
|
|
|
/>
|
|
|
|
|
</Space>
|
|
|
|
|
<Divider plain orientation='left'></Divider>
|
|
|
|
|
{orderListMemo}
|
|
|
|
|
<OrderList formValues={formValues} />
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
function OrderList({ searchCriteria }) {
|
|
|
|
|
console.info(searchCriteria)
|
|
|
|
|
const countryList = useGetJson(`https://p9axztuwd7x8a7.mycht.cn/service-InfoSys/InfoSys/GetCountryList`)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Table loading={countryList === null} dataSource={countryList === null ? null : dataSource} columns={columns} />
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default OrderFollow
|
|
|
|
|