|
|
@ -1,16 +1,31 @@
|
|
|
|
import { WhatsAppOutlined, FileAddOutlined, MailOutlined, PhoneOutlined, UserOutlined, FieldNumberOutlined, CompassOutlined, CalendarOutlined, EditOutlined, CheckOutlined } from '@ant-design/icons'
|
|
|
|
import {
|
|
|
|
|
|
|
|
WhatsAppOutlined,
|
|
|
|
|
|
|
|
FileAddOutlined,
|
|
|
|
|
|
|
|
MailOutlined,
|
|
|
|
|
|
|
|
PhoneOutlined,
|
|
|
|
|
|
|
|
UserOutlined,
|
|
|
|
|
|
|
|
FieldNumberOutlined,
|
|
|
|
|
|
|
|
CompassOutlined,
|
|
|
|
|
|
|
|
CalendarOutlined,
|
|
|
|
|
|
|
|
EditOutlined,
|
|
|
|
|
|
|
|
CheckOutlined,
|
|
|
|
|
|
|
|
ReloadOutlined,
|
|
|
|
|
|
|
|
} from '@ant-design/icons'
|
|
|
|
|
|
|
|
|
|
|
|
import { useEffect, useState } from 'react'
|
|
|
|
import { useEffect, useState, useRef } from 'react'
|
|
|
|
import { App, Flex, Select, Tooltip, Divider, Typography, Skeleton, Checkbox } from 'antd'
|
|
|
|
import { App, Flex, Select, Tooltip, Divider, Typography, Skeleton, Checkbox, Drawer, Button, Form, Input } from 'antd'
|
|
|
|
import { useOrderStore, fetchSetRemindStateAction, OrderLabelDefaultOptions, OrderStatusDefaultOptions, remindStatusOptions } from '@/stores/OrderStore'
|
|
|
|
import { useOrderStore, fetchSetRemindStateAction, OrderLabelDefaultOptions, OrderStatusDefaultOptions, remindStatusOptions } from '@/stores/OrderStore'
|
|
|
|
import { copy, isEmpty } from '@/utils/commons'
|
|
|
|
import { copy, isEmpty } from '@/utils/commons'
|
|
|
|
import { useShallow } from 'zustand/react/shallow'
|
|
|
|
import { useShallow } from 'zustand/react/shallow'
|
|
|
|
import useConversationStore from '@/stores/ConversationStore'
|
|
|
|
import useConversationStore from '@/stores/ConversationStore'
|
|
|
|
|
|
|
|
import useAuthStore from '@/stores/AuthStore'
|
|
|
|
const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
const { notification, message } = App.useApp()
|
|
|
|
const { notification, message } = App.useApp()
|
|
|
|
|
|
|
|
const [formComment] = Form.useForm()
|
|
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const [openOrderCommnet, setOpenOrderCommnet] = useState(false)
|
|
|
|
|
|
|
|
|
|
|
|
const orderLabelOptions = copy(OrderLabelDefaultOptions)
|
|
|
|
const orderLabelOptions = copy(OrderLabelDefaultOptions)
|
|
|
|
orderLabelOptions.unshift({ value: 0, label: '未设置', disabled: true })
|
|
|
|
orderLabelOptions.unshift({ value: 0, label: '未设置', disabled: true })
|
|
|
|
|
|
|
|
|
|
|
@ -23,7 +38,8 @@ const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
s.appendOrderComment,
|
|
|
|
s.appendOrderComment,
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
const currentOrder = useConversationStore(useShallow(state => state.currentConversation?.coli_sn || ""))
|
|
|
|
const loginUser = useAuthStore((state) => state.loginUser)
|
|
|
|
|
|
|
|
const currentOrder = useConversationStore(useShallow((state) => state.currentConversation?.coli_sn || ''))
|
|
|
|
const orderId = coliSN || currentOrder
|
|
|
|
const orderId = coliSN || currentOrder
|
|
|
|
|
|
|
|
|
|
|
|
const [orderRemindState, setOrderRemindState] = useState(orderDetail.remindstate)
|
|
|
|
const [orderRemindState, setOrderRemindState] = useState(orderDetail.remindstate)
|
|
|
@ -186,7 +202,12 @@ const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
<Divider orientation='left'>
|
|
|
|
<Divider orientation='left'>
|
|
|
|
<Typography.Text strong>表单信息</Typography.Text>
|
|
|
|
<Typography.Text strong>表单信息</Typography.Text>
|
|
|
|
<Tooltip title='添加'>
|
|
|
|
<Tooltip title='添加'>
|
|
|
|
<FileAddOutlined className='pl-1' />
|
|
|
|
<FileAddOutlined
|
|
|
|
|
|
|
|
className='pl-1'
|
|
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
setOpenOrderCommnet(true)
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
/>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
</Divider>
|
|
|
|
</Divider>
|
|
|
|
<p className='p-2 overflow-auto m-0 break-words whitespace-pre-wrap' dangerouslySetInnerHTML={{ __html: orderDetail.order_detail }}></p>
|
|
|
|
<p className='p-2 overflow-auto m-0 break-words whitespace-pre-wrap' dangerouslySetInnerHTML={{ __html: orderDetail.order_detail }}></p>
|
|
|
@ -197,20 +218,56 @@ const OrderProfile = ({ coliSN, ...props }) => {
|
|
|
|
<Typography.Text>{orderDetail.customer_request}</Typography.Text>
|
|
|
|
<Typography.Text>{orderDetail.customer_request}</Typography.Text>
|
|
|
|
<Divider orientation='left'>
|
|
|
|
<Divider orientation='left'>
|
|
|
|
<Typography.Text strong>外联备注</Typography.Text>
|
|
|
|
<Typography.Text strong>外联备注</Typography.Text>
|
|
|
|
<Tooltip title='修改'>
|
|
|
|
{/* <Tooltip title='修改'>
|
|
|
|
<EditOutlined className='pl-1' />
|
|
|
|
<EditOutlined className='pl-1' />
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip> */}
|
|
|
|
</Divider>
|
|
|
|
</Divider>
|
|
|
|
<Typography.Text>{orderDetail.wl_memo}</Typography.Text>
|
|
|
|
<Typography.Text>{orderDetail.wl_memo}</Typography.Text>
|
|
|
|
|
|
|
|
|
|
|
|
<Divider orientation='left'>
|
|
|
|
<Divider orientation='left'>
|
|
|
|
<Typography.Text strong>附加信息</Typography.Text>
|
|
|
|
<Typography.Text strong>附加信息</Typography.Text>
|
|
|
|
<Tooltip title='修改'>
|
|
|
|
{/* <Tooltip title='修改'>
|
|
|
|
<EditOutlined className='pl-1' />
|
|
|
|
<EditOutlined className='pl-1' />
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip> */}
|
|
|
|
</Divider>
|
|
|
|
</Divider>
|
|
|
|
<Typography.Text>泰国马来水灯节</Typography.Text>
|
|
|
|
<Typography.Text>泰国马来水灯节</Typography.Text>
|
|
|
|
</Skeleton>
|
|
|
|
</Skeleton>
|
|
|
|
|
|
|
|
<Drawer title='添加表单信息' closable={{ 'aria-label': 'Close Button' }} onClose={() => setOpenOrderCommnet(false)} open={openOrderCommnet}>
|
|
|
|
|
|
|
|
<Form
|
|
|
|
|
|
|
|
layout={'vertical'}
|
|
|
|
|
|
|
|
form={formComment}
|
|
|
|
|
|
|
|
initialValues={{ comment: '' }}
|
|
|
|
|
|
|
|
scrollToFirstError
|
|
|
|
|
|
|
|
onFinish={(values) => {
|
|
|
|
|
|
|
|
console.log('Received values of form: ', values)
|
|
|
|
|
|
|
|
appendOrderComment(loginUser.userId, orderId, values.comment)
|
|
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
notification.success({
|
|
|
|
|
|
|
|
message: '温性提示',
|
|
|
|
|
|
|
|
description: '添加表单信息成功',
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
setOpenOrderCommnet(false)
|
|
|
|
|
|
|
|
formComment.setFieldsValue({ comment: '' })
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((reason) => {
|
|
|
|
|
|
|
|
notification.error({
|
|
|
|
|
|
|
|
message: '添加出错',
|
|
|
|
|
|
|
|
description: reason.message,
|
|
|
|
|
|
|
|
placement: 'top',
|
|
|
|
|
|
|
|
duration: 60,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}}>
|
|
|
|
|
|
|
|
<Form.Item name='comment' label='表单信息' rules={[{ required: true, message: '请输入表单信息' }]}>
|
|
|
|
|
|
|
|
<Input.TextArea rows={4} />
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
<Form.Item>
|
|
|
|
|
|
|
|
<Button type='primary' htmlType='submit'>
|
|
|
|
|
|
|
|
提交
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
|
|
|
|
</Form>
|
|
|
|
|
|
|
|
</Drawer>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|