diff --git a/src/charts/Customer_care_inchina.js b/src/charts/Customer_care_inchina.js index d8ab1dc..d2b6ba8 100644 --- a/src/charts/Customer_care_inchina.js +++ b/src/charts/Customer_care_inchina.js @@ -95,7 +95,7 @@ const Customer_care_inchina = () => { /> - { const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); writeFileXLSX(wb, "在华客人.xlsx"); diff --git a/src/charts/Customer_care_potential.js b/src/charts/Customer_care_potential.js index 0d8caf4..d7c7d01 100644 --- a/src/charts/Customer_care_potential.js +++ b/src/charts/Customer_care_potential.js @@ -89,7 +89,7 @@ const Customer_care_potential = () => { /> - { const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); writeFileXLSX(wb, "潜力客户.xlsx"); diff --git a/src/charts/Customer_care_regular.js b/src/charts/Customer_care_regular.js index 687286e..bf743a0 100644 --- a/src/charts/Customer_care_regular.js +++ b/src/charts/Customer_care_regular.js @@ -94,7 +94,7 @@ const Customer_care_regular = () => { /> - { const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); writeFileXLSX(wb, "老客户.xlsx"); diff --git a/src/config.js b/src/config.js index a07dcf8..b44be47 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,6 @@ import React from "react"; export const stores_Context = React.createContext(); -export const DATE_FORMAT = 'YYYY-MM-DD'; -export const HT_HOST = 'https://p9axztuwd7x8a7.mycht.cn'; -//export const HT_HOST = 'http://202.103.68.100:890';//889正式库 \ No newline at end of file +export const DATE_FORMAT = "YYYY-MM-DD"; +//export const HT_HOST = 'https://p9axztuwd7x8a7.mycht.cn'; +export const HT_HOST = "http://202.103.68.100:890"; //889正式库 diff --git a/src/stores/AuthStore.js b/src/stores/AuthStore.js index d5f70ce..7e28d1b 100644 --- a/src/stores/AuthStore.js +++ b/src/stores/AuthStore.js @@ -13,7 +13,7 @@ class AuthStore { } auth = ['admin']; //开发时候用,正式环境留空 - user = {name:'ycc',userid:'12345678'};//开发时候用,正式环境留空 + user = {name:'loading',userid:'...'};//开发时候用,正式环境留空 has_permission(requireds) { if (Object.keys(requireds).length == 0) { diff --git a/src/stores/DashboardStore.js b/src/stores/DashboardStore.js index d554e0a..7d7c025 100644 --- a/src/stores/DashboardStore.js +++ b/src/stores/DashboardStore.js @@ -158,7 +158,7 @@ class DashboardStore { loading: false, data: [], group_select_mode: 'multiple',//是否多选分组 - groups: ['1', '2', '28', '7', '8', '9', '11', '12', '20', '21'], + groups: ['1', '2', '28', '7', '8', '9', '11', '12', '20', '21','18'], columns: [ { title: '市场', diff --git a/src/utils/commons.js b/src/utils/commons.js index f501970..654a408 100644 --- a/src/utils/commons.js +++ b/src/utils/commons.js @@ -207,8 +207,7 @@ export function show_vs_tag(vs, vs_diff, data1, data2) { }// else { // tag = } color="lime">{vs} {vs_diff} // } - return
{data1} vs {data2}
- {tag}
+ return
{data1} vs {data2}
{tag}
} //数组去掉重复 diff --git a/src/views/Orders.js b/src/views/Orders.js index 51ca871..c70508b 100644 --- a/src/views/Orders.js +++ b/src/views/Orders.js @@ -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 `
${title}
${data.seriesField} ${data.yField}
`; // } 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 { orders_store.onChange_Tabs(active_key)}> 来源类型} key="Form"> - +
+ { + const wb = utils.table_to_book(document.getElementById("table_to_xlsx_form").getElementsByTagName('table')[0]); + writeFileXLSX(wb, "来源类型.xlsx"); + }}>导出excel产品类型} key="Product"> -
+
+ { + const wb = utils.table_to_book(document.getElementById("table_to_xlsx_product").getElementsByTagName('table')[0]); + writeFileXLSX(wb, "产品类型.xlsx"); + }}>导出excel国籍} key="Country"> -
+
+ { + const wb = utils.table_to_book(document.getElementById("table_to_xlsx_country").getElementsByTagName('table')[0]); + writeFileXLSX(wb, "国籍.xlsx"); + }}>导出excel线路} key="line"> -
+
+ { + const wb = utils.table_to_book(document.getElementById("table_to_xlsx_line").getElementsByTagName('table')[0]); + writeFileXLSX(wb, "线路.xlsx"); + }}>导出excel目的地} key="city"> -
+
+ { + const wb = utils.table_to_book(document.getElementById("table_to_xlsx_city").getElementsByTagName('table')[0]); + writeFileXLSX(wb, "目的地.xlsx"); + }}>导出excel页面类型} key="LineClass"> -
+
+ { + const wb = utils.table_to_book(document.getElementById("table_to_xlsx_LineClass").getElementsByTagName('table')[0]); + writeFileXLSX(wb, "页面类型.xlsx"); + }}>导出excel @@ -270,9 +313,6 @@ class Orders extends Component { ); } - } - - export - default +} - observer(Orders); +export default observer(Orders); diff --git a/src/views/Orders_sub.js b/src/views/Orders_sub.js index eff9a00..80fe2e4 100644 --- a/src/views/Orders_sub.js +++ b/src/views/Orders_sub.js @@ -118,12 +118,18 @@ const Orders_sub = () => { dataIndex: 'COLI_Success', key: 'COLI_Success', render: (text, record) => {text == 1 ? '是' : '否'}, + sorter: (a, b) => b.COLI_Success - a.COLI_Success, }, { title: '预定时间', dataIndex: 'COLI_ApplyDate', key: 'COLI_ApplyDate', }, + { + title: 'IP', + dataIndex: 'COLI_SenderIP', + key: 'COLI_SenderIP', + }, { title: '订单内容', dataIndex: 'COLI_OrderDetailText', @@ -180,10 +186,10 @@ const Orders_sub = () => { onChange={(active_key) => orders_store.onChange_Tabs_sub(ordertype, ordertype_sub, active_key)}> 订单内容} key="detail"> - + {date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)}
record.COLI_ID} + columns={table_data.columns} size="small" rowKey={record => record.key} expandable={{ expandedRowRender: (record) => (
{record.COLI_OrderDetailText}
@@ -191,11 +197,11 @@ const Orders_sub = () => { }} /> - - + + {date_picker_store.start_date_cp ? date_picker_store.start_date_cp.format(config.DATE_FORMAT) + '~' + date_picker_store.end_date_cp.format(config.DATE_FORMAT) : ''}
record.COLI_ID} + columns={table_data2.columns} size="small" rowKey={record => record.key} expandable={{ expandedRowRender: (record) => (
{record.COLI_OrderDetailText}
@@ -208,15 +214,15 @@ const Orders_sub = () => { 访问路径} key="page"> - + {date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)} -
record.COLI_ID} +
record.key} columns={table_data.columns} size="small"/> - - + + {date_picker_store.start_date_cp ? date_picker_store.start_date_cp.format(config.DATE_FORMAT) + '~' + date_picker_store.end_date_cp.format(config.DATE_FORMAT) : ''} -
record.COLI_ID} +
record.key} columns={table_data2.columns} size="small"/>