import { LinkOutlined, MailOutlined, PhoneOutlined, UserOutlined, WhatsAppOutlined } from '@ant-design/icons' 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, OrderLabelDefaultOptions, OrderStatusDefaultOptions } from '@/stores/OrderStore' import QuotesHistory from './QuotesHistory' const CustomerProfile = (() => { 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) fetchOrderDetail(currentOrder) .finally(() => setLoading(false)) .catch(reason => { notification.error({ message: '查询出错', description: reason.message, placement: 'top', duration: 60, }) }) } }, [currentOrder]) let regularText = '' if (orderDetail.buytime > 0) regularText = '(R' + orderDetail.buytime + ')' if (currentOrder) { return (
{ setOrderPropValue(currentOrder, 'orderlabel', value) .then(() => { message.success('设置成功') }) .catch(reason => { notification.error({ message: '设置出错', description: reason.message, placement: 'top', duration: 60, }) }) }} value={orderDetail.tags} options={orderLabelOptions} />,