Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
develop-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1150b952
authored
Nov 16, 2020
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
编辑商品-图
1 parent
79d4df9d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
src/components/d2-form/index.vue
src/views/goods/editCommodity.vue
src/components/d2-form/index.vue
View file @
1150b95
...
@@ -270,6 +270,10 @@
...
@@ -270,6 +270,10 @@
class=
"item-tips"
class=
"item-tips"
>
{{item.tips}}
</span>
>
{{item.tips}}
</span>
</div>
</div>
<span
v-if=
"headImg.isHas"
><img
class=
"commodity-img"
:src=
"formData[headImg.attr]"
/></span>
</div>
</div>
</el-form>
</el-form>
<div
slot=
"footer"
>
<div
slot=
"footer"
>
...
@@ -331,6 +335,15 @@ export default {
...
@@ -331,6 +335,15 @@ export default {
type
:
String
,
type
:
String
,
default
:
'add'
default
:
'add'
},
},
headImg
:
{
type
:
Object
,
default
:
()
=>
{
return
{
isHas
:
false
,
attr
:
''
}
}
},
formItemWidth
:
{
formItemWidth
:
{
type
:
String
,
type
:
String
,
default
:
'100%'
default
:
'100%'
...
@@ -378,7 +391,7 @@ export default {
...
@@ -378,7 +391,7 @@ export default {
if
(
targetItem
.
name
===
'goodsCode'
)
{
if
(
targetItem
.
name
===
'goodsCode'
)
{
var
tempVal
=
targetItem
.
optionList
.
find
(
item
=>
item
.
goodsCode
===
value
)
var
tempVal
=
targetItem
.
optionList
.
find
(
item
=>
item
.
goodsCode
===
value
)
this
.
formData
.
goodsTypeName
=
tempVal
.
goodsTypeName
this
.
formData
.
goodsTypeName
=
tempVal
.
goodsTypeName
this
.
formData
.
goodsTypeName
=
tempVal
.
goodsTypeName
this
.
formData
.
thumbUrl
=
tempVal
.
thumbUrl
this
.
formData
.
sapCode
=
tempVal
.
sapCode
this
.
formData
.
sapCode
=
tempVal
.
sapCode
}
}
// if (item.attrName) {
// if (item.attrName) {
...
@@ -636,5 +649,13 @@ export default {
...
@@ -636,5 +649,13 @@ export default {
.d2-form
.error
{
.d2-form
.error
{
color
:
red
;
color
:
red
;
}
}
.d2-form
.commodity-img
{
width
:
200px
;
height
:
200px
;
position
:
absolute
;
right
:
58px
;
top
:
80px
;
}
</
style
>
</
style
>
src/views/goods/editCommodity.vue
View file @
1150b95
...
@@ -10,9 +10,11 @@
...
@@ -10,9 +10,11 @@
:addOrEdit=
"addOrEdit"
:addOrEdit=
"addOrEdit"
:originData=
"editData"
:originData=
"editData"
:formList=
"editForm"
:formList=
"editForm"
:headImg=
"headImg"
@
handleAddConfirm=
"handleAddConfirm"
@
handleAddConfirm=
"handleAddConfirm"
@
handleClose=
"handleAddClose"
@
handleClose=
"handleAddClose"
></d2-form>
></d2-form>
</d2-container>
</d2-container>
</
template
>
</
template
>
...
@@ -29,6 +31,7 @@ export default {
...
@@ -29,6 +31,7 @@ export default {
goodsCode
:
''
,
goodsCode
:
''
,
goodsName
:
''
,
goodsName
:
''
,
goodsTypeName
:
''
,
goodsTypeName
:
''
,
thumbUrl
:
''
,
spsx
:
'基础商品'
,
spsx
:
'基础商品'
,
retailPrice
:
''
,
retailPrice
:
''
,
maxRetailDiscount
:
''
,
maxRetailDiscount
:
''
,
...
@@ -41,6 +44,10 @@ export default {
...
@@ -41,6 +44,10 @@ export default {
shopPrice
:
[{
required
:
true
,
message
:
'请输入到店价'
,
trigger
:
'blur'
}],
shopPrice
:
[{
required
:
true
,
message
:
'请输入到店价'
,
trigger
:
'blur'
}],
linkMerchantIds
:
[{
required
:
true
,
message
:
'请选择关联门店'
,
trigger
:
'change'
}]
linkMerchantIds
:
[{
required
:
true
,
message
:
'请选择关联门店'
,
trigger
:
'change'
}]
},
},
headImg
:
{
isHas
:
true
,
attr
:
'thumbUrl'
},
editForm
:
[{
editForm
:
[{
title
:
'商品基本信息'
,
title
:
'商品基本信息'
,
formBlock
:
[{
formBlock
:
[{
...
@@ -126,12 +133,16 @@ export default {
...
@@ -126,12 +133,16 @@ export default {
id
:
res
.
id
,
id
:
res
.
id
,
goodsCode
:
res
.
goodsCode
,
goodsCode
:
res
.
goodsCode
,
goodsName
:
res
.
goodsInfo
.
goodsName
,
goodsName
:
res
.
goodsInfo
.
goodsName
,
thumbUrl
:
res
.
goodsInfo
.
thumbUrl
,
goodsTypeName
:
res
.
goodsInfo
.
goodsTypeName
,
goodsTypeName
:
res
.
goodsInfo
.
goodsTypeName
,
spsx
:
'基础商品'
,
spsx
:
'基础商品'
,
retailPrice
:
res
.
retailPrice
,
retailPrice
:
res
.
retailPrice
,
shopPrice
:
res
.
shopPrice
,
shopPrice
:
res
.
shopPrice
,
maxRetailDiscount
:
res
.
maxRetailDiscount
,
maxRetailDiscount
:
res
.
maxRetailDiscount
,
upgradeGoods
:
res
.
upgradeGoodsList
,
upgradeGoods
:
res
.
upgradeGoodsList
.
map
(
item
=>
{
item
[
'thumbUrl'
]
=
item
.
goodsInfo
.
thumbUrl
return
item
}),
linkMerchantIds
:
res
.
merchantRefList
.
length
?
res
.
merchantRefList
.
map
(
item
=>
Object
.
assign
(
item
,
item
.
merchantInfo
))
:
[]
linkMerchantIds
:
res
.
merchantRefList
.
length
?
res
.
merchantRefList
.
map
(
item
=>
Object
.
assign
(
item
,
item
.
merchantInfo
))
:
[]
}
}
console
.
log
(
this
.
editData
)
console
.
log
(
this
.
editData
)
...
@@ -203,5 +214,6 @@ export default {
...
@@ -203,5 +214,6 @@ export default {
<
style
>
<
style
>
.edit-commodity
{
.edit-commodity
{
margin
:
0
20px
;
margin
:
0
20px
;
position
:
relative
;
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment