feat: 文旅局服务人数

feature/hotel-cruise
Lei OT 2 years ago
parent ea7048e41b
commit 151dcff1a8

@ -231,6 +231,7 @@ const App = () => {
<Route element={<ProtectedRoute auth={['admin', 'director_bu', 'financial']} />}>
<Route path="/credit_card_bill" element={<Credit_card_bill />} />
<Route path="/exchange_rate" element={<ExchangeRate />} />
<Route path="/service_person_num" element={<ServicePersonNum />} />
</Route>
<Route element={<ProtectedRoute auth={['admin', 'director_bu', 'sale']} />}>
<Route path="/sale" element={<Sale />} />

@ -137,6 +137,12 @@ class FinancialStore {
* 服务人数页面 ----
*/
serviceModelMapper = {
'inbound': { url: '/service-Analyse2/inbound_person_num', keySort: true, dynamicsX: false },
'outbound': { url: '/service-Analyse2/outbound_person_num', keySort: true, dynamicsX: false },
'domestic': { url: '/service-Analyse2/domestic_person_num', keySort: true, dynamicsX: false },
};
servicePersonNum = { curTab: 'inbound',
'inbound': { loading: false, dataSource: [], total: {} },
'outbound': { loading: false, dataSource: [], total: {} },
@ -151,12 +157,17 @@ class FinancialStore {
* 获取服务人数
*/
async getPersonNum(queryData) {
const mkey = this.servicePersonNum.curTab;
const url = this.serviceModelMapper[mkey].url;
this.servicePersonNum[this.servicePersonNum.curTab].loading = true;
const json = await fetchJSON('/inbound_person_num/test', queryData);
const json = await fetchJSON(url, {...queryData, DateType: 'confirmDate'});
const totalRow = {...json.resultTotal, groupsKey: `total${mkey}`};
const IndividualServiceRow = {orgz: json.resultTotal.IndividualService, groupsKey: `individualService${mkey}`, groupsLabel: '单项服务人数', };
if (json.errcode === 0) {
runInAction(() => {
this.servicePersonNum[this.servicePersonNum.curTab].loading = false;
this.servicePersonNum[this.servicePersonNum.curTab].dataSource = [].concat([json.resultTotal], json.result);
this.servicePersonNum[this.servicePersonNum.curTab].dataSource = [].concat([IndividualServiceRow, totalRow], json.result);
this.servicePersonNum[this.servicePersonNum.curTab].total = json.resultTotal;
});
}

@ -3,6 +3,7 @@ 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 './kpi.css';
const apartOptions = [
@ -50,7 +51,7 @@ export default observer((props) => {
...formValues,
DateType: { key: 'startDate', value: 'startDate', label: '走团日期' },
},
shows: ['DateType', 'dates'],
shows: ['dates'],
fieldProps: {
dates: { hide_vs: true },
},
@ -69,6 +70,9 @@ export default observer((props) => {
financialStore.setCurTab(v);
pageRefresh();
}}
tabBarExtraContent={{
right: <TableExportBtn label={'服务人数'} {...{ columns, dataSource: servicePersonNum[curTab].dataSource }} />,
}}
type="card"
items={apartOptions.map((ele) => {
return {
@ -78,7 +82,7 @@ export default observer((props) => {
<Table
id="table_to_xlsx_sale"
dataSource={servicePersonNum[curTab].dataSource}
rowKey='groupsKey'
rowKey="groupsKey"
columns={columns}
size="small"
loading={servicePersonNum[curTab].loading}

Loading…
Cancel
Save