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
shenshaokai
jinfa-admin
Commits
53816a4d
Commit
53816a4d
authored
Sep 30, 2021
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2' of 10.0.0.22:lingxi/lingxi-business-system into v2
parents
6d9252e1
5c0c40ab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
11 deletions
+87
-11
index.tsx
...etingManage/platformCoupon/components/BacisInfo/index.tsx
+2
-2
index.tsx
...upon/platformCouponQuery/components/ActionModal/index.tsx
+3
-2
index.tsx
...mCoupon/platformCouponQuery/components/EditForm/index.tsx
+5
-0
index.tsx
...ketingManage/platformCoupon/platformCouponQuery/index.tsx
+2
-2
useBusinessEffects.ts
...itted/components/CouponForm/effects/useBusinessEffects.ts
+75
-5
No files found.
src/pages/marketingManage/platformCoupon/components/BacisInfo/index.tsx
View file @
53816a4d
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-22 15:34:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-0
6-22 16:44:56
* @LastEditTime: 2021-0
9-30 17:11:02
* @Description: 基本信息
*/
import
React
from
'react'
;
...
...
@@ -91,7 +91,7 @@ const CouponBacisInfo: React.FC<PropsType> = (props: PropsType) => {
},
{
title
:
'活动名称'
,
value
:
'全品类通用优惠券'
,
value
:
dataSource
.
name
,
},
{
title
:
'券面额'
,
...
...
src/pages/marketingManage/platformCoupon/platformCouponQuery/components/ActionModal/index.tsx
View file @
53816a4d
...
...
@@ -8,10 +8,10 @@
import
React
,
{
useRef
}
from
'react'
;
import
{
Modal
}
from
'antd'
;
import
ReasonForm
,
{
ReasonValueType
,
ReasonFormRefHandle
}
from
'../ReasonForm'
;
import
EditForm
,
{
EditSubmitValueType
,
EditFormRefHandle
}
from
'../EditForm'
;
import
EditForm
,
{
EditSubmitValueType
,
EditFormRefHandle
,
EditValueType
}
from
'../EditForm'
;
export
type
ActionModalType
=
'stop'
|
'cancel'
|
'startUp'
|
'edit'
;
export
type
ActionModalValueType
=
{
id
:
number
};
export
type
ActionModalValueType
=
{
id
:
number
}
&
Partial
<
EditValueType
>
;
interface
IProps
{
/**
...
...
@@ -96,6 +96,7 @@ const ActionModal: React.FC<IProps> = (props) => {
render
:
()
=>
(
<
EditForm
onSubmit=
{
handleEditSubmit
}
value=
{
value
as
EditValueType
}
ref=
{
formRef
}
/>
),
...
...
src/pages/marketingManage/platformCoupon/platformCouponQuery/components/EditForm/index.tsx
View file @
53816a4d
...
...
@@ -40,6 +40,10 @@ interface IProps {
* 提交触发事件
*/
onSubmit
:
(
values
:
EditSubmitValueType
)
=>
void
,
/**
* 值
*/
value
:
EditValueType
,
}
export
interface
EditFormRefHandle
{
...
...
@@ -70,6 +74,7 @@ const EditForm: React.ForwardRefRenderFunction<EditFormRefHandle, IProps> = ((pr
components=
{
{
DatePicker
,
}
}
value=
{
value
}
effects=
{
(
$
,
{
setFieldState
})
=>
{
}
}
...
...
src/pages/marketingManage/platformCoupon/platformCouponQuery/index.tsx
View file @
53816a4d
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-22 09:49:42
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-
22 14:09:45
* @LastEditTime: 2021-09-
30 17:07:20
* @Description: 商家优惠劵查询
*/
import
React
,
{
useRef
,
useState
}
from
'react'
;
...
...
@@ -179,7 +179,7 @@ const PlatformCouponQuery: React.FC = () => {
{
record
.
update
&&
(
<
Button
type=
"link"
onClick=
{
()
=>
handleShowActionModal
(
'edit'
,
{
id
:
record
.
id
})
}
onClick=
{
()
=>
handleShowActionModal
(
'edit'
,
{
id
:
record
.
id
,
releaseTimeStart
:
moment
(
record
.
releaseTimeStart
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
releaseTimeEnd
:
moment
(
record
.
releaseTimeEnd
).
format
(
'YYYY-MM-DD HH:mm:ss'
),
quantity
:
`${record.quantity}`
})
}
>
修改
</
Button
>
...
...
src/pages/marketingManage/platformCoupon/platformCouponUnsubmitted/components/CouponForm/effects/useBusinessEffects.ts
View file @
53816a4d
...
...
@@ -2,10 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:04:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-09-
27 10:08:44
* @LastEditTime: 2021-09-
30 16:39:11
* @Description:
*/
import
{
FormEffectHooks
,
FormPath
,
IFormActions
}
from
'@formily/antd'
;
import
moment
from
'moment'
;
import
{
useLinkageUtils
}
from
'@/utils/formEffectUtils'
;
import
{
MERCHANT_COUPON_TYPE_UNIVERSAL
,
...
...
@@ -230,12 +231,80 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
onFieldInputChange$
(
'receiveCondition.conditionGetTotal'
).
subscribe
(
state
=>
{
const
{
value
}
=
state
;
const
conditionGetDayValue
=
getFieldValue
(
'receiveCondition.conditionGetDay'
);
// 每会员ID总共可领取;
if
(
+
value
<
+
conditionGetDayValue
)
{
setFieldState
(
'receiveCondition.conditionGetTotal'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'errors'
,
'每会员ID总共可领取必须大于每日可领取'
);
const
quantityValue
=
getFieldValue
(
'quantity'
);
// 每会员ID总共可领取
if
(
value
&&
quantityValue
)
{
if
(
+
value
>
+
quantityValue
)
{
setFieldState
(
'receiveCondition.conditionGetTotal'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'errors'
,
'每会员ID总共可领取数量应该小于等于发券数量'
);
});
}
else
{
actions
.
clearErrors
(
'receiveCondition.conditionGetTotal'
);
}
}
if
(
value
&&
conditionGetDayValue
)
{
if
(
+
value
<
+
conditionGetDayValue
)
{
setFieldState
(
'receiveCondition.conditionGetTotal'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'errors'
,
'每会员ID总共可领取必须大于每日可领取'
);
});
}
else
{
actions
.
clearErrors
(
'receiveCondition.conditionGetTotal'
);
}
}
});
// 领(发)券起始时间
onFieldValueChange$
(
'[releaseTimeStart, releaseTimeEnd]'
).
subscribe
(
state
=>
{
const
{
value
}
=
state
;
const
releaseTimeStartValue
=
value
?.[
0
];
const
effectiveTime
=
getFieldValue
(
'[effectiveTimeStart, effectiveTimeEnd]'
);
// 券有效期
const
effectiveTimeStartValue
=
effectiveTime
?.[
0
];
if
(
releaseTimeStartValue
&&
effectiveTimeStartValue
&&
moment
(
releaseTimeStartValue
)
>
moment
(
effectiveTimeStartValue
)
)
{
setFieldState
(
'[releaseTimeStart, releaseTimeEnd]'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'errors'
,
'领(发)券起始时间应该小于券有效期起始时间'
);
});
}
else
{
actions
.
clearErrors
(
'[releaseTimeStart, releaseTimeEnd]'
);
}
});
// 券有效期始时间
onFieldValueChange$
(
'[effectiveTimeStart, effectiveTimeEnd]'
).
subscribe
(
state
=>
{
const
{
value
}
=
state
;
const
effectiveTimeStartValue
=
value
?.[
0
];
const
releaseTime
=
getFieldValue
(
'[releaseTimeStart, releaseTimeEnd]'
);
// 券有效期
const
releaseTimeStartValue
=
releaseTime
?.[
0
];
if
(
effectiveTimeStartValue
&&
releaseTimeStartValue
&&
moment
(
effectiveTimeStartValue
)
<
moment
(
releaseTimeStartValue
)
)
{
setFieldState
(
'[effectiveTimeStart, effectiveTimeEnd]'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'errors'
,
'券有效期起始时间应该大于等于领(发)券起始时间'
);
});
}
else
{
actions
.
clearErrors
(
'[effectiveTimeStart, effectiveTimeEnd]'
);
}
});
// 发券数量
onFieldValueChange$
(
'quantity'
).
subscribe
(
state
=>
{
const
{
value
}
=
state
;
const
conditionGetTotalValue
=
getFieldValue
(
'receiveCondition.conditionGetTotal'
);
// 每会员ID总共可领取
if
(
value
&&
conditionGetTotalValue
&&
+
value
<=
+
conditionGetTotalValue
)
{
setFieldState
(
'quantity'
,
fieldState
=>
{
FormPath
.
setIn
(
fieldState
,
'errors'
,
'发券数量应该大于等于每会员ID总共可领取数量'
);
});
}
else
{
actions
.
clearErrors
(
'
receiveCondition.conditionGetTotal
'
);
actions
.
clearErrors
(
'
quantity
'
);
}
});
}
\ No newline at end of file
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