|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
|
import {Row, Col, Button, Tabs, Table} from 'antd';
|
|
|
|
|
import {Row, Col, Button, Tabs, Table, Divider} from 'antd';
|
|
|
|
|
import {
|
|
|
|
|
ContainerOutlined, CarryOutOutlined, BlockOutlined,
|
|
|
|
|
SmileOutlined, TagsOutlined, GlobalOutlined,
|
|
|
|
@ -13,6 +13,7 @@ import DatePickerCharts from '../charts/DatePickerCharts'
|
|
|
|
|
import * as config from "../config";
|
|
|
|
|
import {NavLink} from "react-router-dom";
|
|
|
|
|
import * as comm from "../utils/commons"
|
|
|
|
|
import {utils, writeFileXLSX} from "xlsx";
|
|
|
|
|
|
|
|
|
|
class Orders extends Component {
|
|
|
|
|
|
|
|
|
@ -142,13 +143,13 @@ class Orders extends Component {
|
|
|
|
|
{
|
|
|
|
|
title: '成交毛利(预计)',
|
|
|
|
|
children: [{title: ordercountTotal1.YJLY, dataIndex: 'YJLY'}],
|
|
|
|
|
sorter: (a, b) => b.YJLY - a.YJLY,
|
|
|
|
|
sorter: (a, b) => parseFloat(b.YJLY.replace(/,/g, '')) - parseFloat(a.YJLY.replace(/,/g, '')),
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
title: '单个订单价值',
|
|
|
|
|
children: [{title: ordercountTotal1.Ordervalue, dataIndex: 'Ordervalue'}],
|
|
|
|
|
sorter: (a, b) => b.Ordervalue - a.Ordervalue,
|
|
|
|
|
sorter: (a, b) => parseFloat(b.Ordervalue.replace(/,/g, '')) - parseFloat(a.Ordervalue.replace(/,/g, '')),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
result.dataSource = data.ordercount1;
|
|
|
|
@ -161,7 +162,7 @@ class Orders extends Component {
|
|
|
|
|
const {orders_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=data_source.length ? Math.round((data_source.reduce((a, b) => a + b.yField, 0))/data_source.length):0;//平均值,显示一条平均线
|
|
|
|
|
const avg_line_y = data_source.length ? Math.round((data_source.reduce((a, b) => a + b.yField, 0)) / data_source.length) : 0;//平均值,显示一条平均线
|
|
|
|
|
const config = {
|
|
|
|
|
data: data_source,
|
|
|
|
|
padding: 'auto',
|
|
|
|
@ -211,7 +212,7 @@ class Orders extends Component {
|
|
|
|
|
// return `<div>${title}</div><div>${data.seriesField} ${data.yField}</div>`;
|
|
|
|
|
// }
|
|
|
|
|
title: (title, datum) => {
|
|
|
|
|
return title+' '+ comm.getWeek(datum.xField);//显示周几
|
|
|
|
|
return title + ' ' + comm.getWeek(datum.xField);//显示周几
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
smooth: true,
|
|
|
|
@ -246,22 +247,64 @@ class Orders extends Component {
|
|
|
|
|
<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 dataSource={table_data.dataSource} columns={table_data.columns} size="small"/>
|
|
|
|
|
<Table id="table_to_xlsx_form" dataSource={table_data.dataSource}
|
|
|
|
|
columns={table_data.columns} size="small"
|
|
|
|
|
pagination={false}/>
|
|
|
|
|
<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 dataSource={table_data.dataSource} columns={table_data.columns} size="small"/>
|
|
|
|
|
<Table id="table_to_xlsx_product" dataSource={table_data.dataSource}
|
|
|
|
|
columns={table_data.columns} size="small"
|
|
|
|
|
pagination={false}/>
|
|
|
|
|
<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 dataSource={table_data.dataSource} columns={table_data.columns} size="small"/>
|
|
|
|
|
<Table id="table_to_xlsx_country" dataSource={table_data.dataSource}
|
|
|
|
|
columns={table_data.columns} size="small"
|
|
|
|
|
pagination={false}/>
|
|
|
|
|
<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 dataSource={table_data.dataSource} columns={table_data.columns} size="small"/>
|
|
|
|
|
<Table id="table_to_xlsx_line" dataSource={table_data.dataSource}
|
|
|
|
|
columns={table_data.columns} size="small"
|
|
|
|
|
pagination={false}/>
|
|
|
|
|
<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 dataSource={table_data.dataSource} columns={table_data.columns} size="small"/>
|
|
|
|
|
<Table id="table_to_xlsx_city" dataSource={table_data.dataSource}
|
|
|
|
|
columns={table_data.columns} size="small"
|
|
|
|
|
pagination={false}/>
|
|
|
|
|
<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 dataSource={table_data.dataSource} columns={table_data.columns} size="small"/>
|
|
|
|
|
<Table id="table_to_xlsx_LineClass" dataSource={table_data.dataSource}
|
|
|
|
|
columns={table_data.columns} size="small"
|
|
|
|
|
pagination={false}/>
|
|
|
|
|
<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>
|
|
|
|
|
</Col>
|
|
|
|
@ -270,9 +313,6 @@ class Orders extends Component {
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export
|
|
|
|
|
default
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
observer(Orders);
|
|
|
|
|
export default observer(Orders);
|
|
|
|
|