perf: 客服>*: 搜索组件

feature/pivot
Lei OT 2 years ago
parent e0f55ddeb8
commit f5dc044469

@ -153,6 +153,21 @@ export default observer((props) => {
transform: (value) => isEmpty(value) ? 'ALL' : value?.key || '', transform: (value) => isEmpty(value) ? 'ALL' : value?.key || '',
default: '', default: '',
}, },
'agency': {
key: 'agency',
transform: (value) => value?.key || '',
default: '',
},
'countryArea': {
key: 'countryArea',
transform: (value) => value?.value || value?.key || '',
default: '',
},
'orderStatus': {
key: 'orderStatus',
transform: (value) => value?.value || value?.key || '',
default: '',
},
}; };
let dest = {}; let dest = {};
const { applyDate, applyDate2, year, yearDiff, dates, months, ...omittedValue } = values; const { applyDate, applyDate2, year, yearDiff, dates, months, ...omittedValue } = values;
@ -247,6 +262,19 @@ function getFields(props) {
}; };
let baseChildren = []; let baseChildren = [];
baseChildren = [ baseChildren = [
item(
'agency',
99,
<Form.Item name={'agency'} >
<SearchInput
autoGet
url="/service-web/QueryData/GetVEIName"
map={{ 'CAV_VEI_SN': 'key', 'VEI2_CompanyBN': 'label' }}
resultkey={'result1'}
placeholder="所有地接社"
/>
</Form.Item>
),
item( item(
'billtype', 'billtype',
99, 99,
@ -309,6 +337,42 @@ function getFields(props) {
</Form.Item>, </Form.Item>,
3 3
), ),
item(
'countryArea',
99,
<Form.Item name={`countryArea`} initialValue={at(props, 'initialValue.countryArea')[0] || (fieldProps?.countryArea?.show_all ? { key: 'all', label: '所有国家' } : undefined)}>
<Select style={{ width: '100%' }} placeholder="所有国家" labelInValue>
{fieldProps?.countryArea?.show_all && <Option key="all" value="">
所有国家
</Option>}
<Option key="china" value="china">
国内
</Option>
<Option key="foreign" value="foreign">
国外
</Option>
</Select>
</Form.Item>,
3
),
item(
'orderStatus',
99,
<Form.Item name={`orderStatus`} initialValue={at(props, 'initialValue.orderStatus')[0] || (fieldProps?.orderStatus?.show_all ? { key: '-1', label: '所有' } : undefined)}>
<Select style={{ width: '100%' }} placeholder="所有状态" labelInValue>
{fieldProps?.orderStatus?.show_all && <Select.Option key="所有" value="-1">
所有
</Select.Option> }
<Select.Option key="已成行" value="1">
已成行
</Select.Option>
<Select.Option key="未成行" value="0">
未成行
</Select.Option>
</Select>
</Form.Item>,
3
),
// //
item( item(
'DateType', 'DateType',

@ -59,9 +59,11 @@ class CustomerServices {
{ {
title: '地接社名称', title: '地接社名称',
dataIndex: 'VendorName', dataIndex: 'VendorName',
fixed: 'left',
children: [{ children: [{
// title: this.startDate.format(config.DATE_FORMAT) + '~' + this.endDate.format(config.DATE_FORMAT), // title: this.startDate.format(config.DATE_FORMAT) + '~' + this.endDate.format(config.DATE_FORMAT),
dataIndex: 'VendorName', dataIndex: 'VendorName',
fixed: 'left',
render: (text, record) => <NavLink to={`/agent/${record.EOI_ObjSN}/group/list`}>{record.VendorName}</NavLink> render: (text, record) => <NavLink to={`/agent/${record.EOI_ObjSN}/group/list`}>{record.VendorName}</NavLink>
} }
] ]
@ -297,10 +299,10 @@ class CustomerServices {
{ {
title: '城市', title: '城市',
dataIndex: 'COLD_ServiceCityName', dataIndex: 'COLD_ServiceCityName',
fix: 'left', fixed: 'left',
children: [{ children: [{
dataIndex: 'COLD_ServiceCityName', dataIndex: 'COLD_ServiceCityName',
fix: 'left', fixed: 'left',
render: (text, record) => <NavLink to={`/destination/${record.COLD_ServiceCity}/group/list`}>{record.COLD_ServiceCityName}</NavLink> render: (text, record) => <NavLink to={`/destination/${record.COLD_ServiceCity}/group/list`}>{record.COLD_ServiceCityName}</NavLink>
} }
] ]
@ -455,6 +457,20 @@ class CustomerServices {
}); });
} }
searchValues = {
DateType: { key: 'startDate', label: '走团日期'},
};
setSearchValues(obj, values) {
this.dateType = obj.DateType;
this.selectedAgent = obj.agency;
this.startDateString = obj.Date1;
this.endDateString = obj.Date2;
this.selectedCountry = obj.countryArea;
this.selectedTeam = obj.DepartmentList.replace('ALL', '');
this.selectedOrderStatus = obj.orderStatus;
}
selectDateRange(startDate, endDate) { selectDateRange(startDate, endDate) {
this.startDate = startDate; this.startDate = startDate;
this.endDate = endDate; this.endDate = endDate;
@ -520,7 +536,7 @@ class CustomerServices {
{ {
title: '地接社名称', title: '地接社名称',
dataIndex: 'VendorName', dataIndex: 'VendorName',
fix: 'left', fixed: 'left',
render: (text, record) => { render: (text, record) => {
if (record.EOI_ObjSN === -1) { if (record.EOI_ObjSN === -1) {
return text; return text;

@ -1,142 +1,51 @@
import React, { useContext, useEffect } from 'react'; import { useContext, useEffect } from 'react';
import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd'; import { Row, Col, Typography, Space, Table, Divider } from 'antd';
import { SearchOutlined } from '@ant-design/icons';
import { stores_Context } from '../config'; import { stores_Context } from '../config';
import * as config from '../config';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import moment from 'moment';
import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
import { utils, writeFileXLSX } from 'xlsx'; import { utils, writeFileXLSX } from 'xlsx';
import GroupSelect from './../components/search/GroupSelect'; import SearchForm from './../components/search/SearchForm';
const AgentGroupCount = () => { const AgentGroupCount = () => {
const { customerServicesStore } = useContext(stores_Context); const { customerServicesStore, date_picker_store } = useContext(stores_Context);
const agentList = customerServicesStore.agentList;
const agentGroupList = customerServicesStore.agentGroupList; const agentGroupList = customerServicesStore.agentGroupList;
const agentGroupListColumns = customerServicesStore.agentGroupListColumns; const agentGroupListColumns = customerServicesStore.agentGroupListColumns;
const { startDate, endDate, dateType, inProgress } = customerServicesStore; const { inProgress } = customerServicesStore;
useEffect(() => { useEffect(() => {
customerServicesStore.fetchAllAgent(); customerServicesStore.fetchAllAgent();
}, []); }, []);
const handleSearchClick = () => {
customerServicesStore.fetchAgentGroupCount();
};
const renderAgentItem = (agent) => {
return (
<Select.Option key={agent.CAV_VEI_SN} value={agent.CAV_VEI_SN}>
{agent.VEI2_CompanyBN}
</Select.Option>
);
};
return ( return (
<> <>
<Space direction="vertical" style={{ width: '100%' }}> <Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={{ sm: 16, lg: 32 }} justify="end"> <Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Col md={24} lg={8} xxl={8}> <Col className="gutter-row" span={24}>
<Select <SearchForm
value={customerServicesStore.selectedAgent} defaultValue={{
style={{ width: '95%' }} initialValue: {
showSearch ...date_picker_store.formValues,
onSearch={(value) => { ...customerServicesStore.searchValues,
console.log('search:', value); },
}} shows: ['agency', 'DateType', 'DepartmentList', 'countryArea', 'dates'],
filterOption={(input, option) => { fieldProps: {
return option.children.indexOf(input) > -1; DepartmentList: { show_all: true },
}} WebCode: { show_all: false, mode: 'multiple' },
onChange={(value) => customerServicesStore.selectAgent(value)} dates: { hide_vs: true },
> },
<Select.Option key="0" value="">
所有地接社
</Select.Option>
{agentList.map(renderAgentItem)}
</Select>
</Col>
<Col md={24} lg={8} xxl={8}>
<GroupSelect value={customerServicesStore.selectedTeam}
onChange={(value) => customerServicesStore.selectTeam(value)}
style={{ width: '95%' }} show_all={true}
/>
</Col>
<Col md={24} lg={8} xxl={8}>
<Select
value={customerServicesStore.selectedCountry}
style={{ width: '95%' }}
onChange={(value) => customerServicesStore.selectCountry(value)}
>
<Select.Option key="ALL" value="">
所有国家
</Select.Option>
<Select.Option key="china" value="china">
国内
</Select.Option>
<Select.Option key="foreign" value="foreign">
国外
</Select.Option>
</Select>
</Col>
<Col md={24} lg={8} xxl={8}>
<Select
value={dateType}
style={{ width: '95%' }}
onChange={(value) => customerServicesStore.selectDateType(value)}
>
<Select.Option key="startDate" value="startDate">
走团日期
</Select.Option>
<Select.Option key="ConfirmDate" value="ConfirmDate">
成团日期
</Select.Option>
</Select>
</Col>
<Col md={24} lg={8} xxl={8}>
<DatePicker.RangePicker
format={config.DATE_FORMAT}
locale={zhCNlocale}
allowClear={false}
value={[startDate, endDate]}
onChange={(dates) => {
customerServicesStore.selectDateRange(dates[0], dates[1]);
}} }}
ranges={{ onSubmit={(_err, obj, form) => {
'本周': [moment().startOf('week'), moment().endOf('week')], customerServicesStore.setSearchValues(obj, form);
'上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')], customerServicesStore.fetchAgentGroupCount();
'本月': [moment().startOf('month'), moment().endOf('month')],
'上个月': [
moment().subtract(1, 'months').startOf('month'),
moment(new Date()).subtract(1, 'months').endOf('month'),
],
'近30天': [moment().subtract(30, 'days'), moment()],
'近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')],
'今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')],
'去年': [
moment().subtract(1, 'year').startOf('year').subtract(1, 'month'),
moment().subtract(1, 'year').endOf('year').subtract(1, 'month'),
],
}} }}
/> />
</Col> </Col>
<Col md={24} lg={8} xxl={8}>
<Button
type="primary"
icon={<SearchOutlined />}
loading={inProgress}
onClick={() => {
handleSearchClick();
}}
>
统计
</Button>
</Col>
</Row> </Row>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Typography.Title level={3}>地接社团信息</Typography.Title> <Typography.Title level={3}>地接社团信息</Typography.Title>
<Table sticky <Table
sticky
id="agentGroupList" id="agentGroupList"
dataSource={agentGroupList} dataSource={agentGroupList}
columns={agentGroupListColumns} columns={agentGroupListColumns}
@ -149,9 +58,7 @@ const AgentGroupCount = () => {
<Divider orientation="right" plain> <Divider orientation="right" plain>
<a <a
onClick={() => { onClick={() => {
const wb = utils.table_to_book( const wb = utils.table_to_book(document.getElementById('agentGroupList').getElementsByTagName('table')[0]);
document.getElementById('agentGroupList').getElementsByTagName('table')[0]
);
writeFileXLSX(wb, '地接社团信息.xlsx'); writeFileXLSX(wb, '地接社团信息.xlsx');
}} }}
> >

@ -1,87 +1,56 @@
import React, {useContext, useEffect} from 'react'; import { useContext, useEffect } from 'react';
import {Row, Col, Typography, Space, DatePicker, Button, Select, Table, List} from 'antd'; import { Row, Col, Typography, Space, Table, List } from 'antd';
import { import { stores_Context } from '../config';
SearchOutlined, import { observer } from 'mobx-react';
} from '@ant-design/icons'; import { NavLink, useParams } from 'react-router-dom';
import {stores_Context} from '../config';
import * as config from "../config";
import {observer} from 'mobx-react';
import { NavLink, useParams } from "react-router-dom";
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import moment from "moment"; import SearchForm from './../components/search/SearchForm';
import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
import GroupSelect from './../components/search/GroupSelect';
const AgentGroupList = () => { const AgentGroupList = () => {
const { agentId } = useParams();
const {agentId} = useParams(); const { customerServicesStore, date_picker_store } = useContext(stores_Context);
const { customerServicesStore } = useContext(stores_Context);
useEffect(() => { useEffect(() => {
customerServicesStore.fetchGroupListByAgentId(agentId); customerServicesStore.fetchGroupListByAgentId(agentId);
}, []); }, []);
const groupList = customerServicesStore.groupList; const groupList = customerServicesStore.groupList;
const groupListColumns = customerServicesStore.groupListColumns; const groupListColumns = customerServicesStore.groupListColumns;
const {startDate, endDate, dateType, inProgress} = customerServicesStore; const { startDate, endDate, dateType, inProgress } = customerServicesStore;
return ( return (
<> <>
<Space direction="vertical" style={{width: '100%'}}> <Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={{md: 24}} justify="end"> <Row gutter={{ md: 24 }} justify="end">
<Col span={8}> <Col span={24}>
<NavLink to={'/agent/group/count'}>返回</NavLink> <NavLink to={'/agent/group/count'}>返回</NavLink>
</Col> </Col>
<Col span={4}> <Col className="gutter-row" span={24}>
<GroupSelect value={customerServicesStore.selectedTeam} <SearchForm
onChange={(value) => customerServicesStore.selectTeam(value)} defaultValue={{
style={{ width: '95%' }} show_all={true} initialValue: {
...date_picker_store.formValues,
...customerServicesStore.searchValues,
},
shows: ['DateType', 'DepartmentList', 'dates'],
fieldProps: {
DepartmentList: { show_all: true },
WebCode: { show_all: false, mode: 'multiple' },
dates: { hide_vs: true },
},
}}
onSubmit={(_err, obj, form, str) => {
customerServicesStore.setSearchValues(obj, form);
customerServicesStore.fetchGroupListByAgentId(agentId);
}}
/> />
</Col> </Col>
<Col span={4}>
<Select value={dateType} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectDateType(value)}>
<Select.Option key="1" value="startDate">
走团日期
</Select.Option>
<Select.Option key="2" value="ConfirmDate">
成团日期
</Select.Option>
</Select>
</Col>
<Col span={4}>
<DatePicker.RangePicker
format={config.DATE_FORMAT} locale={zhCNlocale}
allowClear={false}
value={[startDate, endDate]}
onChange={(dates) => {customerServicesStore.selectDateRange(dates[0], dates[1]);}}
ranges={{
'本周': [moment().startOf('week'), moment().endOf('week')],
'上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')],
'近30天': [moment().subtract(30, 'days'), moment()],
'近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')],
'今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')],
'去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')],
}}
/>
</Col>
<Col span={4}>
<Button
type="primary"
icon={<SearchOutlined />}
loading={inProgress}
onClick={() => {
customerServicesStore.fetchGroupListByAgentId(agentId);
}}>
统计
</Button>
</Col>
</Row> </Row>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Typography.Title level={3}>{customerServicesStore.agentCompany}</Typography.Title> <Typography.Title level={3}>{customerServicesStore.agentCompany}</Typography.Title>
<Table sticky <Table
sticky
dataSource={groupList} dataSource={groupList}
columns={groupListColumns} columns={groupListColumns}
size="small" size="small"
@ -91,21 +60,12 @@ const AgentGroupList = () => {
scroll={{ x: 1000 }} scroll={{ x: 1000 }}
expandable={{ expandable={{
expandedRowRender: (record) => ( expandedRowRender: (record) => (
<List itemLayout="horizontal">
<List
itemLayout="horizontal"
>
<List.Item> <List.Item>
<List.Item.Meta <List.Item.Meta title="经过城市" description={record.PassCity} />
title='经过城市'
description={record.PassCity}
/>
</List.Item> </List.Item>
<List.Item> <List.Item>
<List.Item.Meta <List.Item.Meta title="评论内容" description={record.ECI_Content} />
title='评论内容'
description={record.ECI_Content}
/>
</List.Item> </List.Item>
</List> </List>
), ),
@ -113,9 +73,9 @@ const AgentGroupList = () => {
/> />
</Col> </Col>
</Row> </Row>
</Space> </Space>
</> </>
); );
}; };
export default observer(AgentGroupList); export default observer(AgentGroupList);

@ -1,109 +1,49 @@
import React, {useContext, useEffect} from 'react'; import { useContext, useEffect } from 'react';
import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd'; import { Row, Col, Typography, Space, Table, Divider } from 'antd';
import {
SearchOutlined,
} from '@ant-design/icons';
import { stores_Context } from '../config'; import { stores_Context } from '../config';
import * as config from "../config";
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import moment from "moment"; import { utils, writeFileXLSX } from 'xlsx';
import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; import SearchForm from './../components/search/SearchForm';
import { utils, writeFileXLSX } from "xlsx";
import GroupSelect from './../components/search/GroupSelect';
const DestinationGroupCount = () => { const DestinationGroupCount = () => {
const { customerServicesStore, date_picker_store } = useContext(stores_Context);
const {customerServicesStore} = useContext(stores_Context);
const destinationGroupCount = customerServicesStore.destinationGroupCount; const destinationGroupCount = customerServicesStore.destinationGroupCount;
const destinationGroupCountColumns = customerServicesStore.destinationGroupCountColumns; const destinationGroupCountColumns = customerServicesStore.destinationGroupCountColumns;
const {startDate, endDate, dateType, inProgress} = customerServicesStore; const { startDate, endDate, dateType, inProgress } = customerServicesStore;
useEffect(() => {
customerServicesStore.selectCountry('china');
}, []);
const handleSearchClick = () => {
customerServicesStore.fetchDestinationGroupCount();
};
return ( return (
<> <>
<Space direction="vertical" style={{ width: '100%' }}> <Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={{ sm: 16, lg: 32 }} justify="end"> <Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
<Col md={24} lg={8} xxl={8}> <Col className="gutter-row" span={24}>
<GroupSelect value={customerServicesStore.selectedTeam} <SearchForm
onChange={(value) => customerServicesStore.selectTeam(value)} defaultValue={{
style={{ width: '95%' }} show_all={true} initialValue: {
/> ...date_picker_store.formValues,
</Col> countryArea: { key: 'china', label: '国内' },
<Col md={24} lg={8} xxl={8}> ...customerServicesStore.searchValues,
<Select value={customerServicesStore.selectedCountry} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectCountry(value)}> },
<Select.Option key="china" value="china"> shows: ['DateType', 'DepartmentList', 'countryArea', 'orderStatus', 'dates'],
国内 fieldProps: {
</Select.Option> DepartmentList: { show_all: true },
<Select.Option key="foreign" value="foreign"> orderStatus: { show_all: true },
国外 countryArea: { show_all: false },
</Select.Option> dates: { hide_vs: true },
</Select> },
</Col> }}
<Col md={24} lg={8} xxl={8}> onSubmit={(_err, obj, form) => {
<Select value={customerServicesStore.selectedOrderStatus} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectStatus(value)}> customerServicesStore.setSearchValues(obj, form);
<Select.Option key="所有" value="-1"> customerServicesStore.fetchDestinationGroupCount();
所有
</Select.Option>
<Select.Option key="已成行" value="1">
已成行
</Select.Option>
<Select.Option key="未成行" value="0">
未成行
</Select.Option>
</Select>
</Col>
<Col md={24} lg={8} xxl={8}>
<Select value={dateType} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectDateType(value)}>
<Select.Option key="startDate" value="startDate">
走团日期
</Select.Option>
<Select.Option key="ConfirmDate" value="ConfirmDate">
成团日期
</Select.Option>
</Select>
</Col>
<Col md={24} lg={8} xxl={8}>
<DatePicker.RangePicker
format={config.DATE_FORMAT} locale={zhCNlocale}
allowClear={false}
value={[startDate, endDate]}
onChange={(dates) => { customerServicesStore.selectDateRange(dates[0], dates[1]); }}
ranges={{
'本周': [moment().startOf('week'), moment().endOf('week')],
'上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')],
'近30天': [moment().subtract(30, 'days'), moment()],
'近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')],
'今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')],
'去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')],
}} }}
/> />
</Col> </Col>
<Col md={24} lg={8} xxl={8}>
<Button
type="primary"
icon={<SearchOutlined />}
loading={inProgress}
onClick={() => {
handleSearchClick();
}}>
统计
</Button>
</Col>
</Row> </Row>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Typography.Title level={3}>目的地团信息</Typography.Title> <Typography.Title level={3}>目的地团信息</Typography.Title>
<Table sticky <Table
sticky
id="destinationGroupCount" id="destinationGroupCount"
dataSource={destinationGroupCount} dataSource={destinationGroupCount}
columns={destinationGroupCountColumns} columns={destinationGroupCountColumns}
@ -116,9 +56,10 @@ const DestinationGroupCount = () => {
<Divider orientation="right" plain> <Divider orientation="right" plain>
<a <a
onClick={() => { onClick={() => {
const wb = utils.table_to_book(document.getElementById("destinationGroupCount").getElementsByTagName("table")[0]); const wb = utils.table_to_book(document.getElementById('destinationGroupCount').getElementsByTagName('table')[0]);
writeFileXLSX(wb, "目的地团信息.xlsx"); writeFileXLSX(wb, '目的地团信息.xlsx');
}}> }}
>
导出excel 导出excel
</a> </a>
</Divider> </Divider>

@ -1,88 +1,58 @@
import React, {useContext, useEffect} from 'react'; import { useContext, useEffect } from 'react';
import {Row, Col, Typography, Space, DatePicker, Button, Select, Table, List} from 'antd'; import { Row, Col, Space, Table, List } from 'antd';
import { import { stores_Context } from '../config';
SearchOutlined, import { observer } from 'mobx-react';
} from '@ant-design/icons'; import { NavLink, useParams } from 'react-router-dom';
import {stores_Context} from '../config';
import * as config from "../config";
import {observer} from 'mobx-react';
import { NavLink, useParams } from "react-router-dom";
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import moment from "moment"; import SearchForm from './../components/search/SearchForm';
import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
import GroupSelect from './../components/search/GroupSelect';
const DestinationGroupList = () => { const DestinationGroupList = () => {
const { destinationId } = useParams();
const {destinationId} = useParams(); const { customerServicesStore, date_picker_store } = useContext(stores_Context);
const { customerServicesStore } = useContext(stores_Context);
useEffect(() => { useEffect(() => {
customerServicesStore.fetchGroupListByDestinationId(destinationId); customerServicesStore.fetchGroupListByDestinationId(destinationId);
}, []); }, []);
const destinationGroupList = customerServicesStore.destinationGroupList; const destinationGroupList = customerServicesStore.destinationGroupList;
const destinationGroupListColumns = customerServicesStore.destinationGroupListColumns; const destinationGroupListColumns = customerServicesStore.destinationGroupListColumns;
const {startDate, endDate, dateType, inProgress} = customerServicesStore; const { inProgress } = customerServicesStore;
return ( return (
<> <>
<Space direction="vertical" style={{width: '100%'}}> <Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={{md: 24}} justify="end"> <Row gutter={{ md: 24 }} justify="end">
<Col span={8}> <Col span={24}>
<NavLink to={'/destination/group/count'}>返回</NavLink> <NavLink to={'/destination/group/count'}>返回</NavLink>
</Col> </Col>
<Col span={4}> <Col className="gutter-row" span={24}>
<SearchForm
<GroupSelect value={customerServicesStore.selectedTeam} defaultValue={{
onChange={(value) => customerServicesStore.selectTeam(value)} initialValue: {
style={{ width: '95%' }} show_all={true} ...date_picker_store.formValues,
countryArea: { key: 'china', label: '国内' },
...customerServicesStore.searchValues,
},
shows: ['DateType', 'DepartmentList', 'dates'],
fieldProps: {
DepartmentList: { show_all: true },
orderStatus: { show_all: true },
countryArea: { show_all: false },
dates: { hide_vs: true },
},
}}
onSubmit={(_err, obj, form) => {
customerServicesStore.setSearchValues(obj, form);
customerServicesStore.fetchGroupListByDestinationId(destinationId);
customerServicesStore.fetchDestinationGroupCount();
}}
/> />
</Col> </Col>
<Col span={4}>
<Select value={dateType} style={{ width: "95%" }} onChange={(value) => customerServicesStore.selectDateType(value)}>
<Select.Option key="1" value="startDate">
走团日期
</Select.Option>
<Select.Option key="2" value="ConfirmDate">
成团日期
</Select.Option>
</Select>
</Col>
<Col span={4}>
<DatePicker.RangePicker
format={config.DATE_FORMAT} locale={zhCNlocale}
allowClear={false}
value={[startDate, endDate]}
onChange={(dates) => {customerServicesStore.selectDateRange(dates[0], dates[1]);}}
ranges={{
'本周': [moment().startOf('week'), moment().endOf('week')],
'上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
'本月': [moment().startOf('month'), moment().endOf('month')],
'上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')],
'近30天': [moment().subtract(30, 'days'), moment()],
'近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')],
'今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')],
'去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')],
}}
/>
</Col>
<Col span={4}>
<Button
type="primary"
icon={<SearchOutlined />}
loading={inProgress}
onClick={() => {
customerServicesStore.fetchGroupListByDestinationId(destinationId);
customerServicesStore.fetchDestinationGroupCount();
}}>
统计
</Button>
</Col>
</Row> </Row>
<Row> <Row>
<Col span={24}> <Col span={24}>
<Table sticky <Table
sticky
dataSource={destinationGroupList} dataSource={destinationGroupList}
columns={destinationGroupListColumns} columns={destinationGroupListColumns}
size="small" size="small"
@ -92,21 +62,12 @@ const DestinationGroupList = () => {
scroll={{ x: 600 }} scroll={{ x: 600 }}
expandable={{ expandable={{
expandedRowRender: (record) => ( expandedRowRender: (record) => (
<List itemLayout="horizontal">
<List
itemLayout="horizontal"
>
<List.Item> <List.Item>
<List.Item.Meta <List.Item.Meta title="经过城市" description={record.PassCity} />
title='经过城市'
description={record.PassCity}
/>
</List.Item> </List.Item>
<List.Item> <List.Item>
<List.Item.Meta <List.Item.Meta title="地接社" description={record.VendorList} />
title='地接社'
description={record.VendorList}
/>
</List.Item> </List.Item>
</List> </List>
), ),
@ -114,9 +75,9 @@ const DestinationGroupList = () => {
/> />
</Col> </Col>
</Row> </Row>
</Space> </Space>
</> </>
); );
}; };
export default observer(DestinationGroupList); export default observer(DestinationGroupList);

@ -200,7 +200,7 @@ const Sale = () => {
}, },
]; ];
const tableColumns = type_data.columns.map((ele, i) => const tableColumns = type_data.columns.map((ele, i) =>
i === 0 ? { ...ele, fix: 'left', children: (ele?.children || []).map((ele_child, i_child) => (i_child === 0 ? { ...ele_child, fix: 'left' } : { ...ele_child })) } : { ...ele } i === 0 ? { ...ele, fixed: 'left', children: (ele?.children || []).map((ele_child, i_child) => (i_child === 0 ? { ...ele_child, fixed: 'left' } : { ...ele_child })) } : { ...ele }
); );
return ( return (

Loading…
Cancel
Save