perf: 客服: 增加按抵达日期统计; 汇总按整团统计

main
Lei OT 4 months ago
parent 04431635b5
commit ac11babdab

@ -15,6 +15,7 @@ import DatePickerCharts from './DatePickerCharts';
import YearPickerCharts from './YearPickerCharts'; import YearPickerCharts from './YearPickerCharts';
import SearchInput from './Input'; import SearchInput from './Input';
import { objectMapper, at, empty, isEmpty } from './../../utils/commons'; import { objectMapper, at, empty, isEmpty } from './../../utils/commons';
import { departureDateTypes } from './../../libs/ht';
import './search.css'; import './search.css';
@ -52,6 +53,11 @@ export default observer((props) => {
transform: (value) => value?.key || '', transform: (value) => value?.key || '',
default: '', default: '',
}, },
'departureDateType': {
key: 'DateType',
transform: (value) => value?.key || '',
default: '',
},
'HTBusinessUnits': { 'HTBusinessUnits': {
key: 'HTBusinessUnits', key: 'HTBusinessUnits',
transform: (value) => { transform: (value) => {
@ -176,7 +182,7 @@ export default observer((props) => {
}, },
}; };
let dest = {}; 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) }; dest = { ...omittedValue, ...objectMapper(values, destinationObject) };
for (const key in dest) { for (const key in dest) {
if (Object.prototype.hasOwnProperty.call(dest, key)) { if (Object.prototype.hasOwnProperty.call(dest, key)) {
@ -388,6 +394,23 @@ function getFields(props) {
</Form.Item>, </Form.Item>,
fieldProps?.DateType?.col || 3 fieldProps?.DateType?.col || 3
), ),
item(
'departureDateType',
99,
<Form.Item name={`departureDateType`} initialValue={at(props, 'initialValue.departureDateType')[0] || { key: 'departureDate', label: '抵达日期' }}>
<Select labelInValue={true}
style={{ width: '100%' }}
placeholder="选择日期类型"
>
{departureDateTypes.map((ele) => (
<Select.Option key={ele.key} value={ele.key} disabled={fieldProps?.departureDateType?.disabledKeys.includes(ele.key)}>
{ele.label}
</Select.Option>
))}
</Select>
</Form.Item>,
fieldProps?.departureDateType?.col || 3
),
item( item(
'years', 'years',
99, 99,

@ -103,6 +103,10 @@ export const dateTypes = [
{ key: 'confirmDate', value: 'confirmDate', label: '确认日期' }, { key: 'confirmDate', value: 'confirmDate', label: '确认日期' },
{ key: 'startDate', value: 'startDate', label: '走团日期' }, { key: 'startDate', value: 'startDate', label: '走团日期' },
]; ];
export const departureDateTypes = [
...dateTypes,
{ key: 'departureDate', value: 'departureDate', label: '抵达日期' },
];
/** /**
* 结果字段 * 结果字段

@ -3,7 +3,7 @@ import moment from "moment";
import { NavLink } from "react-router-dom"; import { NavLink } from "react-router-dom";
import * as config from "../config"; import * as config from "../config";
import * as req from '../utils/request'; import * as req from '../utils/request';
import { prepareUrl } from '../utils/commons'; import { groupBy, prepareUrl } from '../utils/commons';
class CustomerServices { class CustomerServices {
@ -13,7 +13,7 @@ class CustomerServices {
this.endDate = moment().endOf('week').subtract(7, 'days'); this.endDate = moment().endOf('week').subtract(7, 'days');
this.startDateString = this.startDate.format(config.DATE_FORMAT); this.startDateString = this.startDate.format(config.DATE_FORMAT);
this.endDateString = this.endDate.format(config.DATE_FORMAT) + '%2023:59'; this.endDateString = this.endDate.format(config.DATE_FORMAT) + '%2023:59';
this.dateType = 'startDate'; this.dateType = 'departureDate';
this.inProgress = false; this.inProgress = false;
this.selectedAgent = ''; this.selectedAgent = '';
this.selectedTeam = ''; this.selectedTeam = '';
@ -43,8 +43,8 @@ class CustomerServices {
.append('DateType', this.dateType) .append('DateType', this.dateType)
.append('Date1', this.startDateString) .append('Date1', this.startDateString)
.append('Date2', this.endDateString) .append('Date2', this.endDateString)
.append('OldDate1', this.startDateString) .append('OldDate1', this.startDateDiffString)
.append('OldDate2', this.endDateString) .append('OldDate2', this.endDateDiffString)
.append('VEI_SN', this.selectedAgent) .append('VEI_SN', this.selectedAgent)
.append('DepList', this.selectedTeam) .append('DepList', this.selectedTeam)
.append('Country', this.selectedCountry) .append('Country', this.selectedCountry)
@ -53,8 +53,9 @@ class CustomerServices {
.then(json => { .then(json => {
if (json.errcode === 0) { if (json.errcode === 0) {
runInAction(() => { runInAction(() => {
this.agentGroupList = json.result1; const splitTotalList = groupBy(json.result1, row => row.EOI_ObjSN === -1 ? '0' : '1');
const total1 = json.total1; this.agentGroupList = splitTotalList['1'];
const total1 = splitTotalList['0']?.[0] || {}; // json.total1;
this.agentGroupListColumns = [ this.agentGroupListColumns = [
{ {
title: '地接社名称', title: '地接社名称',
@ -293,8 +294,10 @@ class CustomerServices {
.then(json => { .then(json => {
if (json.errcode === 0) { if (json.errcode === 0) {
runInAction(() => { runInAction(() => {
this.destinationGroupCount = json.result1; const splitTotalList = groupBy(json.result1, row => row.COLD_ServiceCity === -1 ? '0' : '1');
const total1 = json.total1; this.agentGroupList = splitTotalList['1'];
const total1 = splitTotalList['0']?.[0] || {}; // json.total1;
this.destinationGroupCount = splitTotalList['1'];
this.destinationGroupCountColumns = [ this.destinationGroupCountColumns = [
{ {
title: '城市', title: '城市',
@ -342,7 +345,7 @@ class CustomerServices {
dataIndex: 'TotalCost', dataIndex: 'TotalCost',
sorter: (a, b) => a.TotalCost - b.TotalCost, sorter: (a, b) => a.TotalCost - b.TotalCost,
children: [{ children: [{
title: total1.totalcost, title: total1.TotalCost,
dataIndex: 'TotalCost' dataIndex: 'TotalCost'
} }
] ]
@ -352,7 +355,7 @@ class CustomerServices {
dataIndex: 'TotalPrice', dataIndex: 'TotalPrice',
sorter: (a, b) => a.TotalPrice - b.TotalPrice, sorter: (a, b) => a.TotalPrice - b.TotalPrice,
children: [{ children: [{
title: total1.totalprice, title: total1.TotalPrice,
dataIndex: 'TotalPrice' dataIndex: 'TotalPrice'
} }
] ]
@ -458,7 +461,7 @@ class CustomerServices {
} }
searchValues = { searchValues = {
DateType: { key: 'startDate', label: '走团日期'}, DateType: { key: 'departureDate', label: '抵达日期'},
}; };
setSearchValues(obj, values) { setSearchValues(obj, values) {
@ -466,6 +469,8 @@ class CustomerServices {
this.selectedAgent = obj.agency; this.selectedAgent = obj.agency;
this.startDateString = obj.Date1; this.startDateString = obj.Date1;
this.endDateString = obj.Date2; this.endDateString = obj.Date2;
this.startDateDiffString = obj.DateDiff1;
this.endDateDiffString = obj.DateDiff2;
this.selectedCountry = obj.countryArea; this.selectedCountry = obj.countryArea;
this.selectedTeam = obj.DepartmentList.replace('ALL', ''); this.selectedTeam = obj.DepartmentList.replace('ALL', '');
this.selectedOrderStatus = obj.orderStatus; this.selectedOrderStatus = obj.orderStatus;

@ -28,12 +28,12 @@ const AgentGroupCount = () => {
...date_picker_store.formValues, ...date_picker_store.formValues,
...customerServicesStore.searchValues, ...customerServicesStore.searchValues,
}, },
shows: ['agency', 'DateType', 'DepartmentList', 'countryArea', 'dates'], shows: ['agency', 'departureDateType', 'DepartmentList', 'countryArea', 'dates'],
fieldProps: { fieldProps: {
DepartmentList: { show_all: true, mode: 'multiple' }, DepartmentList: { show_all: true, mode: 'multiple' },
WebCode: { show_all: false, mode: 'multiple' }, WebCode: { show_all: false, mode: 'multiple' },
dates: { hide_vs: true }, dates: { hide_vs: true },
DateType: { disabledKeys: ['applyDate'] }, departureDateType: { disabledKeys: ['applyDate'] },
}, },
}} }}
onSubmit={(_err, obj, form) => { onSubmit={(_err, obj, form) => {

@ -25,13 +25,13 @@ const DestinationGroupCount = () => {
countryArea: { key: 'china', label: '国内' }, countryArea: { key: 'china', label: '国内' },
...customerServicesStore.searchValues, ...customerServicesStore.searchValues,
}, },
shows: ['DateType', 'DepartmentList', 'countryArea', 'orderStatus', 'dates'], shows: ['departureDateType', 'DepartmentList', 'countryArea', 'orderStatus', 'dates'],
fieldProps: { fieldProps: {
DepartmentList: { show_all: true, mode: 'multiple' }, DepartmentList: { show_all: true, mode: 'multiple' },
orderStatus: { show_all: true }, orderStatus: { show_all: true },
countryArea: { show_all: false }, countryArea: { show_all: false },
dates: { hide_vs: true }, dates: { hide_vs: true },
DateType: { disabledKeys: ['applyDate'] }, departureDateType: { disabledKeys: ['applyDate'] },
}, },
}} }}
onSubmit={(_err, obj, form) => { onSubmit={(_err, obj, form) => {

Loading…
Cancel
Save