|
|
|
@ -17,12 +17,17 @@ const CustomerProfile = () => {
|
|
|
|
|
const { notification, message } = App.useApp();
|
|
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
|
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
|
|
|
const [currentOrderNumber, setOrderNumber] = useState(false);
|
|
|
|
|
const orderCommentRef = useRef(null);
|
|
|
|
|
const currentOrder = useConversationStore(state => state.currentConversation?.coli_sn || "");
|
|
|
|
|
const currentConversationID = useConversationStore(state => state.currentConversation?.sn || "");
|
|
|
|
|
const [updateCurrentConversation] = useConversationStore(state => [state.updateCurrentConversation]);
|
|
|
|
|
const loginUser = useAuthStore(state => state.loginUser);
|
|
|
|
|
const { orderDetail, customerDetail, lastQuotation, quotationList, fetchOrderDetail, setOrderPropValue, appendOrderComment } = useOrderStore();
|
|
|
|
|
const [
|
|
|
|
|
orderDetail, customerDetail, lastQuotation, quotationList, fetchOrderDetail, setOrderPropValue, appendOrderComment, fetchOtherEmail, otherEmailList
|
|
|
|
|
] = useOrderStore(s => [
|
|
|
|
|
s.orderDetail, s.customerDetail, s.lastQuotation, s.quotationList, s.fetchOrderDetail, s.setOrderPropValue, s.appendOrderComment, s.fetchOtherEmail, s.otherEmailList
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const navigate = useNavigate();
|
|
|
|
|
const orderLabelOptions = copy(OrderLabelDefaultOptions);
|
|
|
|
@ -34,6 +39,9 @@ const CustomerProfile = () => {
|
|
|
|
|
if (currentOrder) {
|
|
|
|
|
setLoading(true);
|
|
|
|
|
fetchOrderDetail(currentOrder)
|
|
|
|
|
.then(result => {
|
|
|
|
|
setOrderNumber(result.orderDetail.order_no)
|
|
|
|
|
})
|
|
|
|
|
.finally(() => setLoading(false))
|
|
|
|
|
.catch(reason => {
|
|
|
|
|
notification.error({
|
|
|
|
@ -43,6 +51,21 @@ const CustomerProfile = () => {
|
|
|
|
|
duration: 60,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fetchOtherEmail('1118878')//currentOrder)
|
|
|
|
|
.then(result => {
|
|
|
|
|
console.info(result)
|
|
|
|
|
})
|
|
|
|
|
.finally(() => setLoading(false))
|
|
|
|
|
.catch(reason => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: "查询出错",
|
|
|
|
|
description: reason.message,
|
|
|
|
|
placement: "top",
|
|
|
|
|
duration: 60,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, [currentOrder]);
|
|
|
|
|
|
|
|
|
@ -58,6 +81,10 @@ const CustomerProfile = () => {
|
|
|
|
|
setNewChatModalVisible(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const renderOtherEmailList = () => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentOrder) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="divide-x-0 divide-y divide-dashed divide-gray-300">
|
|
|
|
@ -65,7 +92,17 @@ const CustomerProfile = () => {
|
|
|
|
|
<Card
|
|
|
|
|
className="p-2 "
|
|
|
|
|
bordered={false}
|
|
|
|
|
title={orderDetail.order_no}
|
|
|
|
|
title={<Select
|
|
|
|
|
style={{
|
|
|
|
|
width: "100%",
|
|
|
|
|
}}
|
|
|
|
|
variant="borderless"
|
|
|
|
|
value={currentOrderNumber}
|
|
|
|
|
options={[
|
|
|
|
|
{ value: '-1', label: '全部' },
|
|
|
|
|
{ value: currentOrderNumber, label: currentOrderNumber }
|
|
|
|
|
]}
|
|
|
|
|
/>}
|
|
|
|
|
actions={[
|
|
|
|
|
<Select
|
|
|
|
|
key={"orderlabel"}
|
|
|
|
@ -173,10 +210,7 @@ const CustomerProfile = () => {
|
|
|
|
|
</Divider>
|
|
|
|
|
|
|
|
|
|
<List
|
|
|
|
|
dataSource={[
|
|
|
|
|
{from: 'nuttour@yahoo.com', subject: 'I have received but I am unable to find his name'},
|
|
|
|
|
{from: 'cuijie121212@kha.biglobe.ne.jp', subject: 'Originally we had included alsisar haveli.'}
|
|
|
|
|
]}
|
|
|
|
|
dataSource={otherEmailList}
|
|
|
|
|
renderItem={(email) => (
|
|
|
|
|
<List.Item
|
|
|
|
|
className='hover:bg-stone-50'
|
|
|
|
@ -186,8 +220,9 @@ const CustomerProfile = () => {
|
|
|
|
|
<Flex
|
|
|
|
|
vertical
|
|
|
|
|
>
|
|
|
|
|
<div><b>From: </b><Typography.Text ellipsis={true}>{email.from}</Typography.Text></div>
|
|
|
|
|
<div><b>Subject: </b>{email.subject}</div>
|
|
|
|
|
<div><Typography.Text ellipsis={{tooltip: email.SenderReceiver}} style={{width: 280}}><b>From: </b>{email.SenderReceiver}</Typography.Text></div>
|
|
|
|
|
<div><Typography.Text ellipsis={{tooltip: email.MAI_Subject}} style={{width: 280}}><b>Subject: </b>{email.MAI_Subject}</Typography.Text></div>
|
|
|
|
|
<Tag>{email.MAI_COLI_ID}</Tag>
|
|
|
|
|
</Flex>
|
|
|
|
|
</List.Item>
|
|
|
|
|
)}
|
|
|
|
|