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