Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
f2126191
Commit
f2126191
authored
Jan 11, 2023
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改有效期数据处理
parent
b7a7533a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
staticdata.js
src/pages/GoodsManage/staticdata.js
+2
-0
FormRuleSetting.jsx
src/pages/ServiceGoods/components/FormRuleSetting.jsx
+11
-7
No files found.
src/pages/GoodsManage/staticdata.js
View file @
f2126191
...
...
@@ -315,6 +315,8 @@ const filterServiceItem = (type, serviceItem) => {
resetTime
(
serviceItem
.
purchaseStartTime
),
resetTime
(
serviceItem
.
purchaseEndTime
),
],
// 购买开始时间
validityPeriodType
:
serviceItem
.
validityPeriodType
,
validityPeriodDays
:
serviceItem
.
validityPeriodDays
,
shopIds
:
serviceItem
.
shopIds
||
[],
// 适用门店列表
unavailableDate
:
serviceItem
.
unavailableDate
,
// 不可用日期
useTimeDescription
:
serviceItem
.
useTimeDescription
,
// 使用时间
...
...
src/pages/ServiceGoods/components/FormRuleSetting.jsx
View file @
f2126191
...
...
@@ -42,7 +42,9 @@ const FormRuleSetting = forwardRef((props, ref) => {
const
shopIds
=
getIsInShops
(
editData
.
shopIds
);
goodInfo
.
shopIds
=
shopIds
;
}
console
.
log
(
'
goodInfo :>>
'
,
goodInfo
);
if
(
goodInfo
.
validityPeriodType
)
{
console
.
log
(
'
+goodInfo.validityPeriodType :>>
'
,
+
goodInfo
.
validityPeriodType
);
setDateType
(
+
goodInfo
.
validityPeriodType
);
}
form
.
setFieldsValue
(
goodInfo
);
...
...
@@ -52,15 +54,17 @@ const FormRuleSetting = forwardRef((props, ref) => {
const
onCheck
=
async
()
=>
{
try
{
const
{
useTime
,
purchaseTime
,
...
values
}
=
await
form
.
validateFields
();
return
{
useStartTime
:
formatTime
(
useTime
[
0
]),
useEndTime
:
formatTime
(
useTime
[
1
]),
const
params
=
{
purchaseStartTime
:
formatTime
(
purchaseTime
[
0
]),
purchaseEndTime
:
formatTime
(
purchaseTime
[
1
]),
temp
:
'
serviceItem
'
,
...
values
,
};
if
(
useTime
&&
useTime
.
length
===
2
)
{
params
.
useStartTime
=
formatTime
(
useTime
[
0
]);
params
.
useEndTime
=
formatTime
(
useTime
[
1
]);
}
return
params
;
}
catch
(
errorInfo
)
{
return
null
;
}
...
...
@@ -90,7 +94,7 @@ const FormRuleSetting = forwardRef((props, ref) => {
form=
{
form
}
name=
"register"
initialValues=
{
{
useTime
:
[],
// 使用开始时间
//
useTime: [], // 使用开始时间
validityPeriodType
:
'
1
'
,
// 有效期类型
// useEndTime: '', // 使用结束时间
purchaseTime
:
[],
// 购买开始时间
...
...
@@ -118,8 +122,8 @@ const FormRuleSetting = forwardRef((props, ref) => {
rules=
{
[{
required
:
true
,
message
:
'
请选择有效期类型!
'
}]
}
>
<
Radio
.
Group
onChange=
{
onChangeDateType
}
>
<
Radio
value=
"1"
>
固定日期
</
Radio
>
<
Radio
value=
"2"
>
指定范围
</
Radio
>
<
Radio
value=
{
1
}
>
固定日期
</
Radio
>
<
Radio
value=
{
2
}
>
指定范围
</
Radio
>
</
Radio
.
Group
>
</
Form
.
Item
>
{
dateType
===
1
?
(
...
...
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