From 47609219fbbd10a5b3ea99b64db6de03b29eb577 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 22 Sep 2023 14:42:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=88=86=E5=B8=83:=20?= =?UTF-8?q?=E4=B8=9A=E7=BB=A9=E7=9A=84=E8=BE=93=E5=87=BA=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Distribution.jsx | 102 +++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 55 deletions(-) diff --git a/src/views/Distribution.jsx b/src/views/Distribution.jsx index 68a07f0..59c6876 100644 --- a/src/views/Distribution.jsx +++ b/src/views/Distribution.jsx @@ -1,31 +1,31 @@ -import { useContext, useEffect, useMemo } from 'react'; +import { useContext, useEffect } from 'react'; import { observer } from 'mobx-react'; import { stores_Context } from '../config'; -import { Row, Col, Spin, Space, Radio, Tabs, Table } from 'antd'; +import { Row, Col, Spin, Tabs, Table } from 'antd'; import { RingProgress } from '@ant-design/plots'; import SearchForm from './../components/search/SearchForm'; -import "./kpi.css"; import { empty } from '../utils/commons'; +import { dataFieldAlias } from '../libs/ht'; + +import './kpi.css'; const apartOptions = [ - { key: 'tourDays', value: 'tourDays', label: '团天数', }, - { key: 'PML', value: 'PML', label: '单团毛利', }, - { key: 'ConfirmDays', value: 'ConfirmDays', label: '成团周期', }, - { key: 'ApplyDays', value: 'ApplyDays', label: '预定周期', }, - { key: 'PersonNum', value: 'PersonNum', label: '人等', }, - { key: 'destination', value: 'destination', label: '国内目的地', }, - { key: 'GlobalDestination', value: 'GlobalDestination', label: '海外目的地', }, + { key: 'tourDays', value: 'tourDays', label: '团天数' }, + { key: 'PML', value: 'PML', label: '单团毛利' }, + { key: 'ConfirmDays', value: 'ConfirmDays', label: '成团周期' }, + { key: 'ApplyDays', value: 'ApplyDays', label: '预定周期' }, + { key: 'PersonNum', value: 'PersonNum', label: '人等' }, + { key: 'destination', value: 'destination', label: '国内目的地' }, + { key: 'GlobalDestination', value: 'GlobalDestination', label: '海外目的地' }, ]; -export default observer((props) => { +export default observer(() => { const { date_picker_store: searchFormStore, DistributionStore } = useContext(stores_Context); const { formValues, formValuesToSub } = searchFormStore; const { curTab } = DistributionStore; + const pageRefresh = (obj) => { - DistributionStore.getData({ - DateType: 'applyDate', - Date1: searchFormStore.start_date.startOf('year').format('YYYY-MM-DD'), - Date2: searchFormStore.end_date.endOf('year').format('YYYY-MM-DD 23:59'), + DistributionStore.getApartData({ ...(obj || formValuesToSub), }); }; @@ -41,7 +41,6 @@ export default observer((props) => { return () => {}; }, [formValuesToSub]); - const onTabsChange = (tab) => { DistributionStore.setCurTab(tab); }; @@ -49,69 +48,62 @@ export default observer((props) => { height: 60, width: 60, autoFit: false, - // percent: Number(_)/100, color: ['#5B8FF9', '#E8EDF3'], }; const columns = [ - { - title: '', - dataIndex: 'label', - }, - { title: '团数', dataIndex: 'ConfirmOrder'}, - { title: '业绩', dataIndex: 'SumML', render1: (v) => `1`}, - { title: '团数占比', dataIndex: 'ConfirmOrderPercent', render: (v) => }, - { title: '业绩占比', dataIndex: 'SumMLPercent', render: (v) => }, + { title: '', dataIndex: 'label' }, + { title: '团数', dataIndex: 'ConfirmOrder' }, + { title: '业绩', dataIndex: 'SumML', render: (v) => dataFieldAlias.SumML.formatter(v) }, + { title: '团数占比', dataIndex: 'ConfirmOrderPercent', render: (v) => }, + { title: '业绩占比', dataIndex: 'SumMLPercent', render: (v) => }, ]; return ( <> - {/* style={{ margin: '-16px -8px', padding: 0 }} */} { + onSubmit={(_err, obj) => { pageRefresh(obj); }} /> -
- { - // const ObjectItemPanel = objectComponents[ele.key]; - return { - ...ele, - children: ( - - {/* */} - record.label} - loading={DistributionStore[curTab].loading} - pagination={false} - scroll={{ x: '100%' }} - /> - - ), - }; - })} - /> +
+ { + return { + ...ele, + children: ( + +
record.label} + loading={DistributionStore[curTab].loading} + pagination={false} + scroll={{ x: '100%' }} + /> + + ), + }; + })} + /> );