|
|
|
@ -37,13 +37,17 @@ const HostCaseCount = () => {
|
|
|
|
|
sorter: (a, b) => parseInt(a.TotalPrice) - parseInt(b.TotalPrice),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
// 筛选函数
|
|
|
|
|
const getFiltersData=(filterData,filterKey)=>{
|
|
|
|
|
return comm.uniqWith(filterData.map(rr => ({ text: rr[filterKey], value: rr[filterKey] })),
|
|
|
|
|
(a, b) => JSON.stringify(a) === JSON.stringify(b)).sort((a, b) => a.text.localeCompare(b.text));
|
|
|
|
|
};
|
|
|
|
|
// 小组筛选菜单项
|
|
|
|
|
// console.log(host_case_data.groupData);
|
|
|
|
|
const allOPI1 = comm.uniqWith(host_case_data.groupData.map(rr => ({ text: rr.GroupBy, value: rr.GroupBy })),
|
|
|
|
|
(a, b) => JSON.stringify(a) === JSON.stringify(b)).sort((a, b) => a.text.localeCompare(b.text));
|
|
|
|
|
const allOPIGroup = getFiltersData(host_case_data.summaryData,"GroupBy");
|
|
|
|
|
// 顾问筛选菜单项
|
|
|
|
|
const allOPI2 = comm.uniqWith(host_case_data.counselorData.map(rr => ({ text: rr.GroupBy, value: rr.GroupBy })),
|
|
|
|
|
(a, b) => JSON.stringify(a) === JSON.stringify(b)).sort((a, b) => a.text.localeCompare(b.text));
|
|
|
|
|
const allOPIConsultant = getFiltersData(host_case_data.counselorData,"GroupBy");
|
|
|
|
|
// 明细表顾问名筛选菜单项
|
|
|
|
|
const allOPIDetailConsultant = getFiltersData(host_case_data.singleDetailData,"OPI_Name");
|
|
|
|
|
const summaryColumnsList = [{
|
|
|
|
|
title: '',
|
|
|
|
|
dataIndex: 'GroupBy',
|
|
|
|
@ -53,7 +57,7 @@ const HostCaseCount = () => {
|
|
|
|
|
title: '组名',
|
|
|
|
|
dataIndex: 'GroupBy',
|
|
|
|
|
key: 'GroupBy',
|
|
|
|
|
filters: allOPI1,
|
|
|
|
|
filters: allOPIGroup,
|
|
|
|
|
onFilter: (value, record) => record.GroupBy === value,
|
|
|
|
|
filterSearch: true,
|
|
|
|
|
}, ...columnsList];
|
|
|
|
@ -61,10 +65,48 @@ const HostCaseCount = () => {
|
|
|
|
|
title: '顾问名',
|
|
|
|
|
dataIndex: 'GroupBy',
|
|
|
|
|
key: 'GroupBy',
|
|
|
|
|
filters: allOPI2,
|
|
|
|
|
filters: allOPIConsultant,
|
|
|
|
|
onFilter: (value, record) => record.GroupBy === value,
|
|
|
|
|
filterSearch: true,
|
|
|
|
|
}, ...columnsList];
|
|
|
|
|
const singleDetailColumnsList = [{
|
|
|
|
|
title: '团名',
|
|
|
|
|
dataIndex: 'GroupBy',
|
|
|
|
|
key: 'GroupBy',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '顾问名',
|
|
|
|
|
dataIndex: 'OPI_Name',
|
|
|
|
|
key: 'OPI_Name',
|
|
|
|
|
filters: allOPIDetailConsultant,
|
|
|
|
|
onFilter: (value, record) => record.OPI_Name === value,
|
|
|
|
|
filterSearch: true,
|
|
|
|
|
},
|
|
|
|
|
...columnsList.slice(1)];
|
|
|
|
|
|
|
|
|
|
const renderRow=(rowColumns,rowDataSource,title)=>{
|
|
|
|
|
return(
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Typography.Title level={3}>{title}</Typography.Title>
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<TableExportBtn label={title} {...{ columns: rowColumns, dataSource: rowDataSource }} />
|
|
|
|
|
</Divider>
|
|
|
|
|
<Table
|
|
|
|
|
sticky
|
|
|
|
|
id={`${rowColumns}`}
|
|
|
|
|
dataSource={rowDataSource}
|
|
|
|
|
columns={rowColumns}
|
|
|
|
|
size="small"
|
|
|
|
|
rowKey={(record) => record.key}
|
|
|
|
|
loading={host_case_data.loading}
|
|
|
|
|
pagination={false}
|
|
|
|
|
scroll={{ x: 1000 }}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
@ -88,67 +130,15 @@ const HostCaseCount = () => {
|
|
|
|
|
customer_store.getHostCaseData("1");
|
|
|
|
|
customer_store.getHostCaseData("2");
|
|
|
|
|
customer_store.getHostCaseData("3");
|
|
|
|
|
customer_store.getHostCaseData("4");
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Typography.Title level={3}>东道主项目汇总</Typography.Title>
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<TableExportBtn label={'东道主项目汇总'} {...{ columns: summaryColumnsList, dataSource: host_case_data.summaryData }} />
|
|
|
|
|
</Divider>
|
|
|
|
|
<Table
|
|
|
|
|
sticky
|
|
|
|
|
id="summaryCountList"
|
|
|
|
|
dataSource={host_case_data.summaryData}
|
|
|
|
|
columns={summaryColumnsList}
|
|
|
|
|
size="small"
|
|
|
|
|
rowKey={(record) => record.key}
|
|
|
|
|
loading={host_case_data.loading}
|
|
|
|
|
pagination={false}
|
|
|
|
|
scroll={{ x: 1000 }}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Typography.Title level={3}>东道主项目小组统计</Typography.Title>
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<TableExportBtn label={'东道主项目小组统计'} {...{ columns: groupColumnsList, dataSource: host_case_data.groupData }} />
|
|
|
|
|
</Divider>
|
|
|
|
|
<Table
|
|
|
|
|
sticky
|
|
|
|
|
id="groupColumnsList"
|
|
|
|
|
dataSource={host_case_data.groupData}
|
|
|
|
|
columns={groupColumnsList}
|
|
|
|
|
size="small"
|
|
|
|
|
rowKey={(record) => record.key}
|
|
|
|
|
loading={host_case_data.loading}
|
|
|
|
|
pagination={false}
|
|
|
|
|
scroll={{ x: 1000 }}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
<Typography.Title level={3}>东道主项目顾问统计</Typography.Title>
|
|
|
|
|
<Divider orientation="right" plain>
|
|
|
|
|
<TableExportBtn label={'东道主项目顾问统计'} {...{ columns: counselorColumnsList, dataSource: host_case_data.counselorData }} />
|
|
|
|
|
</Divider>
|
|
|
|
|
<Table
|
|
|
|
|
sticky
|
|
|
|
|
id="counselorColumnsList"
|
|
|
|
|
dataSource={host_case_data.counselorData}
|
|
|
|
|
columns={counselorColumnsList}
|
|
|
|
|
size="small"
|
|
|
|
|
rowKey={(record) => record.key}
|
|
|
|
|
loading={host_case_data.loading}
|
|
|
|
|
pagination={false}
|
|
|
|
|
scroll={{ x: 1000 }}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
{renderRow(summaryColumnsList,host_case_data.summaryData,'东道主项目汇总')}
|
|
|
|
|
{renderRow(groupColumnsList,host_case_data.groupData,'东道主项目小组统计')}
|
|
|
|
|
{renderRow(counselorColumnsList,host_case_data.counselorData,'东道主项目顾问统计')}
|
|
|
|
|
{renderRow(singleDetailColumnsList,host_case_data.singleDetailData,'单团明细')}
|
|
|
|
|
</Space>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|