Commit 0925d17e authored by Bill's avatar Bill
parents f9e8ebc0 8f85bf8e
......@@ -11,12 +11,12 @@ import { DeleteOutlined, SaveOutlined } from '@ant-design/icons';
import { createFormActions, FormEffectHooks } from '@formily/antd';
import { Radio, DatePicker, ArrayTable } from '@formily/antd-components';
import { history, Prompt } from 'umi';
import moment from 'moment';
import moment, { Moment } from 'moment';
import {
MERCHANT_COUPON_TYPE_VOUCHER,
} from '@/constants/const/marketing';
import AnchorPage from '@/components/AnchorPage';
import { getMarketingCouponPlatformWaitAuditGet, postMarketingCouponPlatformWaitAuditAdd } from '@/services/MarketingV2Api';
import { getMarketingCouponPlatformWaitAuditGet, postMarketingCouponPlatformWaitAuditAdd, postMarketingCouponPlatformWaitAuditUpdate } from '@/services/MarketingV2Api';
import NiceForm from '@/components/NiceForm';
import FormilyRangeTime from '@/components/RangeTime/FormilyRangeTime';
import schema from './schema';
......@@ -57,11 +57,11 @@ export type SubmitValueType = {
/**
* 领(发)劵起始时间
*/
releaseTimeStart: string,
releaseTimeStart: Moment,
/**
* 领(发)劵结束时间
*/
releaseTimeEnd: string,
releaseTimeEnd: Moment,
/**
* 领券方式
*/
......@@ -86,11 +86,11 @@ export type SubmitValueType = {
/**
* 劵有效期起始时间
*/
effectiveTimeStart: string,
effectiveTimeStart: Moment | null,
/**
* 劵有效期结束时间
*/
effectiveTimeEnd: string,
effectiveTimeEnd: Moment | null,
/**
* 自领取后多少天内失效
*/
......@@ -192,10 +192,10 @@ const CouponForm: React.FC<IProps> = (props) => {
suitableMallTypes: suitableMallTypes?.map((item) => item.id),
denomination: `${denomination}`,
quantity: `${quantity}`,
releaseTimeStart: releaseTimeStart ? moment(releaseTimeStart).format('YYYY-MM-DD HH:mm:ss') : '',
releaseTimeEnd: releaseTimeEnd ? moment(releaseTimeEnd).format('YYYY-MM-DD HH:mm:ss') : '',
effectiveTimeStart: effectiveTimeStart ? moment(effectiveTimeStart).format('YYYY-MM-DD HH:mm:ss') : '',
effectiveTimeEnd: effectiveTimeEnd ? moment(effectiveTimeEnd).format('YYYY-MM-DD HH:mm:ss') : '',
releaseTimeStart: moment(releaseTimeStart),
releaseTimeEnd: moment(releaseTimeEnd),
effectiveTimeStart: effectiveTimeStart ? moment(effectiveTimeStart) : null,
effectiveTimeEnd: effectiveTimeEnd ? moment(effectiveTimeEnd) : null,
invalidDay: invalidDay !== null ? `${invalidDay}` : undefined,
useConditionMoney: `${useConditionMoney}`,
receiveCondition: {
......@@ -289,10 +289,10 @@ const CouponForm: React.FC<IProps> = (props) => {
quantity: +quantity,
invalidDay: +(invalidDay as string),
denomination: +denomination,
releaseTimeStart: moment(releaseTimeStart).valueOf(),
releaseTimeEnd: moment(releaseTimeEnd).valueOf(),
effectiveTimeStart: effectiveTimeStart ? moment(effectiveTimeStart).valueOf() : undefined,
effectiveTimeEnd: effectiveTimeEnd ? moment(effectiveTimeEnd).valueOf() : undefined,
releaseTimeStart: releaseTimeStart.valueOf(),
releaseTimeEnd: releaseTimeEnd.valueOf(),
effectiveTimeStart: effectiveTimeStart ? effectiveTimeStart.valueOf() : undefined,
effectiveTimeEnd: effectiveTimeEnd ? effectiveTimeEnd.valueOf() : undefined,
suitableMemberLevelTypes: applicationMemberLevel,
suitableCommoditySkuList,
...restValue,
......
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