Commit f6fb6bec authored by GuanHua's avatar GuanHua
parents 0bb4e16d 34a66518
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-29 09:36:25
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-15 18:12:20
* @LastEditTime: 2021-12-01 09:57:24
* @Description: 发券明细
*/
import React, { useState, useMemo } from 'react';
......@@ -205,7 +205,7 @@ const DeliverCoupon: React.FC<IProps> = (props) => {
},
{
title: '适用用户',
dataIndex: 'memberAgeTypeName',
dataIndex: 'suitableMemberTypeName',
},
{
title: '会员类型',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-28 18:06:53
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-12 14:25:22
* @LastEditTime: 2021-11-30 19:46:56
* @Description: 执行明细
*/
import React, { useRef, } from 'react';
......@@ -178,19 +178,22 @@ const RunningInfo: React.FC<IProps> = (props) => {
},
{
title: '适用用户',
dataIndex: 'bransuitableMemberTypeNamed',
dataIndex: 'suitableMemberTypeName',
},
{
title: '领(发)放劵时间',
dataIndex: 'createTimeStart',
dataIndex: 'createTime',
render: (text) => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '',
},
{
title: '劵有效期起始时间',
dataIndex: 'effectiveTimeStart',
dataIndex: 'validTimeStart',
render: (text) => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '',
},
{
title: '券有效期截止时间',
dataIndex: 'effectiveTimeEnd',
dataIndex: 'validTimeEnd',
render: (text) => text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '',
},
{
title: '关联订单',
......@@ -207,7 +210,7 @@ const RunningInfo: React.FC<IProps> = (props) => {
{
title: '订单金额',
dataIndex: 'amount',
render: (text) => ${text || ''}`,
render: (text) => ${text || '0'}`,
},
{
title: '订单状态',
......
......@@ -40,7 +40,7 @@ const schema: ISchema = {
},
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) {
if ((type === 'start' || type || 'end') && moment().isSame(current, 'day')) {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:04:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-12 15:22:51
* @LastEditTime: 2021-11-30 20:08:50
* @Description:
*/
import { FormEffectHooks, FormPath, IFormActions } from '@formily/antd';
......@@ -260,17 +260,17 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
// 领(发)券起始时间
onFieldValueChange$('[releaseTimeStart, releaseTimeEnd]').subscribe(state => {
const { value } = state;
const releaseTimeStartValue = value?.[0];
const releaseTimeEndValue = value?.[1];
const effectiveTime = getFieldValue('[effectiveTimeStart, effectiveTimeEnd]'); // 券有效期
const effectiveTimeStartValue = effectiveTime?.[0];
if (
releaseTimeStartValue
releaseTimeEndValue
&& effectiveTimeStartValue
&& moment(releaseTimeStartValue) > moment(effectiveTimeStartValue)
&& moment(releaseTimeEndValue) > moment(effectiveTimeStartValue)
) {
setFieldState('[releaseTimeStart, releaseTimeEnd]', fieldState => {
FormPath.setIn(fieldState, 'errors', '领(发)券起始时间应该小于券有效期起始时间');
FormPath.setIn(fieldState, 'errors', '领(发)券截止时间应该小于券有效期起始时间');
});
} else {
actions.clearErrors('[releaseTimeStart, releaseTimeEnd]');
......@@ -282,15 +282,15 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
const { value } = state;
const effectiveTimeStartValue = value?.[0];
const releaseTime = getFieldValue('[releaseTimeStart, releaseTimeEnd]'); // 券有效期
const releaseTimeStartValue = releaseTime?.[0];
const releaseTimeEndValue = releaseTime?.[1];
if (
effectiveTimeStartValue
&& releaseTimeStartValue
&& moment(effectiveTimeStartValue) < moment(releaseTimeStartValue)
&& releaseTimeEndValue
&& moment(effectiveTimeStartValue) < moment(releaseTimeEndValue)
) {
setFieldState('[effectiveTimeStart, effectiveTimeEnd]', fieldState => {
FormPath.setIn(fieldState, 'errors', '券有效期起始时间应该大于等于领(发)券起始时间');
FormPath.setIn(fieldState, 'errors', '券有效期起始时间应该大于等于领(发)券截止时间');
});
} else {
actions.clearErrors('[effectiveTimeStart, effectiveTimeEnd]');
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:05:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-11-15 14:22:39
* @LastEditTime: 2021-11-30 20:14:44
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -106,7 +106,7 @@ const schema: ISchema = {
showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) {
if ((type === 'start' || type || 'end') && moment().isSame(current, 'day')) {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......@@ -303,7 +303,7 @@ const schema: ISchema = {
showTime: true,
disabledDate: (current) => current && current < moment().startOf('day'),
disabledTime: (current, type) => {
if (type === 'start' && moment().isSame(current, 'day')) {
if ((type === 'start' || type || 'end') && moment().isSame(current, 'day')) {
return {
disabledHours: () => range(0, 24).splice(0, moment().get('hour')),
disabledMinutes: () => range(0, 60).splice(0, moment().get('minute')),
......
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