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

fix: 添加交易规则自动取消订单时间

parent 9ecddb23
import React, {useEffect, useRef, useState} from 'react'
import React, {useEffect, useState} from 'react'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import { useInitValue } from '@/formSchema/effects/useInitValue'
import EyePreview from '@/components/EyePreview'
import { findItemAndDelete } from '@/utils'
import { ISchemaFormActions, ISchema, FormEffectHooks, createAsyncFormActions } from '@formily/antd'
import { ISchemaFormActions, ISchema, FormEffectHooks } from '@formily/antd'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { createAddContractTemplateEffect, useUnitPreview } from '../effects'
import { createAddContractTemplateEffect } from '../effects'
import { PublicApi } from '@/services/api'
import {
PlusOutlined,
LinkOutlined,
PlusOutlined, QuestionCircleOutlined,
} from '@ant-design/icons'
import { Button, message } from 'antd'
import { Button, message, Tooltip } from 'antd'
import NiceForm from '@/components/NiceForm'
import ModalTable from '@/components/ModalTable'
import { GlobalConfig } from '@/global/config'
......@@ -256,6 +254,11 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
addSchemaAction.setFieldValue('isElectronicContract', data.isElectronicContract ? true : false)
addSchemaAction.setFieldValue('transactionProcesssId', data.transactionProcesssId)
addSchemaAction.setFieldValue('isTacitlyApprove', data.isTacitlyApprove)
if(data.type === 1) {
addSchemaAction.setFieldState('time', state => {
state.visible = true
})
}
setInitialValue(data)
}
if(id != '') {
......@@ -288,6 +291,13 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
})
}
const help = (text: string, desc: string) => (<>
{text}&nbsp;
<Tooltip title={desc}>
<QuestionCircleOutlined />
</Tooltip>
</>)
return (
<>
<NiceForm
......@@ -298,7 +308,8 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
tableColumns,
tableAddButton,
paginationChange,
productsLength
productsLength,
help
}}
components={{
SelectProcesss,
......@@ -325,10 +336,16 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = false
})
setFieldState("time", state => {
state.visible = false
})
} else {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = true
})
setFieldState("time", state => {
state.visible = true
})
}
})
}}
......
......@@ -74,6 +74,22 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
// fetchSearch: PublicApi.getOrderTradingRulesTransactionProcessList,
// },
},
"time": {
type: 'string',
title: "{{help('订单取消时间', '单后超过多少小时未支付后自动取消订单')}}",
"x-component-props": {
placeholder: "请填写订单取消时间",
style: { width: '100%' },
suffix: '小时'
},
visible: false,
'x-rules': [
{
pattern: /^\d+(\.\d{1})?$/,
message: '数值仅限一位小数',
}
],
},
MEGA_LAYOUT1_1: {
type: 'object',
'x-component': 'mega-layout',
......
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