|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import { Row, Col, Button, Tabs, Table, Divider, Select, Radio } from "antd";
|
|
|
|
|
import { Row, Col, Button, Tabs, Table, Divider, Select, Radio, Spin } from "antd";
|
|
|
|
|
import { ContainerOutlined, CarryOutOutlined, BlockOutlined, SmileOutlined, TagsOutlined, GlobalOutlined, SearchOutlined, FullscreenOutlined, DingtalkOutlined } from "@ant-design/icons";
|
|
|
|
|
import { stores_Context } from "../config";
|
|
|
|
|
import { Line, Pie } from "@ant-design/charts";
|
|
|
|
@ -13,6 +13,8 @@ import { NavLink } from "react-router-dom";
|
|
|
|
|
import * as comm from "../utils/commons";
|
|
|
|
|
import { utils, writeFileXLSX } from "xlsx";
|
|
|
|
|
import DateGroupRadio from '../components/DateGroupRadio';
|
|
|
|
|
import SearchForm from './../components/search/SearchForm';
|
|
|
|
|
|
|
|
|
|
class Orders extends Component {
|
|
|
|
|
static contextType = stores_Context;
|
|
|
|
|
|
|
|
|
@ -219,7 +221,7 @@ class Orders extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { orders_store } = this.context;
|
|
|
|
|
const { orders_store, date_picker_store } = this.context;
|
|
|
|
|
const table_data = orders_store.orderCountData_Form ? this.format_data(orders_store.orderCountData_Form) : [];
|
|
|
|
|
const data_source = orders_store.orderCountData ? orders_store.orderCountData : [];
|
|
|
|
|
const avg_line_y = Math.round(orders_store.avgLine1);
|
|
|
|
@ -310,55 +312,42 @@ class Orders extends Component {
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const tableProps = {
|
|
|
|
|
dataSource: table_data.dataSource,
|
|
|
|
|
columns: table_data.columns,
|
|
|
|
|
size: 'small',
|
|
|
|
|
pagination: false,
|
|
|
|
|
scroll: { x: '100%' },
|
|
|
|
|
loading: orders_store.loading,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<Row gutter={{ sm: 16, lg: 32 }}>
|
|
|
|
|
<Col md={24} lg={12} xxl={14}></Col>
|
|
|
|
|
<Col md={24} lg={12} xxl={10}>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col md={24} lg={8} xxl={8}>
|
|
|
|
|
<GroupSelect store={orders_store} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={8} xxl={8}>
|
|
|
|
|
<SiteSelect store={orders_store} show_all={true} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={8} xxl={8}>
|
|
|
|
|
<Select style={{ width: "100%" }} placeholder="是否含门票" value={orders_store.include_tickets} onChange={orders_store.handleChange_include_tickets}>
|
|
|
|
|
<Select.Option key="1" value="1">
|
|
|
|
|
含门票
|
|
|
|
|
</Select.Option>
|
|
|
|
|
<Select.Option key="0" value="0">
|
|
|
|
|
不含门票
|
|
|
|
|
</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col md={24} lg={8} xxl={8}>
|
|
|
|
|
<DataTypeSelect store={orders_store} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={12} xxl={12}>
|
|
|
|
|
<DatePickerCharts />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col md={24} lg={4} xxl={4} className='align_right'>
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon={<SearchOutlined />}
|
|
|
|
|
loading={orders_store.loading}
|
|
|
|
|
onClick={() => {
|
|
|
|
|
orders_store.getOrderCount();
|
|
|
|
|
orders_store.onChange_Tabs(orders_store.active_tab_key);
|
|
|
|
|
}}>
|
|
|
|
|
统计
|
|
|
|
|
</Button>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row gutter={[16, { sm: 16, lg: 32 }]} >
|
|
|
|
|
<Col span={24} style={{textAlign: 'right'}}>
|
|
|
|
|
<div>
|
|
|
|
|
<Row gutter={16} style={{ margin: '-16px -8px', position: 'relative', top: 0, zIndex: 10 }}>
|
|
|
|
|
<Col className="gutter-row" span={24}>
|
|
|
|
|
<SearchForm
|
|
|
|
|
defaultValue={{
|
|
|
|
|
initialValue: {
|
|
|
|
|
...date_picker_store.formValues,
|
|
|
|
|
...orders_store.searchValues,
|
|
|
|
|
},
|
|
|
|
|
shows: ['DateType', 'DepartmentList', 'WebCode', 'IncludeTickets', 'dates'],
|
|
|
|
|
fieldProps: {
|
|
|
|
|
DepartmentList: { show_all: false },
|
|
|
|
|
WebCode: { show_all: true },
|
|
|
|
|
years: { hide_vs: true },
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
onSubmit={(_err, obj, form, str) => {
|
|
|
|
|
orders_store.setSearchValues(obj, form);
|
|
|
|
|
orders_store.getOrderCount();
|
|
|
|
|
orders_store.onChange_Tabs(orders_store.active_tab_key);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={24} style={{ textAlign: 'right' }}>
|
|
|
|
|
<DateGroupRadio
|
|
|
|
|
visible={data_source.length!==0}
|
|
|
|
|
visible={data_source.length !== 0}
|
|
|
|
|
dataRaw={orders_store.orderCountDataRaw}
|
|
|
|
|
onChange={orders_store.onChangeDateGroup}
|
|
|
|
|
value={orders_store.lineChartXGroup}
|
|
|
|
@ -366,177 +355,116 @@ class Orders extends Component {
|
|
|
|
|
fieldMapper={orders_store.orderCountDataFieldMapper}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Line {...config} />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Tabs activeKey={orders_store.active_tab_key} onChange={active_key => orders_store.onChange_Tabs(active_key)}>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined />
|
|
|
|
|
来源类型
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="Form">
|
|
|
|
|
<Table id="table_to_xlsx_form" dataSource={table_data.dataSource} columns={table_data.columns} size="small" pagination={false} scroll={{ x: "100%" }} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_form").getElementsByTagName("table")[0]);
|
|
|
|
|
writeFileXLSX(wb, "来源类型.xlsx");
|
|
|
|
|
}}>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<CarryOutOutlined />
|
|
|
|
|
产品类型
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="Product">
|
|
|
|
|
<Table id="table_to_xlsx_product" dataSource={table_data.dataSource} columns={table_data.columns} size="small" pagination={false} scroll={{ x: "100%" }} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_product").getElementsByTagName("table")[0]);
|
|
|
|
|
writeFileXLSX(wb, "产品类型.xlsx");
|
|
|
|
|
}}>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<SmileOutlined />
|
|
|
|
|
国籍
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="Country">
|
|
|
|
|
<Table id="table_to_xlsx_country" dataSource={table_data.dataSource} columns={table_data.columns} size="small" pagination={false} scroll={{ x: "100%" }} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_country").getElementsByTagName("table")[0]);
|
|
|
|
|
writeFileXLSX(wb, "国籍.xlsx");
|
|
|
|
|
}}>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<TagsOutlined />
|
|
|
|
|
线路
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="line">
|
|
|
|
|
<Table id="table_to_xlsx_line" dataSource={table_data.dataSource} columns={table_data.columns} size="small" pagination={false} scroll={{ x: "100%" }} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_line").getElementsByTagName("table")[0]);
|
|
|
|
|
writeFileXLSX(wb, "线路.xlsx");
|
|
|
|
|
}}>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<GlobalOutlined />
|
|
|
|
|
目的地
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="city">
|
|
|
|
|
<Table id="table_to_xlsx_city" dataSource={table_data.dataSource} columns={table_data.columns} size="small" pagination={false} scroll={{ x: "100%" }} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_city").getElementsByTagName("table")[0]);
|
|
|
|
|
writeFileXLSX(wb, "目的地.xlsx");
|
|
|
|
|
}}>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<BlockOutlined />
|
|
|
|
|
页面类型
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="LineClass">
|
|
|
|
|
<Table id="table_to_xlsx_LineClass" dataSource={table_data.dataSource} columns={table_data.columns} size="small" pagination={false} scroll={{ x: "100%" }} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_LineClass").getElementsByTagName("table")[0]);
|
|
|
|
|
writeFileXLSX(wb, "页面类型.xlsx");
|
|
|
|
|
}}>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<FullscreenOutlined />
|
|
|
|
|
客群类别
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="GuestGroupType">
|
|
|
|
|
<Table id="table_to_xlsx_GuestGroupType" dataSource={table_data.dataSource} columns={table_data.columns} size="small" pagination={false} scroll={{ x: "100%" }} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_GuestGroupType").getElementsByTagName("table")[0]);
|
|
|
|
|
writeFileXLSX(wb, "客群类别.xlsx");
|
|
|
|
|
}}>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<DingtalkOutlined />
|
|
|
|
|
出行动机
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="TravelMotivation">
|
|
|
|
|
<Table id="table_to_xlsx_TravelMotivation" dataSource={table_data.dataSource} columns={table_data.columns} size="small" pagination={false} scroll={{ x: "100%" }} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_TravelMotivation").getElementsByTagName("table")[0]);
|
|
|
|
|
writeFileXLSX(wb, "出行动机.xlsx");
|
|
|
|
|
}}>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col sm={24} lg={12}>
|
|
|
|
|
<Pie {...pie_config} data={pie_data} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col sm={24} lg={12}>
|
|
|
|
|
<Pie {...pie_config} data={pie_data2} />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
<Row gutter={[16, { sm: 16, lg: 32 }]}>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Spin spinning={orders_store.loading}>
|
|
|
|
|
<Line {...config} />
|
|
|
|
|
</Spin>
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Tabs
|
|
|
|
|
activeKey={orders_store.active_tab_key}
|
|
|
|
|
onChange={(active_key) => orders_store.onChange_Tabs(active_key)}
|
|
|
|
|
items={[
|
|
|
|
|
{
|
|
|
|
|
key: 'Form',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined />
|
|
|
|
|
来源类型
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'Country',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<SmileOutlined />
|
|
|
|
|
国籍
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'line',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<TagsOutlined />
|
|
|
|
|
线路
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'city',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<GlobalOutlined />
|
|
|
|
|
目的地
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'LineClass',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<BlockOutlined />
|
|
|
|
|
页面类型
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'GuestGroupType',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<FullscreenOutlined />
|
|
|
|
|
客群类别
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'TravelMotivation',
|
|
|
|
|
label: (
|
|
|
|
|
<span>
|
|
|
|
|
<DingtalkOutlined />
|
|
|
|
|
出行动机
|
|
|
|
|
</span>
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
].map((ele) => {
|
|
|
|
|
return {
|
|
|
|
|
...ele,
|
|
|
|
|
children: (
|
|
|
|
|
<>
|
|
|
|
|
<Table id={`table_to_xlsx_${ele.key}`} {...tableProps} />
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<a
|
|
|
|
|
onClick={() => {
|
|
|
|
|
const wb = utils.table_to_book(document.getElementById(`table_to_xlsx_${ele.key}`).getElementsByTagName('table')[0]);
|
|
|
|
|
writeFileXLSX(wb, `${ele.key}.xlsx`);
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
导出excel
|
|
|
|
|
</a>
|
|
|
|
|
</Divider>
|
|
|
|
|
</>
|
|
|
|
|
),
|
|
|
|
|
};
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col sm={24} lg={12}>
|
|
|
|
|
<Pie {...pie_config} data={pie_data} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col sm={24} lg={12}>
|
|
|
|
|
<Pie {...pie_config} data={pie_data2} />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|