|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import { useContext } from 'react';
|
|
|
|
|
import { useContext, useEffect } from 'react';
|
|
|
|
|
import { observer } from 'mobx-react';
|
|
|
|
|
import { stores_Context } from '../config';
|
|
|
|
|
import { Spin, Table, Row, Col, Tabs } from 'antd';
|
|
|
|
|
import SearchForm from './../components/search/SearchForm';
|
|
|
|
|
import { TableExportBtn } from './../components/Data';
|
|
|
|
|
import { empty } from '../utils/commons';
|
|
|
|
|
import './kpi.css';
|
|
|
|
|
|
|
|
|
|
const apartOptions = [
|
|
|
|
@ -11,6 +12,7 @@ const apartOptions = [
|
|
|
|
|
{ key: 'outbound', value: 'outbound', label: '出境' },
|
|
|
|
|
{ key: 'domestic', value: 'domestic', label: '国内' },
|
|
|
|
|
];
|
|
|
|
|
const apartOptionsMapped = apartOptions.reduce((r, v) => ({...r, [v.value]: v}), {});
|
|
|
|
|
|
|
|
|
|
export default observer((props) => {
|
|
|
|
|
const { financial_store: financialStore, date_picker_store: searchFormStore } = useContext(stores_Context);
|
|
|
|
@ -18,26 +20,26 @@ export default observer((props) => {
|
|
|
|
|
const { servicePersonNum } = financialStore;
|
|
|
|
|
const { curTab } = servicePersonNum;
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
// DistributionStore.setFormDates(formValuesToSub);
|
|
|
|
|
financialStore.resetPersonNumData();
|
|
|
|
|
return () => {};
|
|
|
|
|
}, [formValuesToSub]);
|
|
|
|
|
|
|
|
|
|
const pageRefresh = (queryData = formValuesToSub) => {
|
|
|
|
|
// console.log(queryData, 'qqqq');
|
|
|
|
|
financialStore.getPersonNum(queryData);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
|
{ title: '名称', dataIndex: 'groupsLabel' },
|
|
|
|
|
{ title: apartOptionsMapped[curTab].label, dataIndex: 'groupsLabel', children: [{ title: `${formValuesToSub.Date1}~${formValuesToSub.Date2.substring(0, 10)}`, dataIndex: 'groupsLabel' }] },
|
|
|
|
|
{
|
|
|
|
|
title: '人次数',
|
|
|
|
|
children: [
|
|
|
|
|
{ title: '外联', dataIndex: 'orgz' },
|
|
|
|
|
{ title: '接待', dataIndex: 'hosts' },
|
|
|
|
|
],
|
|
|
|
|
children: [{ title: '组织', dataIndex: 'orgz' }, ...(['inbound', 'domestic'].includes(curTab) ? [{ title: '接待', dataIndex: 'hosts' }] : [])],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '人天',
|
|
|
|
|
children: [
|
|
|
|
|
{ title: '外联', dataIndex: 'orgzPDays' },
|
|
|
|
|
{ title: '接待', dataIndex: 'hostsPDays' },
|
|
|
|
|
],
|
|
|
|
|
children: [{ title: '组织', dataIndex: 'orgzPDays' }, ...(['inbound', 'domestic'].includes(curTab) ? [{ title: '接待', dataIndex: 'hostsPDays' }] : [])],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
@ -68,7 +70,9 @@ export default observer((props) => {
|
|
|
|
|
activeKey={curTab}
|
|
|
|
|
onChange={(v) => {
|
|
|
|
|
financialStore.setCurTab(v);
|
|
|
|
|
pageRefresh();
|
|
|
|
|
if (empty(servicePersonNum[v].dataSource)) {
|
|
|
|
|
pageRefresh();
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
tabBarExtraContent={{
|
|
|
|
|
right: <TableExportBtn label={'服务人数'} {...{ columns, dataSource: servicePersonNum[curTab].dataSource }} />,
|
|
|
|
|