@ -28,83 +28,92 @@ class Orders extends Component {
if ( date _picker _store . start _date _cp && date _picker _store . end _date _cp ) {
/ / 有 比 较 的 数 据
result . columns = [
{
title : "" ,
{
title : '#' ,
fixed : 'left' ,
children : [
{
title : (
< span >
< div >
{ date _picker _store . start _date . format ( config . DATE _FORMAT ) } ~ { date _picker _store . end _date . format ( config . DATE _FORMAT ) }
< / div >
< div >
{ date _picker _store . start _date _cp . format ( config . DATE _FORMAT ) } ~ { date _picker _store . end _date _cp . format ( config . DATE _FORMAT ) }
< / div >
< / span >
) ,
dataIndex : "OrderType" ,
children : [
{
title : (
< span >
< div >
{ date _picker _store . start _date . format ( config . DATE _FORMAT ) } ~ { date _picker _store . end _date . format ( config . DATE _FORMAT ) }
< / div >
< div >
{ date _picker _store . start _date _cp . format ( config . DATE _FORMAT ) } ~ { date _picker _store . end _date _cp . format ( config . DATE _FORMAT ) }
< / div >
< / span >
) ,
titleX : ` ${ date _picker _store . start _date . format ( config . DATE _FORMAT ) } ~ ${ date _picker _store . end _date . format ( config . DATE _FORMAT ) } vs ${ date _picker _store . start _date _cp . format (
config . DATE _FORMAT
) } ~ $ { date _picker _store . end _date _cp . format ( config . DATE _FORMAT ) } ` ,
dataIndex : 'OrderType' ,
fixed : 'left' ,
render : ( text , record ) => < NavLink to = { ` /orders_sub/ ${ orders _store . active _tab _key } / ${ record . OrderTypeSN } / ${ record . OrderType } ` } > { text } < / NavLink > ,
} ,
] ,
} ,
{
title : "数量" ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . OrderCount _vs , ordercountTotal1 . OrderCount _diff , ordercountTotal1 . OrderCount , ordercountTotal2 . OrderCount ) ,
dataIndex : "OrderCount" ,
} ,
] ,
} ,
{
title : "成交数" ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . CJCount _vs , ordercountTotal1 . CJCount _diff , ordercountTotal1 . CJCount , ordercountTotal2 . CJCount ) ,
dataIndex : "CJCount" ,
} ,
] ,
} ,
{
title : "成交人数" ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . CJPersonNum _vs , ordercountTotal1 . CJPersonNum _diff , ordercountTotal1 . CJPersonNum , ordercountTotal2 . CJPersonNum ) ,
dataIndex : "CJPersonNum" ,
} ,
] ,
} ,
{
title : "成交率" ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . CJrate _vs , ordercountTotal1 . CJrate _diff , ordercountTotal1 . CJrate , ordercountTotal2 . CJrate ) ,
dataIndex : "CJrate" ,
} ,
] ,
} ,
{
title : "成交毛利(预计)" ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . YJLY _vs , ordercountTotal1 . YJLY _diff , ordercountTotal1 . YJLY , ordercountTotal2 . YJLY ) ,
dataIndex : "YJLY" ,
} ,
] ,
} ,
render : ( text , record ) => < NavLink to = { ` /orders_sub/ ${ orders _store . active _tab _key } / ${ record . OrderTypeSN } / ${ record . OrderType } ` } > { text } < / NavLink > ,
} ,
] ,
} ,
{
title : '数量' ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . OrderCount _vs , ordercountTotal1 . OrderCount _diff , ordercountTotal1 . OrderCount , ordercountTotal2 . OrderCount ) ,
titleX : [ ordercountTotal1 . OrderCount , ordercountTotal2 . OrderCount ] . join ( ' vs ' ) ,
dataIndex : 'OrderCount' ,
} ,
] ,
} ,
{
title : '成交数' ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . CJCount _vs , ordercountTotal1 . CJCount _diff , ordercountTotal1 . CJCount , ordercountTotal2 . CJCount ) ,
titleX : [ ordercountTotal1 . CJCount , ordercountTotal2 . CJCount ] . join ( ' vs ' ) ,
dataIndex : 'CJCount' ,
} ,
] ,
} ,
{
title : '成交人数' ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . CJPersonNum _vs , ordercountTotal1 . CJPersonNum _diff , ordercountTotal1 . CJPersonNum , ordercountTotal2 . CJPersonNum ) ,
titleX : [ ordercountTotal1 . CJPersonNum , ordercountTotal2 . CJPersonNum ] . join ( ' vs ' ) ,
dataIndex : 'CJPersonNum' ,
} ,
] ,
} ,
{
title : '成交率' ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . CJrate _vs , ordercountTotal1 . CJrate _diff , ordercountTotal1 . CJrate , ordercountTotal2 . CJrate ) ,
titleX : [ ordercountTotal1 . CJrate , ordercountTotal2 . CJrate ] . join ( ' vs ' ) ,
dataIndex : 'CJrate' ,
} ,
] ,
} ,
{
title : '成交毛利(预计)' ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . YJLY _vs , ordercountTotal1 . YJLY _diff , ordercountTotal1 . YJLY , ordercountTotal2 . YJLY ) ,
titleX : [ ordercountTotal1 . YJLY , ordercountTotal2 . YJLY ] . join ( ' vs ' ) ,
dataIndex : 'YJLY' ,
} ,
] ,
} ,
{
title : "单个订单价值" ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . Ordervalue _vs , ordercountTotal1 . Ordervalue _diff , ordercountTotal1 . Ordervalue , ordercountTotal2 . Ordervalue ) ,
dataIndex : "Ordervalue" ,
} ,
] ,
} ,
] ;
{
title : '单个订单价值' ,
children : [
{
title : comm . show _vs _tag ( ordercountTotal1 . Ordervalue _vs , ordercountTotal1 . Ordervalue _diff , ordercountTotal1 . Ordervalue , ordercountTotal2 . Ordervalue ) ,
titleX : [ ordercountTotal1 . Ordervalue , ordercountTotal2 . Ordervalue ] . join ( ' vs ' ) ,
dataIndex : 'Ordervalue' ,
} ,
] ,
} ,
] ;
/ / 1 . 找 出 两 个 数 组 O r d e r T y p e 相 同 的 数 据 做 比 较 显 示 2 . 找 出 两 组 数 据 O r d e r T y p e 都 不 相 同 的 数 据 做 显 示
let has _same _type = false ; / / 数 组 1 在 数 组 2 中 是 否 找 到 相 同 的 类 型
for ( const item of data . ordercount1 ) {
@ -118,11 +127,17 @@ class Orders extends Component {
OrderType : item . OrderType ,
OrderTypeSN : item . OrderTypeSN ,
OrderCount : comm . show _vs _tag ( item . OrderCount _vs , item . OrderCount _diff , item . OrderCount , item2 . OrderCount ) ,
OrderCount _X : ( [ item . OrderCount , item2 . OrderCount ] . join ( ' vs ' ) ) ,
CJCount : comm . show _vs _tag ( item . CJCount _vs , item . CJCount _diff , item . CJCount , item2 . CJCount ) ,
CJCount _X : ( [ item . CJCount , item2 . CJCount ] . join ( ' vs ' ) ) ,
CJPersonNum : comm . show _vs _tag ( item . CJPersonNum _vs , item . CJPersonNum _diff , item . CJPersonNum , item2 . CJPersonNum ) ,
CJPersonNum _X : ( [ item . CJPersonNum , item2 . CJPersonNum ] . join ( ' vs ' ) ) ,
CJrate : comm . show _vs _tag ( item . CJrate _vs , item . CJrate _diff , item . CJrate , item2 . CJrate ) ,
CJrate _X : ( [ item . CJrate , item2 . CJrate ] . join ( ' vs ' ) ) ,
YJLY : comm . show _vs _tag ( item . YJLY _vs , item . YJLY _diff , item . YJLY , item2 . YJLY ) ,
YJLY _X : ( [ item . YJLY , item2 . YJLY ] . join ( ' vs ' ) ) ,
Ordervalue : comm . show _vs _tag ( item . Ordervalue _vs , item . Ordervalue _diff , item . Ordervalue , item2 . Ordervalue ) ,
Ordervalue _X : ( [ item . Ordervalue , item2 . Ordervalue ] . join ( ' vs ' ) ) ,
} ) ;
}
}
@ -133,11 +148,17 @@ class Orders extends Component {
OrderType : item . OrderType ,
OrderTypeSN : item . OrderTypeSN ,
OrderCount : comm . show _vs _tag ( comm . formatPercent ( item . OrderCount ) , item . OrderCount , item . OrderCount , 0 ) ,
OrderCount _X : ( [ item . OrderCount , 0 ] . join ( ' vs ' ) ) ,
CJCount : comm . show _vs _tag ( comm . formatPercent ( item . CJCount ) , item . CJCount , item . CJCount , 0 ) ,
CJCount _X : ( [ item . CJCount , 0 ] . join ( ' vs ' ) ) ,
CJPersonNum : comm . show _vs _tag ( comm . formatPercent ( item . CJPersonNum ) , item . CJPersonNum , item . CJPersonNum , 0 ) ,
CJPersonNum _X : ( [ item . CJPersonNum , 0 ] . join ( ' vs ' ) ) ,
CJrate : comm . show _vs _tag ( item . CJrate , item . CJrate , item . CJrate , 0 ) ,
CJrate _X : ( [ item . CJrate , 0 ] . join ( ' vs ' ) ) ,
YJLY : comm . show _vs _tag ( comm . formatPercent ( item . YJLY ) , item . YJLY , item . YJLY , 0 ) ,
YJLY _X : ( [ item . YJLY , 0 ] . join ( ' vs ' ) ) ,
Ordervalue : comm . show _vs _tag ( comm . formatPercent ( item . Ordervalue ) , item . Ordervalue , item . Ordervalue , 0 ) ,
Ordervalue _X : ( [ item . Ordervalue , 0 ] . join ( ' vs ' ) ) ,
} ) ;
}
}
@ -155,18 +176,24 @@ class Orders extends Component {
OrderType : item2 . OrderType ,
OrderTypeSN : item2 . OrderTypeSN ,
OrderCount : comm . show _vs _tag ( comm . formatPercent ( - item2 . OrderCount ) , - item2 . OrderCount , 0 , item2 . OrderCount ) ,
OrderCount _X : ( [ 0 , item2 . OrderCount ] . join ( ' vs ' ) ) ,
CJCount : comm . show _vs _tag ( comm . formatPercent ( - item2 . CJCount ) , - item2 . CJCount , 0 , item2 . CJCount ) ,
CJCount _X : ( [ 0 , item2 . CJCount ] . join ( ' vs ' ) ) ,
CJPersonNum : comm . show _vs _tag ( comm . formatPercent ( - item2 . CJPersonNum ) , - item2 . CJPersonNum , 0 , item2 . CJPersonNum ) ,
CJPersonNum _X : ( [ 0 , item2 . CJPersonNum ] . join ( ' vs ' ) ) ,
CJrate : comm . show _vs _tag ( - item2 . CJrate , - item2 . CJrate , 0 , item2 . CJrate ) ,
CJrate _X : ( [ 0 , item2 . CJrate ] . join ( ' vs ' ) ) ,
YJLY : comm . show _vs _tag ( comm . formatPercent ( - item2 . YJLY ) , - item2 . YJLY , 0 , item2 . YJLY ) ,
YJLY _X : ( [ 0 , item2 . YJLY ] . join ( ' vs ' ) ) ,
Ordervalue : comm . show _vs _tag ( comm . formatPercent ( - item2 . Ordervalue ) , - item2 . Ordervalue , 0 , item2 . Ordervalue ) ,
Ordervalue _X : ( [ 0 , item2 . Ordervalue ] . join ( ' vs ' ) ) ,
} ) ;
}
}
} else {
result . columns = [
{
title : " ",
title : " # ",
fixed : 'left' ,
children : [
{
@ -177,6 +204,7 @@ class Orders extends Component {
< / div >
< / span >
) ,
titleX : ` ${ date _picker _store . start _date . format ( config . DATE _FORMAT ) } ~ ${ date _picker _store . end _date . format ( config . DATE _FORMAT ) } ` ,
fixed : 'left' ,
dataIndex : "OrderType" ,
render : ( text , record ) => < NavLink to = { ` /orders_sub/ ${ orders _store . active _tab _key } / ${ record . OrderTypeSN } / ${ record . OrderType } ` } > { text } < / NavLink > ,