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
7f667c1b
Commit
7f667c1b
authored
Oct 20, 2022
by
武广
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改初始化属性
parent
ac2541f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
16 deletions
+27
-16
index.jsx
src/pages/GoodsManage/createModal/index.jsx
+27
-16
No files found.
src/pages/GoodsManage/createModal/index.jsx
View file @
7f667c1b
...
@@ -566,35 +566,46 @@ class goodsManage extends Component {
...
@@ -566,35 +566,46 @@ class goodsManage extends Component {
checkInAttrList
=
id
=>
checkInAttrList
=
id
=>
this
.
state
.
categoryAttrs
.
some
(
item
=>
item
.
valueList
.
some
(
v
=>
+
v
.
id
===
+
id
));
this
.
state
.
categoryAttrs
.
some
(
item
=>
item
.
valueList
.
some
(
v
=>
+
v
.
id
===
+
id
));
// 获取初始化属性数据
getInitAttrValue
=
(
id
,
supportCustomValue
,
optionType
)
=>
{
getInitAttrValue
=
(
id
,
supportCustomValue
,
optionType
)
=>
{
const
skuAttr
=
this
.
props
.
initData
.
productAttributeApplyList
?.
productAttributeApplyList
||
[];
const
skuAttr
=
this
.
props
.
initData
.
productAttributeApplyList
?.
productAttributeApplyList
||
[];
const
v
=
skuAttr
.
filter
(
item
=>
id
===
item
.
productAttributeId
);
const
v
=
skuAttr
.
filter
(
item
=>
id
===
item
.
productAttributeId
);
if
(
v
.
length
)
{
if
(
const
values
=
v
[
0
].
productAttributeApplyValueList
.
map
(
attr
=>
{
v
.
length
&&
if
(
+
attr
.
attributeValueId
&&
this
.
checkInAttrList
(
attr
.
attributeValueId
))
{
v
[
0
].
productAttributeApplyValueList
&&
return
JSON
.
stringify
({
v
[
0
].
productAttributeApplyValueList
.
length
attributeValueId
:
attr
.
attributeValueId
,
)
{
attributeValueName
:
attr
.
attributeValueName
,
const
values
=
[];
});
v
[
0
].
productAttributeApplyValueList
.
forEach
(
attr
=>
{
if
(
+
attr
.
attributeValueId
)
{
if
(
this
.
checkInAttrList
(
attr
.
attributeValueId
))
{
values
.
push
(
JSON
.
stringify
({
attributeValueId
:
attr
.
attributeValueId
,
attributeValueName
:
attr
.
attributeValueName
,
}),
);
}
}
else
{
values
.
push
(
attr
.
attributeValueName
);
}
}
return
attr
.
attributeValueName
;
return
values
;
});
});
if
(
+
supportCustomValue
.
code
===
1
||
+
optionType
.
code
===
2
)
{
if
(
+
supportCustomValue
.
code
===
1
||
+
optionType
.
code
===
2
)
{
return
values
;
return
values
;
}
}
if
(
v
[
0
].
productAttributeApplyValueList
.
length
)
{
if
(
v
[
0
].
productAttributeApplyValueList
.
length
)
{
const
atvalue
=
v
[
0
].
productAttributeApplyValueList
[
0
];
const
atvalue
=
v
[
0
].
productAttributeApplyValueList
[
0
];
return
JSON
.
stringify
({
if
(
this
.
checkInAttrList
(
atvalue
.
attributeValueId
))
{
attributeValueId
:
atvalue
.
attributeValueId
,
return
JSON
.
stringify
({
attributeValueName
:
atvalue
.
attributeValueName
,
attributeValueId
:
atvalue
.
attributeValueId
,
});
attributeValueName
:
atvalue
.
attributeValueName
,
});
}
}
}
return
''
;
return
''
;
}
}
if
(
+
supportCustomValue
.
code
===
1
)
{
if
(
+
supportCustomValue
.
code
===
1
||
+
optionType
.
code
===
2
)
{
return
[];
}
if
(
+
optionType
.
code
===
2
)
{
return
[];
return
[];
}
}
return
''
;
return
''
;
...
...
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