|
|
|
@ -4,6 +4,8 @@ import { useEffect, useState } from 'react'
|
|
|
|
|
import { App, Flex, Select, Tooltip, Divider, Typography, Skeleton, Checkbox } from 'antd'
|
|
|
|
|
import { useOrderStore, fetchSetRemindStateAction, OrderLabelDefaultOptions, OrderStatusDefaultOptions, remindStatusOptions } from '@/stores/OrderStore'
|
|
|
|
|
import { copy, isEmpty } from '@/utils/commons'
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow'
|
|
|
|
|
import useConversationStore from '@/stores/ConversationStore'
|
|
|
|
|
const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
|
const { notification, message } = App.useApp()
|
|
|
|
|
|
|
|
|
@ -21,11 +23,14 @@ const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
|
s.appendOrderComment,
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
const currentOrder = useConversationStore(useShallow(state => state.currentConversation?.coli_sn || ""))
|
|
|
|
|
const orderId = coliSN || currentOrder
|
|
|
|
|
|
|
|
|
|
const [orderRemindState, setOrderRemindState] = useState(orderDetail.remindstate)
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (coliSN) {
|
|
|
|
|
if (orderId) {
|
|
|
|
|
setLoading(true)
|
|
|
|
|
fetchOrderDetail(coliSN)
|
|
|
|
|
fetchOrderDetail(orderId)
|
|
|
|
|
.finally(() => setLoading(false))
|
|
|
|
|
.catch((reason) => {
|
|
|
|
|
notification.error({
|
|
|
|
@ -37,7 +42,7 @@ const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
return () => {}
|
|
|
|
|
}, [coliSN])
|
|
|
|
|
}, [orderId])
|
|
|
|
|
|
|
|
|
|
const handleSetRemindState = async (checkedValue) => {
|
|
|
|
|
const state = checkedValue.filter((v) => v !== orderRemindState)
|
|
|
|
|