diff --git a/src/components/search/SearchForm.jsx b/src/components/search/SearchForm.jsx index 4f43365..464ea44 100644 --- a/src/components/search/SearchForm.jsx +++ b/src/components/search/SearchForm.jsx @@ -153,6 +153,21 @@ export default observer((props) => { transform: (value) => isEmpty(value) ? 'ALL' : value?.key || '', default: '', }, + 'agency': { + key: 'agency', + transform: (value) => value?.key || '', + default: '', + }, + 'countryArea': { + key: 'countryArea', + transform: (value) => value?.value || value?.key || '', + default: '', + }, + 'orderStatus': { + key: 'orderStatus', + transform: (value) => value?.value || value?.key || '', + default: '', + }, }; let dest = {}; const { applyDate, applyDate2, year, yearDiff, dates, months, ...omittedValue } = values; @@ -247,6 +262,19 @@ function getFields(props) { }; let baseChildren = []; baseChildren = [ + item( + 'agency', + 99, + + + + ), item( 'billtype', 99, @@ -309,6 +337,42 @@ function getFields(props) { , 3 ), + item( + 'countryArea', + 99, + + + , + 3 + ), + item( + 'orderStatus', + 99, + + + , + 3 + ), // item( 'DateType', diff --git a/src/stores/CustomerServices.js b/src/stores/CustomerServices.js index 59e6e57..141a7f4 100644 --- a/src/stores/CustomerServices.js +++ b/src/stores/CustomerServices.js @@ -59,9 +59,11 @@ class CustomerServices { { title: '地接社名称', dataIndex: 'VendorName', + fixed: 'left', children: [{ // title: this.startDate.format(config.DATE_FORMAT) + '~' + this.endDate.format(config.DATE_FORMAT), dataIndex: 'VendorName', + fixed: 'left', render: (text, record) => {record.VendorName} } ] @@ -297,10 +299,10 @@ class CustomerServices { { title: '城市', dataIndex: 'COLD_ServiceCityName', - fix: 'left', + fixed: 'left', children: [{ dataIndex: 'COLD_ServiceCityName', - fix: 'left', + fixed: 'left', render: (text, record) => {record.COLD_ServiceCityName} } ] @@ -455,6 +457,20 @@ class CustomerServices { }); } + searchValues = { + DateType: { key: 'startDate', label: '走团日期'}, + }; + + setSearchValues(obj, values) { + this.dateType = obj.DateType; + this.selectedAgent = obj.agency; + this.startDateString = obj.Date1; + this.endDateString = obj.Date2; + this.selectedCountry = obj.countryArea; + this.selectedTeam = obj.DepartmentList.replace('ALL', ''); + this.selectedOrderStatus = obj.orderStatus; + } + selectDateRange(startDate, endDate) { this.startDate = startDate; this.endDate = endDate; @@ -520,7 +536,7 @@ class CustomerServices { { title: '地接社名称', dataIndex: 'VendorName', - fix: 'left', + fixed: 'left', render: (text, record) => { if (record.EOI_ObjSN === -1) { return text; diff --git a/src/views/AgentGroupCount.jsx b/src/views/AgentGroupCount.jsx index 5a75d0f..f685e2e 100644 --- a/src/views/AgentGroupCount.jsx +++ b/src/views/AgentGroupCount.jsx @@ -1,142 +1,51 @@ -import React, { useContext, useEffect } from 'react'; -import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd'; -import { SearchOutlined } from '@ant-design/icons'; +import { useContext, useEffect } from 'react'; +import { Row, Col, Typography, Space, Table, Divider } from 'antd'; import { stores_Context } from '../config'; -import * as config from '../config'; import { observer } from 'mobx-react'; import 'moment/locale/zh-cn'; -import moment from 'moment'; -import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; import { utils, writeFileXLSX } from 'xlsx'; -import GroupSelect from './../components/search/GroupSelect'; +import SearchForm from './../components/search/SearchForm'; const AgentGroupCount = () => { - const { customerServicesStore } = useContext(stores_Context); - const agentList = customerServicesStore.agentList; + const { customerServicesStore, date_picker_store } = useContext(stores_Context); const agentGroupList = customerServicesStore.agentGroupList; const agentGroupListColumns = customerServicesStore.agentGroupListColumns; - const { startDate, endDate, dateType, inProgress } = customerServicesStore; + const { inProgress } = customerServicesStore; useEffect(() => { customerServicesStore.fetchAllAgent(); }, []); - const handleSearchClick = () => { - customerServicesStore.fetchAgentGroupCount(); - }; - - const renderAgentItem = (agent) => { - return ( - - {agent.VEI2_CompanyBN} - - ); - }; - return ( <> - - - - - - customerServicesStore.selectTeam(value)} - style={{ width: '95%' }} show_all={true} - /> - - - - - - - - - { - customerServicesStore.selectDateRange(dates[0], dates[1]); + + + { + customerServicesStore.setSearchValues(obj, form); + customerServicesStore.fetchAgentGroupCount(); }} /> - - - 地接社团信息 - { { - const wb = utils.table_to_book( - document.getElementById('agentGroupList').getElementsByTagName('table')[0] - ); + const wb = utils.table_to_book(document.getElementById('agentGroupList').getElementsByTagName('table')[0]); writeFileXLSX(wb, '地接社团信息.xlsx'); }} > diff --git a/src/views/AgentGroupList.jsx b/src/views/AgentGroupList.jsx index db1ad79..561dbc9 100644 --- a/src/views/AgentGroupList.jsx +++ b/src/views/AgentGroupList.jsx @@ -1,87 +1,56 @@ -import React, {useContext, useEffect} from 'react'; -import {Row, Col, Typography, Space, DatePicker, Button, Select, Table, List} from 'antd'; -import { - SearchOutlined, -} from '@ant-design/icons'; -import {stores_Context} from '../config'; -import * as config from "../config"; -import {observer} from 'mobx-react'; -import { NavLink, useParams } from "react-router-dom"; +import { useContext, useEffect } from 'react'; +import { Row, Col, Typography, Space, Table, List } from 'antd'; +import { stores_Context } from '../config'; +import { observer } from 'mobx-react'; +import { NavLink, useParams } from 'react-router-dom'; import 'moment/locale/zh-cn'; -import moment from "moment"; -import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; -import GroupSelect from './../components/search/GroupSelect'; +import SearchForm from './../components/search/SearchForm'; const AgentGroupList = () => { - - const {agentId} = useParams(); - const { customerServicesStore } = useContext(stores_Context); + const { agentId } = useParams(); + const { customerServicesStore, date_picker_store } = useContext(stores_Context); useEffect(() => { - customerServicesStore.fetchGroupListByAgentId(agentId); - }, []); + customerServicesStore.fetchGroupListByAgentId(agentId); + }, []); const groupList = customerServicesStore.groupList; const groupListColumns = customerServicesStore.groupListColumns; - const {startDate, endDate, dateType, inProgress} = customerServicesStore; + const { startDate, endDate, dateType, inProgress } = customerServicesStore; - return ( - <> - - - + return ( + <> + + + 返回 - - customerServicesStore.selectTeam(value)} - style={{ width: '95%' }} show_all={true} + + { + customerServicesStore.setSearchValues(obj, form); + customerServicesStore.fetchGroupListByAgentId(agentId); + }} /> - - - - - - {customerServicesStore.selectDateRange(dates[0], dates[1]);}} - ranges={{ - '本周': [moment().startOf('week'), moment().endOf('week')], - '上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')], - '本月': [moment().startOf('month'), moment().endOf('month')], - '上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')], - '近30天': [moment().subtract(30, 'days'), moment()], - '近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')], - '今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')], - '去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')], - }} - /> - - - - + {customerServicesStore.agentCompany} -
{ scroll={{ x: 1000 }} expandable={{ expandedRowRender: (record) => ( - - + - + - + ), @@ -113,9 +73,9 @@ const AgentGroupList = () => { /> - - - ); + + + ); }; export default observer(AgentGroupList); diff --git a/src/views/DestinationGroupCount.jsx b/src/views/DestinationGroupCount.jsx index 3890d24..818266b 100644 --- a/src/views/DestinationGroupCount.jsx +++ b/src/views/DestinationGroupCount.jsx @@ -1,109 +1,49 @@ -import React, {useContext, useEffect} from 'react'; -import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd'; -import { - SearchOutlined, -} from '@ant-design/icons'; +import { useContext, useEffect } from 'react'; +import { Row, Col, Typography, Space, Table, Divider } from 'antd'; import { stores_Context } from '../config'; -import * as config from "../config"; import { observer } from 'mobx-react'; import 'moment/locale/zh-cn'; -import moment from "moment"; -import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; -import { utils, writeFileXLSX } from "xlsx"; -import GroupSelect from './../components/search/GroupSelect'; +import { utils, writeFileXLSX } from 'xlsx'; +import SearchForm from './../components/search/SearchForm'; const DestinationGroupCount = () => { - - const {customerServicesStore} = useContext(stores_Context); + const { customerServicesStore, date_picker_store } = useContext(stores_Context); const destinationGroupCount = customerServicesStore.destinationGroupCount; const destinationGroupCountColumns = customerServicesStore.destinationGroupCountColumns; - const {startDate, endDate, dateType, inProgress} = customerServicesStore; - - useEffect(() => { - customerServicesStore.selectCountry('china'); - }, []); - - const handleSearchClick = () => { - customerServicesStore.fetchDestinationGroupCount(); - }; + const { startDate, endDate, dateType, inProgress } = customerServicesStore; return ( <> - - - customerServicesStore.selectTeam(value)} - style={{ width: '95%' }} show_all={true} - /> - - - - - - - - - - - - { customerServicesStore.selectDateRange(dates[0], dates[1]); }} - ranges={{ - '本周': [moment().startOf('week'), moment().endOf('week')], - '上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')], - '本月': [moment().startOf('month'), moment().endOf('month')], - '上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')], - '近30天': [moment().subtract(30, 'days'), moment()], - '近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')], - '今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')], - '去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')], + + + { + customerServicesStore.setSearchValues(obj, form); + customerServicesStore.fetchDestinationGroupCount(); }} /> - - - 目的地团信息 -
{ { - const wb = utils.table_to_book(document.getElementById("destinationGroupCount").getElementsByTagName("table")[0]); - writeFileXLSX(wb, "目的地团信息.xlsx"); - }}> + const wb = utils.table_to_book(document.getElementById('destinationGroupCount').getElementsByTagName('table')[0]); + writeFileXLSX(wb, '目的地团信息.xlsx'); + }} + > 导出excel diff --git a/src/views/DestinationGroupList.jsx b/src/views/DestinationGroupList.jsx index 0408a97..9174956 100644 --- a/src/views/DestinationGroupList.jsx +++ b/src/views/DestinationGroupList.jsx @@ -1,88 +1,58 @@ -import React, {useContext, useEffect} from 'react'; -import {Row, Col, Typography, Space, DatePicker, Button, Select, Table, List} from 'antd'; -import { - SearchOutlined, -} from '@ant-design/icons'; -import {stores_Context} from '../config'; -import * as config from "../config"; -import {observer} from 'mobx-react'; -import { NavLink, useParams } from "react-router-dom"; +import { useContext, useEffect } from 'react'; +import { Row, Col, Space, Table, List } from 'antd'; +import { stores_Context } from '../config'; +import { observer } from 'mobx-react'; +import { NavLink, useParams } from 'react-router-dom'; import 'moment/locale/zh-cn'; -import moment from "moment"; -import zhCNlocale from 'antd/es/date-picker/locale/zh_CN'; -import GroupSelect from './../components/search/GroupSelect'; +import SearchForm from './../components/search/SearchForm'; const DestinationGroupList = () => { - - const {destinationId} = useParams(); - const { customerServicesStore } = useContext(stores_Context); + const { destinationId } = useParams(); + const { customerServicesStore, date_picker_store } = useContext(stores_Context); useEffect(() => { - customerServicesStore.fetchGroupListByDestinationId(destinationId); - }, []); + customerServicesStore.fetchGroupListByDestinationId(destinationId); + }, []); const destinationGroupList = customerServicesStore.destinationGroupList; const destinationGroupListColumns = customerServicesStore.destinationGroupListColumns; - const {startDate, endDate, dateType, inProgress} = customerServicesStore; + const { inProgress } = customerServicesStore; - return ( - <> - - - + return ( + <> + + + 返回 - - - customerServicesStore.selectTeam(value)} - style={{ width: '95%' }} show_all={true} + + { + customerServicesStore.setSearchValues(obj, form); + customerServicesStore.fetchGroupListByDestinationId(destinationId); + customerServicesStore.fetchDestinationGroupCount(); + }} /> - - - - - {customerServicesStore.selectDateRange(dates[0], dates[1]);}} - ranges={{ - '本周': [moment().startOf('week'), moment().endOf('week')], - '上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')], - '本月': [moment().startOf('month'), moment().endOf('month')], - '上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')], - '近30天': [moment().subtract(30, 'days'), moment()], - '近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')], - '今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')], - '去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')], - }} - /> - - - - -
{ scroll={{ x: 600 }} expandable={{ expandedRowRender: (record) => ( - - + - + - + ), @@ -114,9 +75,9 @@ const DestinationGroupList = () => { /> - - - ); + + + ); }; export default observer(DestinationGroupList); diff --git a/src/views/Sale.jsx b/src/views/Sale.jsx index 29f9fbc..4375b67 100644 --- a/src/views/Sale.jsx +++ b/src/views/Sale.jsx @@ -200,7 +200,7 @@ const Sale = () => { }, ]; const tableColumns = type_data.columns.map((ele, i) => - i === 0 ? { ...ele, fix: 'left', children: (ele?.children || []).map((ele_child, i_child) => (i_child === 0 ? { ...ele_child, fix: 'left' } : { ...ele_child })) } : { ...ele } + i === 0 ? { ...ele, fixed: 'left', children: (ele?.children || []).map((ele_child, i_child) => (i_child === 0 ? { ...ele_child, fixed: 'left' } : { ...ele_child })) } : { ...ele } ); return (