diff --git a/src/components/search/GuideLanguageSelect.jsx b/src/components/search/GuideLanguageSelect.jsx
new file mode 100644
index 0000000..906886b
--- /dev/null
+++ b/src/components/search/GuideLanguageSelect.jsx
@@ -0,0 +1,53 @@
+import React, { Component } from 'react';
+import { Select } from 'antd';
+import { observer } from 'mobx-react';
+
+class GuideLanguageSelect extends Component {
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ const { store, value, onChange, ...extProps } = this.props;
+
+ // 导游语种列表
+ const languageOptions = [
+ { value: '', label: 'all' },
+ { value: '102001', label: '英语' },
+ { value: '102002', label: '普通话' },
+ { value: '102003', label: '日语' },
+ { value: '102004', label: '韩语' },
+ { value: '102005', label: '德语' },
+ { value: '102006', label: '法语' },
+ { value: '102007', label: '意大利语' },
+ { value: '102008', label: '西班牙语' },
+ { value: '102009', label: '俄语' },
+ { value: '102010', label: '粤语' },
+ { value: '102011', label: '印尼语' },
+ { value: '102012', label: '泰国语' },
+ { value: '102013', label: '葡萄牙语' }
+ ];
+
+ return (
+
+
+
+ );
+ }
+}
+
+export default observer(GuideLanguageSelect);
\ No newline at end of file
diff --git a/src/components/search/SearchForm.jsx b/src/components/search/SearchForm.jsx
index 9cdd309..ff5f852 100644
--- a/src/components/search/SearchForm.jsx
+++ b/src/components/search/SearchForm.jsx
@@ -13,6 +13,7 @@ import SiteSelect from './SiteSelect';
import DateTypeSelect from './DataTypeSelect';
import DatePickerCharts from './DatePickerCharts';
import YearPickerCharts from './YearPickerCharts';
+import GuideLanguageSelect from './GuideLanguageSelect';
import SearchInput from './Input';
import { objectMapper, at, empty, isEmpty } from '@haina/utils-commons';
import { departureDateTypes } from './../../libs/ht';
@@ -360,6 +361,13 @@ function getFields(props) {
,
fieldProps?.DepartmentList?.col
),
+ item(
+ 'guide_lgc',
+ 99,
+
+
+ ,
+ ),
item(
'WebCode',
99,
diff --git a/src/views/HostCaseReport.jsx b/src/views/HostCaseReport.jsx
index 4276e76..de1d641 100644
--- a/src/views/HostCaseReport.jsx
+++ b/src/views/HostCaseReport.jsx
@@ -7,6 +7,7 @@ import SearchForm from '../components/search/SearchForm';
import useHostCaseStore from '../zustand/HostCase';
import { useShallow } from 'zustand/shallow';
import { exportDoc } from '../components/TemplateLetter2025/Index';
+import { VSDataTag } from './../components/Data';
import ExportDocxBtn from '../components/TemplateLetter2025/ExportDocxBtn';
const sorter = (a, b, key) => parseInt(a[key]) - parseInt(b[key]);
@@ -14,8 +15,8 @@ const HostCaseReport = ({ ...props }) => {
const { date_picker_store } = useContext(stores_Context);
// const host_case_data = customer_store.host_case_data;
- const [loading, reset, searchValues, setSearchValues, forExport] = useHostCaseStore(
- useShallow((state) => [state.loading, state.reset, state.searchValues, state.setSearchValues, state.forExport])
+ const [loading, reset, searchValues, setSearchValues, forExport, searchValuesToSub] = useHostCaseStore(
+ useShallow((state) => [state.loading, state.reset, state.searchValues, state.setSearchValues, state.forExport, state.searchValuesToSub])
);
const [caseSummary, caseSummaryByGuide, caseFeatured, getCaseReport] = useHostCaseStore(
useShallow((state) => [state.caseSummary, state.caseSummaryByGuide, state.caseFeatured, state.getCaseReport])
@@ -26,35 +27,52 @@ const HostCaseReport = ({ ...props }) => {
await getCaseReport(formVal);
};
+ const DataRenderCell = ({ data1, data2, dataSuffix = '', showDiffData }) => {
+ if (showDiffData) {
+ return ;
+ }
+ return {data1}{dataSuffix}
;
+ };
+
const summaryCols = [
{ title: '接团数', dataIndex: 'group_count', width: '6rem',
sorter: (a, b) => sorter(a,b, 'group_count'),
+ render: (text, r) => ,
},
// { title: 'feedback团数', dataIndex: 'feedbak_group', width: '6rem' },
{ title: '东道主团数', dataIndex: 'group_count_dongdaozhu', width1: '8rem',
sorter: (a, b) => sorter(a,b, 'group_count_dongdaozhu'),
+ render: (text, r) => ,
},
{ title: '东道主个数', dataIndex: 'case_count_dongdaozhu', width1: '8rem',
sorter: (a, b) => sorter(a,b, 'case_count_dongdaozhu'),
+ render: (text, r) => ,
+ },
+ { title: '东道主实施比例', dataIndex: 'dongdaozhu_rate',
+ render: (text, r) => ,
},
- { title: '东道主实施比例', dataIndex: 'dongdaozhu_rate' },
{
title: '各类型个数',
children: [
{ title: 'Live There', dataIndex: 'live_there_count',
sorter: (a, b) => sorter(a, b, 'live_there_count'),
+ render: (text, r) => ,
},
{ title: '动机圆梦', dataIndex: 'dream_fulfillment_count',
sorter: (a, b) => sorter(a, b, 'dream_fulfillment_count'),
+ render: (text, r) => ,
},
{ title: '仪式感创造', dataIndex: 'ceremony_creation_count',
sorter: (a, b) => sorter(a, b, 'ceremony_creation_count'),
+ render: (text, r) => ,
},
{ title: '遗憾弥补', dataIndex: 'regret_compensation_count',
sorter: (a, b) => sorter(a, b, 'regret_compensation_count'),
+ render: (text, r) => ,
},
{ title: '力挽狂澜', dataIndex: 'rescue_mission_count',
sorter: (a, b) => sorter(a, b, 'rescue_mission_count'),
+ render: (text, r) => ,
},
],
},
@@ -78,11 +96,11 @@ const HostCaseReport = ({ ...props }) => {
...toJS(date_picker_store.formValues),
...searchValues,
},
- shows: ['years', 'agency'],
+ shows: ['years', 'agency','DepartmentList', 'guide_lgc'],
fieldProps: {
- DepartmentList: { show_all: false, mode: 'multiple' },
+ DepartmentList: { show_all: false },
dates: { hide_vs: true },
- years: { hide_vs: true },
+ years: { hide_vs: false },
agency: { rules: [{ required: true, message: '请选择地接社' }] },
},
}}
diff --git a/src/zustand/HostCase.js b/src/zustand/HostCase.js
index 70880fa..f9bb721 100644
--- a/src/zustand/HostCase.js
+++ b/src/zustand/HostCase.js
@@ -22,28 +22,60 @@ export const transformRows = (cols, rows) => {
});
};
-export const fetchCaseSummary = async (params) => {
- const searchParams = {
+export const transSearchParams = (params) => {
+ const newsearchParams = {
...params,
vei_sn: params.agency,
+ DepartmentList: params.DepartmentList === 'ALL' ? undefined : params.DepartmentList,
};
- const { errcode, result } = await fetchJSON(`${HT_HOST}/service-Analyse2/dong_dao_zhu_total`, searchParams);
- return errcode !== 0 ? [] : (result || []);
-};
-export const fetchCaseSummaryByGuide = async (params) => {
- const searchParams = {
+ const oldseachPararms = {
...params,
+ Date1: params.DateDiff1,
+ Date2: params.DateDiff2,
vei_sn: params.agency,
+ DepartmentList: params.DepartmentList === 'ALL' ? undefined : params.DepartmentList,
};
- const { errcode, result } = await fetchJSON(`${HT_HOST}/service-Analyse2/dong_dao_zhu_tour_guide`, searchParams);
- return errcode !== 0 ? [] : (result || []); // .sort(sortDescBy('case_count_dongdaozhu'));
+ return {
+ newsearchParams,
+ oldseachPararms,
+ };
+};
+export const fetchCaseSummary = async (params) => {
+ const {newsearchParams, oldseachPararms} = transSearchParams(params);
+ const { errcode, result } = await fetchJSON(`${HT_HOST}/service-Analyse2/dong_dao_zhu_total`, newsearchParams);
+ let response2;
+ if(oldseachPararms.DateDiff1){
+ response2 = await fetchJSON(`${HT_HOST}/service-Analyse2/dong_dao_zhu_total`, oldseachPararms);
+ }else{
+ response2 = { errcode: 0, result: [] };
+ }
+ const caseSummary = result.map((item, index) => ({
+ ...item,
+ diff: response2.errcode !== 0 ? {} : (response2.result[index] || {dongdaozhu_rate: "0%"})
+ }));
+
+ return errcode !== 0 ? [] : (caseSummary || []);
};
+
+export const fetchCaseSummaryByGuide = async (params) => {
+ const {newsearchParams, oldseachPararms} = transSearchParams(params);
+ const { errcode, result } = await fetchJSON(`${HT_HOST}/service-Analyse2/dong_dao_zhu_tour_guide`, newsearchParams);
+ let response2;
+ if(oldseachPararms.DateDiff1){
+ response2 = await fetchJSON(`${HT_HOST}/service-Analyse2/dong_dao_zhu_tour_guide`, oldseachPararms);
+ }else{
+ response2 = { errcode: 0, result: [] };
+ }
+ const caseSummaryByGuide = result.map((item, index) => ({
+ ...item,
+ diff: response2.errcode !== 0 ? {} : (response2.result.find(r => r.TGI_SN === item.TGI_SN) || {dongdaozhu_rate: "0%"})
+ }));
+ return errcode !== 0 ? [] : (caseSummaryByGuide || []); // .sort(sortDescBy('case_count_dongdaozhu'));
+};
+
export const fetchCaseFeatured = async (params) => {
- const searchParams = {
- ...params,
- vei_sn: params.agency,
- };
- const { errcode, result } = await fetchJSON(`${HT_HOST}/service-Analyse2/dong_dao_zhu_case`, searchParams);
+ const {newsearchParams, oldseachPararms} = transSearchParams(params);
+ const { errcode, result } = await fetchJSON(`${HT_HOST}/service-Analyse2/dong_dao_zhu_case`, newsearchParams);
return errcode !== 0 ? [] : (result || []);
};
@@ -75,6 +107,7 @@ const useHostCaseStore = create(
setLoading: (loading) => set({ loading }),
setSearchValues: (obj, values) => set((state) => ({ searchValues: values, searchValuesToSub: obj })),
+ setSearchValuesToSub: (values) => set((state) => ({ searchValuesToSub: values })),
setLoadingCase: (loadingCase) => set({ loadingCase }),
setCaseFeatured: (caseFeatured) => set({ caseFeatured }),