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

fix:处理订单重置和时间筛选异常

parent 886063cf
import React, { useState } from 'react'
import React, { useRef, useState } from 'react'
import { Card, Button, Modal } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -8,33 +8,75 @@ import { formatTimeString } from '@/utils'
import { ORDER_TYPE, PurchaseOrderOutWorkStateTexts, PurchaseOrderInsideWorkStateTexts } from '@/constants'
import StatusColors from './components/StatusColors'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { ISchema } from '@formily/antd'
import { createFormActions, 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'
import NiceForm from '@/components/NiceForm'
const formActions = createFormActions();
const tableListSchema: ISchema = {
type: 'object',
properties: {
// orderNo: {
// type: 'string',
// "x-component": 'SearchFilter',
// 'x-component-props': {
// placeholder: '请输入订单编号',
// align: 'flex-end',
// },
// },
// [FORM_FILTER_PATH]: {
// type: 'object',
// 'x-component': 'flex-layout',
// 'x-component-props': {
// inline: true,
// colStyle: {
// marginLeft: 20
// }
// },
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-end',
},
}
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20
}
marginLeft: 20,
},
},
properties: {
orderThe: {
type: 'string',
......@@ -67,7 +109,7 @@ const tableListSchema: ISchema = {
children: '查询',
},
},
},
},}}
},
}
}
......@@ -159,10 +201,6 @@ export const baseOrderListColumns: any[] = [
export interface SaleOrderProps { }
const fetchTableData = async (params) => {
// 格式化查询时间
params.startCreateTime = params.startCreateTime ? moment(params.startCreateTime).valueOf() : undefined
params.endCreateTime = params.endCreateTime ? moment(params.endCreateTime).valueOf() : undefined
const { data } = await PublicApi.getOrderPlatformOrderList(params)
return data
}
......@@ -171,46 +209,73 @@ const fetchTableData = async (params) => {
// 最后一步开始调试 TODO
const SaleOrder: React.FC<SaleOrderProps> = (props) => {
const ref = useRef<any>({})
const secondColumns: any[] = baseOrderListColumns.concat([
])
const controllerBtns = <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
return <Card>
<StandardTable
fetchTableData={params => fetchTableData(params)}
columns={secondColumns}
formilyLayouts={{
justify: 'space-between'
}}
formilyChilds={{
layouts: {
order: 2
},
children: <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
currentRef={ref}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
formilyProps={{
ctx: {
inline: false,
schema: tableListSchema,
effects: ($, actions) => {
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
FORM_FILTER_PATH,
);
},
components: {
DateRangePicker: DatePicker.RangePicker,
)
}}
schema={tableListSchema}
components={{
DateRangePickerUnix,
Submit
}
},
layouts: {
order: 3,
span: 16
}
}}
/>
}
// formilyLayouts={{
// justify: 'space-between'
// }}
// formilyChilds={{
// layouts: {
// order: 2
// },
// children: <Button style={{width: 140}} onClick={() => {}} type='default'>导出</Button>
// }}
// formilyProps={{
// ctx: {
// inline: false,
// schema: tableListSchema,
// effects: ($, actions) => {
// useStateFilterSearchLinkageEffect(
// $,
// actions,
// 'orderNo',
// FORM_FILTER_PATH,
// );
// },
// components: {
// DateRangePicker: DatePicker.RangePicker,
// DateRangePickerUnix,
// Submit
// }
// },
// layouts: {
// order: 3,
// span: 16
// }
// }}
/>
</Card>
}
......
import React from 'react'
import React, { useRef } from 'react'
import { Card } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -9,7 +9,10 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
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'
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
const formActions = createFormActions();
// 待确认支付结果订单
......@@ -22,6 +25,7 @@ const fetchTableData = async (params) => {
// TODO
const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
const ref = useRef<any>({})
const {
columns
} = useSelfTable()
......@@ -30,30 +34,52 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
<StandardTable
fetchTableData={params => fetchTableData(params)}
columns={columns}
rowKey={'orderNo'}
formilyLayouts={{
justify: 'space-between'
tableProps={{
rowKey: 'orderNo'
}}
formilyProps={{
ctx: {
inline: false,
schema: tableListSchema,
effects: ($, actions) => {
currentRef={ref}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'orderNo',
FORM_FILTER_PATH,
);
},
components: {
DateRangePicker: DatePicker.RangePicker,
)
}}
schema={tableListSchema}
components={{
DateRangePickerUnix,
Submit
}
}
}}
/>
}
// formilyLayouts={{
// justify: 'space-between'
// }}
// formilyProps={{
// ctx: {
// inline: false,
// schema: tableListSchema,
// effects: ($, actions) => {
// useStateFilterSearchLinkageEffect(
// $,
// actions,
// 'orderNo',
// FORM_FILTER_PATH,
// );
// },
// components: {
// DateRangePicker: DatePicker.RangePicker,
// DateRangePickerUnix,
// Submit
// }
// }
// }}
/>
</Card>
}
......
......@@ -7,23 +7,57 @@ import { FORM_FILTER_PATH } from '@/formSchema/const';
export const tableListSchema: ISchema = {
type: 'object',
properties: {
// orderNo: {
// type: 'string',
// "x-component": 'SearchFilter',
// 'x-component-props': {
// placeholder: '请输入订单编号',
// align: 'flex-start',
// },
// },
// [FORM_FILTER_PATH]: {
// type: 'object',
// 'x-component': 'flex-layout',
// 'x-component-props': {
// inline: true,
// colStyle: {
// marginRight: 20
// }
// },
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
orderNo: {
type: 'string',
"x-component": 'SearchFilter',
"x-component": 'Search',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-start',
align: 'flex-end',
},
}
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
inline: true,
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginRight: 20
}
marginLeft: 20,
},
},
properties: {
orderThe: {
type: 'string',
......@@ -50,7 +84,7 @@ export const tableListSchema: ISchema = {
children: '查询',
},
},
},
},}}
},
}
}
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