显示订单报价列表

dev/mobile
Jimmy Liow 2 years ago
parent 6979a1eabf
commit 339e794553

@ -12,6 +12,8 @@ const useOrderStore = create((set, get) => ({
lastQuotation: {}, lastQuotation: {},
quotationList: [],
fetchOrderDetail: async (colisn) => { fetchOrderDetail: async (colisn) => {
const json = await fetchJSON(`${API_HOST}/getorderinfo`, { colisn }) const json = await fetchJSON(`${API_HOST}/getorderinfo`, { colisn })
if (json.errcode === 0 && json.result.length > 0) { if (json.errcode === 0 && json.result.length > 0) {
@ -20,6 +22,7 @@ const useOrderStore = create((set, get) => ({
orderDetail: orderResult, orderDetail: orderResult,
customerDetail: orderResult.contact.length > 0 ? orderResult.contact[0] : {}, customerDetail: orderResult.contact.length > 0 ? orderResult.contact[0] : {},
lastQuotation: orderResult.quotes.length > 0 ? orderResult.quotes[0] : {}, lastQuotation: orderResult.quotes.length > 0 ? orderResult.quotes[0] : {},
quotationList: orderResult.quotes,
})) }))
} }
}, },

@ -77,7 +77,7 @@ function AuthApp() {
selectedKeys={[defaultPath]} selectedKeys={[defaultPath]}
items={[ items={[
{ key: '/order/follow', label: <Link to='/order/follow'>订单跟踪</Link> }, { key: '/order/follow', label: <Link to='/order/follow'>订单跟踪</Link> },
{ key: '/order/chat', label: <Link to='/order/chat'>销售聊天</Link> }, { key: '/order/chat', label: <Link to='/order/chat'>在线聊天</Link> },
{ key: '/chat/history', label: <Link to='/chat/history'>聊天历史</Link> }, { key: '/chat/history', label: <Link to='/chat/history'>聊天历史</Link> },
{ key: '/sales/management', label: <Link to='/sales/management'>销售管理</Link> } { key: '/sales/management', label: <Link to='/sales/management'>销售管理</Link> }
]} ]}

@ -1,6 +1,6 @@
import { useEffect } from 'react' import { useEffect } from 'react'
import { useLocation, useParams } from 'react-router-dom' import { useLocation, useParams } from 'react-router-dom'
import { Card, Flex, Select, Typography, Radio, Button, Table } from 'antd' import { Card, Flex, Select, Typography, List, Button, Table } from 'antd'
import { useAuthContext } from '@/stores/AuthContext.js' import { useAuthContext } from '@/stores/AuthContext.js'
import { UserOutlined, LinkOutlined, EllipsisOutlined, SmileOutlined, SyncOutlined, PhoneOutlined, MailOutlined, WhatsAppOutlined, SmileTwoTone } from '@ant-design/icons' import { UserOutlined, LinkOutlined, EllipsisOutlined, SmileOutlined, SyncOutlined, PhoneOutlined, MailOutlined, WhatsAppOutlined, SmileTwoTone } from '@ant-design/icons'
@ -10,7 +10,7 @@ import useOrderStore from '@/stores/OrderStore'
const CustomerProfile = (() => { const CustomerProfile = (() => {
const { order_sn: order_sn } = useParams() const { order_sn: order_sn } = useParams()
const { orderDetail, customerDetail, lastQuotation, const { orderDetail, customerDetail, lastQuotation, quotationList,
fetchOrderDetail, setOrderPropValue fetchOrderDetail, setOrderPropValue
} = useOrderStore() } = useOrderStore()
@ -18,6 +18,14 @@ const CustomerProfile = (() => {
fetchOrderDetail(order_sn) fetchOrderDetail(order_sn)
}, [order_sn]) }, [order_sn])
const paginationProps = {
showLessItems: true,
showTotal: (total) => { return `总数:${total}` }
}
let regularText = ''
if (orderDetail.buytime > 0) regularText = '(R' + orderDetail.buytime + ')'
return ( return (
<div className=' divide-x-0 divide-y divide-dashed divide-gray-300 '> <div className=' divide-x-0 divide-y divide-dashed divide-gray-300 '>
<Card className='p-2 ' <Card className='p-2 '
@ -65,7 +73,7 @@ const CustomerProfile = (() => {
> >
<Flex gap={10}> <Flex gap={10}>
<Flex vertical={true} justify='space-between'> <Flex vertical={true} justify='space-between'>
<Typography.Text ><UserOutlined className=' pr-1' />{customerDetail.name}</Typography.Text> <Typography.Text ><UserOutlined className=' pr-1' />{customerDetail.name + regularText}</Typography.Text>
<Typography.Text ><PhoneOutlined className=' pr-1' />{customerDetail.phone}</Typography.Text> <Typography.Text ><PhoneOutlined className=' pr-1' />{customerDetail.phone}</Typography.Text>
<Typography.Text ><MailOutlined className=' pr-1' />{customerDetail.email}</Typography.Text> <Typography.Text ><MailOutlined className=' pr-1' />{customerDetail.email}</Typography.Text>
<Typography.Text ><WhatsAppOutlined className='pr-1' />{customerDetail.whatsapp_phone_number}</Typography.Text> <Typography.Text ><WhatsAppOutlined className='pr-1' />{customerDetail.whatsapp_phone_number}</Typography.Text>
@ -76,9 +84,24 @@ const CustomerProfile = (() => {
<Typography.Text strong>最新报价</Typography.Text> <Typography.Text strong>最新报价</Typography.Text>
<p className='m-0 py-2 line-clamp-2 '><a target='_blank' href={lastQuotation.letterurl}>{lastQuotation.lettertitle}<LinkOutlined /></a></p> <p className='m-0 py-2 line-clamp-2 '><a target='_blank' href={lastQuotation.letterurl}>{lastQuotation.lettertitle}<LinkOutlined /></a></p>
<Flex justify={'space-between'} > <Flex justify={'space-between'} >
<CreatePayment />
<QuotesHistory /> <QuotesHistory />
</Flex> </Flex>
<List
itemLayout="vertical"
pagination={paginationProps}
dataSource={quotationList}
renderItem={(item) => (
<List.Item
key={item.letterid}
>
<List.Item.Meta
title={<a href={item.letterurl}>{item.lettertitle}</a>}
description={item.letterdate}
/>
</List.Item>
)}
/>
</Flex> </Flex>
<p className='p-2 shadow-inner overflow-auto max-h-72 m-0 break-words whitespace-pre-wrap ' dangerouslySetInnerHTML={{__html: orderDetail.order_detail}}></p> <p className='p-2 shadow-inner overflow-auto max-h-72 m-0 break-words whitespace-pre-wrap ' dangerouslySetInnerHTML={{__html: orderDetail.order_detail}}></p>
</div> </div>

@ -276,46 +276,46 @@ function OrderList({ formValues }) {
const deptMap = new Map([ const deptMap = new Map([
['1', 'CH直销组'], ['1', 'CH直销组'],
['2','CH大客户组'], ['2', 'CH大客户组'],
['7','市场推广'], ['7', '市场推广'],
['8','德语市场'], ['8', '德语市场'],
['9','日语市场'], ['9', '日语市场'],
['10', '商旅市场'], ['10', '商旅市场'],
['11', '法语市场'], ['11', '法语市场'],
['12', '西语市场'], ['12', '西语市场'],
['13', '英文在线组'], ['13', '英文在线组'],
['14', '商务Biztravel'], ['14', '商务Biztravel'],
['15', 'CH产品'], ['15', 'CH产品'],
['16', 'APP移动项目组'], ['16', 'APP移动项目组'],
['17', 'ChinaTravel组'], ['17', 'ChinaTravel组'],
['18', 'CT市场'], ['18', 'CT市场'],
['20', '俄语市场'], ['20', '俄语市场'],
['21', '意语市场'], ['21', '意语市场'],
['22', '爱游网'], ['22', '爱游网'],
['23', '三峡站'], ['23', '三峡站'],
['24', '桂林站'], ['24', '桂林站'],
['25', '上海站'], ['25', '上海站'],
['26', '北京站'], ['26', '北京站'],
['27', '西藏站'], ['27', '西藏站'],
['28', 'AH亚洲项目组'], ['28', 'AH亚洲项目组'],
['29', 'DMC地接组'], ['29', 'DMC地接组'],
['30', 'Trippest项目组'], ['30', 'Trippest项目组'],
['31', '花梨鹰'], ['31', '花梨鹰'],
['32', 'Daytours板块'], ['32', 'Daytours板块'],
['33', 'GH项目组'], ['33', 'GH项目组'],
['34', 'trippest网站'], ['34', 'trippest网站'],
['35', 'newsletter营销'], ['35', 'newsletter营销'],
]) ])
const groupOrderData = groupByParam(orderData, 'OPI_DEI_SN') const groupOrderData = groupByParam(orderData, 'OPI_DEI_SN')
const deptKeys = Object.keys(groupOrderData) const deptKeys = Object.keys(groupOrderData)
const collapseItems = [] const collapseItems = []
deptKeys.forEach(deptNo => { deptKeys.forEach((deptNo, index) => {
const deptOrderList = groupOrderData[deptNo] const deptOrderList = groupOrderData[deptNo]
collapseItems.push( collapseItems.push(
{ {
key: deptNo, key: index,
label: deptMap.get(deptNo) + '订单', label: deptMap.get(deptNo) + '订单',
children: <Table key={'Order Table' + deptNo} loading={loading} dataSource={deptOrderList} children: <Table key={'Order Table' + deptNo} loading={loading} dataSource={deptOrderList}
columns={orderColumns} columns={orderColumns}
@ -324,8 +324,9 @@ function OrderList({ formValues }) {
) )
}) })
return (<Collapse bordered={false} activeKey={deptKeys} items={collapseItems} />) return (<Collapse bordered={false} defaultActiveKey={0} items={collapseItems} />)
} }
function OrderFollow() { function OrderFollow() {
const [advanceChecked, toggleAdvance] = useState(false) const [advanceChecked, toggleAdvance] = useState(false)

Loading…
Cancel
Save