|
|
@ -32,8 +32,8 @@ class SaleStore {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//下单日期或者出发日期
|
|
|
|
//下单日期或者出发日期
|
|
|
|
onChange_datetype(e) {
|
|
|
|
onChange_datetype(value) {
|
|
|
|
this.date_type = e.target.value;
|
|
|
|
this.date_type = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取业绩信息
|
|
|
|
//获取业绩信息
|
|
|
@ -99,59 +99,83 @@ class SaleStore {
|
|
|
|
.then(json => {
|
|
|
|
.then(json => {
|
|
|
|
if (!comm.empty(json.result2) && !comm.empty(date_moment.start_date_cp)) {
|
|
|
|
if (!comm.empty(json.result2) && !comm.empty(date_moment.start_date_cp)) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
let opi_arr = []; //顾问列表
|
|
|
|
if (this.active_tab_key == "All") {
|
|
|
|
let row_title = ""; //行标题
|
|
|
|
result.columns = [
|
|
|
|
let new_data_arr = []; //行列转换后的数组
|
|
|
|
{
|
|
|
|
Object.keys(json.result1[0]).map((col, col_i) => {
|
|
|
|
title: "",
|
|
|
|
switch (col) {
|
|
|
|
children: [
|
|
|
|
case "OPI_Name":
|
|
|
|
{
|
|
|
|
opi_arr = [
|
|
|
|
title: "",
|
|
|
|
{ name: "", index: "c0" },
|
|
|
|
dataIndex: "OPI_Name",
|
|
|
|
...Object.values(json.result1).map((row, row_i) => {
|
|
|
|
},
|
|
|
|
return { name: Object.values(row)[col_i], index: "c" + ++row_i };
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
];
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
title: "毛利",
|
|
|
|
break;
|
|
|
|
children: [{ title: "毛利合计", dataIndex: "COLI_ML" }],
|
|
|
|
case "COLI_OrderCount":
|
|
|
|
sorter: (a, b) => parseInt(b.COLI_ML.replace(/,/g, "")) - parseInt(a.COLI_ML.replace(/,/g, "")),
|
|
|
|
row_title = "订单数";
|
|
|
|
},
|
|
|
|
break;
|
|
|
|
{
|
|
|
|
case "COLI_ML":
|
|
|
|
title: "成行率",
|
|
|
|
row_title = "毛利";
|
|
|
|
children: [{ title: "平均成行率", dataIndex: "COLI_CJrate" }],
|
|
|
|
break;
|
|
|
|
sorter: (a, b) => parseInt(b.COLI_CJrate) - parseInt(a.COLI_CJrate),
|
|
|
|
case "COLI_CJCount":
|
|
|
|
},
|
|
|
|
row_title = "成团数";
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
title: "成团数",
|
|
|
|
case "COLI_CJrate":
|
|
|
|
children: [{ title: "成团数合计", dataIndex: "COLI_CJCount" }],
|
|
|
|
row_title = "成行率";
|
|
|
|
sorter: (a, b) => b.COLI_CJCount - a.COLI_CJCount,
|
|
|
|
break;
|
|
|
|
},
|
|
|
|
case "COLI_Cycle":
|
|
|
|
{
|
|
|
|
row_title = "成行周期";
|
|
|
|
title: "订单数",
|
|
|
|
break;
|
|
|
|
children: [{ title: "订单数合计", dataIndex: "COLI_OrderCount" }],
|
|
|
|
case "COLI_SingleML":
|
|
|
|
sorter: (a, b) => b.COLI_OrderCount - a.COLI_OrderCount,
|
|
|
|
row_title = "单团毛利";
|
|
|
|
},
|
|
|
|
break;
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
title: "单团毛利",
|
|
|
|
return;
|
|
|
|
children: [{ title: "平均单团毛利", dataIndex: "COLI_SingleML" }],
|
|
|
|
}
|
|
|
|
sorter: (a, b) => parseInt(b.COLI_SingleML.replace(/,/g, "")) - parseInt(a.COLI_SingleML.replace(/,/g, "")),
|
|
|
|
new_data_arr.push(
|
|
|
|
},
|
|
|
|
Object.assign(
|
|
|
|
{
|
|
|
|
{ key: col_i },
|
|
|
|
title: "成团周期",
|
|
|
|
{ c0: row_title },
|
|
|
|
children: [{ title: "平均成团周期", dataIndex: "COLI_Cycle" }],
|
|
|
|
...Object.values(json.result1).map((row, row_i) => {
|
|
|
|
sorter: (a, b) => b.COLI_Cycle - a.COLI_Cycle,
|
|
|
|
return { ["c" + ++row_i]: Object.values(row)[col_i] };
|
|
|
|
},
|
|
|
|
})
|
|
|
|
];
|
|
|
|
)
|
|
|
|
result.dataSource = json.result1;
|
|
|
|
);
|
|
|
|
} else if (this.active_tab_key == "Country") {
|
|
|
|
});
|
|
|
|
//获取类型的项目,去掉重复,作为列名
|
|
|
|
|
|
|
|
let type_name_arr = [];
|
|
|
|
|
|
|
|
json.result1.map(item => {
|
|
|
|
|
|
|
|
type_name_arr[item.SubTypeSN] = { SubTypeSN: item.SubTypeSN, SubTypeName: item.SubTypeName };
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let type_data = [];
|
|
|
|
|
|
|
|
let type_data_arr = [];
|
|
|
|
|
|
|
|
|
|
|
|
for (let item of opi_arr) {
|
|
|
|
for (let item of json.result1) {
|
|
|
|
result.columns.push({
|
|
|
|
if (comm.empty(type_data["OP_" + item.OPI_SN])) {
|
|
|
|
title: item.name,
|
|
|
|
type_data["OP_" + item.OPI_SN] = [{ key: item.OPI_SN }, { T_name: item.OPI_Name }, { T_total: item.OPI_TotalYJLY }];
|
|
|
|
dataIndex: item.index,
|
|
|
|
}
|
|
|
|
|
|
|
|
type_data["OP_" + item.OPI_SN].push({ ["T_" + item.SubTypeSN]: item.COLI_YJLY });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object.values(type_data).map(item => {
|
|
|
|
|
|
|
|
type_data_arr.push(
|
|
|
|
|
|
|
|
Object.assign(
|
|
|
|
|
|
|
|
...item.map(it => {
|
|
|
|
|
|
|
|
return it;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
result.columns.push({ title: "顾问", dataIndex: "T_name" }, { title: "合计", dataIndex: "T_total" });
|
|
|
|
|
|
|
|
type_name_arr.map((item, index) => {
|
|
|
|
|
|
|
|
result.columns.push({
|
|
|
|
|
|
|
|
title: item.SubTypeName,
|
|
|
|
|
|
|
|
dataIndex: "T_" + item.SubTypeSN,
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
result.dataSource = type_data_arr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result.dataSource = new_data_arr;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
runInAction(() => {
|
|
|
|
runInAction(() => {
|
|
|
|
this.type_data = result;
|
|
|
|
this.type_data = result;
|
|
|
|