Compare commits
34 Commits
Author | SHA1 | Date |
---|---|---|
|
021fb429ce | 4 days ago |
|
a9f45e334d | 1 month ago |
|
488b33ae50 | 1 month ago |
|
6dbf9cfb56 | 1 month ago |
|
108becd2cd | 1 month ago |
|
73e1dcdb4c | 1 month ago |
|
baae505831 | 1 month ago |
|
16b08311fa | 1 month ago |
|
e0e7c3c84f | 2 months ago |
|
87f24c40fa | 2 months ago |
|
bed6b81753 | 2 months ago |
|
171dd7514a | 2 months ago |
|
a0ea6507a3 | 2 months ago |
|
40cd81f9a7 | 2 months ago |
|
876216458e | 2 months ago |
|
8a0f919a42 | 2 months ago |
|
020c9fc3e9 | 2 months ago |
|
b2e539a4d2 | 2 months ago |
|
fee1185406 | 2 months ago |
|
e297d36256 | 2 months ago |
|
667574ec34 | 2 months ago |
|
185db1ec80 | 2 months ago |
|
6dc82a0a01 | 2 months ago |
|
4724b13a2d | 2 months ago |
|
f532f138ff | 2 months ago |
|
3b51ae8d08 | 2 months ago |
|
a6f7884e6e | 2 months ago |
|
928e27913d | 2 months ago |
|
94363df0fc | 2 months ago |
|
621d3a2446 | 2 months ago |
|
8f12fc8747 | 2 months ago |
|
397c886aea | 2 months ago |
|
459db55453 | 2 months ago |
|
6317c24a75 | 2 months ago |
@ -0,0 +1,147 @@
|
|||||||
|
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),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
// 筛选函数
|
||||||
|
const getFiltersData=(filterData,filterKey)=>{
|
||||||
|
return comm.uniqWith(filterData.map(rr => ({ text: rr[filterKey], value: rr[filterKey] })),
|
||||||
|
(a, b) => JSON.stringify(a) === JSON.stringify(b)).sort((a, b) => a.text.localeCompare(b.text));
|
||||||
|
};
|
||||||
|
// 小组筛选菜单项
|
||||||
|
const allOPIGroup = getFiltersData(host_case_data.summaryData,"GroupBy");
|
||||||
|
// 顾问筛选菜单项
|
||||||
|
const allOPIConsultant = getFiltersData(host_case_data.counselorData,"GroupBy");
|
||||||
|
// 明细表顾问名筛选菜单项
|
||||||
|
const allOPIDetailConsultant = getFiltersData(host_case_data.singleDetailData,"OPI_Name");
|
||||||
|
const summaryColumnsList = [{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'GroupBy',
|
||||||
|
key: 'GroupBy',
|
||||||
|
}, ...columnsList];
|
||||||
|
const groupColumnsList = [{
|
||||||
|
title: '组名',
|
||||||
|
dataIndex: 'GroupBy',
|
||||||
|
key: 'GroupBy',
|
||||||
|
filters: allOPIGroup,
|
||||||
|
onFilter: (value, record) => record.GroupBy === value,
|
||||||
|
filterSearch: true,
|
||||||
|
}, ...columnsList];
|
||||||
|
const counselorColumnsList = [{
|
||||||
|
title: '顾问名',
|
||||||
|
dataIndex: 'GroupBy',
|
||||||
|
key: 'GroupBy',
|
||||||
|
filters: allOPIConsultant,
|
||||||
|
onFilter: (value, record) => record.GroupBy === value,
|
||||||
|
filterSearch: true,
|
||||||
|
}, ...columnsList];
|
||||||
|
const singleDetailColumnsList = [{
|
||||||
|
title: '团名',
|
||||||
|
dataIndex: 'GroupBy',
|
||||||
|
key: 'GroupBy',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '顾问名',
|
||||||
|
dataIndex: 'OPI_Name',
|
||||||
|
key: 'OPI_Name',
|
||||||
|
filters: allOPIDetailConsultant,
|
||||||
|
onFilter: (value, record) => record.OPI_Name === value,
|
||||||
|
filterSearch: true,
|
||||||
|
},
|
||||||
|
...columnsList.slice(1)];
|
||||||
|
|
||||||
|
const renderRow=(rowColumns,rowDataSource,title)=>{
|
||||||
|
return(
|
||||||
|
<Row>
|
||||||
|
<Col span={24}>
|
||||||
|
<Typography.Title level={3}>{title}</Typography.Title>
|
||||||
|
<Divider orientation="right" plain>
|
||||||
|
<TableExportBtn label={title} {...{ columns: rowColumns, dataSource: rowDataSource }} />
|
||||||
|
</Divider>
|
||||||
|
<Table
|
||||||
|
sticky
|
||||||
|
id={`${rowColumns}`}
|
||||||
|
dataSource={rowDataSource}
|
||||||
|
columns={rowColumns}
|
||||||
|
size="small"
|
||||||
|
rowKey={(record) => record.key}
|
||||||
|
loading={host_case_data.loading}
|
||||||
|
pagination={false}
|
||||||
|
scroll={{ x: 1000 }}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
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");
|
||||||
|
customer_store.getHostCaseData("4");
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
{renderRow(summaryColumnsList,host_case_data.summaryData,'东道主项目汇总')}
|
||||||
|
{renderRow(groupColumnsList,host_case_data.groupData,'东道主项目小组统计')}
|
||||||
|
{renderRow(counselorColumnsList,host_case_data.counselorData,'东道主项目顾问统计')}
|
||||||
|
{renderRow(singleDetailColumnsList,host_case_data.singleDetailData,'单团明细')}
|
||||||
|
</Space>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default observer(HostCaseCount);
|
Loading…
Reference in New Issue