|
|
|
@ -1,16 +1,23 @@
|
|
|
|
|
import { Conditional } from '@/components/Conditional'
|
|
|
|
|
import useAuthStore from '@/stores/AuthStore'
|
|
|
|
|
import useFormStore from '@/stores/FormStore'
|
|
|
|
|
import useOrderStore from '@/stores/OrderStore'
|
|
|
|
|
import { copy, isNotEmpty } from '@/utils/commons'
|
|
|
|
|
import { InfoCircleTwoTone, MailTwoTone, MessageTwoTone, PhoneTwoTone, WhatsAppOutlined } from '@ant-design/icons'
|
|
|
|
|
import {
|
|
|
|
|
App, Badge, Button, DatePicker, Tabs, Flex, Form, Input, Empty,
|
|
|
|
|
Radio, Row, Col, Select, Space, Switch, Table, Tag, Tooltip
|
|
|
|
|
App, Badge, Button,
|
|
|
|
|
Col,
|
|
|
|
|
DatePicker,
|
|
|
|
|
Empty,
|
|
|
|
|
Flex, Form, Input,
|
|
|
|
|
Radio, Row,
|
|
|
|
|
Select, Space, Switch, Table,
|
|
|
|
|
Tabs,
|
|
|
|
|
Tag, Tooltip
|
|
|
|
|
} from 'antd'
|
|
|
|
|
import { InfoCircleTwoTone, MessageTwoTone, PhoneTwoTone, MailTwoTone, WhatsAppOutlined } from '@ant-design/icons'
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import { memo, useCallback, useEffect, useState } from 'react'
|
|
|
|
|
import { Link } from 'react-router-dom'
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import { Conditional } from '@/components/Conditional'
|
|
|
|
|
import useOrderStore from '@/stores/OrderStore'
|
|
|
|
|
import useAuthStore from '@/stores/AuthStore'
|
|
|
|
|
import { copy, isNotEmpty } from '@/utils/commons'
|
|
|
|
|
import useFormStore from '@/stores/FormStore';
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow'
|
|
|
|
|
|
|
|
|
|
const { RangePicker } = DatePicker
|
|
|
|
@ -155,11 +162,21 @@ function OrderGroupTable({ formValues }) {
|
|
|
|
|
title: '订单号',
|
|
|
|
|
dataIndex: 'COLI_ID',
|
|
|
|
|
width: 222,
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
if (record.COLI_LineGrade === 240003) return <Space>{text}<Tag color='red'>重点</Tag></Space>
|
|
|
|
|
else if (record.COLI_LineGrade === 240002) return <Space>{text}<Tag color='green'>次重点</Tag></Space>
|
|
|
|
|
else if (record.COLI_LineGrade === 240001) return <Space>{text}<Tag color='blue'>一般</Tag></Space>
|
|
|
|
|
else return <Space>{text}</Space>
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
let tagIcon = ''
|
|
|
|
|
|
|
|
|
|
if (record.COLI_LineGrade === 240003) tagIcon = <Tag color='red'>重点</Tag>
|
|
|
|
|
else if (record.COLI_LineGrade === 240002) tagIcon = <Tag color='green'>次重点</Tag>
|
|
|
|
|
else if (record.COLI_LineGrade === 240001) tagIcon = <Tag color='blue'>一般</Tag>
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Space>
|
|
|
|
|
<Link to={`/order/chat/${record.COLI_SN}`} state={record}>
|
|
|
|
|
{text}
|
|
|
|
|
</Link>
|
|
|
|
|
{tagIcon}
|
|
|
|
|
</Space>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -171,9 +188,7 @@ function OrderGroupTable({ formValues }) {
|
|
|
|
|
return (
|
|
|
|
|
<Space>
|
|
|
|
|
{isNotEmpty(record.coli_guest_WhatsApp) && <WhatsAppOutlined className={['pl-1', record.last_received_time ? 'text-whatsapp' : 'text-neutral-500']} />}
|
|
|
|
|
<Link to={`/order/chat/${record.COLI_SN}`} state={record} title={record.coli_guest_WhatsApp}>
|
|
|
|
|
{text + regularText}
|
|
|
|
|
</Link>
|
|
|
|
|
{text + regularText}
|
|
|
|
|
<Badge
|
|
|
|
|
count={record.unread_msg}
|
|
|
|
|
style={{
|
|
|
|
@ -181,7 +196,7 @@ function OrderGroupTable({ formValues }) {
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Space>
|
|
|
|
|
);
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -269,9 +284,9 @@ function OrderGroupTable({ formValues }) {
|
|
|
|
|
|
|
|
|
|
function groupByParam(array, param) {
|
|
|
|
|
return array.reduce((result, item) => {
|
|
|
|
|
(result[item[param]] = result[item[param]] || []).push(item);
|
|
|
|
|
return result;
|
|
|
|
|
}, {});
|
|
|
|
|
(result[item[param]] = result[item[param]] || []).push(item)
|
|
|
|
|
return result
|
|
|
|
|
}, {})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const deptMap = new Map([
|
|
|
|
@ -335,8 +350,8 @@ function OrderGroupTable({ formValues }) {
|
|
|
|
|
|
|
|
|
|
function OrderFollow() {
|
|
|
|
|
|
|
|
|
|
const [formValues, setFormValues] = useFormStore(useShallow((state) => [state.orderFollowForm, state.setOrderFollowForm]));
|
|
|
|
|
const [advanceChecked, toggleAdvance] = useFormStore(useShallow((state) => [state.orderFollowAdvanceChecked, state.setOrderFollowAdvanceChecked]));
|
|
|
|
|
const [formValues, setFormValues] = useFormStore(useShallow((state) => [state.orderFollowForm, state.setOrderFollowForm]))
|
|
|
|
|
const [advanceChecked, toggleAdvance] = useFormStore(useShallow((state) => [state.orderFollowAdvanceChecked, state.setOrderFollowAdvanceChecked]))
|
|
|
|
|
|
|
|
|
|
const handleSubmit = useCallback((values) => {
|
|
|
|
|
setFormValues({ ...values, type: 'advance' })
|
|
|
|
|