Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-admin
Commits
4fede455
Commit
4fede455
authored
Dec 03, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of
http://10.0.0.22:3000/lingxi/lingxi-business-system
into v2
parents
6df65374
74b32fdb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
useBusinessEffects.ts
...itted/components/CouponForm/effects/useBusinessEffects.ts
+9
-9
No files found.
src/pages/marketingManage/platformCoupon/platformCouponUnsubmitted/components/CouponForm/effects/useBusinessEffects.ts
View file @
4fede455
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:04:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-1
1-30 20:08:50
* @LastEditTime: 2021-1
2-03 15:08:15
* @Description:
*/
import
{
FormEffectHooks
,
FormPath
,
IFormActions
}
from
'@formily/antd'
;
...
...
@@ -262,15 +262,15 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
const
{
value
}
=
state
;
const
releaseTimeEndValue
=
value
?.[
1
];
const
effectiveTime
=
getFieldValue
(
'[effectiveTimeStart, effectiveTimeEnd]'
);
// 券有效期
const
effectiveTime
StartValue
=
effectiveTime
?.[
0
];
const
effectiveTime
EndValue
=
effectiveTime
?.[
1
];
if
(
releaseTimeEndValue
&&
effectiveTime
Start
Value
&&
moment
(
releaseTimeEndValue
)
>
moment
(
effectiveTimeStart
Value
)
&&
effectiveTime
End
Value
&&
moment
(
releaseTimeEndValue
)
>
=
moment
(
effectiveTimeEnd
Value
)
)
{
setFieldState
(
'[releaseTimeStart, releaseTimeEnd]'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'errors'
,
'领(发)券截止时间应该小于券有效期
起始
时间'
);
FormPath
.
setIn
(
fieldState
,
'errors'
,
'领(发)券截止时间应该小于券有效期
截止
时间'
);
});
}
else
{
actions
.
clearErrors
(
'[releaseTimeStart, releaseTimeEnd]'
);
...
...
@@ -280,17 +280,17 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
// 券有效期始时间
onFieldValueChange$
(
'[effectiveTimeStart, effectiveTimeEnd]'
).
subscribe
(
state
=>
{
const
{
value
}
=
state
;
const
effectiveTime
StartValue
=
value
?.[
0
];
const
effectiveTime
EndValue
=
value
?.[
1
];
const
releaseTime
=
getFieldValue
(
'[releaseTimeStart, releaseTimeEnd]'
);
// 券有效期
const
releaseTimeEndValue
=
releaseTime
?.[
1
];
if
(
effectiveTime
Start
Value
effectiveTime
End
Value
&&
releaseTimeEndValue
&&
moment
(
effectiveTime
StartValue
)
<
moment
(
releaseTimeEndValue
)
&&
moment
(
effectiveTime
EndValue
)
<=
moment
(
releaseTimeEndValue
)
)
{
setFieldState
(
'[effectiveTimeStart, effectiveTimeEnd]'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'errors'
,
'券有效期
起始时间应该大于等
于领(发)券截止时间'
);
FormPath
.
setIn
(
fieldState
,
'errors'
,
'券有效期
截止时间应该大
于领(发)券截止时间'
);
});
}
else
{
actions
.
clearErrors
(
'[effectiveTimeStart, effectiveTimeEnd]'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment