|
|
|
@ -1,5 +1,3 @@
|
|
|
|
|
import { Conditional } from '@/components/Conditional'
|
|
|
|
|
import { useAuthContext } from '@/stores/AuthContext'
|
|
|
|
|
import {
|
|
|
|
|
App,
|
|
|
|
|
Badge,
|
|
|
|
@ -16,10 +14,41 @@ import {
|
|
|
|
|
} from 'antd'
|
|
|
|
|
import { memo, useCallback, useEffect, useState } from 'react'
|
|
|
|
|
import { NavLink } from 'react-router-dom'
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import { Conditional } from '@/components/Conditional'
|
|
|
|
|
import { useAuthContext } from '@/stores/AuthContext'
|
|
|
|
|
import { prepareUrl } from '@/utils/commons'
|
|
|
|
|
|
|
|
|
|
const { RangePicker } = DatePicker
|
|
|
|
|
|
|
|
|
|
const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
|
|
|
|
|
const DATE_PRESETS = [
|
|
|
|
|
{
|
|
|
|
|
label: '本周',
|
|
|
|
|
value: [dayjs().startOf('w'), dayjs().endOf('w')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '上周',
|
|
|
|
|
value: [dayjs().startOf('w').subtract(7, 'days'), dayjs().endOf('w').subtract(7, 'days')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '本月',
|
|
|
|
|
value: [dayjs().startOf('M'), dayjs().endOf('M')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '上月',
|
|
|
|
|
value: [dayjs().subtract(1, 'M').startOf('M'), dayjs().subtract(1, 'M').endOf('M')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '前三月',
|
|
|
|
|
value: [dayjs().subtract(2, 'M').startOf('M'), dayjs().endOf('M')],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '本年',
|
|
|
|
|
value: [dayjs().startOf('y'), dayjs().endOf('y')],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
const [form] = Form.useForm()
|
|
|
|
|
function handleSubmit(values) {
|
|
|
|
|
onSubmit?.(values)
|
|
|
|
@ -28,7 +57,9 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
<Form
|
|
|
|
|
layout={'inline'}
|
|
|
|
|
form={form}
|
|
|
|
|
initialValues={{ orderLabel: '全部', orderStatus: '全部' }}
|
|
|
|
|
initialValues={{ orderLabel: '', orderStatus: '',
|
|
|
|
|
startDateRange: [dayjs().startOf('M'), dayjs().endOf('M')]
|
|
|
|
|
}}
|
|
|
|
|
onFinish={handleSubmit}
|
|
|
|
|
style={{
|
|
|
|
|
maxWidth: 'none',
|
|
|
|
@ -40,6 +71,7 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
width: 100,
|
|
|
|
|
}}
|
|
|
|
|
options={[
|
|
|
|
|
{ value: '', label: '全部' },
|
|
|
|
|
{ value: '240003', label: '重点' },
|
|
|
|
|
{ value: '240002', label: '潜力' },
|
|
|
|
|
{ value: '240001', label: '休眠' }
|
|
|
|
@ -52,29 +84,34 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
width: 100,
|
|
|
|
|
}}
|
|
|
|
|
options={[
|
|
|
|
|
{ value: '', label: '全部' },
|
|
|
|
|
{
|
|
|
|
|
value: '新订单',
|
|
|
|
|
value: '1',
|
|
|
|
|
label: '新订单',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '报价中',
|
|
|
|
|
value: '2',
|
|
|
|
|
label: '报价中',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '丢失',
|
|
|
|
|
label: '丢失',
|
|
|
|
|
value: '3',
|
|
|
|
|
label: '以后联系',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '一催',
|
|
|
|
|
label: '一催',
|
|
|
|
|
value: '4',
|
|
|
|
|
label: '等待付订金',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '二催',
|
|
|
|
|
label: '二催',
|
|
|
|
|
value: '5',
|
|
|
|
|
label: '成行',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '三催',
|
|
|
|
|
label: '三催',
|
|
|
|
|
value: '6',
|
|
|
|
|
label: '丢失',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: '7',
|
|
|
|
|
label: '取消',
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
/>
|
|
|
|
@ -83,7 +120,11 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
<Input placeholder='订单号' allowClear />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item label='出发日期' name='startDateRange'>
|
|
|
|
|
<RangePicker />
|
|
|
|
|
<RangePicker
|
|
|
|
|
allowClear={false}
|
|
|
|
|
inputReadOnly={true}
|
|
|
|
|
presets={DATE_PRESETS}
|
|
|
|
|
/>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item >
|
|
|
|
|
<Button type='primary' htmlType='submit'>搜索</Button>
|
|
|
|
@ -94,6 +135,7 @@ const AdvanceSearchForm = memo(function ({ onSubmit }) {
|
|
|
|
|
|
|
|
|
|
function OrderList({ formValues }) {
|
|
|
|
|
|
|
|
|
|
console.info(formValues)
|
|
|
|
|
const orderColumns = [
|
|
|
|
|
{
|
|
|
|
|
title: '订单号',
|
|
|
|
@ -155,10 +197,24 @@ function OrderList({ formValues }) {
|
|
|
|
|
const [orderData, setOrderData] = useState([])
|
|
|
|
|
const [loading, setLoading] = useState(false)
|
|
|
|
|
const { loginUser } = useAuthContext()
|
|
|
|
|
let fetchOrderUrl = `https://p9axztuwd7x8a7.mycht.cn/whatsapp_callback/getwlorder?opisn=${loginUser.userId}&otype=${formValues.type}`
|
|
|
|
|
|
|
|
|
|
if (formValues.type === 'advance') {
|
|
|
|
|
const fromDate = formValues.startDateRange[0].format('YYYY-MM-DD')
|
|
|
|
|
const thruDate = formValues.startDateRange[1].format('YYYY-MM-DD')
|
|
|
|
|
fetchOrderUrl = prepareUrl('https://p9axztuwd7x8a7.mycht.cn/whatsapp_callback/getdvancedwlorder')
|
|
|
|
|
.append('opisn', loginUser.userId)
|
|
|
|
|
.append('startdate', fromDate)
|
|
|
|
|
.append('enddate', thruDate)
|
|
|
|
|
.append('tag', formValues.orderLabel)
|
|
|
|
|
.append('orderstate', formValues.orderStatus)
|
|
|
|
|
.append('coli_id', formValues.orderNumber)
|
|
|
|
|
.build()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setLoading(true)
|
|
|
|
|
fetch(`http://202.103.68.157:8888/gettodayorder?opisn=${loginUser.userId}`)
|
|
|
|
|
fetch(fetchOrderUrl)
|
|
|
|
|
.then(response => response.json())
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode === 0) {
|
|
|
|
@ -260,11 +316,11 @@ function OrderFollow() {
|
|
|
|
|
<Radio.Group
|
|
|
|
|
options={[
|
|
|
|
|
{ label: '今日任务', value: 'today' },
|
|
|
|
|
{ label: '潜力客户', value: 'star' },
|
|
|
|
|
{ label: '重点订单', value: 'important' },
|
|
|
|
|
{ label: '成行', value: 'myfavorites' },
|
|
|
|
|
{ label: '走团中', value: 'ing' },
|
|
|
|
|
{ label: '走团后一月', value: 'lastMonth' }
|
|
|
|
|
{ label: '重点订单', value: 'zhongdian' },
|
|
|
|
|
{ label: '潜力客户', value: 'qianli' },
|
|
|
|
|
{ label: '成行', value: 'chengxing' },
|
|
|
|
|
{ label: '走团中', value: 'zoutuan' },
|
|
|
|
|
{ label: '走团后一月', value: 'zoutuanhou' }
|
|
|
|
|
]}
|
|
|
|
|
value={formValues.type}
|
|
|
|
|
onChange={({ target: { value } }) => {
|
|
|
|
@ -277,7 +333,6 @@ function OrderFollow() {
|
|
|
|
|
buttonStyle='solid'
|
|
|
|
|
disabled={advanceChecked}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Switch checkedChildren='高级查询' unCheckedChildren='高级查询'
|
|
|
|
|
defaultChecked={false}
|
|
|
|
|
onChange={() => { toggleAdvance(!advanceChecked) }} />
|
|
|
|
|