金额的排序bug,因为带有,

订单数据的样式修改
feature/2.0-sales-trade
尹诚诚 3 years ago
parent e447bd26e3
commit c76065be63

@ -95,7 +95,7 @@ const Customer_care_inchina = () => {
/> />
</Col> </Col>
<Col span={24}> <Col span={24}>
<Divider orientation="right"><a <Divider orientation="right" plain><a
onClick={() => { onClick={() => {
const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]);
writeFileXLSX(wb, "在华客人.xlsx"); writeFileXLSX(wb, "在华客人.xlsx");

@ -89,7 +89,7 @@ const Customer_care_potential = () => {
/> />
</Col> </Col>
<Col span={24}> <Col span={24}>
<Divider orientation="right"><a <Divider orientation="right" plain><a
onClick={() => { onClick={() => {
const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]);
writeFileXLSX(wb, "潜力客户.xlsx"); writeFileXLSX(wb, "潜力客户.xlsx");

@ -94,7 +94,7 @@ const Customer_care_regular = () => {
/> />
</Col> </Col>
<Col span={24}> <Col span={24}>
<Divider orientation="right"><a <Divider orientation="right" plain><a
onClick={() => { onClick={() => {
const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]); const wb = utils.table_to_book(document.getElementById("table_to_xlsx").getElementsByTagName('table')[0]);
writeFileXLSX(wb, "老客户.xlsx"); writeFileXLSX(wb, "老客户.xlsx");

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
export const stores_Context = React.createContext(); export const stores_Context = React.createContext();
export const DATE_FORMAT = 'YYYY-MM-DD'; export const DATE_FORMAT = "YYYY-MM-DD";
export const HT_HOST = 'https://p9axztuwd7x8a7.mycht.cn'; //export const HT_HOST = 'https://p9axztuwd7x8a7.mycht.cn';
//export const HT_HOST = 'http://202.103.68.100:890';//889正式库 export const HT_HOST = "http://202.103.68.100:890"; //889正式库

@ -13,7 +13,7 @@ class AuthStore {
} }
auth = ['admin']; //开发时候用,正式环境留空 auth = ['admin']; //开发时候用,正式环境留空
user = {name:'ycc',userid:'12345678'};//开发时候用,正式环境留空 user = {name:'loading',userid:'...'};//开发时候用,正式环境留空
has_permission(requireds) { has_permission(requireds) {
if (Object.keys(requireds).length == 0) { if (Object.keys(requireds).length == 0) {

@ -158,7 +158,7 @@ class DashboardStore {
loading: false, loading: false,
data: [], data: [],
group_select_mode: 'multiple',//是否多选分组 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: [ columns: [
{ {
title: '市场', title: '市场',

@ -207,8 +207,7 @@ export function show_vs_tag(vs, vs_diff, data1, data2) {
}// else { }// else {
// tag = <Tag icon={< CaretUpOutlined/>} color="lime">{vs} {vs_diff}</Tag> // tag = <Tag icon={< CaretUpOutlined/>} color="lime">{vs} {vs_diff}</Tag>
// } // }
return <span><div>{data1} vs {data2}</div> return <span><div>{data1} vs {data2} </div> {tag} </span>
{tag}</span>
} }
//数组去掉重复 //数组去掉重复

@ -1,5 +1,5 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Row, Col, Button, Tabs, Table} from 'antd'; import {Row, Col, Button, Tabs, Table, Divider} from 'antd';
import { import {
ContainerOutlined, CarryOutOutlined, BlockOutlined, ContainerOutlined, CarryOutOutlined, BlockOutlined,
SmileOutlined, TagsOutlined, GlobalOutlined, SmileOutlined, TagsOutlined, GlobalOutlined,
@ -13,6 +13,7 @@ import DatePickerCharts from '../charts/DatePickerCharts'
import * as config from "../config"; import * as config from "../config";
import {NavLink} from "react-router-dom"; import {NavLink} from "react-router-dom";
import * as comm from "../utils/commons" import * as comm from "../utils/commons"
import {utils, writeFileXLSX} from "xlsx";
class Orders extends Component { class Orders extends Component {
@ -142,13 +143,13 @@ class Orders extends Component {
{ {
title: '成交毛利(预计)', title: '成交毛利(预计)',
children: [{title: ordercountTotal1.YJLY, dataIndex: 'YJLY'}], 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: '单个订单价值', title: '单个订单价值',
children: [{title: ordercountTotal1.Ordervalue, dataIndex: 'Ordervalue'}], 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; result.dataSource = data.ordercount1;
@ -161,7 +162,7 @@ class Orders extends Component {
const {orders_store} = this.context; const {orders_store} = this.context;
const table_data = orders_store.orderCountData_Form ? this.format_data(orders_store.orderCountData_Form) : []; const table_data = orders_store.orderCountData_Form ? this.format_data(orders_store.orderCountData_Form) : [];
const data_source = orders_store.orderCountData ? orders_store.orderCountData : []; 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 = { const config = {
data: data_source, data: data_source,
padding: 'auto', padding: 'auto',
@ -211,7 +212,7 @@ class Orders extends Component {
// return `<div>${title}</div><div>${data.seriesField} ${data.yField}</div>`; // return `<div>${title}</div><div>${data.seriesField} ${data.yField}</div>`;
// } // }
title: (title, datum) => { title: (title, datum) => {
return title+' '+ comm.getWeek(datum.xField);//显示周几 return title + ' ' + comm.getWeek(datum.xField);//显示周几
}, },
}, },
smooth: true, smooth: true,
@ -246,22 +247,64 @@ class Orders extends Component {
<Tabs activeKey={orders_store.active_tab_key} <Tabs activeKey={orders_store.active_tab_key}
onChange={(active_key) => orders_store.onChange_Tabs(active_key)}> onChange={(active_key) => orders_store.onChange_Tabs(active_key)}>
<Tabs.TabPane tab={<span><ContainerOutlined/>来源类型</span>} key="Form"> <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>
<Tabs.TabPane tab={<span><CarryOutOutlined/>产品类型</span>} key="Product"> <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>
<Tabs.TabPane tab={<span><SmileOutlined/>国籍</span>} key="Country"> <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>
<Tabs.TabPane tab={<span><TagsOutlined/>线路</span>} key="line"> <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>
<Tabs.TabPane tab={<span><GlobalOutlined/>目的地</span>} key="city"> <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>
<Tabs.TabPane tab={<span><BlockOutlined/>页面类型</span>} key="LineClass"> <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.TabPane>
</Tabs> </Tabs>
</Col> </Col>
@ -270,9 +313,6 @@ class Orders extends Component {
</div> </div>
); );
} }
} }
export
default
observer(Orders); export default observer(Orders);

@ -118,12 +118,18 @@ const Orders_sub = () => {
dataIndex: 'COLI_Success', dataIndex: 'COLI_Success',
key: 'COLI_Success', key: 'COLI_Success',
render: (text, record) => <span>{text == 1 ? '是' : '否'}</span>, render: (text, record) => <span>{text == 1 ? '是' : '否'}</span>,
sorter: (a, b) => b.COLI_Success - a.COLI_Success,
}, },
{ {
title: '预定时间', title: '预定时间',
dataIndex: 'COLI_ApplyDate', dataIndex: 'COLI_ApplyDate',
key: 'COLI_ApplyDate', key: 'COLI_ApplyDate',
}, },
{
title: 'IP',
dataIndex: 'COLI_SenderIP',
key: 'COLI_SenderIP',
},
{ {
title: '订单内容', title: '订单内容',
dataIndex: 'COLI_OrderDetailText', dataIndex: 'COLI_OrderDetailText',
@ -180,10 +186,10 @@ const Orders_sub = () => {
onChange={(active_key) => orders_store.onChange_Tabs_sub(ordertype, ordertype_sub, active_key)}> onChange={(active_key) => orders_store.onChange_Tabs_sub(ordertype, ordertype_sub, active_key)}>
<Tabs.TabPane tab={<span><ContainerOutlined/>订单内容</span>} key="detail"> <Tabs.TabPane tab={<span><ContainerOutlined/>订单内容</span>} key="detail">
<Row> <Row>
<Col span={11}> <Col span={24}>
{date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)} {date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)}
<Table dataSource={table_data.dataSource} <Table dataSource={table_data.dataSource}
columns={table_data.columns} size="small" rowKey={record => record.COLI_ID} columns={table_data.columns} size="small" rowKey={record => record.key}
expandable={{ expandable={{
expandedRowRender: (record) => ( expandedRowRender: (record) => (
<pre>{record.COLI_OrderDetailText}</pre> <pre>{record.COLI_OrderDetailText}</pre>
@ -191,11 +197,11 @@ const Orders_sub = () => {
}} }}
/> />
</Col> </Col>
<Col span={2}></Col>
<Col span={11}> <Col span={24}>
{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) : ''} {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) : ''}
<Table dataSource={table_data2.dataSource} <Table dataSource={table_data2.dataSource}
columns={table_data2.columns} size="small" rowKey={record => record.COLI_ID} columns={table_data2.columns} size="small" rowKey={record => record.key}
expandable={{ expandable={{
expandedRowRender: (record) => ( expandedRowRender: (record) => (
<pre>{record.COLI_OrderDetailText}</pre> <pre>{record.COLI_OrderDetailText}</pre>
@ -208,15 +214,15 @@ const Orders_sub = () => {
</Tabs.TabPane> </Tabs.TabPane>
<Tabs.TabPane tab={<span><ContainerOutlined/>访问路径</span>} key="page"> <Tabs.TabPane tab={<span><ContainerOutlined/>访问路径</span>} key="page">
<Row> <Row>
<Col span={11}> <Col span={24}>
{date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)} {date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)}
<Table dataSource={table_data.dataSource} rowKey={record => record.COLI_ID} <Table dataSource={table_data.dataSource} rowKey={record => record.key}
columns={table_data.columns} size="small"/> columns={table_data.columns} size="small"/>
</Col> </Col>
<Col span={2}></Col>
<Col span={11}> <Col span={24}>
{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) : ''} {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) : ''}
<Table dataSource={table_data2.dataSource} rowKey={record => record.COLI_ID} <Table dataSource={table_data2.dataSource} rowKey={record => record.key}
columns={table_data2.columns} size="small"/> columns={table_data2.columns} size="small"/>
</Col> </Col>

Loading…
Cancel
Save