perf(搜索组件): 补充字段

feature/2.0-sales-trade
Lei OT 2 years ago
parent 11e0684edf
commit 87cd4f6caa

@ -1,8 +1,8 @@
import { createContext, useContext } from 'react';
import { toJS } from "mobx";
import { toJS } from 'mobx';
import { observer } from 'mobx-react';
import { DATE_FORMAT, stores_Context } from './../../config';
import { SearchOutlined, } from "@ant-design/icons";
import { SearchOutlined } from '@ant-design/icons';
import { Form, Row, Col, Select, Button, Space, DatePicker } from 'antd';
import moment from 'moment';
// import locale from 'antd/es/date-picker/locale/zh_CN';
@ -52,6 +52,13 @@ export default observer((props) => {
transform: (value) => value?.key || '',
default: '',
},
'HTBusinessUnits': {
key: 'HTBusinessUnits',
transform: (value) => {
return Array.isArray(value) ? value.map((ele) => ele.key).join(',') : value ? (!isNaN(parseInt(value.key), 10) ? value.key : '') : '-1';
},
default: '',
},
'businessUnits': {
key: 'businessUnits',
transform: (value) => {
@ -69,7 +76,7 @@ export default observer((props) => {
'WebCode': {
key: 'WebCode',
transform: (value) => {
return Array.isArray(value) ? value.map((ele) => ele.key).join(',') : value ? (value.key) : 'ALL';
return Array.isArray(value) ? value.map((ele) => ele.key).join(',') : value ? value.key : 'ALL';
},
default: '',
},
@ -131,6 +138,11 @@ export default observer((props) => {
default: '',
},
],
'country': {
key: 'country',
transform: (value) => value?.key || '',
default: '',
},
};
let dest = {};
const { applyDate, applyDate2, year, yearDiff, ...omittedValue } = values;
@ -169,7 +181,7 @@ export default observer((props) => {
<Row gutter={10} style={{ background: '#f9fafa', margin: '0px 0px 10px 0px', padding: '16px 8px' }}>
{getFields({ sort, initialValue, hides, shows, fieldProps, form })}
{/* 'textAlign': 'right' */}
<Col flex="1 0 120px" style={{ padding: '0px 5px', }}>
<Col flex="1 0 120px" style={{ padding: '0px 5px' }}>
<Space align="center">
<Button size={'middle'} type="primary" icon={<SearchOutlined />} htmlType="submit">
{confirmText || '统计'}
@ -261,31 +273,6 @@ function getFields(props) {
</Form.Item>,
2
),
// item(
// 'applyDate',
// 99,
// <Form.Item
// name={`applyDate`}
// initialValue={[moment('2015/01/01', DATE_FORMAT), moment('2015/01/01', DATE_FORMAT)]}
// // initialValue={at(props, 'initialValue.applyDate')[0] || undefined}
// >
// <RangePicker ranges={quickRange} format={DATE_FORMAT} style={{ width: '100%' }} locale={locale} />
// </Form.Item>,
// midCol
// ),
// item(
// 'applyDate2',
// 99,
// <Form.Item>
// <Form.Item name={`applyDate1`} noStyle>
// <RangePicker ranges={quickRange} format={DATE_FORMAT} style={{ width: '100%' }} locale={locale} />
// </Form.Item>
// <Form.Item name={`applyDate2`} noStyle>
// <RangePicker ranges={quickRange} format={DATE_FORMAT} style={{ width: '100%' }} locale={locale} />
// </Form.Item>
// </Form.Item>,
// 12
// ),
item(
'dates',
99,

@ -7,6 +7,9 @@ export const biz = [
{ key: '2', label: '国际事业部', code: '' },
{ key: '4', label: '孵化学院', code: '' },
];
/**
* HT 事业部
*/
export const bu = [
{ key: '91001', value: '91001', label: 'CH事业部' },
{ key: '91002', value: '91002', label: '商旅事业部' },
@ -18,6 +21,15 @@ export const bu = [
{ key: '91010', value: '91010', label: '花梨鹰' },
{ key: '91012', value: '91012', label: '西语组' },
];
/**
* HT 销售小组
*/
export const deptUnits = [
{ key: '43001', value: '43001', label: '英文A组(骆梅玉)' },
{ key: '43002', value: '43002', label: '英文B组(王健)' },
{ key: '43003', value: '43003', label: '目的地组(杨新玲)' },
{ key: '43005', value: '43005', label: '其他' },
];
/**
* 小组
*/
@ -48,33 +60,33 @@ export const groupsMappedByCode = groups.reduce((a, c) => ({ ...a, [String(c.cod
* 来源
*/
export const sites = [
{ key: '2', label: 'CHT', code: 'CHT' },
{ key: '8', label: 'AH', code: 'AH' },
{ key: '163', label: 'GH', code: 'GH' },
{ key: '28', label: '客运中国', code: 'GHKYZG' },
{ key: '7', label: '客运海外', code: 'GHKYHW' },
{ key: '172', label: 'GH TO B业务', code: 'GHTOB' },
{ key: '11,12,20,21,10,18', label: '国际(入境)', code: 'JP,VAC,IT,GM,RU,VC' },
{ key: '122,200,211,100,188', label: '国际(海外)', code: 'VACHW,ITHW,GMHW,RUHW,VCHW' },
{ key: '11', label: '日语', code: 'JP' },
{ key: '12', label: '西语', code: 'VAC' },
{ key: '122', label: '西语海外', code: 'VACHW' },
{ key: '20', label: '意大利', code: 'IT' },
{ key: '200', label: '意大利海外', code: 'ITHW' },
{ key: '21', label: '德语', code: 'GM' },
{ key: '211', label: '德语海外', code: 'GMHW' },
{ key: '10', label: '俄语', code: 'RU' },
{ key: '100', label: '俄语海外', code: 'RUHW' },
{ key: '18', label: '法语', code: 'VC' },
{ key: '188', label: '法语海外', code: 'VCHW' },
{ key: '16', label: 'CT', code: 'CT' },
{ key: '30', label: 'TP', code: 'trippest' },
{ key: '31', label: '花梨鹰', code: 'HLY' },
{ value: '2', key: '2', label: 'CHT', code: 'CHT' },
{ value: '8', key: '8', label: 'AH', code: 'AH' },
{ value: '163', key: '163', label: 'GH', code: 'GH' },
{ value: '28', key: '28', label: '客运中国', code: 'GHKYZG' },
{ value: '7', key: '7', label: '客运海外', code: 'GHKYHW' },
{ value: '172', key: '172', label: 'GH TO B业务', code: 'GHTOB' },
{ value: '11,12,20,21,10,18', key: '11,12,20,21,10,18', label: '国际(入境)', code: 'JP,VAC,IT,GM,RU,VC' },
{ value: '122,200,211,100,188', key: '122,200,211,100,188', label: '国际(海外)', code: 'VACHW,ITHW,GMHW,RUHW,VCHW' },
{ value: '11', key: '11', label: '日语', code: 'JP' },
{ value: '12', key: '12', label: '西语', code: 'VAC' },
{ value: '122', key: '122', label: '西语海外', code: 'VACHW' },
{ value: '20', key: '20', label: '意大利', code: 'IT' },
{ value: '200', key: '200', label: '意大利海外', code: 'ITHW' },
{ value: '21', key: '21', label: '德语', code: 'GM' },
{ value: '211', key: '211', label: '德语海外', code: 'GMHW' },
{ value: '10', key: '10', label: '俄语', code: 'RU' },
{ value: '100', key: '100', label: '俄语海外', code: 'RUHW' },
{ value: '18', key: '18', label: '法语', code: 'VC' },
{ value: '188', key: '188', label: '法语海外', code: 'VCHW' },
{ value: '16', key: '16', label: 'CT', code: 'CT' },
{ value: '30', key: '30', label: 'TP', code: 'trippest' },
{ value: '31', key: '31', label: '花梨鹰', code: 'HLY' },
];
export const dateTypes = [
{ key: 'applyDate', label: '提交日期' },
{ key: 'ConfirmDate', label: '确认日期' },
{ key: 'startDate', label: '走团日期' },
{ key: 'applyDate', value: 'applyDate', label: '提交日期' },
{ key: 'ConfirmDate', value: 'ConfirmDate', label: '确认日期' },
{ key: 'startDate', value: 'startDate', label: '走团日期' },
];
/**
@ -105,9 +117,9 @@ export const dataFieldAlias = dataFieldOptions.reduce(
*/
export const KPIObjects = [
{ key: 'overview', value: 'overview', label: '海纳' },
{ key: 'bu', value: 'bu', label: '事业部' },
{ key: 'dept', value: 'dept', label: '小组' },
{ key: 'du', value: 'du', label: '销售小组' },
{ key: 'bu', value: 'bu', label: '事业部', data: bu },
{ key: 'dept', value: 'dept', label: '小组', data: groups },
{ key: 'du', value: 'du', label: '销售小组', data: deptUnits },
{ key: 'operator', value: 'operator', label: '顾问' },
{ key: 'destination', value: 'destination', label: '目的地' },
{ key: 'country', value: 'country', label: '国籍' },

Loading…
Cancel
Save