perf: 邮件绑定订单. 绑定到其他人订单

dev/RoosterEditor
Lei OT 5 months ago
parent c9b44f233d
commit b7fa9490a7

@ -1,5 +1,5 @@
import { useState } from 'react'
import { App, Modal, Button, Table } from 'antd'
import { App, Modal, Button, Table, Form, Row, Col, Input } from 'antd'
import { ApiOutlined } from '@ant-design/icons'
import { isEmpty, cloneDeep } from '@/utils/commons'
import { fetchJSON } from '@/utils/request'
@ -9,12 +9,17 @@ import dayjs from 'dayjs'
import useAuthStore from '@/stores/AuthStore'
import { fetchEmailBindOrderAction } from '@/actions/EmailActions'
const fetchOrderList = async (params) => {
const fetchMyOrderList = async (params) => {
const { errcode, result } = await fetchJSON(`${API_HOST}/getdvancedwlorder`, params)
return errcode !== 0 ? [] : result
}
const fetchHTOrderList = async (params) => {
const { errcode, result } = await fetchJSON(`${API_HOST}/query_order`, params)
return errcode !== 0 ? [] : result
}
export const EmailBindFormModal = ({ mai_sn, conversationid, userId, onBoundSuccess, ...props }) => {
export const EmailBindFormModal = ({ mai_sn, conversationid, userId, coliID, onBoundSuccess, ...props }) => {
const [form] = Form.useForm()
const [open, setOpen] = useState(false)
const { userId: loginUserId } = useAuthStore((state) => state.loginUser)
@ -39,11 +44,12 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, onBoundSucc
})
return false
}
values.opisn = loginUserId
// values.opisn = loginUserId
values.sourcetype = values.sourcetype || '227001'
setLoading(false)
setSearchLoading(true)
setSearchResult([])
const result = await fetchOrderList(values)
const result = await fetchHTOrderList(values)
setSearchResult(result)
setSearchLoading(false)
}
@ -76,34 +82,52 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, onBoundSucc
width: 222,
},
{
title: '客人姓名',
key: 'coli_guest',
dataIndex: 'coli_guest',
render: (text, record) => {
let regularText = ''
if (record.buytime > 0) regularText = '(R' + record.buytime + ')'
return text + regularText
},
title: '顾问',
key: 'OperatorName',
dataIndex: 'OperatorName',
width: 100,
},
{
title: '出发日期',
key: 'COLI_OrderStartDate',
dataIndex: 'COLI_OrderStartDate',
width: 120,
hidden: false,
sortDirections: ['ascend', 'descend'],
sorter: (a, b) => {
const datejsA = isEmpty(a.COLI_OrderStartDate) ? 0 : new dayjs(a.COLI_OrderStartDate).valueOf()
const datejsB = isEmpty(b.COLI_OrderStartDate) ? 0 : new dayjs(b.COLI_OrderStartDate).valueOf()
return datejsA - datejsB
},
title: '分配时间',
key: 'COLI_AssignDate',
dataIndex: 'COLI_AssignDate',
width: 100,
},
{
title: '附加信息',
ellipsis: true,
key: 'COLI_Introduction',
dataIndex: 'COLI_Introduction',
title: '天数',
key: 'COLI_Days',
dataIndex: 'COLI_Days',
width: 100,
},
// {
// title: '',
// key: 'coli_guest',
// dataIndex: 'coli_guest',
// render: (text, record) => {
// let regularText = ''
// if (record.buytime > 0) regularText = '(R' + record.buytime + ')'
// return text + regularText
// },
// },
// {
// title: '',
// key: 'COLI_OrderStartDate',
// dataIndex: 'COLI_OrderStartDate',
// width: 120,
// hidden: false,
// sortDirections: ['ascend', 'descend'],
// sorter: (a, b) => {
// const datejsA = isEmpty(a.COLI_OrderStartDate) ? 0 : new dayjs(a.COLI_OrderStartDate).valueOf()
// const datejsB = isEmpty(b.COLI_OrderStartDate) ? 0 : new dayjs(b.COLI_OrderStartDate).valueOf()
// return datejsA - datejsB
// },
// },
// {
// title: '',
// ellipsis: true,
// key: 'COLI_Introduction',
// dataIndex: 'COLI_Introduction',
// },
{
title: '',
key: 'action',
@ -132,7 +156,33 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, onBoundSucc
setOpen(false)
}}
destroyOnClose>
<AdvanceSearchForm onSubmit={onSearchOrder} loading={searchLoading} />
{/* <AdvanceSearchForm onSubmit={onSearchOrder} loading={searchLoading} /> */}
<Form
// layout={'inline'}
form={form}
initialValues={{
orderLabel: '',
orderStatus: '',
remindState: '',
// ...initialValues,
}}
onFinish={onSearchOrder}>
<Row justify='start' gutter={16}>
<Col span={4}>
<Form.Item label='订单号' name='coli_id' initialValue={coliID}>
<Input placeholder='订单号' allowClear />
</Form.Item>
<Form.Item hidden label='订单类型' name='sourcetype' initialValues={'227001'}>
<Input placeholder='订单类型' allowClear />
</Form.Item>
</Col>
<div style={{ flex: '0 1 64px' }} className='flex justify-between'>
<Button type='primary' htmlType='submit' loading={searchLoading}>
搜索
</Button>
</div>
</Row>
</Form>
<Table key={'advanceOrderTable'} loading={loading} dataSource={searchResult} columns={searchResultColumns} pagination={searchResult.length <= 10 ? false : paginationProps} />
</Modal>
</>

Loading…
Cancel
Save