|
|
|
@ -12,6 +12,7 @@ import QuotesHistory from "./QuotesHistory";
|
|
|
|
|
import ConversationBind from "./../ConversationBind";
|
|
|
|
|
import ConversationsNewItem from "./../ConversationsNewItem";
|
|
|
|
|
import { useConversationNewItem } from "@/hooks/useConversation";
|
|
|
|
|
import EmailDetail from './../Components/EmailDetail';
|
|
|
|
|
|
|
|
|
|
const CustomerProfile = () => {
|
|
|
|
|
const { notification, message } = App.useApp();
|
|
|
|
@ -22,6 +23,7 @@ const CustomerProfile = () => {
|
|
|
|
|
const currentOrder = useConversationStore(state => state.currentConversation?.coli_sn || "");
|
|
|
|
|
const currentConversationID = useConversationStore(state => state.currentConversation?.sn || "");
|
|
|
|
|
const [updateCurrentConversation] = useConversationStore(state => [state.updateCurrentConversation]);
|
|
|
|
|
const [emailMsg, setEmailMsg, detailPopupOpen, setDetailOpen, openDetail] = useConversationStore(state => [state.emailMsg, state.setEmailMsg, state.detailPopupOpen, state.setDetailOpen, state.openDetail]);
|
|
|
|
|
const loginUser = useAuthStore(state => state.loginUser);
|
|
|
|
|
const [
|
|
|
|
|
orderDetail, customerDetail, lastQuotation, quotationList, fetchOrderDetail, setOrderPropValue, appendOrderComment, fetchOtherEmail, otherEmailList
|
|
|
|
@ -83,6 +85,23 @@ const CustomerProfile = () => {
|
|
|
|
|
|
|
|
|
|
const renderOtherEmailList = () => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const handleEmailClick = (emailItem) => {
|
|
|
|
|
const emailMsg = {
|
|
|
|
|
conversationid: currentConversationID,
|
|
|
|
|
order_opi: orderDetail.opi_sn,
|
|
|
|
|
coli_sn: currentOrder,
|
|
|
|
|
id: emailItem.MAI_SN,
|
|
|
|
|
msgOrigin: {
|
|
|
|
|
from: '',
|
|
|
|
|
to: '',
|
|
|
|
|
id: emailItem.MAI_SN,
|
|
|
|
|
email: { mai_sn: emailItem.MAI_SN, subject: emailItem.MAI_Subject, id: emailItem.MAI_SN },
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
setEmailMsg(emailMsg);
|
|
|
|
|
openDetail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentOrder) {
|
|
|
|
@ -220,9 +239,9 @@ const CustomerProfile = () => {
|
|
|
|
|
}
|
|
|
|
|
renderItem={(email) => (
|
|
|
|
|
<List.Item
|
|
|
|
|
className='hover:bg-stone-50'
|
|
|
|
|
className='hover:bg-stone-50 cursor-pointer'
|
|
|
|
|
onClick={() => {
|
|
|
|
|
console.info('email...')
|
|
|
|
|
handleEmailClick(email)
|
|
|
|
|
}}>
|
|
|
|
|
<Flex
|
|
|
|
|
vertical
|
|
|
|
@ -275,6 +294,8 @@ const CustomerProfile = () => {
|
|
|
|
|
</Button>
|
|
|
|
|
</Spin>
|
|
|
|
|
<ConversationsNewItem initialValues={newChatFormValues} open={newChatModalVisible} onCreate={handleNewChat} onCancel={() => setNewChatModalVisible(false)} />
|
|
|
|
|
<EmailDetail open={detailPopupOpen} setOpen={setDetailOpen} emailMsg={emailMsg} key={`supplier-email-detail-1-${emailMsg?.id}`} />
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|