diff --git a/src/components/search/SearchForm.jsx b/src/components/search/SearchForm.jsx index 448b8ed..f2be2fe 100644 --- a/src/components/search/SearchForm.jsx +++ b/src/components/search/SearchForm.jsx @@ -15,6 +15,7 @@ import DatePickerCharts from './DatePickerCharts'; import YearPickerCharts from './YearPickerCharts'; import SearchInput from './Input'; import { objectMapper, at, empty, isEmpty } from './../../utils/commons'; +import { departureDateTypes } from './../../libs/ht'; import './search.css'; @@ -52,6 +53,11 @@ export default observer((props) => { transform: (value) => value?.key || '', default: '', }, + 'departureDateType': { + key: 'DateType', + transform: (value) => value?.key || '', + default: '', + }, 'HTBusinessUnits': { key: 'HTBusinessUnits', transform: (value) => { @@ -176,7 +182,7 @@ export default observer((props) => { }, }; let dest = {}; - const { applyDate, applyDate2, year, yearDiff, dates, months, date, ...omittedValue } = values; + const { departureDateType, applyDate, applyDate2, year, yearDiff, dates, months, date, ...omittedValue } = values; dest = { ...omittedValue, ...objectMapper(values, destinationObject) }; for (const key in dest) { if (Object.prototype.hasOwnProperty.call(dest, key)) { @@ -388,6 +394,23 @@ function getFields(props) { , fieldProps?.DateType?.col || 3 ), + item( + 'departureDateType', + 99, + + + , + fieldProps?.departureDateType?.col || 3 + ), item( 'years', 99, diff --git a/src/libs/ht.js b/src/libs/ht.js index f35659b..db592f5 100644 --- a/src/libs/ht.js +++ b/src/libs/ht.js @@ -103,6 +103,10 @@ export const dateTypes = [ { key: 'confirmDate', value: 'confirmDate', label: '确认日期' }, { key: 'startDate', value: 'startDate', label: '走团日期' }, ]; +export const departureDateTypes = [ + ...dateTypes, + { key: 'departureDate', value: 'departureDate', label: '抵达日期' }, +]; /** * 结果字段 diff --git a/src/stores/CustomerServices.js b/src/stores/CustomerServices.js index 141a7f4..26f18b8 100644 --- a/src/stores/CustomerServices.js +++ b/src/stores/CustomerServices.js @@ -3,7 +3,7 @@ import moment from "moment"; import { NavLink } from "react-router-dom"; import * as config from "../config"; import * as req from '../utils/request'; -import { prepareUrl } from '../utils/commons'; +import { groupBy, prepareUrl } from '../utils/commons'; class CustomerServices { @@ -13,7 +13,7 @@ class CustomerServices { this.endDate = moment().endOf('week').subtract(7, 'days'); this.startDateString = this.startDate.format(config.DATE_FORMAT); this.endDateString = this.endDate.format(config.DATE_FORMAT) + '%2023:59'; - this.dateType = 'startDate'; + this.dateType = 'departureDate'; this.inProgress = false; this.selectedAgent = ''; this.selectedTeam = ''; @@ -43,8 +43,8 @@ class CustomerServices { .append('DateType', this.dateType) .append('Date1', this.startDateString) .append('Date2', this.endDateString) - .append('OldDate1', this.startDateString) - .append('OldDate2', this.endDateString) + .append('OldDate1', this.startDateDiffString) + .append('OldDate2', this.endDateDiffString) .append('VEI_SN', this.selectedAgent) .append('DepList', this.selectedTeam) .append('Country', this.selectedCountry) @@ -53,8 +53,9 @@ class CustomerServices { .then(json => { if (json.errcode === 0) { runInAction(() => { - this.agentGroupList = json.result1; - const total1 = json.total1; + const splitTotalList = groupBy(json.result1, row => row.EOI_ObjSN === -1 ? '0' : '1'); + this.agentGroupList = splitTotalList['1']; + const total1 = splitTotalList['0']?.[0] || {}; // json.total1; this.agentGroupListColumns = [ { title: '地接社名称', @@ -293,8 +294,10 @@ class CustomerServices { .then(json => { if (json.errcode === 0) { runInAction(() => { - this.destinationGroupCount = json.result1; - const total1 = json.total1; + const splitTotalList = groupBy(json.result1, row => row.COLD_ServiceCity === -1 ? '0' : '1'); + this.agentGroupList = splitTotalList['1']; + const total1 = splitTotalList['0']?.[0] || {}; // json.total1; + this.destinationGroupCount = splitTotalList['1']; this.destinationGroupCountColumns = [ { title: '城市', @@ -342,7 +345,7 @@ class CustomerServices { dataIndex: 'TotalCost', sorter: (a, b) => a.TotalCost - b.TotalCost, children: [{ - title: total1.totalcost, + title: total1.TotalCost, dataIndex: 'TotalCost' } ] @@ -352,7 +355,7 @@ class CustomerServices { dataIndex: 'TotalPrice', sorter: (a, b) => a.TotalPrice - b.TotalPrice, children: [{ - title: total1.totalprice, + title: total1.TotalPrice, dataIndex: 'TotalPrice' } ] @@ -458,7 +461,7 @@ class CustomerServices { } searchValues = { - DateType: { key: 'startDate', label: '走团日期'}, + DateType: { key: 'departureDate', label: '抵达日期'}, }; setSearchValues(obj, values) { @@ -466,6 +469,8 @@ class CustomerServices { this.selectedAgent = obj.agency; this.startDateString = obj.Date1; this.endDateString = obj.Date2; + this.startDateDiffString = obj.DateDiff1; + this.endDateDiffString = obj.DateDiff2; this.selectedCountry = obj.countryArea; this.selectedTeam = obj.DepartmentList.replace('ALL', ''); this.selectedOrderStatus = obj.orderStatus; diff --git a/src/views/AgentGroupCount.jsx b/src/views/AgentGroupCount.jsx index c4e0dae..e391fba 100644 --- a/src/views/AgentGroupCount.jsx +++ b/src/views/AgentGroupCount.jsx @@ -28,12 +28,12 @@ const AgentGroupCount = () => { ...date_picker_store.formValues, ...customerServicesStore.searchValues, }, - shows: ['agency', 'DateType', 'DepartmentList', 'countryArea', 'dates'], + shows: ['agency', 'departureDateType', 'DepartmentList', 'countryArea', 'dates'], fieldProps: { DepartmentList: { show_all: true, mode: 'multiple' }, WebCode: { show_all: false, mode: 'multiple' }, dates: { hide_vs: true }, - DateType: { disabledKeys: ['applyDate'] }, + departureDateType: { disabledKeys: ['applyDate'] }, }, }} onSubmit={(_err, obj, form) => { diff --git a/src/views/DestinationGroupCount.jsx b/src/views/DestinationGroupCount.jsx index 401d6e4..790a0e1 100644 --- a/src/views/DestinationGroupCount.jsx +++ b/src/views/DestinationGroupCount.jsx @@ -25,13 +25,13 @@ const DestinationGroupCount = () => { countryArea: { key: 'china', label: '国内' }, ...customerServicesStore.searchValues, }, - shows: ['DateType', 'DepartmentList', 'countryArea', 'orderStatus', 'dates'], + shows: ['departureDateType', 'DepartmentList', 'countryArea', 'orderStatus', 'dates'], fieldProps: { DepartmentList: { show_all: true, mode: 'multiple' }, orderStatus: { show_all: true }, countryArea: { show_all: false }, dates: { hide_vs: true }, - DateType: { disabledKeys: ['applyDate'] }, + departureDateType: { disabledKeys: ['applyDate'] }, }, }} onSubmit={(_err, obj, form) => {