|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { useState } from 'react'
|
|
|
|
|
import { App, Modal, Button, Table, Form, Row, Col, Input } from 'antd'
|
|
|
|
|
import { App, Modal, Button, Table, Form, Row, Col, Input, Checkbox } from 'antd'
|
|
|
|
|
import { ApiOutlined } from '@ant-design/icons'
|
|
|
|
|
import { isEmpty, cloneDeep } from '@/utils/commons'
|
|
|
|
|
import { fetchJSON } from '@/utils/request'
|
|
|
|
@ -33,7 +33,7 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, coliID, onB
|
|
|
|
|
const copyObject = cloneDeep(values)
|
|
|
|
|
delete copyObject.type
|
|
|
|
|
const allEmpty = Object.values(copyObject).every((val) => {
|
|
|
|
|
return val === null || val === '' || val === undefined
|
|
|
|
|
return val === null || String(val).trim() === '' || val === undefined
|
|
|
|
|
})
|
|
|
|
|
if (allEmpty) {
|
|
|
|
|
notification.warning({
|
|
|
|
@ -45,12 +45,13 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, coliID, onB
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
// values.opisn = loginUserId
|
|
|
|
|
values.sourcetype = values.sourcetype || '227001'
|
|
|
|
|
values.sourcetype = values.is_biz ? '227002' : '227001'
|
|
|
|
|
delete values.is_biz
|
|
|
|
|
setLoading(false)
|
|
|
|
|
setSearchLoading(true)
|
|
|
|
|
setSearchResult([])
|
|
|
|
|
const result = await fetchHTOrderList(values)
|
|
|
|
|
setSearchResult(result)
|
|
|
|
|
setSearchResult(result.map(ele => ({...ele, sourcetype: values.sourcetype})))
|
|
|
|
|
setSearchLoading(false)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -133,7 +134,7 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, coliID, onB
|
|
|
|
|
key: 'action',
|
|
|
|
|
width: 150,
|
|
|
|
|
render: (_, record) => (
|
|
|
|
|
<Button type={'text'} className='text-primary' onClick={() => handleBindOrder({ coli_sn: record.COLI_SN, coli_id: record.COLI_ID })}>
|
|
|
|
|
<Button type={'text'} className='text-primary' onClick={() => handleBindOrder({ coli_sn: record.COLI_SN, coli_id: record.COLI_ID, sourcetype: record.sourcetype })}>
|
|
|
|
|
关联此订单
|
|
|
|
|
</Button>
|
|
|
|
|
),
|
|
|
|
@ -158,7 +159,7 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, coliID, onB
|
|
|
|
|
destroyOnHidden>
|
|
|
|
|
{/* <AdvanceSearchForm onSubmit={onSearchOrder} loading={searchLoading} /> */}
|
|
|
|
|
<Form
|
|
|
|
|
// layout={'inline'}
|
|
|
|
|
layout={'inline'}
|
|
|
|
|
form={form}
|
|
|
|
|
initialValues={{
|
|
|
|
|
orderLabel: '',
|
|
|
|
@ -167,21 +168,17 @@ export const EmailBindFormModal = ({ mai_sn, conversationid, userId, coliID, onB
|
|
|
|
|
// ...initialValues,
|
|
|
|
|
}}
|
|
|
|
|
onFinish={onSearchOrder}>
|
|
|
|
|
<Row justify='start' gutter={16}>
|
|
|
|
|
<Col span={4}>
|
|
|
|
|
<Form.Item label='订单号' name='coli_id' initialValue={coliID}>
|
|
|
|
|
<Form.Item label='订单号' name='coli_id' initialValue={coliID} rules={[{ required: true, message: '请输入订单号' }]}>
|
|
|
|
|
<Input placeholder='订单号' allowClear />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
<Form.Item hidden label='订单类型' name='sourcetype' initialValue={'227001'}>
|
|
|
|
|
<Input placeholder='订单类型' allowClear />
|
|
|
|
|
<Form.Item name='is_biz' className='' valuePropName='checked'>
|
|
|
|
|
<Checkbox>商务订单</Checkbox>
|
|
|
|
|
</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} rowKey={'COLI_SN'} />
|
|
|
|
|
</Modal>
|
|
|
|
|