Merge remote-tracking branch 'origin/main' into dev/chat

dev/chat
Lei OT 2 years ago
commit 2a333c1e45

@ -53,7 +53,7 @@ const router = createBrowserRouter([
ReactDOM.createRoot(document.getElementById('root')).render( ReactDOM.createRoot(document.getElementById('root')).render(
// <React.StrictMode> // <React.StrictMode>
<ThemeContext.Provider value={{ colorPrimary: '#1ba784', borderRadius: 4 }}> <ThemeContext.Provider value={{ colorPrimary: '#1ba784', borderRadius: 4 }}>
<AuthContext.Provider value={{ loginUser: { userId: 354 } }}> <AuthContext.Provider value={{ loginUser: { userId: 354, username: '廖一军', accountList: ['LYJ', 'LYJAH', 'LYJGH'] } }}>
<ConversationProvider> <ConversationProvider>
<RouterProvider router={router} fallbackElement={() => <div>Loading...</div>} /> <RouterProvider router={router} fallbackElement={() => <div>Loading...</div>} />
</ConversationProvider> </ConversationProvider>

@ -1,8 +1,10 @@
import { useEffect } from 'react' import { useEffect } from 'react'
import { import {
Row, Col, Space, Descriptions, Avatar, Radio Row, Col, Space, Descriptions, Avatar, Radio, Tag
} from 'antd' } from 'antd'
import {
UserOutlined
} from '@ant-design/icons'
import { useAuthContext } from '@/stores/AuthContext' import { useAuthContext } from '@/stores/AuthContext'
function AccountProfile() { function AccountProfile() {
@ -17,19 +19,11 @@ function AccountProfile() {
<Row> <Row>
<Col span={12} offset={6}> <Col span={12} offset={6}>
<Descriptions title='个人资料' layout='vertical' column={2}> <Descriptions title='个人资料' layout='vertical' column={2}>
<Descriptions.Item label='名字'><Space size='middle'><Avatar src={loginUser.avatarUrl} />{loginUser.username}</Space></Descriptions.Item> <Descriptions.Item label='名字'><Space size='middle'><Avatar src={loginUser.avatarUrl}>{loginUser.username.substring(1)}</Avatar>{loginUser.username}</Space></Descriptions.Item>
<Descriptions.Item label='HT 账号'> <Descriptions.Item label='HT 账号'>
{loginUser.accountName} {loginUser.accountList?.map(a => { return (
<Radio.Group <Tag icon={<UserOutlined />} bordered={false}>{a}</Tag>
options={[ )})}
{ label: 'LMY', value: '1' },
{ label: 'christy', value: '2' },
{ label: 'LMYGH', value: '3' }
]}
value='2'
optionType='button'
buttonStyle='solid'
/>
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label='手机'>{loginUser.mobile}</Descriptions.Item> <Descriptions.Item label='手机'>{loginUser.mobile}</Descriptions.Item>
<Descriptions.Item label='邮件'>{loginUser.email}</Descriptions.Item> <Descriptions.Item label='邮件'>{loginUser.email}</Descriptions.Item>

@ -90,7 +90,7 @@ function AuthApp() {
trigger={['click']} trigger={['click']}
> >
<a onClick={(e) => e.preventDefault()} style={{ color: colorPrimary }}> <a onClick={(e) => e.preventDefault()} style={{ color: colorPrimary }}>
<Space><Avatar src={loginUser.avatarUrl} />廖一军<DownOutlined /></Space> <Space><Avatar src={loginUser.avatarUrl}>{loginUser.username.substring(1)}</Avatar>{loginUser.username}<DownOutlined /></Space>
</a> </a>
</Dropdown> </Dropdown>

@ -1,16 +1,6 @@
import { import {
App, App, Badge, Button, DatePicker, Divider, Flex, Form, Input,
Badge, Radio, Row, Col, Select, Space, Switch, Table, Tag
Button,
DatePicker,
Divider,
Flex, Form,
Input,
Radio, Select,
Space,
Switch,
Table,
Tag
} from 'antd' } from 'antd'
import { memo, useCallback, useEffect, useState } from 'react' import { memo, useCallback, useEffect, useState } from 'react'
import { NavLink } from 'react-router-dom' import { NavLink } from 'react-router-dom'
@ -55,70 +45,79 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
} }
return ( return (
<Form <Form
layout={'inline'} layout={'vertical'}
form={form} form={form}
initialValues={{ orderLabel: '', orderStatus: '', initialValues={{
orderLabel: '', orderStatus: '', remindState: '',
startDateRange: [dayjs().startOf('M'), dayjs().endOf('M')] startDateRange: [dayjs().startOf('M'), dayjs().endOf('M')]
}} }}
onFinish={handleSubmit} onFinish={handleSubmit}
style={{
maxWidth: 'none',
}}
> >
<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='FirstName' name='firstName'>
<Input placeholder='FirstName' allowClear />
</Form.Item>
</Col>
<Col span={4}>
<Form.Item label='LastName' name='lastName'>
<Input placeholder='LastName' allowClear />
</Form.Item>
</Col>
<Col span={4}>
<Form.Item label='邮件地址/客人电话/传真' name='email'>
<Input placeholder='邮件地址/客人电话/传真' allowClear />
</Form.Item>
</Col>
</Row>
<Row justify='start' gutter={16}>
<Col span={2}>
<Form.Item label='标签' name='orderLabel'> <Form.Item label='标签' name='orderLabel'>
<Select <Select
style={{
width: 100,
}}
options={[ options={[
{ value: '', label: '全部' }, { value: '', label: '全部' },
{ value: '240003', label: '重点' }, { value: '240003', label: '重点' },
{ value: '240002', label: '潜力' }, { value: '240002', label: '次重点' },
{ value: '240001', label: '休眠' } { value: '240001', label: '一般' }
]} ]}
/> />
</Form.Item> </Form.Item>
</Col>
<Col span={2}>
<Form.Item label='状态' name='orderStatus'> <Form.Item label='状态' name='orderStatus'>
<Select <Select
style={{
width: 100,
}}
options={[ options={[
{ value: '', label: '全部' }, { value: '', label: '全部' },
{ { value: '1', label: '新订单' },
value: '1', { value: '2', label: '报价中' },
label: '新订单', { value: '3', label: '以后联系' },
}, { value: '4', label: '等待付订金' },
{ { value: '5', label: '成行' },
value: '2', { value: '6', label: '丢失' },
label: '报价中', { value: '7', label: '取消' }
},
{
value: '3',
label: '以后联系',
},
{
value: '4',
label: '等待付订金',
},
{
value: '5',
label: '成行',
},
{
value: '6',
label: '丢失',
},
{
value: '7',
label: '取消',
},
]} ]}
/> />
</Form.Item> </Form.Item>
<Form.Item label='订单号' name='orderNumber'> </Col>
<Input placeholder='订单号' allowClear /> <Col span={2}>
<Form.Item label='催信' name='remindState'>
<Select
options={[
{ value: '', label: '全部' },
{ value: '1', label: '一催' },
{ value: '2', label: '二催' },
{ value: '3', label: '三催' }
]}
/>
</Form.Item> </Form.Item>
</Col>
<Col span={4}>
<Form.Item label='出发日期' name='startDateRange'> <Form.Item label='出发日期' name='startDateRange'>
<RangePicker <RangePicker
allowClear={false} allowClear={false}
@ -126,16 +125,26 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
presets={DATE_PRESETS} presets={DATE_PRESETS}
/> />
</Form.Item> </Form.Item>
<Form.Item > </Col>
<Button type='primary' htmlType='submit'>搜索</Button> <Col span={4}>
<Form.Item label='确认日期' name='confirmDateRange'>
<RangePicker
allowClear={false}
inputReadOnly={true}
presets={DATE_PRESETS}
/>
</Form.Item> </Form.Item>
</Col>
<Col span={2}>
<Button type='primary' htmlType='submit'>搜索</Button>
</Col>
</Row>
</Form> </Form>
) )
}) })
function OrderList({ formValues }) { function OrderList({ formValues }) {
console.info(formValues)
const orderColumns = [ const orderColumns = [
{ {
title: '订单号', title: '订单号',
@ -143,8 +152,8 @@ function OrderList({ formValues }) {
width: 222, width: 222,
render: (text, record) => { render: (text, record) => {
if (record.COLI_LineGrade === 240003) return <Space>{text}<Tag color='red'>重点</Tag></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 === 240002) return <Space>{text}<Tag color='green'>次重点</Tag></Space>
else if (record.COLI_LineGrade === 240001) return <Space>{text}<Tag color='blue'>休眠</Tag></Space> else if (record.COLI_LineGrade === 240001) return <Space>{text}<Tag color='blue'>一般</Tag></Space>
else return <Space>{text}</Space> else return <Space>{text}</Space>
} }
}, },
@ -208,6 +217,7 @@ function OrderList({ formValues }) {
.append('enddate', thruDate) .append('enddate', thruDate)
.append('tag', formValues.orderLabel) .append('tag', formValues.orderLabel)
.append('orderstate', formValues.orderStatus) .append('orderstate', formValues.orderStatus)
.append('remindstate', formValues.remindState)
.append('coli_id', formValues.orderNumber) .append('coli_id', formValues.orderNumber)
.build() .build()
} }
@ -218,51 +228,7 @@ function OrderList({ formValues }) {
.then(response => response.json()) .then(response => response.json())
.then(json => { .then(json => {
if (json.errcode === 0) { if (json.errcode === 0) {
const testOrder = [{ setOrderData(json.result.map((order) => { return { ...order, key: order.COLI_ID } }))
"key": 240129001,
"COLI_SN": 240129001,
"COLI_ID": "LYJ240129001",
"unread_msg": Math.floor(Math.random() * (100 - 2 + 1) + 2),
"COLI_LineGrade": 240001,
"coli_guest": "LiaoYijun",
"buytime": 1,
"COLI_StateCode": 1,
"COLI_State": "新订单",
"lettertitle": "1st Trip Plan: 8-Day Essential Japan Family Trip with Disneyland",
"last_received_time": new Date().toDateString(),
"COLI_Introduction": "",
"RemindState": 0
},{
"key": 240129002,
"COLI_SN": 240129002,
"COLI_ID": "QQS240129002",
"unread_msg": Math.floor(Math.random() * (100 - 2 + 1) + 2),
"COLI_LineGrade": 240002,
"coli_guest": "QinQianSheng",
"buytime": 2,
"COLI_StateCode": 1,
"COLI_State": "新订单",
"lettertitle": "2nd Trip Plan: 2-Week Japan Private Family Vacation",
"last_received_time": new Date().toDateString(),
"COLI_Introduction": "",
"RemindState": 0
},{
"key": 240129003,
"COLI_SN": 240129003,
"COLI_ID": "LYT240129003",
"unread_msg": Math.floor(Math.random() * (100 - 2 + 1) + 2),
"COLI_LineGrade": 240003,
"coli_guest": "LeiYuanTing",
"buytime": 3,
"COLI_StateCode": 1,
"COLI_State": "新订单",
"lettertitle": "3rd Trip Plan: 12-Day Best of Thailand and Cambodia Tour",
"last_received_time": new Date().toDateString(),
"COLI_Introduction": "",
"RemindState": 0
}]
const fetchData = json.result.map((order) => { return {...order, key: order.COLI_ID}})
setOrderData([...testOrder, ...fetchData])
} else { } else {
notification.error({ notification.error({
message: '查询出错', message: '查询出错',
@ -290,7 +256,7 @@ function OrderList({ formValues }) {
showQuickJumper: true, showQuickJumper: true,
showLessItems: true, showLessItems: true,
showSizeChanger: true, showSizeChanger: true,
showTotal: (total) => {return `总数:${total}`} showTotal: (total) => { return `总数:${total}` }
}} /> }} />
) )
} }
@ -306,7 +272,7 @@ function OrderFollow() {
}) })
const handleSubmit = useCallback((values) => { const handleSubmit = useCallback((values) => {
setFormValues({...values, type: 'advance'}) setFormValues({ ...values, type: 'advance' })
}, []) }, [])
return ( return (
@ -317,7 +283,7 @@ function OrderFollow() {
options={[ options={[
{ label: '今日任务', value: 'today' }, { label: '今日任务', value: 'today' },
{ label: '重点订单', value: 'zhongdian' }, { label: '重点订单', value: 'zhongdian' },
{ label: '潜力客户', value: 'qianli' }, { label: '次重点客户', value: 'qianli' },
{ label: '成行', value: 'chengxing' }, { label: '成行', value: 'chengxing' },
{ label: '走团中', value: 'zoutuan' }, { label: '走团中', value: 'zoutuan' },
{ label: '走团后一月', value: 'zoutuanhou' } { label: '走团后一月', value: 'zoutuanhou' }

Loading…
Cancel
Save