Compare commits

..

No commits in common. 'main' and 'v2.11.10' have entirely different histories.

4
package-lock.json generated

@ -1,12 +1,12 @@
{ {
"name": "haina-dashboard", "name": "haina-dashboard",
"version": "2.11.12", "version": "2.11.10",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "haina-dashboard", "name": "haina-dashboard",
"version": "2.11.12", "version": "2.11.10",
"dependencies": { "dependencies": {
"@ant-design/charts": "^1.4.2", "@ant-design/charts": "^1.4.2",
"@ant-design/pro-components": "^2.6.16", "@ant-design/pro-components": "^2.6.16",

@ -1,6 +1,6 @@
{ {
"name": "haina-dashboard", "name": "haina-dashboard",
"version": "2.11.12", "version": "2.11.10",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@ant-design/charts": "^1.4.2", "@ant-design/charts": "^1.4.2",

@ -27,7 +27,6 @@ import ProtectedRoute from './views/ProtectedRoute';
import Customer_care_inchina from './charts/Customer_care_inchina'; import Customer_care_inchina from './charts/Customer_care_inchina';
import Customer_care_potential from './charts/Customer_care_potential'; import Customer_care_potential from './charts/Customer_care_potential';
import Customer_care_regular from './charts/Customer_care_regular'; import Customer_care_regular from './charts/Customer_care_regular';
import Customer_care_regular_pivot from './charts/Customer_care_regular_pivot';
import Wechat_session from './charts/Wechat_session'; import Wechat_session from './charts/Wechat_session';
import WhatsApp_session from './charts/WhatsApp_session'; import WhatsApp_session from './charts/WhatsApp_session';
import AgentGroupCount from './views/AgentGroupCount'; import AgentGroupCount from './views/AgentGroupCount';
@ -49,6 +48,7 @@ import DataPivot from './views/DataPivot';
import Welcome from './views/Welcome'; import Welcome from './views/Welcome';
import Meeting2024GH from './views/Meeting2024-GH'; import Meeting2024GH from './views/Meeting2024-GH';
import Meeting2025GH from './views/Meeting2025-GH'; import Meeting2025GH from './views/Meeting2025-GH';
import SalesCustomerCareRegular from './views/SalesCustomerCareRegular';
import { stores_Context, APP_VERSION } from './config'; import { stores_Context, APP_VERSION } from './config';
import { WaterMark } from '@ant-design/pro-components'; import { WaterMark } from '@ant-design/pro-components';
import CooperationIcon from './components/icons/CooperationIcon'; import CooperationIcon from './components/icons/CooperationIcon';
@ -128,7 +128,7 @@ const App = () => {
key: 32, key: 32,
label: <NavLink to="/customer_care_regular">老客户</NavLink>, label: <NavLink to="/customer_care_regular">老客户</NavLink>,
}, },
{ key: 'customer_care_regular_pivot', label: <NavLink to="/customer_care_regular_pivot">老客户-分析</NavLink> }, { key: 'customer_care_regular_sales', label: <NavLink to="/customer_care_regular_sales">老客户-分析</NavLink> },
{ {
key: 33, key: 33,
label: <NavLink to="/customer_care_inchina">在华客户</NavLink>, label: <NavLink to="/customer_care_inchina">在华客户</NavLink>,
@ -257,7 +257,7 @@ const App = () => {
<Route element={<ProtectedRoute auth={['admin', 'director_bu', 'customer_care']} />}> <Route element={<ProtectedRoute auth={['admin', 'director_bu', 'customer_care']} />}>
<Route path="/customer_care_inchina" element={<Customer_care_inchina />} /> <Route path="/customer_care_inchina" element={<Customer_care_inchina />} />
<Route path="/customer_care_regular" element={<Customer_care_regular />} /> <Route path="/customer_care_regular" element={<Customer_care_regular />} />
<Route path="/customer_care_regular_pivot" element={<Customer_care_regular_pivot />} /> <Route path="/customer_care_regular_sales" element={<SalesCustomerCareRegular />} />
<Route path="/customer_care_potential" element={<Customer_care_potential />} /> <Route path="/customer_care_potential" element={<Customer_care_potential />} />
<Route path="/whatsapp_session" element={<WhatsApp_session />} /> <Route path="/whatsapp_session" element={<WhatsApp_session />} />
<Route path="/wechat_session" element={<Wechat_session />} /> <Route path="/wechat_session" element={<Wechat_session />} />

@ -7,7 +7,6 @@ import { observer } from 'mobx-react';
import SearchForm from './../components/search/SearchForm'; import SearchForm from './../components/search/SearchForm';
import LineWithAvg from '../components/LineWithAvg'; import LineWithAvg from '../components/LineWithAvg';
import { flow } from 'mobx'; import { flow } from 'mobx';
import { TableExportBtn } from '../components/Data';
const Customer_care_regular = () => { const Customer_care_regular = () => {
const { orders_store, date_picker_store, customer_store } = useContext(stores_Context); const { orders_store, date_picker_store, customer_store } = useContext(stores_Context);
@ -15,196 +14,6 @@ const Customer_care_regular = () => {
// useEffect(() => {}, []); // useEffect(() => {}, []);
const columns = [
{
title: '订单号',
dataIndex: 'COLI_ID',
key: 'COLI_ID',
},
{
title: '预定日期',
dataIndex: 'COLI_ApplyDate',
key: 'COLI_ApplyDate',
},
{
title: '订单状态',
width: '4rem',
dataIndex: 'OrderState1',
key: 'OrderState1',
render: (text, record) => record.OrderState === 1 ? '成行' : '未成行',
sorter: (a, b) => b.OrderState - a.OrderState,
},
{
title: '毛利',
dataIndex: 'ML',
key: 'ML',
},
{
title: '人数',
dataIndex: 'PersonNum',
key: 'PersonNum',
},
{
title: '天数',
dataIndex: 'COLI_Days',
key: 'COLI_Days',
},
{
title: '人天数',
dataIndex: 'CGI_PersonDays',
key: 'CGI_PersonDays',
},
{
title: '走团日期',
dataIndex: 'COLI_OrderStartDate',
key: 'COLI_OrderStartDate',
},
{
title: '走团国家',
dataIndex: 'recommend_country',
key: 'recommend_country',
width: '4em',
},
{
title: '小组',
dataIndex: 'Department',
key: 'Department',
},
{
title: '老客户',
dataIndex: 'COLI_IsOld',
key: 'COLI_IsOld',
},
{
title: '老客户推荐',
dataIndex: 'COLI_IsCusCommend',
key: 'COLI_IsCusCommend',
},
{
title: '国籍',
dataIndex: 'MEI_Country',
key: 'MEI_Country',
},
{
title: '网站',
dataIndex: 'COLI_WebCode',
key: 'COLI_WebCode',
},
{
title: '来源',
dataIndex: 'SourceType',
key: 'SourceType',
},
{
title: '页面类型',
dataIndex: 'COLI_LineClass',
key: 'COLI_LineClass',
},
{
title: '券额',
dataIndex: 'Voucher_amount',
key: 'Voucher_amount',
width: '4em',
},
{
title: '券类别',
dataIndex: 'Voucher_type',
key: 'Voucher_type',
width: '5em',
},
{
title: '上次 订单号',
dataIndex: 'coli_id_Last',
key: 'coli_id_Last',
width: '5em',
onCell: (r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' },
}),
},
{
title: '上次 走团日期',
dataIndex: 'COLI_OrderStartDate_Last',
key: 'COLI_OrderStartDate_Last',
width: '4em',
onCell: (_, r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' } ,
}),
},
{
title: '上次 小组',
dataIndex: 'Department_Last',
key: 'Department_Last',
width: '4em',
onCell: (_, r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' } ,
}),
},
];
const export_columns = [].concat(columns, [
{
title: '上次经过国家',
dataIndex: 'last_country',
key: 'last_country',
onCell: (r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' },
}),
},
{
title: '复购周期',
dataIndex: 'Repurchase_cycle',
key: 'Repurchase_cycle',
width: '4em',
onCell: (_, r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' },
}),
},
{
title: '下单次数',
dataIndex: 'Orders_number',
key: 'Orders_number',
width: '4em',
onCell: (_, r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' },
}),
},
{
title: '推荐次数',
dataIndex: 'recommend_time',
key: 'recommend_time',
width: '4em',
onCell: (_, r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' },
}),
},
{
title: '历史成行次数',
dataIndex: 'Travel_count',
key: 'Travel_count',
width: '4em',
onCell: (_, r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' },
}),
},
{
title: '旅行周期',
dataIndex: 'Travel_cycle',
key: 'Travel_cycle',
width: '4em',
onCell: (_, r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' },
}),
},
{
title: '第1次走团日期',
dataIndex: 'firstStartdate',
key: 'firstStartdate',
width: '4em',
onCell: (_, r) => ({
style: { backgroundColor: '#5B8FF9' + '1A' },
}),
},
]);
return ( return (
<div> <div>
<Row gutter={16} className={date_picker_store.siderBroken ? '' : 'sticky-top'}> <Row gutter={16} className={date_picker_store.siderBroken ? '' : 'sticky-top'}>
@ -331,9 +140,8 @@ const Customer_care_regular = () => {
writeFileXLSX(wb, '老客户.xlsx'); writeFileXLSX(wb, '老客户.xlsx');
}} }}
> >
导出下表 导出excel
</a> </a>
<TableExportBtn btnTxt='导出详情' label={'老客户-详情'} columns={export_columns} dataSource={regular_data.data_detail} style={{ marginLeft: '10px' }} />
</Divider> </Divider>
<Table <Table
id="table_to_xlsx" id="table_to_xlsx"
@ -341,7 +149,100 @@ const Customer_care_regular = () => {
loading={regular_data.detail_loading} loading={regular_data.detail_loading}
dataSource={regular_data.data_detail} dataSource={regular_data.data_detail}
scroll={{ x: 1200 }} scroll={{ x: 1200 }}
columns={columns} columns={[
{
title: '订单号',
dataIndex: 'COLI_ID',
key: 'COLI_ID',
},
{
title: '预定日期',
dataIndex: 'COLI_ApplyDate',
key: 'COLI_ApplyDate',
},
{
title: '订单状态',width: '4rem',
dataIndex: 'OrderState',
key: 'OrderState',
render: (text, record) => <span>{text == 1 ? '成行' : '未成行'}</span>,
sorter: (a, b) => b.OrderState - a.OrderState,
},
{
title: '毛利',
dataIndex: 'ML',
key: 'ML',
},
{
title: '人数',
dataIndex: 'PersonNum',
key: 'PersonNum',
},
{
title: '天数',
dataIndex: 'COLI_Days',
key: 'COLI_Days',
},
{
title: '人天数',
dataIndex: 'CGI_PersonDays',
key: 'CGI_PersonDays',
},
{
title: '走团日期',
dataIndex: 'COLI_OrderStartDate',
key: 'COLI_OrderStartDate',
},
{
title: '小组',
dataIndex: 'Department',
key: 'Department',
},
{
title: '老客户',
dataIndex: 'COLI_IsOld',
key: 'COLI_IsOld',
},
{
title: '老客户推荐',
dataIndex: 'COLI_IsCusCommend',
key: 'COLI_IsCusCommend',
},
{
title: '国籍',
dataIndex: 'MEI_Country',
key: 'MEI_Country',
},
{
title: '网站',
dataIndex: 'COLI_WebCode',
key: 'COLI_WebCode',
},
{
title: '来源',
dataIndex: 'SourceType',
key: 'SourceType',
},
{
title: '页面类型',
dataIndex: 'COLI_LineClass',
key: 'COLI_LineClass',
},
{ title: '上次 订单号', dataIndex: 'coli_id_Last', key: 'coli_id_Last', width: '4em',
render: (_, r) => ({
props: { style: { backgroundColor: '#5B8FF9'+'1A' } },
children: _,
}), },
{ title: '上次 走团日期', dataIndex: 'COLI_OrderStartDate_Last', key: 'COLI_OrderStartDate_Last',width: '4em',
render: (_, r) => ({
props: { style: { backgroundColor: '#5B8FF9'+'1A' } },
children: _,
}), },
{ title: '上次 小组', dataIndex: 'Department_Last', key: 'Department_Last',width: '4em',
render: (_, r) => ({
props: { style: { backgroundColor: '#5B8FF9'+'1A' } },
children: _,
}), },
]}
size="small" size="small"
rowKey={(record) => record.COLI_ID} rowKey={(record) => record.COLI_ID}
/> />

@ -153,7 +153,7 @@ export default observer((props) => {
], ],
'country': { 'country': {
key: 'country', key: 'country',
transform: (value) => Array.isArray(value) ? value.map((ele) => ele.key).join(',') : value ? (!isNaN(parseInt(value.key), 10) ? value.key : '') : '', transform: (value) => value?.key || '',
default: '', default: '',
}, },
'city': { 'city': {
@ -506,7 +506,7 @@ function getFields(props) {
'country', 'country',
99, 99,
<Form.Item name={'country'}> <Form.Item name={'country'}>
<SearchInput {...fieldProps?.country || {}} autoGet url="/service-Analyse2/GetCountryInfo" map={{ 'c_id': 'key', 'cn_name': 'label' }} resultkey={'result'} placeholder="输入搜索国籍: 中/英名字" /> <SearchInput autoGet url="/service-Analyse2/GetCountryInfo" map={{ 'c_id': 'key', 'cn_name': 'label' }} resultkey={'result'} placeholder="输入搜索国籍: 中/英名字" />
</Form.Item> </Form.Item>
), ),
item( item(

@ -1,4 +1,4 @@
import {makeAutoObservable, runInAction, toJS } from "mobx"; import {makeAutoObservable, runInAction} from "mobx";
import { fetchJSON } from '../utils/request'; import { fetchJSON } from '../utils/request';
import * as config from "../config"; import * as config from "../config";
import { groupsMappedByKey, sitesMappedByCode, pivotBy } from './../libs/ht'; import { groupsMappedByKey, sitesMappedByCode, pivotBy } from './../libs/ht';
@ -457,8 +457,8 @@ class CustomerStore {
// 销售-老客户 // 销售-老客户
sales_regular_data = { sales_regular_data = {
loading: false, loading: false,
// data: [], data: [],
// mergedData: [], mergedData: [],
rawData: [], rawData: [],
searchValues: { searchValues: {
DepartmentList: ['1', '2', '28', '7'].map(kk => groupsMappedByKey[kk]), DepartmentList: ['1', '2', '28', '7'].map(kk => groupsMappedByKey[kk]),
@ -466,53 +466,78 @@ class CustomerStore {
DateType: { key: 'applyDate', label: '提交日期'}, DateType: { key: 'applyDate', label: '提交日期'},
IncludeTickets: { key: '0', label: '不含门票' }, IncludeTickets: { key: '0', label: '不含门票' },
}, },
// pivotData: { pivotData: {
// operatorName: { loading: false, data: [], rawData: [], mergedData: [], filterColValues: [] }, operatorName: { loading: false, data: [], rawData: [], mergedData: [], filterColValues: [] },
// country: { loading: false, data: [], rawData: [], mergedData: [], filterColValues: [] }, country: { loading: false, data: [], rawData: [], mergedData: [], filterColValues: [] },
// }, },
pivotResult: [],
filterColValues: [],
rawDataArr: [],
}; };
get_sales_regular_data_vs = async (param, pivotRow = 'operatorName', pivotCol = 'hasOld') => { get_sales_regular_data_vs = async (param, pivotRow = 'operatorName') => {
this.sales_regular_data.loading = true; this.sales_regular_data.pivotData[pivotRow].loading = true;
const hasCompare = !isEmpty(param.DateDiff1); const hasCompare = !isEmpty(param.DateDiff1);
const [result1, result2] = await Promise.all([ const [result1, result2] = await Promise.all([
this.get_sales_regular_data(param), this.get_sales_regular_data(param, pivotRow),
hasCompare ? this.get_sales_regular_data({...param, Date1: param.DateDiff1, Date2: param.DateDiff2}) : { filterHasOld: []}, hasCompare ? this.get_sales_regular_data({...param, Date1: param.DateDiff1, Date2: param.DateDiff2}, pivotRow) : { mergeDataBySales: [], mergeDataBySalesAccount: [], filterHasOld: []},
]); ]);
const allTypes = ['老客户', '老客户推荐'];
// 独立的账户
const allSales = Array.from(new Set([...result1.mergeDataBySales.map(row=>row[pivotRow]), ...result2.mergeDataBySales.map(row=>row[pivotRow])]));
const sales1 = groupBy(result1.mergeDataBySales, pivotRow);
const sales2 = groupBy(result2.mergeDataBySales, pivotRow);
const mergeDataBySales = allSales.reduce((r, sale) => {
const _default = { [pivotRow]: sale, rowLabel: sales1?.[sale]?.rowLabel || sales2?.[sale]?.rowLabel, children: sales1?.[sale]?.children || [], key: sale};
const operatorRow = {...(sales1?.[sale]?.[0] || _default), vsData: sales2?.[sale]?.[0] || {}};
// 展开的两项: '老客户', '老客户推荐'
const series1Children = sales1?.[sale]?.[0]?.children || [];
const series2Children = sales2?.[sale]?.[0]?.children || [];
const children = allTypes.reduce((r, type) => {
const _default = { [pivotRow]: type, rowLabel: type, key: type};
const _typeRow = series1Children.find(sc => sc[pivotRow] === type) || _default;
const _typeVSRow = series2Children.find(sc => sc[pivotRow] === type) || {};
return r.concat({..._typeRow, vsData: _typeVSRow});
}, []);
operatorRow.children = children;
return r.concat(operatorRow);
}, []);
// 合并顾问的账户 // 合并顾问的账户
// let mergeDataBySalesAccount = []; let mergeDataBySalesAccount = [];
// if (pivotRow === 'operatorName') { if (pivotRow === 'operatorName') {
// const allSalesMerged = Array.from(new Set([...result1.mergeDataBySalesAccount.map(row=>row.operatorName), ...result2.mergeDataBySalesAccount.map(row=>row.operatorName)])); const allSalesMerged = Array.from(new Set([...result1.mergeDataBySalesAccount.map(row=>row.operatorName), ...result2.mergeDataBySalesAccount.map(row=>row.operatorName)]));
// const salesM1 = groupBy(result1.mergeDataBySalesAccount, 'operatorName'); const salesM1 = groupBy(result1.mergeDataBySalesAccount, 'operatorName');
// const salesM2 = groupBy(result2.mergeDataBySalesAccount, 'operatorName'); const salesM2 = groupBy(result2.mergeDataBySalesAccount, 'operatorName');
// mergeDataBySalesAccount = allSalesMerged.reduce((r, sale) => { mergeDataBySalesAccount = allSalesMerged.reduce((r, sale) => {
// const _default = { operatorName: sale, rowLabel: salesM1?.[sale]?.rowLabel || salesM2?.[sale]?.rowLabel, children: salesM1?.[sale]?.children || [], key: sale}; const _default = { operatorName: sale, rowLabel: salesM1?.[sale]?.rowLabel || salesM2?.[sale]?.rowLabel, children: salesM1?.[sale]?.children || [], key: sale};
// const operatorRow = {...(salesM1?.[sale]?.[0] || _default), vsData: salesM2?.[sale]?.[0] || {}}; const operatorRow = {...(salesM1?.[sale]?.[0] || _default), vsData: salesM2?.[sale]?.[0] || {}};
// // 展开的两项: '老客户', '老客户推荐' // 展开的两项: '老客户', '老客户推荐'
// const series1Children = salesM1?.[sale]?.[0]?.children || []; const series1Children = salesM1?.[sale]?.[0]?.children || [];
// const series2Children = salesM2?.[sale]?.[0]?.children || []; const series2Children = salesM2?.[sale]?.[0]?.children || [];
// const children = allTypes.reduce((r, type) => { const children = allTypes.reduce((r, type) => {
// const _default = { operatorName: type, rowLabel: type, key: type}; const _default = { operatorName: type, rowLabel: type, key: type};
// const _typeRow = series1Children.find(sc => sc.operatorName === type) || _default; const _typeRow = series1Children.find(sc => sc.operatorName === type) || _default;
// const _typeVSRow = series2Children.find(sc => sc.operatorName === type) || {}; const _typeVSRow = series2Children.find(sc => sc.operatorName === type) || {};
// return r.concat({..._typeRow, vsData: _typeVSRow}); return r.concat({..._typeRow, vsData: _typeVSRow});
// }, []); }, []);
// operatorRow.children = children; operatorRow.children = children;
// return r.concat(operatorRow); return r.concat(operatorRow);
// }, []); }, []);
// } }
const filterColValues = uniqWith(
this.sales_regular_data.loading = false; mergeDataBySales.map((rr) => ({ text: rr[pivotRow], value: rr[pivotRow] })),
this.sales_regular_data.rawData = [].concat(result1.filterHasOld, result2.filterHasOld); (a, b) => JSON.stringify(a) === JSON.stringify(b)
this.sales_regular_data.rawDataArr = [result1, result2]; ).sort((a, b) => a.text.localeCompare(b.text, 'zh-CN'));
this.sales_regular_data.pivotData[pivotRow].loading = false;
this.sales_regular_data.pivotData[pivotRow].rawData = [].concat(result1.filterHasOld, result2.filterHasOld);
this.sales_regular_data.pivotData[pivotRow].data = mergeDataBySales;
this.sales_regular_data.pivotData[pivotRow].mergedData = isEmpty(mergeDataBySalesAccount) ? mergeDataBySales : mergeDataBySalesAccount;
this.sales_regular_data.pivotData[pivotRow].filterColValues = filterColValues;
}; };
get_sales_regular_data = async (param) => { get_sales_regular_data = async (param, pivotRow = 'operatorName') => {
const seriesKey = `${param.Date1}${param.Date2}`; const seriesKey = `${param.Date1}${param.Date2}`;
const rawData = await getDetailData({...param, }); const rawData = await getDetailData({...param, });
const filterHasOld = rawData.filter(ele => (ele.IsOld === '1' || ele.isCusCommend === '1')).map(e => ({ const filterHasOld = rawData.filter(ele => (ele.IsOld === '1' || ele.isCusCommend === '1')).map(e => ({
@ -521,69 +546,38 @@ class CustomerStore {
operatorNameB: e.operatorName.replace(/\([^)]*\)/gi, '').toLowerCase(), operatorNameB: e.operatorName.replace(/\([^)]*\)/gi, '').toLowerCase(),
})); }));
const { data: hasOldData, } = pivotBy(filterHasOld, [['hasOld', pivotRow], [], []]);
const { data: IsOldData, } = pivotBy(filterHasOld.filter(ele => ele.IsOld === '1'), [[pivotRow, 'IsOld_txt', ], [], []]);
const { data: isCusCommendData, } = pivotBy(filterHasOld.filter(ele => ele.isCusCommend === '1'), [[pivotRow, 'isCusCommend_txt', ], [], []]);
// console.log('IsOldData====', IsOldData, '\nisCusCommend', isCusCommendData);
// console.log('data====', rawData, '\ncolumnValues', columnValues, '\nsummaryRows', summaryRows, '\nsummaryColumns', summaryColumns, '\nsummaryMix', summaryMix, '\nhasOld',filterHasOld);
const mergeDataBySales = hasOldData.map((ele) => ({
...ele,
seriesKey,
children: [].concat(
IsOldData.filter((ele1) => ele1[pivotRow] === ele[pivotRow]).map(o => ({...o, [pivotRow]: o.IsOld_txt, key: o.rowLabel, seriesKey,})),
isCusCommendData.filter((ele2) => ele2[pivotRow] === ele[pivotRow]).map(o => ({...o, [pivotRow]: o.isCusCommend_txt, key: o.rowLabel, seriesKey,}))
),
}));
// 合并顾问的账户 // 合并顾问的账户
// let mergeDataBySalesAccount = []; let mergeDataBySalesAccount = [];
// if (pivotRow === 'operatorName') { if (pivotRow === 'operatorName') {
// const { data: hasOldDataSales, } = pivotBy(filterHasOld, [['hasOld', 'operatorNameB'], [], []]); const { data: hasOldDataSales, } = pivotBy(filterHasOld, [['hasOld', 'operatorNameB'], [], []]);
// const { data: IsOldDataSales, } = pivotBy(filterHasOld.filter(ele => ele.IsOld === '1'), [['operatorNameB', 'IsOld_txt', ], [], []]); const { data: IsOldDataSales, } = pivotBy(filterHasOld.filter(ele => ele.IsOld === '1'), [['operatorNameB', 'IsOld_txt', ], [], []]);
// const { data: isCusCommendDataSales, } = pivotBy(filterHasOld.filter(ele => ele.isCusCommend === '1'), [['operatorNameB', 'isCusCommend_txt', ], [], []]); const { data: isCusCommendDataSales, } = pivotBy(filterHasOld.filter(ele => ele.isCusCommend === '1'), [['operatorNameB', 'isCusCommend_txt', ], [], []]);
// mergeDataBySalesAccount = hasOldDataSales.map((ele) => ({ mergeDataBySalesAccount = hasOldDataSales.map((ele) => ({
// ...ele, ...ele,
// operatorName: ele.operatorNameB, operatorName: ele.operatorNameB,
// seriesKey, seriesKey,
// children: [].concat( children: [].concat(
// IsOldDataSales.filter((ele1) => ele1.operatorNameB === ele.operatorNameB).map(o => ({...o, operatorName: o.IsOld_txt, key: o.rowLabel, seriesKey,})), IsOldDataSales.filter((ele1) => ele1.operatorNameB === ele.operatorNameB).map(o => ({...o, operatorName: o.IsOld_txt, key: o.rowLabel, seriesKey,})),
// isCusCommendDataSales.filter((ele2) => ele2.operatorNameB === ele.operatorNameB).map(o => ({...o, operatorName: o.isCusCommend_txt, key: o.rowLabel, seriesKey,})) isCusCommendDataSales.filter((ele2) => ele2.operatorNameB === ele.operatorNameB).map(o => ({...o, operatorName: o.isCusCommend_txt, key: o.rowLabel, seriesKey,}))
// ), ),
// })); }));
// } }
// console.log('IsOldDataSales====', IsOldDataSales, '\nisCusCommendDataSales', isCusCommendDataSales); // console.log('IsOldDataSales====', IsOldDataSales, '\nisCusCommendDataSales', isCusCommendDataSales);
// console.log('mergeDataByRow====\n', mergeDataByRow); return { mergeDataBySales, mergeDataBySalesAccount, filterHasOld };
// return { mergeDataBySales, mergeDataBySalesAccount, filterHasOld };
return { filterHasOld };
};
regular_data_pivot = (pivotRow, pivotCol) => {
// 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 ---- ', 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);
const [pivot1, pivot2] = [result1, result2].map(_result => {
const dataColField = pivotCol.replace('_txt', '');
const rawData = pivotCol === 'hasOld' ? _result.filterHasOld : _result.filterHasOld.filter((ele) => ele[dataColField] === '1');
const { data: pivotResult } = pivotBy(rawData, [[pivotRow, pivotCol], [], []]);
return pivotResult;
});
const rows1 = groupBy(pivot1, pivotRow);
const rows2 = groupBy(pivot2, pivotRow);
const pivotResultWithCompare = isEmpty(pivot2) ? pivot1 : allRows.reduce((r, rowName) => {
const _default = { [pivotRow]: rowName, rowLabel: rows1?.[rowName]?.rowLabel || rows2?.[rowName]?.rowLabel, children: rows1?.[rowName], key: rowName};
const operatorRow = {...(rows1?.[rowName]?.[0] || _default), vsData: rows2?.[rowName]?.[0] || {}};
// 展开的两项: '老客户', '老客户推荐'
// const series1Children = rows1?.[rowName]?.[0]?.children || [];
// const series2Children = rows2?.[rowName]?.[0]?.children || [];
// const children = allTypes.reduce((r, type) => {
// const _default = { [pivotRow]: type, rowLabel: type, key: type};
// const _typeRow = series1Children.find(sc => sc[pivotRow] === type) || _default;
// const _typeVSRow = series2Children.find(sc => sc[pivotRow] === type) || {};
// return r.concat({..._typeRow, vsData: _typeVSRow});
// }, []);
// operatorRow.children = children;
return r.concat(operatorRow);
}, []);
// console.log(' ------ pivot1', pivot1, '\npivot2', pivot2, '\npivotResultWithCompare', pivotResultWithCompare);
const filterColValues = uniqWith(
allRows.map((rr) => ({ text: rr, value: rr })),
(a, b) => JSON.stringify(a) === JSON.stringify(b)
).sort((a, b) => a.text.localeCompare(b.text, 'zh-CN'));
this.sales_regular_data.pivotResult = pivotResultWithCompare;
this.sales_regular_data.filterColValues = filterColValues;
}; };
setSearchValues(obj, values, target) { setSearchValues(obj, values, target) {

@ -157,11 +157,9 @@ class HotelCruise {
{} {}
); );
summaryDelta.RecommendRateDelta = queryParam.Compare === '0' ? undefined : fixTo2Decimals((summaryRow.RecommendRate - (summaryRow.CPRecommendRate || 0)) * 100); summaryDelta.RecommendRateDelta = queryParam.Compare === '0' ? undefined : fixTo2Decimals((summaryRow.RecommendRate - (summaryRow.CPRecommendRate || 0)) * 100);
const resfilter = resCP.map(row => ({text: row.CityName, value: row.CityName})); // .sort((a, b) => a.text.localeCompare(b.text));
runInAction(() => { runInAction(() => {
this.hotel.loading = false; this.hotel.loading = false;
this.hotel.dataSource = resCP; this.hotel.dataSource = resCP;
this.hotel.filters = resfilter;
this.hotel.summaryRow = { ...summaryRow, ...summaryDelta }; this.hotel.summaryRow = { ...summaryRow, ...summaryDelta };
}); });
} }
@ -183,8 +181,8 @@ class HotelCruise {
this.searchValuesToSub = obj; this.searchValuesToSub = obj;
} }
cruise = { loading: false, dataSource: [], summaryRow: {}, filters: [] }; cruise = { loading: false, dataSource: [], summaryRow: {} };
hotel = { loading: false, dataSource: [], summaryRow: {}, filters: [] }; hotel = { loading: false, dataSource: [], summaryRow: {} };
resetData = () => { resetData = () => {
this.results.loading = false; this.results.loading = false;
for (const key of Object.keys(this.results)) { for (const key of Object.keys(this.results)) {

@ -155,7 +155,7 @@ class SalesCRMData {
// IncludeTickets: { key: '1', label: '含门票'}, // IncludeTickets: { key: '1', label: '含门票'},
DepartmentList: [groupsMappedByCode.GH], DepartmentList: [groupsMappedByCode.GH],
operator: '-1', operator: '-1',
IncludeTickets: { key: '0', value: '0', label: '不含门票' }, IncludeTickets: '0',
opisn: '-1', opisn: '-1',
date90: { date90: {
Date1: moment().subtract(90, 'days').format(DATE_FORMAT), Date1: moment().subtract(90, 'days').format(DATE_FORMAT),

@ -99,7 +99,7 @@ const pageSetting = {
{ key: 'SingleML', title: '单团毛利', dataIndex: 'SingleML', width: '5em' }, { key: 'SingleML', title: '单团毛利', dataIndex: 'SingleML', width: '5em' },
{ key: 'OrderValue', title: '单个订单价值', dataIndex: 'OrderValue', width: '5em' }, { key: 'OrderValue', title: '单个订单价值', dataIndex: 'OrderValue', width: '5em' },
{ key: 'PPPriceRange', title: '人均天(外币)', dataIndex: 'PPPriceRange', width: '5em' }, { key: 'PPPriceRange', title: '人均天(外币)', dataIndex: 'PPPriceRange', width: '5em' },
{ key: 'AvgPPPrice', title: '人均天/单(外币)-平均', dataIndex: 'AvgPPPrice', width: '5em' }, { key: 'AvgPPPrice', title: '人均天/单(外币)', dataIndex: 'AvgPPPrice', width: '5em' },
// { key: 'unitPPPrice', title: '()', dataIndex: 'unitPPPrice', width: '5em' }, // { key: 'unitPPPrice', title: '()', dataIndex: 'unitPPPrice', width: '5em' },
// { key: 'unitPPPriceRange', title: '()', dataIndex: 'unitPPPriceRange', width: '5em' }, // { key: 'unitPPPriceRange', title: '()', dataIndex: 'unitPPPriceRange', width: '5em' },
{ key: 'confirmDays', title: '成团周期(天)', dataIndex: 'confirmDays', width: '5em' }, { key: 'confirmDays', title: '成团周期(天)', dataIndex: 'confirmDays', width: '5em' },

@ -9,7 +9,7 @@ const { Text } = Typography;
export default observer((props) => { export default observer((props) => {
const { date_picker_store: searchFormStore } = useContext(stores_Context); const { date_picker_store: searchFormStore } = useContext(stores_Context);
const { date_picker_store, HotelCruiseStore } = useContext(stores_Context); const { date_picker_store, HotelCruiseStore } = useContext(stores_Context);
const { loading, dataSource, summaryRow, filters } = HotelCruiseStore.hotel; const { loading, dataSource, summaryRow } = HotelCruiseStore.hotel;
const { formValues, siderBroken } = searchFormStore; const { formValues, siderBroken } = searchFormStore;
@ -25,9 +25,6 @@ export default observer((props) => {
title: '目的地', title: '目的地',
sorter: (a, b) => a.CityName.localeCompare(b.CityName, 'zh-CN'), sorter: (a, b) => a.CityName.localeCompare(b.CityName, 'zh-CN'),
children: [{ title: summaryRow.CityName, dataIndex: 'CityName', key: 'CityName' }], children: [{ title: summaryRow.CityName, dataIndex: 'CityName', key: 'CityName' }],
filters: filters,
onFilter: (value, record) => record.CityName === value,
filterSearch: true,
}, },
{ {
title: '总间夜', title: '总间夜',

@ -171,12 +171,6 @@ const Orders_sub = () => {
return result; return result;
}; };
//
const addLineBreaksAtCommas = (text) => {
if (!text) return '';
return text.replace(/&amp;/g, "&").replace(//g, '\n').replace(/,/g, ',\n').replace(//g, '\n').replace(/;/g, ';\n');
};
const table_data = format_data_detail(orders_store.orderCountData_Form_sub.ordercount1); const table_data = format_data_detail(orders_store.orderCountData_Form_sub.ordercount1);
const table_data2 = format_data_detail(orders_store.orderCountData_Form_sub.ordercount2); const table_data2 = format_data_detail(orders_store.orderCountData_Form_sub.ordercount2);
const table_data_p = format_data(orders_store.orderCountData_Form_sub.ordercount1); const table_data_p = format_data(orders_store.orderCountData_Form_sub.ordercount1);
@ -198,7 +192,7 @@ const Orders_sub = () => {
rowKey={record => record.key} rowKey={record => record.key}
expandable={{ expandable={{
expandedRowRender: record => ( expandedRowRender: record => (
<pre style={{ whiteSpace: 'pre-wrap', wordWrap: 'break-word', fontSize: '16px' }}> <pre>
<Divider orientation="left" plain> <Divider orientation="left" plain>
客户需求 客户需求
</Divider> </Divider>
@ -206,7 +200,7 @@ const Orders_sub = () => {
<Divider orientation="left" plain> <Divider orientation="left" plain>
订单内容 订单内容
</Divider> </Divider>
{addLineBreaksAtCommas(record.COLI_OrderDetailText)} {record.COLI_OrderDetailText}
</pre> </pre>
), ),
}} }}
@ -230,7 +224,7 @@ const Orders_sub = () => {
size="small" size="small"
rowKey={record => record.key} rowKey={record => record.key}
expandable={{ expandable={{
expandedRowRender: record => <pre style={{ whiteSpace: 'pre-wrap', wordWrap: 'break-word', fontSize: '16px' }}>{record.COLI_OrderDetailText}</pre>, expandedRowRender: record => <pre>{record.COLI_OrderDetailText}</pre>,
}} }}
/> />
</Col> </Col>

@ -3,8 +3,8 @@ import { observer } from 'mobx-react';
import { stores_Context } from '../config'; import { stores_Context } from '../config';
import { Table, Row, Col, Divider, Switch, Space, Tabs } from 'antd'; import { Table, Row, Col, Divider, Switch, Space, Tabs } from 'antd';
import SearchForm from '../components/search/SearchForm'; import SearchForm from '../components/search/SearchForm';
import { TableExportBtn, VSTag } from '../components/Data'; import { TableExportBtn, VSTag } from './../components/Data';
import { fixTo2Decimals, isEmpty } from '../utils/commons'; import { fixTo2Decimals, isEmpty } from './../utils/commons';
// TdCellDataTable // TdCellDataTable
const TdCell = (tdprops) => { const TdCell = (tdprops) => {
@ -13,27 +13,16 @@ const TdCell = (tdprops) => {
return <td {...restProps} />; return <td {...restProps} />;
}; };
const pivotOptions = [ const SalesCustomerCareRegular = (props) => {
{ key: 'operatorName', label: '顾问' },
{ key: 'country', label: '国籍' },
];
const pivotColOptions = [
{ key: 'hasOld', value: 'hasOld', label: '老客户+推荐' },
{ key: 'IsOld_txt', value: 'IsOld_txt', label: '老客户' },
{ key: 'isCusCommend_txt', value: 'isCusCommend_txt', label: '推荐' },
];
const CustomerCareRegularPivot = (props) => {
const { date_picker_store: searchFormStore, customer_store } = useContext(stores_Context); const { date_picker_store: searchFormStore, customer_store } = useContext(stores_Context);
const { formValues, formValuesToSub, siderBroken } = searchFormStore; const { formValues, formValuesToSub, siderBroken } = searchFormStore;
const { loading, pivotResult, filterColValues, rawData } = customer_store.sales_regular_data; const { pivotData: pageData } = customer_store.sales_regular_data;
const pivotOptions = [{key: 'operatorName', label: '顾问'}, {key: 'country', label: '国家'}];
const [pivotRow, setPivotRow] = useState('operatorName'); const [pivotRow, setPivotRow] = useState('operatorName');
const [pivotCol, setPivotCol] = useState('hasOld');
const [pivotColLabel, setPivotColLabel] = useState('老客户+推荐');
const onTabsChange = (key) => { const onTabsChange = (key) => {
setPivotRow(key); setPivotRow(key);
customer_store.regular_data_pivot(key, pivotCol);
}; };
const [dataSource, setDataSource] = useState([]); const [dataSource, setDataSource] = useState([]);
@ -43,40 +32,38 @@ const CustomerCareRegularPivot = (props) => {
useEffect(() => { useEffect(() => {
if ( ! ifmerge) { if ( ! ifmerge) {
// setDataSource(pageData[pivotRow].data); setDataSource(pageData[pivotRow].data);
setDataSource(pivotResult); setDataForExport(
// setDataForExport( pageData[pivotRow].data.reduce(
// // pageData[pivotRow].data.reduce( (r, c) =>
// pivotResult.reduce( r.concat(
// (r, c) => [{ ...c, children: undefined }],
// r.concat( c.children
// [{ ...c, children: undefined }], .reduce((rc, ele) => rc.concat([{ ...ele, [pivotRow]: ele.rowLabel }], [{ ...ele.vsData, [pivotRow]: ele.vsData.rowLabel, vsData: {} }]), [])
// (c?.children || []) .filter((ele) => ele.SumOrder !== undefined)
// .reduce((rc, ele) => rc.concat([{ ...ele, [pivotRow]: ele.rowLabel }], [{ ...ele.vsData, [pivotRow]: ele.vsData.rowLabel, vsData: {} }]), []) ),
// .filter((ele) => ele.SumOrder !== undefined) []
// ), )
// [] );
// ) setDataForExportS(pageData[pivotRow].data.reduce((r, c) => r.concat([{...c, children: undefined}], [{ ...c.vsData, vsData: {} }]), []).filter((ele) => ele.SumOrder !== undefined));
// );
setDataForExportS(pivotResult.reduce((r, c) => r.concat([{...c, children: undefined}], [{ ...c.vsData, vsData: {} }]), []).filter((ele) => ele.SumOrder !== undefined));
} else { } else {
// setDataSource(pageData[pivotRow].mergedData); setDataSource(pageData[pivotRow].mergedData);
// setDataForExport( setDataForExport(
// pageData[pivotRow].mergedData.reduce( pageData[pivotRow].mergedData.reduce(
// (r, c) => (r, c) =>
// r.concat( r.concat(
// [{ ...c, children: undefined }], [{ ...c, children: undefined }],
// c.children.reduce((rc, ele) => rc.concat([{ ...ele, operatorName: ele.rowLabel }], [{ ...ele.vsData, operatorName: ele.vsData.rowLabel, vsData: {} }]), []) c.children.reduce((rc, ele) => rc.concat([{ ...ele, operatorName: ele.rowLabel }], [{ ...ele.vsData, operatorName: ele.vsData.rowLabel, vsData: {} }]), [])
// .filter((ele) => ele.SumOrder !== undefined) .filter((ele) => ele.SumOrder !== undefined)
// ), ),
// [] []
// ) )
// ); );
// setDataForExportS(pageData[pivotRow].mergedData.reduce((r, c) => r.concat([{...c, children: undefined}], [{ ...c.vsData, vsData: {} }]), []).filter((ele) => ele.SumOrder !== undefined)); setDataForExportS(pageData[pivotRow].mergedData.reduce((r, c) => r.concat([{...c, children: undefined}], [{ ...c.vsData, vsData: {} }]), []).filter((ele) => ele.SumOrder !== undefined));
} }
return () => {}; return () => {};
}, [ifmerge, pivotResult]); }, [ifmerge, pageData[pivotRow].data]);
const rowColumns = [ const rowColumns = [
@ -97,14 +84,14 @@ const CustomerCareRegularPivot = (props) => {
{ title: '来源', dataIndex: 'SourceType', key: 'SourceType' }, { title: '来源', dataIndex: 'SourceType', key: 'SourceType' },
{ title: '页面类型', dataIndex: 'COLI_LineClass', key: 'COLI_LineClass' }, { title: '页面类型', dataIndex: 'COLI_LineClass', key: 'COLI_LineClass' },
]; ];
const calcDelta = (r, key) => !isEmpty(Number(r?.vsData?.[key])) ? fixTo2Decimals((Number(r[key] || 0) - Number(r.vsData[key]))/Number(r.vsData[key]) *100) : null; const calcDelta = (r, key) => !isEmpty(Number(r.vsData[key])) ? fixTo2Decimals((Number(r[key] || 0) - Number(r.vsData[key]))/Number(r.vsData[key]) *100) : null;
const renderVS = (v, r, key) => { const renderVS = (v, r, key) => {
const delta = calcDelta(r, key); const delta = calcDelta(r, key);
return <> return <>
<Space direction={'vertical'}> <Space direction={'vertical'}>
<span> <span>
{v || 0} {v || 0}
{r?.vsData?.[key] ? <span type="secondary"> VS {r.vsData[key]}</span> : null} {r.vsData[key] ? <span type="secondary"> VS {r.vsData[key]}</span> : null}
</span> </span>
{delta && <VSTag diffPercent={delta} />} {delta && <VSTag diffPercent={delta} />}
</Space> </Space>
@ -118,7 +105,7 @@ const CustomerCareRegularPivot = (props) => {
{ key: 'SumML', title: '预计毛利', dataIndex: 'SumML', width: '5em', render: (v, r) => renderVS(v, r, 'SumML') }, // SumML_txt { key: 'SumML', title: '预计毛利', dataIndex: 'SumML', width: '5em', render: (v, r) => renderVS(v, r, 'SumML') }, // SumML_txt
{ key: 'ConfirmRates', title: '成交率', dataIndex: 'ConfirmRates_txt', width: '5em', render: (v, r) => renderVS(v, r, 'ConfirmRates') }, { key: 'ConfirmRates', title: '成交率', dataIndex: 'ConfirmRates_txt', width: '5em', render: (v, r) => renderVS(v, r, 'ConfirmRates') },
{ key: 'SingleML', title: '单团毛利', dataIndex: 'SingleML', width: '5em', render: (v, r) => renderVS(v, r, 'SingleML') }, { key: 'SingleML', title: '单团毛利', dataIndex: 'SingleML', width: '5em', render: (v, r) => renderVS(v, r, 'SingleML') },
].map(c => ({...c, sorter: (a, b) => (a[c.key] - b[c.key])})); ];
return ( return (
<> <>
<Row gutter={16} className={siderBroken ? '' : 'sticky-top'}> <Row gutter={16} className={siderBroken ? '' : 'sticky-top'}>
@ -136,15 +123,14 @@ const CustomerCareRegularPivot = (props) => {
dates: { hide_vs: false }, dates: { hide_vs: false },
}, },
}} }}
onSubmit={async (_err, obj, form, str) => { onSubmit={(_err, obj, form, str) => {
customer_store.setSearchValues(obj, form, 'sales_regular_data'); customer_store.setSearchValues(obj, form, 'sales_regular_data');
await customer_store.get_sales_regular_data_vs(obj, pivotRow); customer_store.get_sales_regular_data_vs(obj, pivotRow);
customer_store.regular_data_pivot(pivotRow, pivotCol);
}} }}
/> />
</Col> </Col>
</Row> </Row>
<Tabs tabBarExtraContent={{ left: (<div style={{ width: '6rem'}}></div>)}} <Tabs
type={'card'} type={'card'}
activeKey={pivotRow} activeKey={pivotRow}
onChange={onTabsChange} onChange={onTabsChange}
@ -156,7 +142,7 @@ const CustomerCareRegularPivot = (props) => {
{/* <h2>{ele.label}-老客户, 含推荐</h2> */} {/* <h2>{ele.label}-老客户, 含推荐</h2> */}
<> <>
<Divider orientation={'right'} style={{backgroundColor: '#fff', margin: 0, padding: '10px 0'}} > <Divider orientation={'right'} style={{backgroundColor: '#fff', margin: 0, padding: '10px 0'}} >
{/* {dataSource.length > 0 && pivotRow === 'operatorName' && ( {pageData[pivotRow].data.length > 0 && pivotRow === 'operatorName' && (
<Switch <Switch
unCheckedChildren="各账户" unCheckedChildren="各账户"
checkedChildren="合并" checkedChildren="合并"
@ -167,58 +153,43 @@ const CustomerCareRegularPivot = (props) => {
}} }}
/> />
)} )}
<Divider type={'vertical'} /> */} <Divider type={'vertical'} />
<TableExportBtn <TableExportBtn
btnTxt="导出明细" btnTxt="导出明细"
label={`${formValuesToSub.Date1}-老客户-明细`} label={`${formValuesToSub.Date1}-老客户-明细`}
{...{ columns: [{ title: ele.label, dataIndex: pivotRow, key: pivotRow }, ...rowColumns], dataSource: rawData }} {...{ columns: [{ title: ele.label, dataIndex: pivotRow, key: pivotRow }, ...rowColumns], dataSource: pageData[pivotRow].rawData }}
/> />
{/* <Divider type={'vertical'} /> <Divider type={'vertical'} />
<TableExportBtn <TableExportBtn
btnTxt="导出下表-展开" btnTxt="导出下表-展开"
label={`${formValuesToSub.Date1}-${ele.label}.老客户`} label={`${formValuesToSub.Date1}-${ele.label}.老客户`}
{...{ columns: [{ title: ele.label, dataIndex: pivotRow, key: pivotRow }, ...columns], dataSource: dataForExport }} {...{ columns: [{ title: ele.label, dataIndex: pivotRow, key: pivotRow }, ...columns], dataSource: dataForExport }}
/> */} />
<Divider type={'vertical'} /> <Divider type={'vertical'} />
<TableExportBtn <TableExportBtn
btnTxt="导出下表" btnTxt="导出下表-总"
label={`${formValuesToSub.Date1}-${ele.label}.${pivotColLabel}`} label={`${formValuesToSub.Date1}-${ele.label}.老客户`}
{...{ columns: [{ title: ele.label, dataIndex: pivotRow, key: pivotRow }, ...columns], dataSource: dataForExportS }} {...{ columns: [{ title: ele.label, dataIndex: pivotRow, key: pivotRow }, ...columns], dataSource: dataForExportS }}
/> />
</Divider> </Divider>
</> </>
<Tabs style={{ backgroundColor: '#fff' }} <Table
tabPosition={'left'} defaultActiveKey={'mix'} activeKey={pivotCol} sticky
onChange={(sub) => { dataSource={dataSource}
setPivotCol(sub); loading={pageData[ele.key].loading}
setPivotColLabel(pivotColOptions.find((ele) => ele.key === sub).label); columns={[
customer_store.regular_data_pivot(pivotRow, sub); {
}} key: ele.key,
items={pivotColOptions.map((col, i) => { title: ele.label,
// const SubjectTableComponent = subjectComponents[ele.key]; dataIndex: ele.key,
return { width: '6em',
...col, filters: pageData[ele.key].filterColValues,
children: ( onFilter: (value, record) => value.includes(record[ele.key]),
<Table filterSearch: true,
sticky },
dataSource={dataSource} ...columns,
loading={loading} ]}
columns={[ pagination={false}
{
key: ele.key,
title: ele.label,
dataIndex: ele.key,
width: '6em',
filters: filterColValues,
onFilter: (value, record) => value.includes(record[ele.key]),
filterSearch: true,
},
...columns,
]}
pagination={false}
/>)
};
})}
/> />
</> </>
), ),
@ -228,4 +199,4 @@ const CustomerCareRegularPivot = (props) => {
</> </>
); );
}; };
export default observer(CustomerCareRegularPivot); export default observer(SalesCustomerCareRegular);

@ -199,7 +199,7 @@ export default observer((props) => {
filterSearch: true, filterSearch: true,
filters: operatorObjects.sort((a, b) => a.text.localeCompare(b.text)), filters: operatorObjects.sort((a, b) => a.text.localeCompare(b.text)),
onFilter: (value, record) => record.groupsKey === value || record.groupType === 'overview', onFilter: (value, record) => record.groupsKey === value || record.groupType === 'overview',
render: (text, record) => (record.groupType !== 'operator' ? text : <Link to={`/sales-crm/risk/sales/${record.groupsKey}`}>{text}</Link>), render: (text, record) => (record.groupType !== 'operator' ? text : <Link to={`/op_risk/sales/${record.groupsKey}`}>{text}</Link>),
}, },
{ {
title: () => (<>前90 -30<br/>{searchValues.date90.Date1} {searchValues.date90.Date2}</>), title: () => (<>前90 -30<br/>{searchValues.date90.Date1} {searchValues.date90.Date2}</>),

@ -232,12 +232,11 @@ export default observer((props) => {
...formValues, ...formValues,
...SalesCRMDataStore.searchValues, ...SalesCRMDataStore.searchValues,
}, },
shows: ['DepartmentList', 'WebCode', 'DateType', 'dates', 'IncludeTickets', 'country'], shows: ['DepartmentList', 'WebCode', 'DateType', 'dates', 'IncludeTickets'],
fieldProps: { fieldProps: {
DepartmentList: { show_all: false, mode: 'multiple', col: 5 }, DepartmentList: { show_all: false, mode: 'multiple', col: 5 },
WebCode: { show_all: false, mode: 'multiple', col: 5 }, WebCode: { show_all: false, mode: 'multiple', col: 5 },
dates: { hide_vs: true }, dates: { hide_vs: true },
country: { show_all: false, mode: 'multiple', col: 5 },
}, },
}} }}
onSubmit={(_err, obj, form, str) => { onSubmit={(_err, obj, form, str) => {

Loading…
Cancel
Save