perf: 东道主报告: 选择年份; 排序

main
Lei OT 4 months ago
parent 97f6bdeb9e
commit e39fe19559

@ -72,6 +72,7 @@ function buildTable(cols, data) {
columnSpan: td.columnSpan,
children: [new Paragraph({ text: td.title, alignment: AlignmentType.CENTER, style: 'TableHeader' })],
verticalAlign: AlignmentType.CENTER,
...(td.width ? { width: { size: 1200, type: WidthType.DXA } } : {}),
})
),
})

@ -9,6 +9,7 @@ import { useShallow } from 'zustand/shallow';
import { exportDoc } from '../components/TemplateLetter2025/Index';
import ExportDocxBtn from '../components/TemplateLetter2025/ExportDocxBtn';
const sorter = (a, b, key) => parseInt(a[key]) - parseInt(b[key]);
const HostCaseReport = ({ ...props }) => {
const { date_picker_store } = useContext(stores_Context);
// const host_case_data = customer_store.host_case_data;
@ -26,19 +27,35 @@ const HostCaseReport = ({ ...props }) => {
};
const summaryCols = [
{ title: '接团数', dataIndex: 'group_count', width: '6rem' },
{ title: 'feedback团数', dataIndex: 'feedbak_group', width: '6rem' },
{ title: '东道主团数', dataIndex: 'group_count_dongdaozhu', width1: '8rem' },
{ title: '东道主个数', dataIndex: 'case_count_dongdaozhu', width1: '8rem' },
{ title: '接团数', dataIndex: 'group_count', width: '6rem',
sorter: (a, b) => sorter(a,b, 'group_count'),
},
// { title: 'feedback', dataIndex: 'feedbak_group', width: '6rem' },
{ title: '东道主团数', dataIndex: 'group_count_dongdaozhu', width1: '8rem',
sorter: (a, b) => sorter(a,b, 'group_count_dongdaozhu'),
},
{ title: '东道主个数', dataIndex: 'case_count_dongdaozhu', width1: '8rem',
sorter: (a, b) => sorter(a,b, 'case_count_dongdaozhu'),
},
{ title: '东道主实施比例', dataIndex: 'dongdaozhu_rate' },
{
title: '各类型个数',
children: [
{ title: 'Live There', dataIndex: 'live_there_count' },
{ title: '动机圆梦', dataIndex: 'dream_fulfillment_count' },
{ title: '仪式感创造', dataIndex: 'ceremony_creation_count' },
{ title: '遗憾弥补', dataIndex: 'regret_compensation_count' },
{ title: '力挽狂澜', dataIndex: 'rescue_mission_count' },
{ title: 'Live There', dataIndex: 'live_there_count',
sorter: (a, b) => sorter(a, b, 'live_there_count'),
},
{ title: '动机圆梦', dataIndex: 'dream_fulfillment_count',
sorter: (a, b) => sorter(a, b, 'dream_fulfillment_count'),
},
{ title: '仪式感创造', dataIndex: 'ceremony_creation_count',
sorter: (a, b) => sorter(a, b, 'ceremony_creation_count'),
},
{ title: '遗憾弥补', dataIndex: 'regret_compensation_count',
sorter: (a, b) => sorter(a, b, 'regret_compensation_count'),
},
{ title: '力挽狂澜', dataIndex: 'rescue_mission_count',
sorter: (a, b) => sorter(a, b, 'rescue_mission_count'),
},
],
},
];
@ -52,7 +69,7 @@ const HostCaseReport = ({ ...props }) => {
return (
<>
<Space direction="vertical" style={{ width: '100%' }}>
<div>
<Row gutter={16} className={toJS(date_picker_store.siderBroken) ? '' : 'sticky-top'}>
<Col className="gutter-row" span={24}>
<SearchForm
@ -61,10 +78,11 @@ const HostCaseReport = ({ ...props }) => {
...toJS(date_picker_store.formValues),
...searchValues,
},
shows: ['dates', 'agency'],
shows: ['years', 'agency'],
fieldProps: {
DepartmentList: { show_all: false, mode: 'multiple' },
dates: { hide_vs: true },
years: { hide_vs: true },
agency: { rules: [{ required: true, message: '请选择地接社' }] },
},
}}
@ -81,20 +99,20 @@ const HostCaseReport = ({ ...props }) => {
subject={forExport.title}
title={forExport.agencyName}
sectionsData={[
{ tableTitle: '2025年东道主总体情况', tableColumns: summaryCols, tableData: caseSummary },
{ tableTitle: '2025年导游实施东道主情况', tableColumns: guideSummaryCols, tableData: caseSummaryByGuide },
{ tableTitle: '2025年精品案例', tableColumns: featuredCaseCols, tableData: caseFeatured },
{ tableTitle: forExport.year+ '年东道主总体情况', tableColumns: summaryCols, tableData: caseSummary },
{ tableTitle: forExport.year+ '年导游实施东道主情况', tableColumns: guideSummaryCols, tableData: caseSummaryByGuide },
{ tableTitle: forExport.year+ '年精品案例', tableColumns: featuredCaseCols, tableData: caseFeatured },
]}
/>
</Divider>
<Typography.Title level={3}>2025年东道主总体情况</Typography.Title>
<Table dataSource={caseSummary} columns={summaryCols} loading={loading} pagination={false} bordered />
<Typography.Title level={3}>2025年导游实施东道主情况</Typography.Title>
<Table dataSource={caseSummaryByGuide} columns={guideSummaryCols} loading={loading} pagination={false} bordered rowKey={'TGI_SN'} />
<Typography.Title level={3}>2025年精品案例</Typography.Title>
<Table dataSource={caseFeatured} columns={featuredCaseCols} loading={loading} pagination={false} bordered rowKey={'case_id'} />
<Typography.Title level={3}>{forExport.year}年东道主总体情况</Typography.Title>
<Table size='small' dataSource={caseSummary} columns={summaryCols} loading={loading} pagination={false} bordered />
<Typography.Title level={3}>{forExport.year}年导游实施东道主情况</Typography.Title>
<Table size='small' dataSource={caseSummaryByGuide} columns={guideSummaryCols} loading={loading} pagination={false} bordered rowKey={'TGI_SN'} />
<Typography.Title level={3}>{forExport.year}年精品案例</Typography.Title>
<Table size='small' dataSource={caseFeatured} columns={featuredCaseCols} loading={loading} pagination={false} bordered rowKey={'case_id'} />
</div>
</Space>
</div>
</>
);
};

@ -60,6 +60,7 @@ const initialState = {
forExport: {
agencyName: '',
title: '',
year: '',
}
};
@ -92,7 +93,11 @@ const useHostCaseStore = create(
caseSummary: summary,
caseSummaryByGuide: guideSummary,
caseFeatured: featured,
forExport: { title: `${moment(params.Date1).format('YYYY年MM月')}-${moment(params.Date2).format('YYYY年MM月')}总结`, agencyName: searchValues.agency.label },
forExport: {
title: `${moment(params.Date1).format('YYYY年')}总结`,
agencyName: searchValues.agency.label,
year: moment(params.Date1).format('YYYY'),
},
});
setLoading(false);
},

Loading…
Cancel
Save