feat:东道主项目页

main
ZJYHX 2 months ago
parent e297d36256
commit fee1185406

@ -57,6 +57,7 @@ import OPProcess from './views/sales-crm/Process';
import OPRisk from './views/sales-crm/Risk'; import OPRisk from './views/sales-crm/Risk';
import Cruise from './views/Cruise'; import Cruise from './views/Cruise';
import Hotel from './views/Hotel'; import Hotel from './views/Hotel';
import HostCaseCount from './views/HostCaseCount';
const App = () => { const App = () => {
const { Content, Footer, Sider, } = Layout; const { Content, Footer, Sider, } = Layout;
@ -162,6 +163,7 @@ const App = () => {
}, },
{ key: 'cruise', label: <NavLink to="/cruise">三峡游船</NavLink> }, { key: 'cruise', label: <NavLink to="/cruise">三峡游船</NavLink> },
{ key: 'hotel', label: <NavLink to="/hotel">酒店</NavLink> }, { key: 'hotel', label: <NavLink to="/hotel">酒店</NavLink> },
{ key: 'hostcase', label: <NavLink to="/hostcase/count">东道主项目</NavLink> },
], ],
}, },
{ {
@ -265,6 +267,7 @@ const App = () => {
<Route path="/destination/:destinationId/group/list" element={<DestinationGroupList />} /> <Route path="/destination/:destinationId/group/list" element={<DestinationGroupList />} />
<Route path="/cruise" element={<Cruise />} /> <Route path="/cruise" element={<Cruise />} />
<Route path="/hotel" element={<Hotel />} /> <Route path="/hotel" element={<Hotel />} />
<Route path="/hostcase/count" element={<HostCaseCount />} />
</Route> </Route>
<Route element={<ProtectedRoute auth={['admin', 'director_bu', 'financial']} />}> <Route element={<ProtectedRoute auth={['admin', 'director_bu', 'financial']} />}>
<Route path="/credit_card_bill" element={<Credit_card_bill />} /> <Route path="/credit_card_bill" element={<Credit_card_bill />} />

@ -101,6 +101,7 @@ class CustomerStore {
// 老客户 beign // 老客户 beign
// isCompare对比数据boolean isCompareRender对比折线boolean
regular_customer_order(get_detail = false, isCompare = false, isCompareRender=false) { regular_customer_order(get_detail = false, isCompare = false, isCompareRender=false) {
let pivotByOrder = 'SumOrder'; let pivotByOrder = 'SumOrder';
let pivotByDate = 'applyDate'; let pivotByDate = 'applyDate';
@ -399,6 +400,52 @@ class CustomerStore {
}; };
// 在华客人 end // 在华客人 end
// 东道主项目 begin
host_case_data = {
loading: false,
summaryData: [], // 汇总数据
groupData: [], // 小组数据
counselorData: [], // 顾问数据
group_select_mode: 'multiple',
groups: ['1', '2', '28', '7'],
searchValues: {
DepartmentList: ['1', '2', '28', '7'].map(kk => groupsMappedByKey[kk]),
},
};
getHostCaseData(groupBy) {
this.host_case_data.loading = true;
const date_picker_store = this.rootStore.date_picker_store;
let url = '/service-Analyse2/DDZCount';
url += '?DEI_SN=' + this.host_case_data.groups.toString();
url += '&ArriveDateStart=' + date_picker_store.start_date.format(config.DATE_FORMAT) + '&ArriveDateEnd=' + date_picker_store.end_date.format(config.SMALL_DATETIME_FORMAT);
url += '&GroupBy=' + groupBy;
fetch(config.HT_HOST + url)
.then((response) => response.json())
.then((json) => {
runInAction(() => {
this.host_case_data.loading = false;
switch(groupBy){
case "1":
this.host_case_data.summaryData = json.result?json.result:[];
break;
case "2":
this.host_case_data.counselorData = json.result?json.result:[];
break;
case "3":
this.host_case_data.groupData = json.result?json.result:[];
break;
}
});
})
.catch((error) => {
this.host_case_data.loading = false;
console.log('fetch data failed', error);
});
};
// 东道主项目 end
// 销售-老客户 // 销售-老客户
sales_regular_data = { sales_regular_data = {
loading: false, loading: false,

@ -0,0 +1,157 @@
import { useContext } from 'react';
import { Row, Col, Typography, Space, Table, Divider } from 'antd';
import { stores_Context } from '../config';
import { observer } from 'mobx-react';
import 'moment/locale/zh-cn';
import SearchForm from '../components/search/SearchForm';
import { TableExportBtn } from '../components/Data';
import * as comm from '../utils/commons';
const HostCaseCount = () => {
const { customer_store, date_picker_store } = useContext(stores_Context);
const host_case_data = customer_store.host_case_data;
const columnsList = [
{
title: '团数',
dataIndex: 'TotalGroupNum',
key: 'TotalGroupNum',
sorter: (a, b) => parseInt(a.TotalGroupNum) - parseInt(b.TotalGroupNum),
},
{
title: '人数',
dataIndex: 'TotalPersonNum',
key: 'TotalPersonNum',
sorter: (a, b) => parseInt(a.TotalPersonNum) - parseInt(b.TotalPersonNum),
},
{
title: '计费团天数',
dataIndex: 'TotalDays',
key: 'TotalDays',
sorter: (a, b) => parseInt(a.TotalDays) - parseInt(b.TotalDays),
},
{
title: '交易额',
dataIndex: 'TotalPrice',
key: 'TotalPrice',
sorter: (a, b) => parseInt(a.TotalPrice) - parseInt(b.TotalPrice),
},
];
//
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 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 summaryColumnsList = [{
title: '',
dataIndex: 'GroupBy',
key: 'GroupBy',
}, ...columnsList];
const groupColumnsList = [{
title: '组名',
dataIndex: 'GroupBy',
key: 'GroupBy',
filters: allOPI1,
onFilter: (value, record) => record.GroupBy === value,
filterSearch: true,
}, ...columnsList];
const counselorColumnsList = [{
title: '顾问名',
dataIndex: 'GroupBy',
key: 'GroupBy',
filters: allOPI2,
onFilter: (value, record) => record.GroupBy === value,
filterSearch: true,
}, ...columnsList];
return (
<>
<Space direction="vertical" style={{ width: '100%' }}>
<Row gutter={16} className={date_picker_store.siderBroken ? "" : "sticky-top"} >
<Col className="gutter-row" span={24}>
<SearchForm
defaultValue={{
initialValue: {
...date_picker_store.formValues,
...host_case_data.searchValues,
},
shows: ['DepartmentList', 'dates'],
fieldProps: {
DepartmentList: { show_all: false, mode: 'multiple' },
dates: { hide_vs: true },
},
}}
onSubmit={(_err, obj, form) => {
customer_store.setSearchValues(obj, form,"host_case_data");
customer_store.getHostCaseData("1");
customer_store.getHostCaseData("2");
customer_store.getHostCaseData("3");
}}
/>
</Col>
</Row>
<Row>
<Col span={24}>
<Typography.Title level={3}>东道主项目汇总</Typography.Title>
<Divider orientation="right" plain>
<TableExportBtn label={'东道主项目汇总'} {...{ columns: summaryColumnsList, dataSource: host_case_data.summaryData }} />
</Divider>
<Table
sticky
id="summaryCountList"
dataSource={host_case_data.summaryData}
columns={summaryColumnsList}
size="small"
rowKey={(record) => record.key}
loading={host_case_data.loading}
pagination={false}
scroll={{ x: 1000 }}
/>
</Col>
</Row>
<Row>
<Col span={24}>
<Typography.Title level={3}>东道主项目小组统计</Typography.Title>
<Divider orientation="right" plain>
<TableExportBtn label={'东道主项目小组统计'} {...{ columns: groupColumnsList, dataSource: host_case_data.groupData }} />
</Divider>
<Table
sticky
id="summaryCountList"
dataSource={host_case_data.groupData}
columns={groupColumnsList}
size="small"
rowKey={(record) => record.key}
loading={host_case_data.loading}
pagination={false}
scroll={{ x: 1000 }}
/>
</Col>
</Row>
<Row>
<Col span={24}>
<Typography.Title level={3}>东道主项目顾问统计</Typography.Title>
<Divider orientation="right" plain>
<TableExportBtn label={'东道主项目顾问统计'} {...{ columns: counselorColumnsList, dataSource: host_case_data.counselorData }} />
</Divider>
<Table
sticky
id="summaryCountList"
dataSource={host_case_data.counselorData}
columns={counselorColumnsList}
size="small"
rowKey={(record) => record.key}
loading={host_case_data.loading}
pagination={false}
scroll={{ x: 1000 }}
/>
</Col>
</Row>
</Space>
</>
);
};
export default observer(HostCaseCount);
Loading…
Cancel
Save