From bed6b8175312b85284a14f7e31b0241f3c112845 Mon Sep 17 00:00:00 2001 From: ZJYHX Date: Wed, 14 May 2025 16:35:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=B8=9C=E9=81=93=E4=B8=BB=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE:=E5=8D=95=E5=9B=A2=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/CustomerStore.js | 4 ++ src/views/HostCaseCount.jsx | 118 +++++++++++++++++------------------- 2 files changed, 58 insertions(+), 64 deletions(-) diff --git a/src/stores/CustomerStore.js b/src/stores/CustomerStore.js index 1a7abf6..c4f67cb 100644 --- a/src/stores/CustomerStore.js +++ b/src/stores/CustomerStore.js @@ -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; } }); }) diff --git a/src/views/HostCaseCount.jsx b/src/views/HostCaseCount.jsx index df29603..ce42b74 100644 --- a/src/views/HostCaseCount.jsx +++ b/src/views/HostCaseCount.jsx @@ -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( + + + {title} + + + + record.key} + loading={host_case_data.loading} + pagination={false} + scroll={{ x: 1000 }} + /> + + + ); + }; return ( <> @@ -88,67 +130,15 @@ const HostCaseCount = () => { customer_store.getHostCaseData("1"); customer_store.getHostCaseData("2"); customer_store.getHostCaseData("3"); + customer_store.getHostCaseData("4"); }} /> - - - 东道主项目汇总 - - - -
record.key} - loading={host_case_data.loading} - pagination={false} - scroll={{ x: 1000 }} - /> - - - - - 东道主项目小组统计 - - - -
record.key} - loading={host_case_data.loading} - pagination={false} - scroll={{ x: 1000 }} - /> - - - - - 东道主项目顾问统计 - - - -
record.key} - loading={host_case_data.loading} - pagination={false} - scroll={{ x: 1000 }} - /> - - + {renderRow(summaryColumnsList,host_case_data.summaryData,'东道主项目汇总')} + {renderRow(groupColumnsList,host_case_data.groupData,'东道主项目小组统计')} + {renderRow(counselorColumnsList,host_case_data.counselorData,'东道主项目顾问统计')} + {renderRow(singleDetailColumnsList,host_case_data.singleDetailData,'单团明细')} );