diff --git a/src/components/OrderProfile.jsx b/src/components/OrderProfile.jsx index d36682d..49eb5de 100644 --- a/src/components/OrderProfile.jsx +++ b/src/components/OrderProfile.jsx @@ -1,7 +1,7 @@ import { WhatsAppOutlined, FileAddOutlined, MailOutlined, PhoneOutlined, UserOutlined, FieldNumberOutlined, CompassOutlined, CalendarOutlined, EditOutlined, CheckOutlined } from '@ant-design/icons' import { useEffect, useState } from 'react' -import { App, Flex, Select, Tooltip, Tabs, Button, Divider, Typography, Skeleton, Checkbox } from 'antd' +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' const OrderProfile = ({ coliSN, ...props }) => { @@ -21,7 +21,7 @@ const OrderProfile = ({ coliSN, ...props }) => { s.appendOrderComment, ]) - const [orderRemindState, setOrderRemindState] = useState(orderDetail.remindstate); + const [orderRemindState, setOrderRemindState] = useState(orderDetail.remindstate) useEffect(() => { if (coliSN) { setLoading(true) @@ -40,20 +40,20 @@ const OrderProfile = ({ coliSN, ...props }) => { }, [coliSN]) const handleSetRemindState = async (checkedValue) => { - const state = checkedValue.filter(v => v !== orderRemindState); - const oldState = orderRemindState; + const state = checkedValue.filter((v) => v !== orderRemindState) + const oldState = orderRemindState try { if (isEmpty(state)) { - setOrderRemindState(null); + setOrderRemindState(null) } else { - setOrderRemindState(state[0]); + setOrderRemindState(state[0]) } - await fetchSetRemindStateAction({ coli_sn: coliSN, remindstate: state }); - message.success('设置成功'); + await fetchSetRemindStateAction({ coli_sn: coliSN, remindstate: state }) + message.success('设置成功') } catch (error) { - notification.warning({ message: '设置失败', description: error.message, placement: 'top', duration: 60 }); - setOrderRemindState(oldState); + notification.warning({ message: '设置失败', description: error.message, placement: 'top', duration: 60 }) + setOrderRemindState(oldState) } } @@ -79,7 +79,7 @@ const OrderProfile = ({ coliSN, ...props }) => { })} /> */} - + {orderDetail.order_no} @@ -129,20 +129,20 @@ const OrderProfile = ({ coliSN, ...props }) => { width: '100%', }} variant='underlined' - onSelect={value => { - setOrderPropValue(coliSN, "orderlabel", value) - .then(() => { - message.success("设置成功"); - }) - .catch(reason => { - notification.error({ - message: "设置出错", - description: reason.message, - placement: "top", - duration: 60, - }); - }); - }} + onSelect={(value) => { + setOrderPropValue(coliSN, 'orderlabel', value) + .then(() => { + message.success('设置成功') + }) + .catch((reason) => { + notification.error({ + message: '设置出错', + description: reason.message, + placement: 'top', + duration: 60, + }) + }) + }} value={orderDetail.tags} options={orderLabelOptions} /> @@ -154,20 +154,20 @@ const OrderProfile = ({ coliSN, ...props }) => { width: '100%', }} variant='underlined' - onSelect={value => { - setOrderPropValue(coliSN, "orderstatus", value) - .then(() => { - message.success("设置成功"); - }) - .catch(reason => { - notification.error({ - message: "设置出错", - description: reason.message, - placement: "top", - duration: 60, - }); - }); - }} + onSelect={(value) => { + setOrderPropValue(coliSN, 'orderstatus', value) + .then(() => { + message.success('设置成功') + }) + .catch((reason) => { + notification.error({ + message: '设置出错', + description: reason.message, + placement: 'top', + duration: 60, + }) + }) + }} value={orderDetail.states} options={orderStatusOptions} /> @@ -176,7 +176,7 @@ const OrderProfile = ({ coliSN, ...props }) => { 催信 - + 表单信息 diff --git a/src/views/orders/components/MailBox.jsx b/src/views/orders/components/MailBox.jsx index 3b999d2..c062f7c 100644 --- a/src/views/orders/components/MailBox.jsx +++ b/src/views/orders/components/MailBox.jsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react' -import { ReloadOutlined, ReadOutlined, CheckSquareOutlined, RightOutlined, LeftOutlined, ExpandOutlined } from '@ant-design/icons' -import { Flex, Button, Tooltip, List, Form, Row, Col, Dropdown, Input, Checkbox, DatePicker, Switch, Breadcrumb, Skeleton } from 'antd' +import { ReloadOutlined, ReadOutlined, RightOutlined, LeftOutlined, ExpandOutlined } from '@ant-design/icons' +import { Flex, Button, Tooltip, List, Form, Row, Col, Input, Checkbox, DatePicker, Switch, Breadcrumb, Skeleton } from 'antd' import dayjs from 'dayjs' import { useEmailList } from '@/hooks/useEmail' import { isEmpty } from '@/utils/commons' @@ -12,7 +12,7 @@ const { RangePicker } = DatePicker const PAGE_SIZE = 50 // 每页显示条数 -const MailBox = ({ mailboxDir, onMailItemClick, onSelect, ...props }) => { +const MailBox = ({ mailboxDir, onMailItemClick, ...props }) => { const DATE_RANGE_PRESETS = [ { label: '本周', @@ -100,24 +100,21 @@ const MailBox = ({ mailboxDir, onMailItemClick, onSelect, ...props }) => { const mailStateClass = item.MOI_ReadState === 0 ? 'font-bold' : '' const hasAtta = item.MAI_Attachment !== 0 ? : null return ( -
  • -
    +
  • +
    i.MAI_SN === item.MAI_SN)} - onClick={e => { - const isChecked = e.target.checked; - const updatedSelection = isChecked - ? [...selectedItems, item] - : selectedItems.filter((item) => item.MAI_SN !== item.MAI_SN) - setSelectedItems(updatedSelection) - } - }> -
    -
    i.MAI_SN === item.MAI_SN)} + onClick={(e) => { + const isChecked = e.target.checked + const updatedSelection = isChecked ? [...selectedItems, item] : selectedItems.filter((item) => item.MAI_SN !== item.MAI_SN) + setSelectedItems(updatedSelection) + }}> +
    +
    { onMailItemClick(item) - }}> + }}>
    {orderNumber} @@ -138,38 +135,38 @@ const MailBox = ({ mailboxDir, onMailItemClick, onSelect, ...props }) => { 0 && - selectedItems.length < pagination.pagedList.length - } - checked={pagination.pagedList.length === 0 ? false : pagination.pagedList.every((item) => - selectedItems.some((selected) => selected.MAI_SN === item.MAI_SN) - )} - onChange={(e) => { - const isChecked = e.target.checked; + indeterminate={selectedItems.length > 0 && selectedItems.length < pagination.pagedList.length} + checked={pagination.pagedList.length === 0 ? false : pagination.pagedList.every((item) => selectedItems.some((selected) => selected.MAI_SN === item.MAI_SN))} + onChange={(e) => { + const isChecked = e.target.checked if (isChecked) { - setSelectedItems((prev) => [ - ...prev, - ...pagination.pagedList, - ]); + setSelectedItems((prev) => [...prev, ...pagination.pagedList]) } else { - setSelectedItems([]); + setSelectedItems([]) } - }} - > + }}> -
    -
    +
    - - { - return { - title: ( - <> - - {bc.title} - - ), - } - })} - /> + - 已选: {selectedItems.length} 项; - - {(pagination.current - 1) * PAGE_SIZE + 1}-{Math.min(pagination.current * PAGE_SIZE, pagination.total)} of {pagination.total} - - - + { + return { + title: ( + <> + + {bc.title} + + ), + } + })} + /> + + 已选: {selectedItems.length} 项; + + {(pagination.current - 1) * PAGE_SIZE + 1}-{Math.min(pagination.current * PAGE_SIZE, pagination.total)} of {pagination.total} + + + + - - } - itemLayout='vertical' - pagination={false} - dataSource={pagination.pagedList} - renderItem={mailItemRender} - /> + } + itemLayout='vertical' + pagination={false} + dataSource={pagination.pagedList} + renderItem={mailItemRender} + />