|
|
|
@ -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 }) => {
|
|
|
|
|
})}
|
|
|
|
|
/> */}
|
|
|
|
|
<Skeleton active loading={loading}>
|
|
|
|
|
<Flex gap='small' vertical={true} justify='space-between'>
|
|
|
|
|
<Flex gap='small' vertical={true} justify='space-between' className='p-2'>
|
|
|
|
|
<Typography.Text>
|
|
|
|
|
<FieldNumberOutlined className='pr-1' />
|
|
|
|
|
{orderDetail.order_no}
|
|
|
|
@ -129,19 +129,19 @@ const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
|
width: '100%',
|
|
|
|
|
}}
|
|
|
|
|
variant='underlined'
|
|
|
|
|
onSelect={value => {
|
|
|
|
|
setOrderPropValue(coliSN, "orderlabel", value)
|
|
|
|
|
onSelect={(value) => {
|
|
|
|
|
setOrderPropValue(coliSN, 'orderlabel', value)
|
|
|
|
|
.then(() => {
|
|
|
|
|
message.success("设置成功");
|
|
|
|
|
message.success('设置成功')
|
|
|
|
|
})
|
|
|
|
|
.catch(reason => {
|
|
|
|
|
.catch((reason) => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: "设置出错",
|
|
|
|
|
message: '设置出错',
|
|
|
|
|
description: reason.message,
|
|
|
|
|
placement: "top",
|
|
|
|
|
placement: 'top',
|
|
|
|
|
duration: 60,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}}
|
|
|
|
|
value={orderDetail.tags}
|
|
|
|
|
options={orderLabelOptions}
|
|
|
|
@ -154,19 +154,19 @@ const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
|
width: '100%',
|
|
|
|
|
}}
|
|
|
|
|
variant='underlined'
|
|
|
|
|
onSelect={value => {
|
|
|
|
|
setOrderPropValue(coliSN, "orderstatus", value)
|
|
|
|
|
onSelect={(value) => {
|
|
|
|
|
setOrderPropValue(coliSN, 'orderstatus', value)
|
|
|
|
|
.then(() => {
|
|
|
|
|
message.success("设置成功");
|
|
|
|
|
message.success('设置成功')
|
|
|
|
|
})
|
|
|
|
|
.catch(reason => {
|
|
|
|
|
.catch((reason) => {
|
|
|
|
|
notification.error({
|
|
|
|
|
message: "设置出错",
|
|
|
|
|
message: '设置出错',
|
|
|
|
|
description: reason.message,
|
|
|
|
|
placement: "top",
|
|
|
|
|
placement: 'top',
|
|
|
|
|
duration: 60,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}}
|
|
|
|
|
value={orderDetail.states}
|
|
|
|
|
options={orderStatusOptions}
|
|
|
|
@ -176,7 +176,7 @@ const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
|
<Divider orientation='left'>
|
|
|
|
|
<Typography.Text strong>催信</Typography.Text>
|
|
|
|
|
</Divider>
|
|
|
|
|
<Checkbox.Group key='substatus' className="px-2" value={[orderRemindState]} options={remindStatusOptions} onChange={handleSetRemindState} />
|
|
|
|
|
<Checkbox.Group key='substatus' className='px-2' value={[orderRemindState]} options={remindStatusOptions} onChange={handleSetRemindState} />
|
|
|
|
|
|
|
|
|
|
<Divider orientation='left'>
|
|
|
|
|
<Typography.Text strong>表单信息</Typography.Text>
|
|
|
|
|