|
|
|
@ -150,13 +150,13 @@ const dataSales = (tKey, rawData, yearData, yearData2) => {
|
|
|
|
|
const filterDataYear2 = yearData2.filter((ele) => targetList.some((item) => ele.OrderType.toLocaleLowerCase().indexOf(item) !== -1));
|
|
|
|
|
const rowYearData2 = ['YJLY', 'CJCount'].reduce((r, key) => ({ ...r, [key]: filterDataYear2.reduce((a, c) => a + price_to_number(c[key]), 0) }), {});
|
|
|
|
|
const rowYear = {
|
|
|
|
|
YJLY: price_to_number(rowYearData.YJLY), CJCount: rowYearData.CJCount,
|
|
|
|
|
YJLY2: price_to_number(rowYearData2.YJLY), CJCount2: rowYearData2.CJCount,
|
|
|
|
|
YJLY: price_to_number(rowYearData.YJLY), CJCount: rowYearData.CJCount, GroupCount: rowYearData.CJCount,
|
|
|
|
|
YJLY2: price_to_number(rowYearData2.YJLY), CJCount2: rowYearData2.CJCount, GroupCount2: rowYearData2.CJCount,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const cols = ['YJLY', 'CJCount'].reduce((r, key) => ({ ...r, [key]: filterData.reduce((a, c) => a + price_to_number(c[key]), 0) }), {});
|
|
|
|
|
// console.log(tKey, filterData, filterDataYear, filterDataYear2);
|
|
|
|
|
return { ...cols, CJCount, YJLY, rowYear, rawData: filterData, rawYearData: filterDataYear, rawYearData2: filterDataYear2 };
|
|
|
|
|
return { ...cols, GroupCount:CJCount, CJCount, YJLY, rowYear, rawData: filterData, rawYearData: filterDataYear, rawYearData2: filterDataYear2 };
|
|
|
|
|
};
|
|
|
|
|
const dataSalesGHOther = (rawData, yearData, yearData2) => {
|
|
|
|
|
const exceptContry = Object.values(GHCountryListSetting).reduce((r, c) => r.concat(c), []);
|
|
|
|
@ -178,12 +178,12 @@ const dataSalesGHOther = (rawData, yearData, yearData2) => {
|
|
|
|
|
const rowYearData2 = ['YJLY', 'CJCount'].reduce((r, key) => ({ ...r, [key]: filterDataYear2.reduce((a, c) => a + price_to_number(c[key]), 0) }), {});
|
|
|
|
|
|
|
|
|
|
const rowYear = {
|
|
|
|
|
YJLY: price_to_number(rowYearData.YJLY), CJCount: rowYearData.CJCount,
|
|
|
|
|
YJLY2: price_to_number(rowYearData2.YJLY), CJCount2: rowYearData2.CJCount,
|
|
|
|
|
YJLY: price_to_number(rowYearData.YJLY), CJCount: rowYearData.CJCount, GroupCount: rowYearData.CJCount,
|
|
|
|
|
YJLY2: price_to_number(rowYearData2.YJLY), CJCount2: rowYearData2.CJCount, GroupCount2: rowYearData2.CJCount,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// console.log('Oo', filterData, filterDataYear, filterDataYear2);
|
|
|
|
|
return { CJCount, YJLY, rowYear, rawData: filterData, rawYearData: filterDataYear, rawYearData2: filterDataYear2 };
|
|
|
|
|
return { GroupCount:CJCount, CJCount, YJLY, rowYear, rawData: filterData, rawYearData: filterDataYear, rawYearData2: filterDataYear2 };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class MeetingData {
|
|
|
|
@ -306,25 +306,29 @@ class MeetingData {
|
|
|
|
|
*/
|
|
|
|
|
dataGHService = async (param) => {
|
|
|
|
|
this.GHServiceLoading = true;
|
|
|
|
|
const serviceParam = { ...param, DateType: 'startDate' };
|
|
|
|
|
const serviceParam = { ...param, DateType: 'startDate', 'WebCode': 'All' };
|
|
|
|
|
// 走团数
|
|
|
|
|
const { ordercountTotal1: { OrderCount: GroupCount } } = await getOrderCountByType({ ...serviceParam, 'DepartmentList': '1', 'WebCode': 'All', OrderType: 'Form' });
|
|
|
|
|
const { ordercountTotal1: { OrderCount: GroupCount } } = await getOrderCountByType({ ...serviceParam, 'DepartmentList': '1', OrderType: 'Form' });
|
|
|
|
|
const exceptCHDataWeek = await getDetailData({ ...serviceParam, 'DepartmentList': '28,33' });
|
|
|
|
|
// 好评数
|
|
|
|
|
const { total1: { GoodCount } } = await getAgentGroupInfoALL({ ...serviceParam, 'DepartmentList': '1', });
|
|
|
|
|
const yearStart = moment().startOf("year").format(DATE_FORMAT);
|
|
|
|
|
// 走团数 - 年
|
|
|
|
|
const { ordercountTotal1: { OrderCount: GroupCountYear } } = await getOrderCountByType({ ...serviceParam, 'DepartmentList': '1', 'WebCode': 'All', OrderType: 'Form', Date1: yearStart, });
|
|
|
|
|
const { total1: { GoodCountYear } } = await getAgentGroupInfoALL({ ...serviceParam, Date1: yearStart, 'DepartmentList': '1', });
|
|
|
|
|
|
|
|
|
|
// const { total1: yearData } = await getAgentGroupInfoALL({ ...serviceParam, 'DepartmentList': '28,33', Country: 'foreign' });
|
|
|
|
|
const yearStart = moment().startOf("year").format(DATE_FORMAT);
|
|
|
|
|
const { ordercountTotal1: { OrderCount: GroupCountYear } } = await getOrderCountByType({ ...serviceParam, 'DepartmentList': '1', OrderType: 'Form', Date1: yearStart, });
|
|
|
|
|
const exceptCHDataYear = await getDetailData({ ...serviceParam, Date1: yearStart, 'DepartmentList': '28,33' });
|
|
|
|
|
const { total1: { GoodCount: GoodCountYear } } = await getAgentGroupInfoALL({ ...serviceParam, Date1: yearStart, 'DepartmentList': '1', });
|
|
|
|
|
|
|
|
|
|
const rows = [
|
|
|
|
|
{ key: 'ch', label: '中国', ...{GoodCount, GroupCount}, rowYear: { GroupCount: GroupCountYear, GoodCount: GoodCountYear } },
|
|
|
|
|
// { key: 'ja', label: '日本+', ...dataJA(exceptCHData, exceptCHDataYear) },
|
|
|
|
|
// { key: 'se', label: '东南亚+', ...dataSE(exceptCHData, exceptCHDataYear) },
|
|
|
|
|
// { key: 'in', label: '印度+', ...dataIN(exceptCHData, exceptCHDataYear) },
|
|
|
|
|
// { key: 'other', label: '其他GH', ...dataGHOther(exceptCHData, exceptCHDataYear) },
|
|
|
|
|
{ key: 'ja', label: '日本+', ...dataSales('ja', exceptCHDataWeek, exceptCHDataYear, []) },
|
|
|
|
|
{ key: 'se', label: '东南亚+', ...dataSales('se', exceptCHDataWeek, exceptCHDataYear, []) },
|
|
|
|
|
{ key: 'in', label: '印度+', ...dataSales('in', exceptCHDataWeek, exceptCHDataYear, []) },
|
|
|
|
|
{ key: 'other', label: '其他GH', ...dataSalesGHOther(exceptCHDataWeek, exceptCHDataYear, []) },
|
|
|
|
|
];
|
|
|
|
|
const columnsSum = ['GoodCount', 'GroupCount'].reduce((r, col) => ({ ...r, [col]: rows.reduce((rr, row) => rr + (row[col] || 0), 0) }), {});
|
|
|
|
|
const allYearData = rows.map(row => row.rowYear);
|
|
|
|
|
const rowYear = ['GoodCount', 'GroupCount', ].reduce((r, col) => ({ ...r, [col]: allYearData.reduce((rr, row) => rr + (row[col] || 0), 0) }), {});
|
|
|
|
|
rows.push({ key: 'columnSum', label: '合计', ...columnsSum, rowYear });
|
|
|
|
|
// console.log(rows);
|
|
|
|
|
runInAction(() => {
|
|
|
|
|
this.GHServiceTableData = rows;
|
|
|
|
|