历史记录: 搜索客人列表

dev/chat
Lei OT 1 year ago
parent c86acb9111
commit d857d8fc69

@ -9,6 +9,14 @@ export const fetchSalesAgent = async (q) => {
return errcode !== 0 ? [] : result.map((ele) => ({ ...ele, label: ele.cn_name, value: ele.op_id }));
};
/**
* 客人列表
*/
export const fetchCustomerList = async (q) => {
const { errcode, result } = await fetchJSON(`${API_HOST}/GetWhatsappidList`, { search: q });
return errcode !== 0 ? [] : result.map((ele) => ({ ...ele, label: ele.whatsapp_name, value: ele.whatsapp_phone_number }));
};
/**
* 上传单个文件
* @returns {object} { errcode, result: { file_url } }

@ -6,7 +6,7 @@ import { isEmpty } from '@/utils/utils';
import useFormStore from '@/stores/FormStore';
import { useShallow } from 'zustand/react/shallow';
import { fetchSalesAgent } from '@/actions/CommonActions';
import { fetchSalesAgent, fetchCustomerList } from '@/actions/CommonActions';
import SearchInput from '@/components/SearchInput';
const { Sider, Content, Header, Footer } = Layout;
@ -19,7 +19,11 @@ const { RangePicker } = DatePicker;
const SearchForm = memo(function ({ initialValues, onSubmit }) {
const [form] = Form.useForm();
function handleSubmit(values) {
onSubmit?.({...values, travel: values?.agent?.value || -1});
onSubmit?.({
...values,
travel: values?.agent?.value || '',
customer_name: values?.customer?.label || '',
});
}
return (
<Form
@ -33,57 +37,19 @@ const SearchForm = memo(function ({ initialValues, onSubmit }) {
<Form.Item label='顾问' name='agent' style={{ width: '200px' }}>
<SearchInput placeholder='搜索顾问' fetchOptions={fetchSalesAgent} />
</Form.Item>
<Form.Item label='客人' name='orderLabel' style={{ width: '200px' }}>
<Form.Item label='客人' name='customer' style={{ width: '200px' }}>
<SearchInput placeholder='搜索客人' fetchOptions={fetchCustomerList} />
</Form.Item>
{/* <Form.Item label='H' name='orderLabel' style={{ width: '200px' }}>
<Select
showSearch
placeholder='请选择'
optionFilterProp='children'
filterOption={(input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase())}
options={[
{
value: 'Denise',
label: 'Denise',
},
{
value: 'Kennedy',
label: 'Kennedy',
},
{
value: 'Harsh',
label: 'Harsh',
},
{
value: 'SMLiew',
label: 'SMLiew',
},
{
value: 'See Kok Ching',
label: 'See Kok Ching',
},
{
value: 'Jonathan Michael Lilley',
label: 'Jonathan Michael Lilley',
},
{
value: 'Loan',
label: 'Loan',
},
{
value: 'Leah Belle',
label: 'Leah Belle',
},
{
value: 'Christelle Narvasa',
label: 'Christelle Narvasa',
},
{
value: 'Mai Schaefer',
label: 'Mai Schaefer',
},
]}
options={[]}
/>
</Form.Item>
<Form.Item label='关键词' name='orderNumber'>
</Form.Item> */}
<Form.Item label='关键词' name='search'>
<Input placeholder='关键词' allowClear />
</Form.Item>
<Form.Item label='日期' name='startDate'>

Loading…
Cancel
Save