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
77526c73
Commit
77526c73
authored
Dec 30, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改弹窗不显示问题
parent
a68f202a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
41 deletions
+47
-41
index.jsx
src/pages/ServiceGoods/index.jsx
+47
-41
No files found.
src/pages/ServiceGoods/index.jsx
View file @
77526c73
...
@@ -329,49 +329,55 @@ const ServiceGoods = options => {
...
@@ -329,49 +329,55 @@ const ServiceGoods = options => {
// 保存草稿
// 保存草稿
const
onSaveDraft
=
async
()
=>
{
const
onSaveDraft
=
async
()
=>
{
console
.
log
(
'
newCategoryList :>>
'
,
newCategoryList
);
console
.
log
(
'
newCategoryList :>>
'
,
newCategoryList
);
const
info
=
localStorage
.
get
(
localAutoSaveKey
);
const
info
=
localStorage
.
get
(
localAutoSaveKey
);
if
(
info
)
{
if
(
if
(
!
info
||
!
info
.
infoMation
||
!
info
.
infoMation
||
!
info
.
infoMation
.
name
||
!
info
.
infoMation
.
name
||
!
info
.
infoMation
.
categoryId
||
!
info
.
infoMation
.
categoryId
||
info
.
infoMation
.
categoryId
.
length
!==
3
info
.
infoMation
.
categoryId
.
length
!==
3
)
{
)
{
message
.
warning
(
'
请添加商品类目和名称
'
);
message
.
warning
(
'
请添加商品类目和名称
'
);
return
;
return
;
}
info
.
type
=
productType
;
let
arr
=
newCategoryList
[
info
.
type
];
const
first
=
arr
.
find
(
item
=>
item
.
id
===
info
.
infoMation
.
categoryId
[
0
]);
arr
=
first
.
children
;
const
second
=
arr
.
find
(
item
=>
item
.
id
===
info
.
infoMation
.
categoryId
[
1
]);
arr
=
second
.
children
;
const
third
=
arr
.
find
(
item
=>
item
.
id
===
info
.
infoMation
.
categoryId
[
2
]);
const
params
=
{
productName
:
info
.
infoMation
.
name
,
productType
:
info
.
type
,
firstCategoryId
:
info
.
infoMation
.
categoryId
[
0
],
firstCategoryName
:
first
.
name
,
secondCategoryId
:
info
.
infoMation
.
categoryId
[
1
],
secondCategoryName
:
second
.
name
,
thirdCategoryId
:
info
.
infoMation
.
categoryId
[
2
],
thirdCategoryName
:
third
.
name
,
content
:
JSON
.
stringify
(
info
),
};
console
.
log
(
'
params :>>
'
,
params
);
setPageLoading
(
true
);
let
api
=
apiCreateDraft
;
if
(
options
.
isDraft
)
{
params
.
id
=
SourceData
.
id
;
api
=
apiEditDraft
;
}
await
api
(
params
);
localStorage
.
remove
(
localAutoSaveKey
);
setPageLoading
(
false
);
message
.
success
(
'
草稿保存成功!
'
);
handleCancel
(
true
);
}
}
Modal
.
confirm
({
title
:
'
确认提示
'
,
content
:
'
确定将商品信息保存至草稿箱?
'
,
onOk
:
async
()
=>
{
info
.
type
=
productType
;
let
arr
=
newCategoryList
[
info
.
type
];
const
first
=
arr
.
find
(
item
=>
item
.
id
===
info
.
infoMation
.
categoryId
[
0
]);
arr
=
first
.
children
;
const
second
=
arr
.
find
(
item
=>
item
.
id
===
info
.
infoMation
.
categoryId
[
1
]);
arr
=
second
.
children
;
const
third
=
arr
.
find
(
item
=>
item
.
id
===
info
.
infoMation
.
categoryId
[
2
]);
const
params
=
{
productName
:
info
.
infoMation
.
name
,
productType
:
info
.
type
,
firstCategoryId
:
info
.
infoMation
.
categoryId
[
0
],
firstCategoryName
:
first
.
name
,
secondCategoryId
:
info
.
infoMation
.
categoryId
[
1
],
secondCategoryName
:
second
.
name
,
thirdCategoryId
:
info
.
infoMation
.
categoryId
[
2
],
thirdCategoryName
:
third
.
name
,
content
:
JSON
.
stringify
(
info
),
};
console
.
log
(
'
params :>>
'
,
params
);
setPageLoading
(
true
);
let
api
=
apiCreateDraft
;
if
(
options
.
isDraft
)
{
params
.
id
=
SourceData
.
id
;
api
=
apiEditDraft
;
}
await
api
(
params
);
localStorage
.
remove
(
localAutoSaveKey
);
setPageLoading
(
false
);
message
.
success
(
'
草稿保存成功!
'
);
handleCancel
(
true
);
},
});
};
};
const
providerValue
=
{
const
providerValue
=
{
...
...
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