增加成员关系. 顾问KPI允许选择不分配订单的; 业绩和KPI总额: 匹配前端配置的事业部

feature/2.0-sales-trade
Lei OT 2 years ago
parent fd3148cf5d
commit 36ce786c6c

@ -7,7 +7,7 @@ const yearInitial = {};
const searchFormItemSet = { const searchFormItemSet = {
'bu': { shows: ['DateType', 'years', 'HTBusinessUnits'], sort }, 'bu': { shows: ['DateType', 'years', 'HTBusinessUnits'], sort },
'dept': { shows: ['DateType', 'years', 'DepartmentList'], sort, fieldProps: { DepartmentList: { allowClear: true,isLeaf: true, show_all: false } }, }, 'dept': { shows: ['DateType', 'years', 'DepartmentList'], sort, fieldProps: { DepartmentList: { allowClear: true,isLeaf: true, show_all: false } }, },
'operator': { shows: ['DateType', 'years', 'DepartmentList', 'operator'], fieldProps: { DepartmentList: { allowClear: true, isLeaf: true }, operator: { param: { is_assign: 1 } } }, sort }, 'operator': { shows: ['DateType', 'years', 'DepartmentList', 'operator'], fieldProps: { DepartmentList: { allowClear: true, isLeaf: true }, operator: { param: { } } }, sort }, // is_assign: 1
'destination': { shows: ['DateType', 'years', 'destination'], sort }, 'destination': { shows: ['DateType', 'years', 'destination'], sort },
'country': { shows: ['DateType', 'years', 'country'], sort }, 'country': { shows: ['DateType', 'years', 'country'], sort },
}; };

