diff --git a/src/components/OrderProfile.jsx b/src/components/OrderProfile.jsx index b6eb710..dc150fd 100644 --- a/src/components/OrderProfile.jsx +++ b/src/components/OrderProfile.jsx @@ -1,168 +1,172 @@ -import { - WhatsAppOutlined, FileAddOutlined, MailOutlined, - PhoneOutlined, - UserOutlined, - FieldNumberOutlined, - SaveOutlined, CompassOutlined, CalendarOutlined, - HeartTwoTone, - MoneyCollectTwoTone, - FolderOutlined, - DeleteOutlined, EditOutlined, - FormOutlined -} from '@ant-design/icons' +import { WhatsAppOutlined, FileAddOutlined, MailOutlined, PhoneOutlined, UserOutlined, FieldNumberOutlined, CompassOutlined, CalendarOutlined, EditOutlined, CheckOutlined } from '@ant-design/icons' -import { useCallback, useEffect, useState } from 'react' -import { - Flex,Select,Tooltip, - Button, Space, Divider, Typography, - Input, Radio,Skeleton ,Checkbox, -} from 'antd' -import { InboxIcon, MailCheckIcon, MailUnreadIcon, SendPlaneFillIcon } from '@/components/Icons' -import { useOrderStore, OrderLabelDefaultOptions, OrderStatusDefaultOptions, remindStatusOptions, fetchSetRemindStateAction, remindStatusOptionsMapped } from "@/stores/OrderStore"; -import { copy, isEmpty } from "@/utils/commons"; -const OrderProfile = ({coliSN, ...props}) => { +import { useEffect, useState } from 'react' +import { App, Flex, Select, Tooltip, Tabs, Button, Divider, Typography, Skeleton, Checkbox } from 'antd' +import { useOrderStore, OrderLabelDefaultOptions, OrderStatusDefaultOptions, remindStatusOptions } from '@/stores/OrderStore' +import { copy } from '@/utils/commons' +const OrderProfile = ({ coliSN, ...props }) => { + const { notification, message } = App.useApp() - const [loading, setLoading] = useState(false); - const orderLabelOptions = copy(OrderLabelDefaultOptions); - orderLabelOptions.unshift({ value: 0, label: "未设置", disabled: true }); + const [loading, setLoading] = useState(false) + const orderLabelOptions = copy(OrderLabelDefaultOptions) + orderLabelOptions.unshift({ value: 0, label: '未设置', disabled: true }) - const orderStatusOptions = copy(OrderStatusDefaultOptions); - const [ - orderDetail, customerDetail, lastQuotation, quotationList, fetchOrderDetail, setOrderPropValue, appendOrderComment, fetchOtherEmail, otherEmailList, fetchHistoryOrder - ] = useOrderStore(s => [ - s.orderDetail, s.customerDetail, s.lastQuotation, s.quotationList, s.fetchOrderDetail, s.setOrderPropValue, s.appendOrderComment, s.fetchOtherEmail, s.otherEmailList, s.fetchHistoryOrder + const orderStatusOptions = copy(OrderStatusDefaultOptions) + const [orderDetail, customerDetail, fetchOrderDetail, setOrderPropValue, appendOrderComment] = useOrderStore((s) => [ + s.orderDetail, + s.customerDetail, + s.fetchOrderDetail, + s.setOrderPropValue, + s.appendOrderComment, ]) useEffect(() => { - if (coliSN) { - setLoading(true); - fetchOrderDetail(coliSN) - .then(result => { + if (coliSN) { + setLoading(true) + fetchOrderDetail(coliSN) + .then((result) => { console.info(result) }) - .finally(() => setLoading(false)) - // .catch(reason => { - // notification.error({ - // message: "查询出错", - // description: reason.message, - // placement: "top", - // duration: 60, - // }); - // }); - } + .finally(() => setLoading(false)) + .catch((reason) => { + notification.error({ + message: '查询出错', + description: reason.message, + placement: 'top', + duration: 60, + }) + }) + } return () => {} - }, [coliSN]); + }, [coliSN]) const regularText = () => { - if (orderDetail.buytime > 0) return "(R" + orderDetail.buytime + ")" + if (orderDetail.buytime > 0) return '(R' + orderDetail.buytime + ')' return '' } - return ( <> - - - - - {orderDetail.order_no} - - - - {customerDetail.name + regularText()} - - - - Thailand - - - - - - - - {customerDetail.email} - - - - - - - - 出发日期:2025-09-18,已下计划 - - - - - 订单状态 - - - { - }} - value={orderDetail.states} - options={orderStatusOptions} - /> - - - - 催信 - - + + + + + 2025-09-18 + + + + + + 已下计划 + + + + + 订单状态 + + + {}} + value={orderDetail.states} + options={orderStatusOptions} + /> + - - 表单信息 - - - - -

+ + 催信 + + - - 特殊要求 - - - {orderDetail.customer_request} - - - 外联备注 - - - {orderDetail.wl_memo} - + + 表单信息 + + + + +

+ + 特殊要求 + + {orderDetail.customer_request} + + 外联备注 + + + + + {orderDetail.wl_memo} - - 附加信息 - - - - - - 泰国马来水灯节 - + + 附加信息 + + + + + 泰国马来水灯节
)