|
|
|
@ -2,19 +2,25 @@ import { LinkOutlined, MailOutlined, PhoneOutlined, UserOutlined, WhatsAppOutlin
|
|
|
|
|
import { App, Button, Card, Empty, Flex, Select, Spin, Typography } from 'antd'
|
|
|
|
|
import { useEffect, useState } from 'react'
|
|
|
|
|
|
|
|
|
|
import { copy, isNotEmpty } from '@/utils/commons'
|
|
|
|
|
import { Conditional } from '@/components/Conditional'
|
|
|
|
|
import useConversationStore from '@/stores/ConversationStore'
|
|
|
|
|
import useOrderStore from '@/stores/OrderStore'
|
|
|
|
|
import { useOrderStore, OrderLabelDefaultOptions, OrderStatusDefaultOptions } from '@/stores/OrderStore'
|
|
|
|
|
import QuotesHistory from './QuotesHistory'
|
|
|
|
|
|
|
|
|
|
const CustomerProfile = (() => {
|
|
|
|
|
const { notification } = App.useApp()
|
|
|
|
|
const { notification, message } = App.useApp()
|
|
|
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
|
const currentOrder = useConversationStore((state) => state.currentConversation?.coli_sn || '')
|
|
|
|
|
const { orderDetail, customerDetail, lastQuotation, quotationList,
|
|
|
|
|
fetchOrderDetail, setOrderPropValue
|
|
|
|
|
} = useOrderStore()
|
|
|
|
|
|
|
|
|
|
const orderLabelOptions = copy(OrderLabelDefaultOptions)
|
|
|
|
|
orderLabelOptions.unshift({ value: 0, label: '未设置', disabled: true, })
|
|
|
|
|
|
|
|
|
|
const orderStatusOptions = copy(OrderStatusDefaultOptions)
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (currentOrder) {
|
|
|
|
|
setLoading(true)
|
|
|
|
@ -36,7 +42,7 @@ const CustomerProfile = (() => {
|
|
|
|
|
|
|
|
|
|
if (currentOrder) {
|
|
|
|
|
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'>
|
|
|
|
|
<Spin spinning={loading}>
|
|
|
|
|
<Card className='p-2 '
|
|
|
|
|
bordered={false}
|
|
|
|
@ -48,15 +54,21 @@ const CustomerProfile = (() => {
|
|
|
|
|
}}
|
|
|
|
|
variant='borderless'
|
|
|
|
|
onSelect={(value) => {
|
|
|
|
|
setOrderPropValue(order_sn, 'orderlabel', value)
|
|
|
|
|
setOrderPropValue(currentOrder, 'orderlabel', value)
|
|
|
|
|
.then(() => {
|
|
|
|
|
message.success('设置成功')
|
|
|
|
|
})
|
|
|
|
|
.catch(reason => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: '设置出错',
|
|
|
|
|
description: reason.message,
|
|
|
|
|
placement: 'top',
|
|
|
|
|
duration: 60,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}}
|
|
|
|
|
value={orderDetail.tags}
|
|
|
|
|
options={[
|
|
|
|
|
{ value: 0, label: '未设置', disabled: true, },
|
|
|
|
|
{ value: 240003, label: '重点' },
|
|
|
|
|
{ value: 240002, label: '次重点' },
|
|
|
|
|
{ value: 240001, label: '一般' }
|
|
|
|
|
]}
|
|
|
|
|
options={orderLabelOptions}
|
|
|
|
|
/>,
|
|
|
|
|
<Select
|
|
|
|
|
style={{
|
|
|
|
@ -64,19 +76,21 @@ const CustomerProfile = (() => {
|
|
|
|
|
}}
|
|
|
|
|
variant='borderless'
|
|
|
|
|
onSelect={(value) => {
|
|
|
|
|
setOrderPropValue(order_sn,'orderstatus', value)
|
|
|
|
|
setOrderPropValue(currentOrder,'orderstatus', value)
|
|
|
|
|
.then(() => {
|
|
|
|
|
message.success('设置成功')
|
|
|
|
|
})
|
|
|
|
|
.catch(reason => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: '设置出错',
|
|
|
|
|
description: reason.message,
|
|
|
|
|
placement: 'top',
|
|
|
|
|
duration: 60,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}}
|
|
|
|
|
value={orderDetail.states}
|
|
|
|
|
options={[
|
|
|
|
|
{ value: 1, label: '新订单' },
|
|
|
|
|
{ value: 2, label: '报价中' },
|
|
|
|
|
{ value: 3, label: '以后联系' },
|
|
|
|
|
{ value: 4, label: '等待付订金' },
|
|
|
|
|
{ value: 5, label: '成行' },
|
|
|
|
|
{ value: 6, label: '丢失' },
|
|
|
|
|
{ value: 7, label: '取消' },
|
|
|
|
|
{ value: 8, label: '未报价' }
|
|
|
|
|
]}
|
|
|
|
|
options={orderStatusOptions}
|
|
|
|
|
/>
|
|
|
|
|
]}
|
|
|
|
|
>
|
|
|
|
|