Commit eaad0500 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理订单列表高级筛选异常

parent 1c0bd081
import React, { useRef, useEffect, useMemo } from 'react'
import { DatePicker } from 'antd';
import moment from 'moment';
/**
* Unix时间戳格式的时间范围选择
*/
const { RangePicker } = DatePicker;
const DateRangePickerUnix = (props) => {
const { value, mutators } = props
const { placeholder, dataSource, ...rest } = props.props["x-component-props"] || {}
const handleChange = (dates, dateString) => {
if(dateString.length === 2) {
mutators.change([dateString[0] ? moment(dateString[0]).format('x') : null, dateString[1] ? moment(dateString[1]).format('x') : null]);
}
}
let v: any = []
if(value.length) {
let startTime = moment(Number(value[0])).format('YYYY-MM-DD HH:mm:ss')
let endTime = moment(Number(value[1])).format('YYYY-MM-DD HH:mm:ss')
v = [moment(startTime, 'YYYY-MM-DD HH:mm:ss'), moment(endTime, 'YYYY-MM-DD HH:mm:ss')]
}
return (
<RangePicker
showTime={true}
style={{minWidth: 160}}
placeholder={placeholder}
onChange={handleChange}
value={v}
{...rest}
/>
)
}
DateRangePickerUnix.defaultProps = {}
DateRangePickerUnix.isFieldComponent = true;
export default DateRangePickerUnix
......@@ -23,6 +23,7 @@ import SearchSelect from './components/SearchSelect';
import TableTagList from './components/TableTagList';
import { Checkbox } from '@formily/antd-components';
import DateSelect from './components/DateSelect';
import DateRangePickerUnix from './components/DateRangePickerUnix';
import SmilingFace from './components/SmilingFace';
import './index.less'
......@@ -90,8 +91,9 @@ export const componentExport = {
SearchSelect,
DateRangePicker: DatePicker.RangePicker,
TableTagList,
DateSelect,
SmilingFace,
DateSelect,
DateRangePickerUnix,
SmilingFace,
}
const NiceForm: React.FC<NiceFormProps> = props => {
const { children, components, ...reset } = props;
......
......@@ -12,6 +12,7 @@ import { ISchema } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { DatePicker } from '@formily/antd-components'
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import moment from 'moment'
const tableListSchema: ISchema = {
......@@ -44,18 +45,18 @@ const tableListSchema: ISchema = {
"supplyMembersName": {
type: 'string',
"x-component-props": {
placeholder: '请输入采购会员名称'
placeholder: '请输入供应会员名称'
}
},
"memberName": {
type: 'string',
"x-component-props": {
placeholder: '请输入供应会员名称'
placeholder: '请输入采购会员名称'
}
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'daterangepicker',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
......@@ -200,6 +201,7 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
},
components: {
DateRangePicker: DatePicker.RangePicker,
DateRangePickerUnix,
Submit
}
},
......
......@@ -8,6 +8,7 @@ import { tableListSchema } from './schema'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import Submit from '@/components/NiceForm/components/Submit'
import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePickerUnix'
import { DatePicker } from '@formily/antd-components'
// 待确认支付结果订单
......@@ -47,6 +48,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
},
components: {
DateRangePicker: DatePicker.RangePicker,
DateRangePickerUnix,
Submit
}
}
......
......@@ -103,7 +103,7 @@ export const useSelfTable = () => {
width: 200
},
{ title: '已支付', align: 'center', dataIndex: 'alreadyPay', key: 'alreadyPay' },
{ title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => text },
{ title: '当前支付', align: 'center', dataIndex: 'currentPayments', render: (text, record) => `${text} / ${record.sum} 次` },
{
title: '订单类型',
align: 'center',
......
......@@ -39,7 +39,7 @@ export const tableListSchema: ISchema = {
},
"[startCreateTime,endCreateTime]": {
type: 'array',
"x-component": 'daterangepicker',
"x-component": 'DateRangePickerUnix',
'x-component-props': {
placeholder: ['开始时间','结束时间'],
},
......@@ -53,4 +53,4 @@ export const tableListSchema: ISchema = {
},
},
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment