|
|
|
@ -55,8 +55,8 @@ class SaleStore {
|
|
|
|
|
this.date_title += ` ${date2_start}~${date2_end}`;
|
|
|
|
|
}
|
|
|
|
|
fetch(config.HT_HOST + url)
|
|
|
|
|
.then((response) => response.json())
|
|
|
|
|
.then((json) => {
|
|
|
|
|
.then(response => response.json())
|
|
|
|
|
.then(json => {
|
|
|
|
|
result = json.result1;
|
|
|
|
|
// if (!comm.empty(json.result2) && !comm.empty(date_moment.start_date_cp)) {
|
|
|
|
|
// let diff_days = date_moment.start_date.diff(date_moment.start_date_cp, "days");
|
|
|
|
@ -74,7 +74,7 @@ class SaleStore {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
.catch(error => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
console.log("fetch data failed", error);
|
|
|
|
|
});
|
|
|
|
@ -97,8 +97,8 @@ class SaleStore {
|
|
|
|
|
this.date_title += ` ${date2_start}~${date2_end}`;
|
|
|
|
|
}
|
|
|
|
|
fetch(config.HT_HOST + url)
|
|
|
|
|
.then((response) => response.json())
|
|
|
|
|
.then((json) => {
|
|
|
|
|
.then(response => response.json())
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (!comm.empty(json.result2) && !comm.empty(date_moment.start_date_cp)) {
|
|
|
|
|
} else {
|
|
|
|
|
if (this.active_tab_key == "All") {
|
|
|
|
@ -155,11 +155,6 @@ class SaleStore {
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "首次报价回复率",
|
|
|
|
|
children: [{ title: "", dataIndex: "FirstRspRate" }],
|
|
|
|
|
sorter: (a, b) => parseInt(b.FirstRspRate) - parseInt(a.FirstRspRate),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "报价次数",
|
|
|
|
|
children: [{ title: json.result1.reduce((a, b) => a + b.PriceTime, 0), dataIndex: "PriceTime" }],
|
|
|
|
@ -202,11 +197,69 @@ class SaleStore {
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
result.dataSource = json.result1;
|
|
|
|
|
} else if (this.active_tab_key == "ResponseRateWhatsApp") {
|
|
|
|
|
result.columns = [
|
|
|
|
|
{
|
|
|
|
|
title: "",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
title: "",
|
|
|
|
|
dataIndex: "OPI_Name",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "首次回复率",
|
|
|
|
|
children: [{ title: "", dataIndex: "firstReplayRate" }],
|
|
|
|
|
sorter: (a, b) => parseInt(b.firstReplayRate) - parseInt(a.firstReplayRate),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "一次报价率",
|
|
|
|
|
children: [{ title: '', dataIndex: "FirstQuotationRate" }],
|
|
|
|
|
sorter: (a, b) => b.FirstQuotationRate - a.FirstQuotationRate,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "一次报价回复率",
|
|
|
|
|
children: [{ title: '', dataIndex: "FirstQuotationReplayRate" }],
|
|
|
|
|
sorter: (a, b) => b.FirstQuotationReplayRate - a.FirstQuotationReplayRate,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "一次报价回复周期",
|
|
|
|
|
children: [{ title: '', dataIndex: "FirstQuotationReplaytimeAVG" }],
|
|
|
|
|
sorter: (a, b) => b.FirstQuotationReplaytimeAVG - a.FirstQuotationReplaytimeAVG,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "二次报价率",
|
|
|
|
|
children: [{ title: '', dataIndex: "SecondQuotationRate" }],
|
|
|
|
|
sorter: (a, b) => b.SecondQuotationRate - a.SecondQuotationRate,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "二次报价回复率",
|
|
|
|
|
children: [{ title: '', dataIndex: "SecondQuotationReplayRate" }],
|
|
|
|
|
sorter: (a, b) => b.SecondQuotationReplayRate - a.SecondQuotationReplayRate,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "二次报价回复周期",
|
|
|
|
|
children: [{ title: '', dataIndex: "SecondQuotationReplaytimeAVG" }],
|
|
|
|
|
sorter: (a, b) => b.SecondQuotationReplaytimeAVG - a.SecondQuotationReplaytimeAVG,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "成团率",
|
|
|
|
|
children: [{ title: '', dataIndex: "COLI_SuccessRate" }],
|
|
|
|
|
sorter: (a, b) => b.COLI_SuccessRate - a.COLI_SuccessRate,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "成团周期",
|
|
|
|
|
children: [{ title: '', dataIndex: "COLI_ConfirmTimeAVG" }],
|
|
|
|
|
sorter: (a, b) => b.COLI_ConfirmTimeAVG - a.COLI_ConfirmTimeAVG,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
result.dataSource = json.result1;
|
|
|
|
|
} else {
|
|
|
|
|
//if (this.active_tab_key == "Country")
|
|
|
|
|
//获取类型的项目,去掉重复,作为列名
|
|
|
|
|
let type_name_arr = [];
|
|
|
|
|
json.result1.map((item) => {
|
|
|
|
|
json.result1.map(item => {
|
|
|
|
|
type_name_arr[item.SubTypeSN] = { SubTypeSN: item.SubTypeSN, SubTypeName: item.SubTypeName };
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -215,17 +268,17 @@ class SaleStore {
|
|
|
|
|
|
|
|
|
|
for (let item of json.result1) {
|
|
|
|
|
let op_sn = "OP_" + item.OPI_SN; //顾问的SN
|
|
|
|
|
let items = json.result1.filter((d) => d.OPI_SN == item.OPI_SN); //筛选出有当前顾问的记录
|
|
|
|
|
let items = json.result1.filter(d => d.OPI_SN == item.OPI_SN); //筛选出有当前顾问的记录
|
|
|
|
|
let total_data_value = items.length ? items.reduce((a, b) => a + b.COLI_YJLY, 0) : ""; //记录累加
|
|
|
|
|
if (comm.empty(type_data[op_sn])) {
|
|
|
|
|
type_data[op_sn] = [{ key: item.OPI_SN }, { T_name: item.OPI_Name }, { T_total: total_data_value }];
|
|
|
|
|
}
|
|
|
|
|
type_data[op_sn].push({ ["T_" + item.SubTypeSN]: item.COLI_YJLY });
|
|
|
|
|
}
|
|
|
|
|
Object.values(type_data).map((item) => {
|
|
|
|
|
Object.values(type_data).map(item => {
|
|
|
|
|
type_data_arr.push(
|
|
|
|
|
Object.assign(
|
|
|
|
|
...item.map((it) => {
|
|
|
|
|
...item.map(it => {
|
|
|
|
|
return it;
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
@ -237,7 +290,7 @@ class SaleStore {
|
|
|
|
|
);
|
|
|
|
|
Object.values(type_name_arr).map((item, index) => {
|
|
|
|
|
let data_index = "T_" + item.SubTypeSN;
|
|
|
|
|
let items = type_data_arr.filter((d) => d[data_index]); //筛选出有对应类型的记录
|
|
|
|
|
let items = type_data_arr.filter(d => d[data_index]); //筛选出有对应类型的记录
|
|
|
|
|
let total_data_value = items.length ? items.reduce((a, b) => a + b[data_index], 0) : ""; //记录累加
|
|
|
|
|
result.columns.push({
|
|
|
|
|
title: item.SubTypeName,
|
|
|
|
@ -253,7 +306,7 @@ class SaleStore {
|
|
|
|
|
this.loading_table = false;
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
.catch(error => {
|
|
|
|
|
this.loading_table = false;
|
|
|
|
|
console.log("fetch data failed", error);
|
|
|
|
|
});
|
|
|
|
@ -275,8 +328,8 @@ class SaleStore {
|
|
|
|
|
this.date_title += ` ${date2_start}~${date2_end}`;
|
|
|
|
|
}
|
|
|
|
|
fetch(config.HT_HOST + url)
|
|
|
|
|
.then((response) => response.json())
|
|
|
|
|
.then((json) => {
|
|
|
|
|
.then(response => response.json())
|
|
|
|
|
.then(json => {
|
|
|
|
|
if (!comm.empty(json.result2) && !comm.empty(date_moment.start_date_cp)) {
|
|
|
|
|
} else {
|
|
|
|
|
result.columns = [
|
|
|
|
@ -315,7 +368,7 @@ class SaleStore {
|
|
|
|
|
//数据处理,把相同类型放入同一个数组
|
|
|
|
|
let type_data = [];
|
|
|
|
|
!comm.empty(json.result1) &&
|
|
|
|
|
Object.values(json.result1).map((item) => {
|
|
|
|
|
Object.values(json.result1).map(item => {
|
|
|
|
|
let subtype_sn = "type_" + item.subType;
|
|
|
|
|
if (comm.empty(type_data[subtype_sn])) {
|
|
|
|
|
type_data[subtype_sn] = { subType: item.subType, subType_name: item.subTypeVal, data: [item] };
|
|
|
|
@ -331,7 +384,7 @@ class SaleStore {
|
|
|
|
|
this.spinning = false;
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
.catch(error => {
|
|
|
|
|
this.spinning = false;
|
|
|
|
|
console.log("fetch data failed", error);
|
|
|
|
|
});
|
|
|
|
|