feat:东道主项目:单团明细

main
ZJYHX 2 months ago
parent 171dd7514a
commit bed6b81753

@ -407,6 +407,7 @@ class CustomerStore {
summaryData: [], // 汇总数据
groupData: [], // 小组数据
counselorData: [], // 顾问数据
singleDetailData:[], // 单团详细数据
group_select_mode: 'multiple',
groups: ['1', '2', '28', '7'],
searchValues: {
@ -436,6 +437,9 @@ class CustomerStore {
case "3":
this.host_case_data.groupData = json.result?json.result:[];
break;
case "4":
this.host_case_data.singleDetailData = json.result?json.result:[];
break;
}
});
})

@ -37,13 +37,17 @@ const HostCaseCount = () => {
sorter: (a, b) => parseInt(a.TotalPrice) - parseInt(b.TotalPrice),
},
];
//
// console.log(host_case_data.groupData);
const allOPI1 = comm.uniqWith(host_case_data.groupData.map(rr => ({ text: rr.GroupBy, value: rr.GroupBy })),
//
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));
};
//
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>
</>
);

Loading…
Cancel
Save