@ -56,6 +56,7 @@ export const groups = [
]; ];
export const groupsMappedByCode = groups.reduce((a, c) => ({ ...a, [String(c.code || c.key)]: c }), {}); export const groupsMappedByCode = groups.reduce((a, c) => ({ ...a, [String(c.code || c.key)]: c }), {});
export const leafGroup = groups.slice(3); export const leafGroup = groups.slice(3);
export const overviewGroup = groups.slice(0, 3); // todo: 花梨鹰 APP Trippest
/** /**
* 来源 * 来源
*/ */
@ -116,7 +117,11 @@ export const dataFieldAlias = dataFieldOptions.reduce(
* KPI对象 * KPI对象
*/ */
export const KPIObjects = [ export const KPIObjects = [
{ key: 'overview', value: 'overview', label: '海纳', data: [{ key: '-1', value: '-1', label: '海纳' }] }, { key: 'overview', value: 'overview', label: '海纳', data: [
{ key: 'ALL', value: 'ALL', label: '海纳' },
...overviewGroup
]
},
{ {
key: 'bizarea', key: 'bizarea',
value: 'bizarea', value: 'bizarea',
@ -132,12 +137,17 @@ export const KPIObjects = [
{ key: 'operator', value: 'operator', label: '顾问' }, { key: 'operator', value: 'operator', label: '顾问' },
{ key: 'destination', value: 'destination', label: '目的地' }, { key: 'destination', value: 'destination', label: '目的地' },
{ key: 'country', value: 'country', label: '国籍' }, { key: 'country', value: 'country', label: '国籍' },
{ key: 'guestgrouptype', value: 'guestgrouptype', label: '成员关系', data: [ // todo: {
{ key: 'family', value: 'family', label: '家庭' }, key: 'guestgrouptype',
{ key: 'solo', value: 'solo', label: 'Solo' }, value: 'guestgrouptype',
{ key: 'group', value: 'group', label: '组织' }, label: '成员关系',
{ key: 'other', value: 'other', label: '其他' }, data: [
] { key: '146001', value: '146001', label: '夫妻' },
{ key: '146002', value: '146002', label: '家庭' },
{ key: '146003', value: '146003', label: 'Solo' },
{ key: '146004', value: '146004', label: '组织' },
{ key: '146005', value: '146005', label: '其他' },
],
}, },
]; ];
export const KPISubjects = [ export const KPISubjects = [

@ -10,6 +10,7 @@ const modelMapper = {
'PersonNum': { url: '/service-Analyse2/GetTradeApartByPersonNum' }, 'PersonNum': { url: '/service-Analyse2/GetTradeApartByPersonNum' },
'destination': { url: '/service-Analyse2/GetTradeApartByDestination' }, 'destination': { url: '/service-Analyse2/GetTradeApartByDestination' },
'GlobalDestination': { url: '/service-Analyse2/GetTradeApartByGlobalDestination' }, 'GlobalDestination': { url: '/service-Analyse2/GetTradeApartByGlobalDestination' },
'destinationCountry': { url: '/service-Analyse2/GetTradeApartByDestinationCountry' },
}; };
class Distribution { class Distribution {
constructor(appStore){ constructor(appStore){
@ -21,6 +22,7 @@ class Distribution {
* 各个类型的分布 * 各个类型的分布
*/ */
getApartData = async (param) => { getApartData = async (param) => {
this.pageLoading = true;
const mkey = this.curTab; const mkey = this.curTab;
this[mkey] = { loading: true, dataSource: [] }; this[mkey] = { loading: true, dataSource: [] };
const json = await req.fetchJSON(modelMapper[mkey].url, param); const json = await req.fetchJSON(modelMapper[mkey].url, param);
@ -30,6 +32,7 @@ class Distribution {
this[mkey].loading = false; this[mkey].loading = false;
this[mkey].originData = json.result; this[mkey].originData = json.result;
this[mkey].dataSource = dataLength > 20 ? json.result.slice(0, 30) : json.result; this[mkey].dataSource = dataLength > 20 ? json.result.slice(0, 30) : json.result;
this.pageLoading = false;
}); });
} }
return this[mkey]; return this[mkey];
@ -63,6 +66,7 @@ class Distribution {
this.PersonNum = { loading: false, dataSource: [] }; this.PersonNum = { loading: false, dataSource: [] };
this.destination = { loading: false, dataSource: [] }; this.destination = { loading: false, dataSource: [] };
this.GlobalDestination = { loading: false, dataSource: [] }; this.GlobalDestination = { loading: false, dataSource: [] };
this.destinationCountry = { loading: false, dataSource: [] };
}; };
curTab = 'tourDays'; curTab = 'tourDays';
@ -82,5 +86,6 @@ class Distribution {
PersonNum = { loading: false, dataSource: [] }; PersonNum = { loading: false, dataSource: [] };
destination = { loading: false, dataSource: [] }; destination = { loading: false, dataSource: [] };
GlobalDestination = { loading: false, dataSource: [] }; GlobalDestination = { loading: false, dataSource: [] };
destinationCountry = { loading: false, dataSource: [] };
} }
export default Distribution; export default Distribution;

@ -14,7 +14,7 @@ class Trade {
*/ */
fetchSummaryData(queryData) { fetchSummaryData(queryData) {
this.summaryData.loading = true; this.summaryData.loading = true;
queryData.groupType = 'overview'; queryData.groupType = queryData?.groupType || 'overview';
queryData.groupDateType = 'year'; queryData.groupDateType = 'year';
this.fetchTradeData(queryData).then((json) => { this.fetchTradeData(queryData).then((json) => {
if (json.errcode === 0) { if (json.errcode === 0) {
@ -57,7 +57,8 @@ class Trade {
fetchTradeDataByDate(queryData) { fetchTradeDataByDate(queryData) {
this.timeData.loading = true; this.timeData.loading = true;
queryData = queryData || this.searchPayloadHome; queryData = queryData || this.searchPayloadHome;
Object.assign(queryData, { groupType: 'overview', groupDateType: this.timeLineKey }); queryData.groupType = queryData?.groupType || 'overview';
Object.assign(queryData, { groupDateType: this.timeLineKey });
this.fetchTradeData(queryData).then((json) => { this.fetchTradeData(queryData).then((json) => {
if (json.errcode === 0) { if (json.errcode === 0) {
runInAction(() => { runInAction(() => {
@ -162,7 +163,7 @@ class Trade {
/** /**
* 从结果中取出目标客户的数据 * 从结果中取出目标客户的数据
*/ */
setTargetsRes = () => {}; getTargetsRes = () => {};
setStateSearch(body) { setStateSearch(body) {
this.searchPayloadHome = body; this.searchPayloadHome = body;

@ -17,6 +17,7 @@ const apartOptions = [
{ key: 'PersonNum', value: 'PersonNum', label: '人等' }, { key: 'PersonNum', value: 'PersonNum', label: '人等' },
{ key: 'destination', value: 'destination', label: '国内目的地' }, { key: 'destination', value: 'destination', label: '国内目的地' },
{ key: 'GlobalDestination', value: 'GlobalDestination', label: '海外目的地' }, { key: 'GlobalDestination', value: 'GlobalDestination', label: '海外目的地' },
{ key: 'destinationCountry', value: 'GlobalDestination', label: '目的地国籍' },
]; ];
export default observer(() => { export default observer(() => {

@ -41,6 +41,8 @@ export default observer(() => {
}, []); }, []);
const pageRefresh = (queryData) => { const pageRefresh = (queryData) => {
const overviewFlag = queryData.DepartmentList.toLowerCase() === 'all' || queryData.DepartmentList.toLowerCase().includes(',');
queryData.groupType = overviewFlag ? 'overview' : 'dept';
TradeStore.fetchSummaryData(queryData); TradeStore.fetchSummaryData(queryData);
TradeStore.fetchTradeDataByDate(queryData); TradeStore.fetchTradeDataByDate(queryData);
TradeStore.fetchTradeDataByBU(queryData); TradeStore.fetchTradeDataByBU(queryData);

@ -61,7 +61,7 @@ export default observer((props) => {
if (curObject === 'operator') { if (curObject === 'operator') {
KPIStore.setListLoading(true); KPIStore.setListLoading(true);
const searchOperator = await DictDataStore.fetchDictData('operator', { const searchOperator = await DictDataStore.fetchDictData('operator', {
is_assign: 1, // is_assign: 1,
dept_id: (obj?.DepartmentList || '').replace('ALL', ''), dept_id: (obj?.DepartmentList || '').replace('ALL', ''),
q: searchFormStore.formValues?.operator?.label || '', q: searchFormStore.formValues?.operator?.label || '',
}); });

Loading…
Cancel
Save