diff --git a/src/charts/Customer_care_regular_pivot.jsx b/src/charts/Customer_care_regular_pivot.jsx
index fb325f6..8ae398b 100644
--- a/src/charts/Customer_care_regular_pivot.jsx
+++ b/src/charts/Customer_care_regular_pivot.jsx
@@ -31,6 +31,19 @@ const pivotOptions = [
>
),
},
+ {
+ key: 'destinations',
+ value: 'destinations',
+ labelX: '目的地城市',
+ label: (
+ <>
+ 目的地城市
+
+
+
+ >
+ ),
+ },
];
const pivotColOptions = [
{ key: 'hasOld', value: 'hasOld', label: '老客户+推荐' },
@@ -40,7 +53,7 @@ const pivotColOptions = [
const CustomerCareRegularPivot = (props) => {
const { date_picker_store: searchFormStore, customer_store } = useContext(stores_Context);
const { formValues, formValuesToSub, siderBroken } = searchFormStore;
- const { loading, pivotResult, filterColValues, rawData, countrySummary } = customer_store.sales_regular_data;
+ const { loading, pivotResult, filterColValues, rawData, countrySummary, citySummary } = customer_store.sales_regular_data;
// console.log('❤❤', countrySummary);
const [pivotRow, setPivotRow] = useState('operatorName');
const [pivotCol, setPivotCol] = useState('hasOld');
@@ -173,6 +186,7 @@ const CustomerCareRegularPivot = (props) => {
sticky={{ offsetHeader: 88 }}
dataSource={dataSource}
loading={loading}
+ components={{ body: { cell: TdCell } }}
columns={[
{
key: ele.key,
@@ -187,7 +201,7 @@ const CustomerCareRegularPivot = (props) => {
]}
summary={() => {
return (
- pivotRow === 'country' &&
+ pivotRow === 'country' ?
countrySummary.map((srow) => (
{srow.country}
@@ -198,6 +212,17 @@ const CustomerCareRegularPivot = (props) => {
))}
))
+ : pivotRow === 'destinations' ? citySummary.map((srow) => (
+
+ {srow.destinations}
+ {columns.map((td) => (
+
+
+
+ ))}
+
+ )) : null
+
);
}}
pagination={false}
diff --git a/src/stores/CustomerStore.js b/src/stores/CustomerStore.js
index 3d96a04..250544a 100644
--- a/src/stores/CustomerStore.js
+++ b/src/stores/CustomerStore.js
@@ -497,6 +497,7 @@ class CustomerStore {
// },
pivotResult: [],
countrySummary: [],
+ citySummary: [],
filterColValues: [],
rawDataArr: [],
};
@@ -576,7 +577,7 @@ class CustomerStore {
// console.log('regular_data_pivot ---- ', pivotRow, pivotCol);
const [result1, result2] = this.sales_regular_data.rawDataArr;
// const allRows = Array.from(new Set([...result1.filterHasOld.map(row=>row[pivotRow]), ...result2.filterHasOld.map(row=>row[pivotRow])]));
- // console.log(' ------ allRows', allRows);
+ // console.log(' ------ allRows', result1, result2);
const [{ pivotResult: pivot1, rowValues: rowValues1 }, { pivotResult: pivot2, rowValues: rowValues2 }] = [result1, result2].map((_result) => {
const dataColField = pivotCol.replace('_txt', '');
const rawData = pivotCol === 'hasOld' ? _result.filterHasOld : _result.filterHasOld.filter((ele) => ele[dataColField] === '1');
@@ -635,6 +636,53 @@ class CustomerStore {
this.sales_regular_data.countrySummary = [aseanSummary, eurusdSummary];
}
+ if (pivotRow === 'destinations') {
+ const city1 = ['昆明','大理','丽江','中甸','德钦','西双版纳','普洱','泸沽湖','腾冲'];
+ const [city11, city12] = [
+ pivot1.filter((ele) => city1.includes(ele.destinations)),
+ pivot2.filter((ele) => city1.includes(ele.destinations)),
+ ];
+ const city1Summary = calcSummaryRow(city11, city12);
+ city1Summary.key = '云南';
+ city1Summary.destinations = '云南';
+
+ const city2 = ['上海','苏州','杭州','黄山','婺源','上饶','景德镇'];
+ const [city21, city22] = [
+ pivot1.filter((ele) => city2.includes(ele.destinations)),
+ pivot2.filter((ele) => city2.includes(ele.destinations)),
+ ];
+ const city2Summary = calcSummaryRow(city21, city22);
+ city2Summary.key = '华东';
+ city2Summary.destinations = '华东';
+
+ const city3 = ['乌鲁木齐','喀什','伊宁','昭苏','霍城','那拉提','喀纳斯','禾木','布尔津','吐鲁番','库尔勒','赛里木湖','和田','库车'];
+ const [city31, city32] = [
+ pivot1.filter((ele) => city3.includes(ele.destinations)),
+ pivot2.filter((ele) => city3.includes(ele.destinations)),
+ ];
+ const city3Summary = calcSummaryRow(city31, city32);
+ city3Summary.key = '新疆';
+ city3Summary.destinations = '新疆';
+ const city4 = ['拉萨','江孜','林芝','鲁朗','巴松措','然乌','波密','日喀则','定日','泽当','塔钦'];
+ const [city41, city42] = [
+ pivot1.filter((ele) => city4.includes(ele.destinations)),
+ pivot2.filter((ele) => city4.includes(ele.destinations)),
+ ];
+ const city4Summary = calcSummaryRow(city41, city42);
+ city4Summary.key = '西藏';
+ city4Summary.destinations = '西藏';
+
+ const city5 = ['贵阳','安顺','黄果树','榕江','从江','毕节','织金','铜仁','梵净山','荔波','平塘','兴义'];
+ const [city51, city52] = [
+ pivot1.filter((ele) => city5.includes(ele.destinations)),
+ pivot2.filter((ele) => city5.includes(ele.destinations)),
+ ];
+ const city5Summary = calcSummaryRow(city51, city52);
+ city5Summary.key = '贵州';
+ city5Summary.destinations = '贵州';
+
+ this.sales_regular_data.citySummary = [city1Summary, city2Summary, city3Summary, city4Summary, city5Summary];
+ }
this.sales_regular_data.pivotResult = pivotResultWithCompare;
this.sales_regular_data.filterColValues = filterColValues;