|
|
|
@ -177,16 +177,24 @@ class CustomerServices {
|
|
|
|
|
result.push({
|
|
|
|
|
EOI_ObjSN: item1.EOI_ObjSN,
|
|
|
|
|
VendorName: item1.VendorName,
|
|
|
|
|
GroupCount: show_vs_tag(formatPercent((item1.GroupCount-item2.GroupCount)/item2.GroupCount),item1.GroupCount-item2.GroupCount,item1.GroupCount,item2.GroupCount),
|
|
|
|
|
PersonNum: show_vs_tag(formatPercent((item1.PersonNum-item2.PersonNum)/item2.PersonNum),item1.PersonNum-item2.PersonNum,item1.PersonNum,item2.PersonNum),
|
|
|
|
|
GroupDays: show_vs_tag(formatPercent((item1.GroupDays-item2.GroupDays)/item2.GroupDays),item1.GroupDays-item2.GroupDays,item1.GroupDays,item2.GroupDays),
|
|
|
|
|
totalcost: show_vs_tag(formatPercent((item1.totalcost-item2.totalcost)/item2.totalcost),
|
|
|
|
|
GroupCount: show_vs_tag(formatPercent((item1.GroupCount-item2.GroupCount)/(item2.GroupCount===0?1:item2.GroupCount)),
|
|
|
|
|
item1.GroupCount-item2.GroupCount,item1.GroupCount,item2.GroupCount),
|
|
|
|
|
PersonNum: show_vs_tag(formatPercent((item1.PersonNum-item2.PersonNum)/(item2.PersonNum===0?1:item2.PersonNum)),
|
|
|
|
|
item1.PersonNum-item2.PersonNum,item1.PersonNum,item2.PersonNum),
|
|
|
|
|
GroupDays: show_vs_tag(formatPercent((item1.GroupDays-item2.GroupDays)/(item2.GroupDays===0?1:item2.GroupDays)),
|
|
|
|
|
item1.GroupDays-item2.GroupDays,item1.GroupDays,item2.GroupDays),
|
|
|
|
|
totalcost: show_vs_tag(formatPercent((item1.totalcost-item2.totalcost)/(item2.totalcost===0?1:item2.totalcost)),
|
|
|
|
|
(item1.totalcost-item2.totalcost).toFixed(2),item1.totalcost,item2.totalcost),
|
|
|
|
|
GoodCount: show_vs_tag(formatPercent((item1.GoodCount-item2.GoodCount)/item2.GoodCount),item1.GoodCount-item2.GoodCount,item1.GoodCount,item2.GoodCount),
|
|
|
|
|
GoodRate: show_vs_tag(formatPercent((goodRate1-goodRate2)/goodRate2),formatPercent(goodRate1-goodRate2),item1.GoodRate,item2.GoodRate),
|
|
|
|
|
BadCount: show_vs_tag(formatPercent((item1.BadCount-item2.BadCount)/item2.BadCount),item1.BadCount-item2.BadCount,item1.BadCount,item2.BadCount),
|
|
|
|
|
BadRate: show_vs_tag(formatPercent((badRate1-badRate2)/badRate2),formatPercent(badRate1-badRate2),item1.BadRate,item2.BadRate),
|
|
|
|
|
qianqin: show_vs_tag(formatPercent((item1.qianqin-item2.qianqin)/item2.qianqin),(item1.qianqin-item2.qianqin).toFixed(2),item1.qianqin,item2.qianqin),
|
|
|
|
|
GoodCount: show_vs_tag(formatPercent((item1.GoodCount-item2.GoodCount)/(item2.GoodCount===0?1:item2.GoodCount)),
|
|
|
|
|
item1.GoodCount-item2.GoodCount,item1.GoodCount,item2.GoodCount),
|
|
|
|
|
GoodRate: show_vs_tag(formatPercent((goodRate1-goodRate2)/(goodRate2===0?1:goodRate2)),
|
|
|
|
|
formatPercent(goodRate1-goodRate2),item1.GoodRate,item2.GoodRate),
|
|
|
|
|
BadCount: show_vs_tag(formatPercent((item1.BadCount-item2.BadCount)/(item2.BadCount===0?1:item2.BadCount)),
|
|
|
|
|
item1.BadCount-item2.BadCount,item1.BadCount,item2.BadCount),
|
|
|
|
|
BadRate: show_vs_tag(formatPercent((badRate1-badRate2)/(badRate2===0?1:badRate2)),
|
|
|
|
|
formatPercent(badRate1-badRate2),item1.BadRate,item2.BadRate),
|
|
|
|
|
qianqin: show_vs_tag(formatPercent((item1.qianqin-item2.qianqin)/(item2.qianqin===0?1:item2.qianqin)),
|
|
|
|
|
(item1.qianqin-item2.qianqin).toFixed(2),item1.qianqin,item2.qianqin),
|
|
|
|
|
key:item1.key,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -435,8 +443,8 @@ class CustomerServices {
|
|
|
|
|
.append('DateType', this.dateType)
|
|
|
|
|
.append('Date1', this.startDateString)
|
|
|
|
|
.append('Date2', this.endDateString)
|
|
|
|
|
.append('OldDate1', this.startDateString)
|
|
|
|
|
.append('OldDate2', this.endDateString)
|
|
|
|
|
.append('OldDate1', this.startDateDiffString)
|
|
|
|
|
.append('OldDate2', this.endDateDiffString)
|
|
|
|
|
.append('DepList', this.selectedTeam)
|
|
|
|
|
.append('Country', this.selectedCountry)
|
|
|
|
|
.append('OrderStatus', this.selectedOrderStatus)
|
|
|
|
@ -445,73 +453,169 @@ class CustomerServices {
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (json.errcode === 0) {
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
const splitTotalList = groupBy(json.result1, row => row.COLD_ServiceCity === -1 ? '0' : '1');
|
|
|
|
|
this.agentGroupList = splitTotalList['1'];
|
|
|
|
|
const total1 = splitTotalList['0']?.[0] || {}; // json.total1;
|
|
|
|
|
this.destinationGroupCount = splitTotalList['1'];
|
|
|
|
|
this.destinationGroupCountColumns = [
|
|
|
|
|
{
|
|
|
|
|
title: '城市',
|
|
|
|
|
dataIndex: 'COLD_ServiceCityName',
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
children: [{
|
|
|
|
|
dataIndex: 'COLD_ServiceCityName',
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
render: (text, record) => <NavLink to={`/destination/${record.COLD_ServiceCity}/group/list`}>{record.COLD_ServiceCityName}</NavLink>
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '团数',
|
|
|
|
|
dataIndex: 'GroupCount',
|
|
|
|
|
sorter: (a, b) => a.GroupCount - b.GroupCount,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.GroupCount,
|
|
|
|
|
dataIndex: 'GroupCount'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '人数',
|
|
|
|
|
dataIndex: 'PersonNum',
|
|
|
|
|
sorter: (a, b) => a.PersonNum - b.PersonNum,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.PersonNum,
|
|
|
|
|
dataIndex: 'PersonNum'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '团天数',
|
|
|
|
|
dataIndex: 'GroupDays',
|
|
|
|
|
sorter: (a, b) => a.GroupDays - b.GroupDays,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.GroupDays,
|
|
|
|
|
dataIndex: 'GroupDays'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '交易额',
|
|
|
|
|
dataIndex: 'TotalCost',
|
|
|
|
|
sorter: (a, b) => a.TotalCost - b.TotalCost,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.TotalCost,
|
|
|
|
|
dataIndex: 'TotalCost'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '报价',
|
|
|
|
|
dataIndex: 'TotalPrice',
|
|
|
|
|
sorter: (a, b) => a.TotalPrice - b.TotalPrice,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.TotalPrice,
|
|
|
|
|
dataIndex: 'TotalPrice'
|
|
|
|
|
if (isEmpty(json.result2)){
|
|
|
|
|
const splitTotalList = groupBy(json.result1, row => row.COLD_ServiceCity === -1 ? '0' : '1');
|
|
|
|
|
this.agentGroupList = splitTotalList['1'];
|
|
|
|
|
const total1 = splitTotalList['0']?.[0] || {}; // json.total1;
|
|
|
|
|
this.destinationGroupCount = splitTotalList['1'];
|
|
|
|
|
this.destinationGroupCountColumns = [
|
|
|
|
|
{
|
|
|
|
|
title: '城市',
|
|
|
|
|
dataIndex: 'COLD_ServiceCityName',
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
children: [{
|
|
|
|
|
dataIndex: 'COLD_ServiceCityName',
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
render: (text, record) => <NavLink to={`/destination/${record.COLD_ServiceCity}/group/list`}>{record.COLD_ServiceCityName}</NavLink>
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '团数',
|
|
|
|
|
dataIndex: 'GroupCount',
|
|
|
|
|
sorter: (a, b) => a.GroupCount - b.GroupCount,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.GroupCount,
|
|
|
|
|
dataIndex: 'GroupCount'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '人数',
|
|
|
|
|
dataIndex: 'PersonNum',
|
|
|
|
|
sorter: (a, b) => a.PersonNum - b.PersonNum,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.PersonNum,
|
|
|
|
|
dataIndex: 'PersonNum'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '团天数',
|
|
|
|
|
dataIndex: 'GroupDays',
|
|
|
|
|
sorter: (a, b) => a.GroupDays - b.GroupDays,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.GroupDays,
|
|
|
|
|
dataIndex: 'GroupDays'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '交易额',
|
|
|
|
|
dataIndex: 'TotalCost',
|
|
|
|
|
sorter: (a, b) => a.TotalCost - b.TotalCost,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.TotalCost,
|
|
|
|
|
dataIndex: 'TotalCost'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '报价',
|
|
|
|
|
dataIndex: 'TotalPrice',
|
|
|
|
|
sorter: (a, b) => a.TotalPrice - b.TotalPrice,
|
|
|
|
|
children: [{
|
|
|
|
|
title: total1.TotalPrice,
|
|
|
|
|
dataIndex: 'TotalPrice'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
const splitTotalList1 = groupBy(json.result1, row => row.COLD_ServiceCity === -1 ? '0' : '1');
|
|
|
|
|
const splitTotalList2 = groupBy(json.result2, row => row.COLD_ServiceCity === -1 ? '0' : '1');
|
|
|
|
|
const result = [];
|
|
|
|
|
for (const item1 of splitTotalList1['1']) {
|
|
|
|
|
for (const item2 of splitTotalList2['1']) {
|
|
|
|
|
if (item1.COLD_ServiceCity === item2.COLD_ServiceCity) {
|
|
|
|
|
result.push({
|
|
|
|
|
COLD_ServiceCity: item1.COLD_ServiceCity,
|
|
|
|
|
COLD_ServiceCityName: item1.COLD_ServiceCityName,
|
|
|
|
|
GroupCount: show_vs_tag(formatPercent((item1.GroupCount-item2.GroupCount)/(item2.GroupCount===0?1:item2.GroupCount)),
|
|
|
|
|
item1.GroupCount-item2.GroupCount,item1.GroupCount,item2.GroupCount),
|
|
|
|
|
PersonNum: show_vs_tag(formatPercent((item1.PersonNum-item2.PersonNum)/(item2.PersonNum===0?1:item2.PersonNum)),
|
|
|
|
|
item1.PersonNum-item2.PersonNum,item1.PersonNum,item2.PersonNum),
|
|
|
|
|
GroupDays: show_vs_tag(formatPercent((item1.GroupDays-item2.GroupDays)/(item2.GroupDays===0?1:item2.GroupDays)),
|
|
|
|
|
item1.GroupDays-item2.GroupDays,item1.GroupDays,item2.GroupDays),
|
|
|
|
|
TotalCost: show_vs_tag(formatPercent((item1.TotalCost-item2.TotalCost)/(item2.TotalCost===0?1:item2.TotalCost)),
|
|
|
|
|
(item1.TotalCost-item2.TotalCost).toFixed(2),item1.TotalCost,item2.TotalCost),
|
|
|
|
|
TotalPrice: show_vs_tag(formatPercent((item1.TotalPrice-item2.TotalPrice)/(item2.TotalPrice===0?1:item2.TotalPrice)),
|
|
|
|
|
item1.TotalPrice-item2.TotalPrice,item1.TotalPrice,item2.TotalPrice),
|
|
|
|
|
key:item1.key,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
this.destinationGroupCount = result;
|
|
|
|
|
const total1 = splitTotalList1['0']?.[0] || {};
|
|
|
|
|
const total2 = splitTotalList2['0']?.[0] || {};
|
|
|
|
|
this.destinationGroupCountColumns = [
|
|
|
|
|
{
|
|
|
|
|
title: '城市',
|
|
|
|
|
dataIndex: 'COLD_ServiceCityName',
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
children: [{
|
|
|
|
|
dataIndex: 'COLD_ServiceCityName',
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
render: (text, record) => <NavLink to={`/destination/${record.COLD_ServiceCity}/group/list`}>{record.COLD_ServiceCityName}</NavLink>
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '团数',
|
|
|
|
|
dataIndex: 'GroupCount',
|
|
|
|
|
sorter: (a, b) => a.GroupCount - b.GroupCount,
|
|
|
|
|
children: [{
|
|
|
|
|
title: show_vs_tag(formatPercent((total1.GroupCount-total2.GroupCount)/total2.GroupCount),total1.GroupCount-total2.GroupCount,total1.GroupCount,total2.GroupCount),
|
|
|
|
|
dataIndex: 'GroupCount'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '人数',
|
|
|
|
|
dataIndex: 'PersonNum',
|
|
|
|
|
sorter: (a, b) => a.PersonNum - b.PersonNum,
|
|
|
|
|
children: [{
|
|
|
|
|
title: show_vs_tag(formatPercent((total1.PersonNum-total2.PersonNum)/total2.PersonNum),total1.PersonNum-total2.PersonNum,total1.PersonNum,total2.PersonNum),
|
|
|
|
|
dataIndex: 'PersonNum'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '团天数',
|
|
|
|
|
dataIndex: 'GroupDays',
|
|
|
|
|
sorter: (a, b) => a.GroupDays - b.GroupDays,
|
|
|
|
|
children: [{
|
|
|
|
|
title: show_vs_tag(formatPercent((total1.GroupDays-total2.GroupDays)/total2.GroupDays),total1.GroupDays-total2.GroupDays,total1.GroupDays,total2.GroupDays),
|
|
|
|
|
dataIndex: 'GroupDays'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '交易额',
|
|
|
|
|
dataIndex: 'TotalCost',
|
|
|
|
|
sorter: (a, b) => a.TotalCost - b.TotalCost,
|
|
|
|
|
children: [{
|
|
|
|
|
title: show_vs_tag(formatPercent((total1.TotalCost-total2.TotalCost)/total2.TotalCost),
|
|
|
|
|
(total1.TotalCost-total2.TotalCost).toFixed(2),total1.TotalCost,total2.TotalCost),
|
|
|
|
|
dataIndex: 'TotalCost'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '报价',
|
|
|
|
|
dataIndex: 'TotalPrice',
|
|
|
|
|
sorter: (a, b) => a.TotalPrice - b.TotalPrice,
|
|
|
|
|
children: [{
|
|
|
|
|
title: show_vs_tag(formatPercent((total1.TotalPrice-total2.TotalPrice)/total2.TotalPrice),
|
|
|
|
|
(total1.TotalPrice-total2.TotalPrice).toFixed(2),total1.TotalPrice,total2.TotalPrice),
|
|
|
|
|
dataIndex: 'TotalPrice'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|