feat: 老客户-分析: 增加`华裔`

main
Lei OT 3 weeks ago
parent 9edfa0c5b8
commit bb2b9cfd6b

@ -18,6 +18,7 @@ const TdCell = (tdprops) => {
const pivotOptions = [
{ key: 'operatorName', label: '顾问' },
{ key: 'country', label: '国籍' },
{ key: 'countryFChina', label: 'X 华裔', dataIndex: 'country' },
{
key: 'destinationCountry',
value: 'destinationCountry',
@ -191,7 +192,7 @@ const CustomerCareRegularPivot = (props) => {
{
key: ele.key,
title: ele.label,
dataIndex: ele.key,
dataIndex: ele.dataIndex || ele.key,
width: '6em',
filters: filterColValues,
onFilter: (value, record) => value.includes(record[ele.key]),
@ -201,7 +202,7 @@ const CustomerCareRegularPivot = (props) => {
]}
summary={() => {
return (
pivotRow === 'country' ?
['country','countryFChina'].includes(pivotRow) ?
countrySummary.map((srow) => (
<Table.Summary.Row key={srow.key}>
<Table.Summary.Cell index1={0}><b>{srow.country}</b></Table.Summary.Cell>

@ -652,17 +652,21 @@ class CustomerStore {
return { filterHasOld };
};
regular_data_pivot = (pivotRow, pivotCol) => {
regular_data_pivot = (_pivotRow, pivotCol) => {
const pivotRow = _pivotRow === 'countryFChina' ? 'country' : _pivotRow;
// console.clear();
// this.sales_regular_data.rawData;
// console.log('regular_data_pivot -------------------------------------------------------------- rawData 000 ', toJS(this.sales_regular_data.rawData));
// console.log('regular_data_pivot -------------------------------------------------------------- rawData 000 ', toJS(this.sales_regular_data.rawDataArr));
// 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', 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');
let rawData = pivotCol === 'hasOld' ? _result.filterHasOld : _result.filterHasOld.filter((ele) => ele[dataColField] === '1');
if (_pivotRow === 'countryFChina') {
rawData = rawData.filter(ele => ele.travelMotivation_china === '华裔');
}
const {
data: pivotResult,
columnValues: [[rowValues], columnsKeys, dateKeys],

@ -38,6 +38,7 @@ const filterFields = [
options: [
{ key: 'country', value: 'country', label: '国籍' },
{ key: 'travelMotivation', value: 'travelMotivation', label: '出行目的' },
{ key: 'travelMotivation_china', value: 'travelMotivation_china', label: '来华动机' },
{ key: 'IsOld_txt', value: 'IsOld_txt', label: '是否老客户' },
{ key: 'isCusCommend_txt', value: 'isCusCommend_txt', label: '是否老客户推荐' },
{ key: 'hasOld_txt', value: 'hasOld_txt', label: '老客户(含推荐)' },

@ -4,7 +4,9 @@ import { immer } from 'zustand/middleware/immer';
import { fetchJSON } from '@haina/utils-request';
import { HT_HOST } from '../config';
import { isEmpty } from '@haina/utils-commons';
/**
* 客户服务
*/
const defaultParams = {};
export const fetchAgentGroupCount = async (params) => {

Loading…
Cancel
Save