|
|
|
@ -1,11 +1,21 @@
|
|
|
|
|
import { memo, useCallback, useEffect, useState } from 'react'
|
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
|
import {
|
|
|
|
|
Badge, Divider, Table, Button, Input,
|
|
|
|
|
Space, Tag, Radio, Select, Flex, Form, Switch, DatePicker, App
|
|
|
|
|
} from 'antd'
|
|
|
|
|
import { Conditional } from '@/components/Conditional'
|
|
|
|
|
import { useAuthContext } from '@/stores/AuthContext'
|
|
|
|
|
import {
|
|
|
|
|
App,
|
|
|
|
|
Badge,
|
|
|
|
|
Button,
|
|
|
|
|
DatePicker,
|
|
|
|
|
Divider,
|
|
|
|
|
Flex, Form,
|
|
|
|
|
Input,
|
|
|
|
|
Radio, Select,
|
|
|
|
|
Space,
|
|
|
|
|
Switch,
|
|
|
|
|
Table,
|
|
|
|
|
Tag
|
|
|
|
|
} from 'antd'
|
|
|
|
|
import { memo, useCallback, useEffect, useState } from 'react'
|
|
|
|
|
import { NavLink } from 'react-router-dom'
|
|
|
|
|
|
|
|
|
|
const { RangePicker } = DatePicker
|
|
|
|
|
|
|
|
|
@ -18,7 +28,7 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
<Form
|
|
|
|
|
layout={'inline'}
|
|
|
|
|
form={form}
|
|
|
|
|
initialValues={{ orderLabel: '全部' }}
|
|
|
|
|
initialValues={{ orderLabel: '全部', orderStatus: '全部' }}
|
|
|
|
|
onFinish={handleSubmit}
|
|
|
|
|
style={{
|
|
|
|
|
maxWidth: 'none',
|
|
|
|
@ -30,18 +40,9 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
width: 100,
|
|
|
|
|
}}
|
|
|
|
|
options={[
|
|
|
|
|
{
|
|
|
|
|
value: '潜力',
|
|
|
|
|
label: '潜力',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '重点',
|
|
|
|
|
label: '重点',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '休眠',
|
|
|
|
|
label: '休眠',
|
|
|
|
|
}
|
|
|
|
|
{ value: '240003', label: '重点' },
|
|
|
|
|
{ value: '240002', label: '潜力' },
|
|
|
|
|
{ value: '240001', label: '休眠' }
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
@ -81,7 +82,7 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
<Form.Item label='订单号' name='orderNumber'>
|
|
|
|
|
<Input placeholder='订单号' allowClear />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label='出发日期' name='startDate'>
|
|
|
|
|
<Form.Item label='出发日期' name='startDateRange'>
|
|
|
|
|
<RangePicker />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item >
|
|
|
|
@ -97,26 +98,23 @@ function OrderList({ formValues }) {
|
|
|
|
|
{
|
|
|
|
|
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>
|
|
|
|
|
if (record.COLI_LineGrade === 240003) return <Space>{text}<Tag color='red'>重点</Tag></Space>
|
|
|
|
|
else if (record.COLI_LineGrade === 240002) return <Space>{text}<Tag color='green'>潜力</Tag></Space>
|
|
|
|
|
else if (record.COLI_LineGrade === 240001) return <Space>{text}<Tag color='blue'>休眠</Tag></Space>
|
|
|
|
|
else return <Space>{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> */}
|
|
|
|
|
<Link to={'/order/chat/' + record.COLI_SN}>{text + regularText}</Link>
|
|
|
|
|
<Space>
|
|
|
|
|
<NavLink to={`/order/chat/${record.COLI_SN}`}>{text + regularText}</NavLink>
|
|
|
|
|
<Badge
|
|
|
|
|
count={record.unread_msg}
|
|
|
|
|
style={{
|
|
|
|
@ -130,7 +128,6 @@ function OrderList({ formValues }) {
|
|
|
|
|
{
|
|
|
|
|
title: '订单状态',
|
|
|
|
|
dataIndex: 'COLI_State',
|
|
|
|
|
key: 'COLI_State',
|
|
|
|
|
width: 120,
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
let extra = ''
|
|
|
|
@ -143,23 +140,20 @@ function OrderList({ formValues }) {
|
|
|
|
|
{
|
|
|
|
|
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 { notification } = App.useApp()
|
|
|
|
|
const [orderData, setOrderData] = useState([])
|
|
|
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
|
const { loginUser } = useAuthContext()
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
@ -168,7 +162,7 @@ function OrderList({ formValues }) {
|
|
|
|
|
.then(response => response.json())
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode === 0) {
|
|
|
|
|
setOrderData([...json.result])
|
|
|
|
|
setOrderData(json.result.map((order) => { return {...order, key: order.COLI_ID}}))
|
|
|
|
|
} else {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: '查询出错',
|
|
|
|
@ -190,7 +184,7 @@ function OrderList({ formValues }) {
|
|
|
|
|
}, [formValues])
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Table loading={loading} dataSource={orderData} columns={orderColumns} />
|
|
|
|
|
<Table key='Order Table' loading={loading} dataSource={orderData} columns={orderColumns} />
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
function OrderFollow() {
|
|
|
|
|