显示订单报价列表

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

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

@ -77,7 +77,7 @@ function AuthApp() {
selectedKeys={[defaultPath]}
items={[
{ 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: '/sales/management', label: <Link to='/sales/management'>销售管理</Link> }
]}

@ -1,6 +1,6 @@
import { useEffect } from 'react'
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 { 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 { order_sn: order_sn } = useParams()
const { orderDetail, customerDetail, lastQuotation,
const { orderDetail, customerDetail, lastQuotation, quotationList,
fetchOrderDetail, setOrderPropValue
} = useOrderStore()
@ -18,6 +18,14 @@ const CustomerProfile = (() => {
fetchOrderDetail(order_sn)
}, [order_sn])
const paginationProps = {
showLessItems: true,
showTotal: (total) => { return `总数:${total}` }
}
let regularText = ''
if (orderDetail.buytime > 0) regularText = '(R' + orderDetail.buytime + ')'
return (
<div className=' divide-x-0 divide-y divide-dashed divide-gray-300 '>
<Card className='p-2 '
@ -65,7 +73,7 @@ const CustomerProfile = (() => {
>
<Flex gap={10}>
<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 ><MailOutlined className=' pr-1' />{customerDetail.email}</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>
<p className='m-0 py-2 line-clamp-2 '><a target='_blank' href={lastQuotation.letterurl}>{lastQuotation.lettertitle}<LinkOutlined /></a></p>
<Flex justify={'space-between'} >
<CreatePayment />
<QuotesHistory />
</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>
<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>

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

Loading…
Cancel
Save