Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-discover
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 9b1e8b5e
authored
Aug 30, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
联调基本完成
1 parent
72b7be88
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
324 additions
and
83 deletions
src/api/modules/goods.js
src/views/goods/add.vue
src/views/goods/addPrefer.vue
src/views/goods/components/selectGoods.vue
src/views/goods/index.vue
src/api/modules/goods.js
View file @
9b1e8b5
...
...
@@ -42,6 +42,16 @@ const getCarlifeGoodsApi = params => {
})
}
const
getSelfSupportGoodsApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.discover.page'
return
http
({
url
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
const
addGoodsApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.configuration.upgrade.add.or.update'
...
...
@@ -130,12 +140,23 @@ const exportGoodsApi = params => {
sign
:
true
})
}
const
getSelfGoodsDetailApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.getById'
return
http
({
url
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getGoodsListApi
,
updateGoodsStatusApi
,
delGoodsApi
,
getCarlifeGoodsApi
,
getSelfSupportGoodsApi
,
addGoodsApi
,
getGoodsDetail
,
getMerchantListApi
,
...
...
@@ -143,5 +164,6 @@ export default {
getVisitorListApi
,
getSharedListApi
,
exportBrowseApi
,
exportGoodsApi
exportGoodsApi
,
getSelfGoodsDetailApi
}
\ No newline at end of file
src/views/goods/add.vue
View file @
9b1e8b5
...
...
@@ -13,12 +13,18 @@
<glsx-combi-form
:isInline=
"false"
ref=
"goodsInfoRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:formObj
.
sync=
"formObj"
:formData=
"goodsFormData"
:formRules=
"goodsRule"
>
<div
slot=
"uploadSlot"
class=
"upload-calss"
>
<glsx-preview
:picOptions=
"posterOptions"
:imageUrlArr=
"formObj.coverList"
@
change=
"changeChannelImg"
></glsx-preview>
<glsx-preview
:picOptions=
"posterOptions"
:imageUrlArr=
"formObj.coverList"
></glsx-preview>
<span
class=
"tip"
>
建议尺寸750*750,图片格式为jpg,jpeg,png,大小2M以内
</span>
</div>
</glsx-combi-form>
</div>
<div
slot=
"propagateCoverSlot"
class=
"propagate-cover-class"
>
<div
class=
"upload-wrap"
>
<glsx-preview
:picOptions=
"posterOptions"
:imageUrlArr=
"formObj.styleBImgList"
></glsx-preview>
<span
class=
"preview"
@
click=
"showPreviewDialog=true"
>
预览
</span>
</div>
<span
class=
"tip"
>
分类布局选择种草样式B时商品宣传大图,建议720*540,大小2M以内
</span>
</div>
<div
slot=
"paymentSlot"
>
<el-radio-group
:disabled=
"disabled"
v-model=
"formObj.paymentType"
>
<el-radio
:label=
"1"
>
全款
</el-radio>
...
...
@@ -95,10 +101,6 @@
</div>
</div>
</div>
<div
slot=
"categorySlot"
>
<brandCascader
:curInfo=
"curCategoryInfo"
:disabled=
"disabled"
@
clickItem=
"selectCategory"
class=
"category-class"
></brandCascader>
</div>
</glsx-combi-form>
</div>
<GLFooter
style=
"margin-top: 16px;"
>
...
...
@@ -107,7 +109,7 @@
</GLFooter>
<selectCarDialog
v-if=
"carDialogVisible"
:echoData=
"vehicleSeriesRequestList"
@
handleClose=
"handleCarSeriesClose"
@
handleConfirm=
"handleConfirm"
:dialogVisible=
"carDialogVisible"
></selectCarDialog>
<selectGoods
v-if=
"goodsVisible"
:routeInfo=
"routeInfo"
:dialogVisible=
"goodsVisible"
<selectGoods
v-if=
"goodsVisible"
:routeInfo=
"routeInfo"
:dialogVisible=
"goodsVisible"
:goodsInfo=
"{}"
@
handleGoodsConfirm=
"handleGoodsConfirm"
@
handleGoodsClose=
"handleGoodsClose"
></selectGoods>
<selectMerchantDialog
@
confirmDialog=
"confirmDialog"
@
closeDialog=
"closeDialog"
:goodsId=
"formObj.smartcarlifeInfoId"
:selectedList=
"saleMerchantList"
...
...
@@ -116,6 +118,9 @@
<img
:src=
"dialogSrc"
width=
"100%"
v-if=
"dialogType == 'img'"
/>
<video
width=
"100%"
autoplay
controls
:src=
"dialogSrc"
v-else
></video>
</el-dialog>
<div
v-if=
"showPreviewDialog"
class=
"preview-dialog"
@
click=
"showPreviewDialog = false"
>
<img
class=
"preview-img"
src=
"@/assets/preview.png"
alt=
""
/>
</div>
</div>
</template>
<
script
>
...
...
@@ -156,7 +161,6 @@ const notPriceColumns = [
}
]
import
glsxCombiForm
from
'@/components/glsx-combi-form'
import
brandCascader
from
'./components/brandCascader'
import
selectGoods
from
'./components/selectGoods'
import
selectCarDialog
from
'@/views/store/components/selectCarDialog'
import
selectMerchantDialog
from
'./components/selectMerchantDialog'
...
...
@@ -165,7 +169,6 @@ export default {
name
:
'add'
,
components
:
{
glsxCombiForm
,
brandCascader
,
selectGoods
,
selectCarDialog
,
selectMerchantDialog
...
...
@@ -184,19 +187,18 @@ export default {
},
data
()
{
return
{
showPreviewDialog
:
false
,
dialogVisibleImg
:
false
,
goodsVisible
:
false
,
carDialogVisible
:
false
,
merchantDialogVisible
:
false
,
disabled
:
false
,
dialogSrc
:
''
,
goodsInfo
:
{},
dialogSrc
:
''
,
routeInfo
:
{},
defaultProps
:
{
children
:
'categoryName'
,
label
:
'childs'
},
curCategoryInfo
:
{},
posterOptions
:
{
width
:
'104px'
,
height
:
'104px'
,
...
...
@@ -236,12 +238,13 @@ export default {
minSellPrice
:
''
,
retailPrice
:
''
,
coverList
:
[],
styleBImgList
:
[],
styleBImg
:
''
,
paymentType
:
1
,
depositPrice
:
''
,
vehicleSeriesType
:
1
,
goodsVideo
:
''
,
associationClassifyFirstId
:
''
,
associationClassifySecondId
:
''
associationClassifyFirstId
:
''
},
saleMerchantList
:
[],
vehicleSeriesRequestList
:
[],
...
...
@@ -324,17 +327,7 @@ export default {
},
trigger
:
'change'
}],
categoryName
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
!
this
.
formObj
.
associationClassifyFirstId
||
!
this
.
formObj
.
associationClassifySecondId
)
{
callback
(
new
Error
(
'请选择关联商品分类'
))
}
else
{
callback
()
}
},
trigger
:
'change'
}],
associationClassifyFirstId
:
[{
required
:
true
,
message
:
'请选择关联商品分类'
,
trigger
:
'change'
}],
},
formData
:
[
{
...
...
@@ -352,6 +345,11 @@ export default {
isDisabled
:
false
},
{
label
:
'种草样式B宣传图'
,
name
:
'propagateCover'
,
addHtml
:
'propagateCoverSlot'
},
{
label
:
'收款方式'
,
name
:
'paymentType'
,
addHtml
:
'paymentSlot'
...
...
@@ -402,11 +400,20 @@ export default {
name
:
'carSeriesName'
,
addHtml
:
'carSeriesSlot'
,
},
// {
// label: '关联商品分类',
// name: 'categoryName',
// addHtml: 'categorySlot'
// },
{
label
:
'关联商品分类'
,
name
:
'categoryName'
,
addHtml
:
'categorySlot'
}
name
:
'associationClassifyFirstId'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'id'
,
optionLabel
:
'categoryName'
,
isDisabled
:
false
},
],
selectedtableParams
:
{
listName
:
'list'
,
...
...
@@ -418,7 +425,7 @@ export default {
}
},
created
()
{
//
this.getCategory()
this
.
getCategory
()
const
urlParam
=
this
.
$route
.
params
this
.
routeInfo
=
JSON
.
parse
(
decodeURIComponent
(
urlParam
.
id
))
const
{
id
,
type
}
=
this
.
routeInfo
...
...
@@ -427,6 +434,8 @@ export default {
this
.
posterOptions
.
isClose
=
false
const
_target
=
this
.
goodsFormData
.
find
(
item
=>
item
.
name
==
'goodsName'
)
_target
.
isDisabled
=
true
const
_classifyTarget
=
this
.
formData
.
find
(
item
=>
item
.
name
==
'associationClassifyFirstId'
)
_classifyTarget
.
isDisabled
=
true
this
.
selectedtableParams
.
tableOption
=
null
}
if
(
id
)
{
...
...
@@ -434,6 +443,19 @@ export default {
}
},
methods
:
{
getCategory
()
{
const
params
=
{
pageSize
:
10000
,
pageNum
:
1
,
categoryType
:
1
}
this
.
$apis
.
category
.
getCategoryListApi
(
params
).
then
(
res
=>
{
if
(
res
?.
list
?.
length
)
{
const
_target
=
this
.
formData
.
find
(
item
=>
item
.
name
==
'associationClassifyFirstId'
)
_target
.
optionList
=
res
.
list
}
})
},
// 上传视频
handleVideoChange
(
e
)
{
let
file
=
e
.
srcElement
.
files
[
0
]
...
...
@@ -590,11 +612,13 @@ export default {
getParams
()
{
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
formObj
))
obj
.
goodsImage
=
obj
.
coverList
[
0
]
obj
.
styleBImg
=
obj
.
styleBImgList
[
0
]
obj
.
depositPrice
=
obj
.
depositPrice
?
Number
(
Number
(
obj
.
depositPrice
*
10
*
10
).
toFixed
(
0
))
:
0
if
(
obj
.
paymentType
==
1
)
delete
obj
.
depositPrice
delete
obj
.
minSellPrice
delete
obj
.
retailPrice
delete
obj
.
coverList
delete
obj
.
styleBImgList
let
saleMerchantList
=
this
.
saleMerchantList
.
map
(
item
=>
{
let
{
merchantId
,
merchantName
,
activityPrice
,
originalPrice
}
=
item
...
...
@@ -650,12 +674,9 @@ export default {
this
.
formObj
[
key
]
=
res
[
key
]
}
}
this
.
curCategoryInfo
=
{
categoryName
:
res
.
associationClassifySecondName
,
id
:
res
.
associationClassifySecondId
}
this
.
formObj
.
goodsType
=
'1'
this
.
formObj
.
coverList
=
[
res
.
goodsImage
]
this
.
formObj
.
styleBImgList
=
res
.
styleBImg
?
[
res
.
styleBImg
]
:
[]
this
.
saleMerchantList
=
res
.
saleMerchantList
?.
map
(
item
=>
{
let
activityPrice
=
item
.
activityPrice
?
Number
(
Number
(
item
.
activityPrice
/
100
).
toFixed
(
2
))
:
0
let
originalPrice
=
item
.
originalPrice
?
Number
(
Number
(
item
.
originalPrice
/
100
).
toFixed
(
2
))
:
0
...
...
@@ -688,6 +709,30 @@ export default {
color
:
#666666
;
}
.propagate-cover-class
{
.preview{
color
:
#5850ff
;
font-weight
:
400
;
font-size
:
14px
;
line-height
:
20px
;
align-self
:
self-end
;
margin-left
:
10px
;
cursor
:
pointer
;
}
.upload-wrap
{
display
:
flex
;
}
.tip
{
height
:
20px
;
line-height
:
20px
;
align-self
:
flex-end
;
font-weight
:
400
;
font-size
:
14px
;
color
:
#999999
;
}
}
.goods-wrap
{
padding
:
20px
20px
1px
;
width
:
1000px
;
...
...
@@ -848,4 +893,22 @@ export default {
color
:
#999999
;
margin-bottom
:
-35px
;
}
.preview-dialog
{
position
:
fixed
;
left
:
0
;
right
:
0
;
top
:
0
;
z-index
:
99
;
bottom
:
0
;
background
:
rgba
(
0
,
0
,
0
,
0.5
);
.preview-img{
position
:
absolute
;
top
:
50%
;
left
:
50%
;
transform
:
translate
(
-50%
,
-50%
);
width
:
390px
;
height
:
720px
;
}
}
</
style
>
src/views/goods/addPrefer.vue
View file @
9b1e8b5
...
...
@@ -84,8 +84,21 @@
<glsx-combi-form
:isInline=
"false"
ref=
"expressInfoRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:formObj
.
sync=
"formObj"
:formData=
"expressInfoFormData"
:formRules=
"myRule"
>
<div
slot=
"expressFeeSlot"
>
<format-input
class=
"expressFee-class"
:disabled=
"disabled"
:intDigit=
"4"
:precise=
"2"
v-model=
"formObj.expressFee"
></format-input>
<format-input
class=
"expressFee-class"
:disabled=
"disabled"
:intDigit=
"4"
:precise=
"2"
v-model=
"formObj.expressFee"
></format-input>
</div>
<div
slot=
"selfSlot"
>
<div>
<span
style=
"color: #666666;"
>
配送方式:
</span>
<span>
{{ formObj.deliveryType==1 ? '到店核销' : '快递发货' }}
</span>
</div>
<div>
<span
style=
"color: #666666;"
>
运费/元:
</span>
<span>
{{ formObj.deliveryType==1 ? '--' : (formObj.expressFee || 0) }}
</span>
</div>
<div>
<span
style=
"color: #666666;"
>
服务说明:
</span>
<span>
{{ formObj.introduction }}
</span>
</div>
</div>
</glsx-combi-form>
</div>
...
...
@@ -130,6 +143,45 @@ const MerchantColumns = [
addHtml
:
'giveIntegralSlot'
}
]
const
defaultExpreeCol
=
[
{
label
:
'配送方式'
,
name
:
'deliveryType'
,
type
:
'radio'
,
optionList
:
[{
confId
:
2
,
confName
:
'快递发货'
},{
confId
:
1
,
confName
:
'到店核销'
}],
optionId
:
'confId'
,
optionLabel
:
'confName'
,
isDisabled
:
false
},
{
label
:
'运费/元'
,
name
:
'expressFee'
,
addHtml
:
'expressFeeSlot'
,
isDisabled
:
false
},
{
label
:
'服务说明'
,
name
:
'introduction'
,
type
:
'input'
,
inputType
:
'textarea'
,
isDisabled
:
false
,
showLimit
:
true
,
maxlength
:
200
},
]
const
selfGoodsExpreeCol
=
[
{
label
:
''
,
addHtml
:
'selfSlot'
,
}
]
import
glsxCombiForm
from
'@/components/glsx-combi-form'
import
selectGoods
from
'./components/selectGoods'
import
selectMerchantDialog
from
'./components/selectMerchantDialog'
...
...
@@ -386,6 +438,12 @@ export default {
if
(
!
nVal
)
this
.
formObj
.
commerceDescribe
=
''
},
deep
:
true
},
'formObj.goodsSource'
:{
handler
(
nVal
,
oVal
)
{
this
.
expressInfoFormData
=
nVal
==
2
?
selfGoodsExpreeCol
:
defaultExpreeCol
},
deep
:
true
}
},
created
()
{
...
...
@@ -502,7 +560,7 @@ export default {
},
handleGoodsConfirm
(
e
)
{
if
(
this
.
formObj
.
smartcarlifeInfoId
!=
e
?.
id
)
this
.
saleMerchantList
=
[]
let
{
id
:
smartcarlifeInfoId
,
goodsName
,
goodsImage
,
minSellPrice
,
retailPrice
,
goodsVideo
}
=
e
||
{}
let
{
id
,
goodsName
,
goodsImage
,
minSellPrice
,
retailPrice
,
goodsVideo
,
goodsId
}
=
e
||
{}
minSellPrice
=
minSellPrice
?
Number
(
Number
(
minSellPrice
/
100
).
toFixed
(
2
))
:
0
retailPrice
=
retailPrice
?
Number
(
Number
(
retailPrice
/
100
).
toFixed
(
2
))
:
0
...
...
@@ -510,7 +568,7 @@ export default {
if
(
goodsVideo
)
this
.
formObj
.
goodsVideo
=
goodsVideo
this
.
formObj
=
{
...
this
.
formObj
,
smartcarlifeInfoId
,
smartcarlifeInfoId
:
this
.
formObj
.
goodsSource
==
2
?
goodsId
:
id
,
//自营和智享的id字段不一致
goodsName
,
goodsImage
,
coverList
:
[
goodsImage
],
...
...
@@ -518,8 +576,18 @@ export default {
retailPrice
}
this
.
handleGoodsClose
()
if
(
this
.
formObj
.
goodsSource
==
2
){
this
.
setSelfGoodsInfo
(
e
)
}
this
.
validateField
([
'selectBtnSlot'
,
'goodsInfoSlot'
])
},
setSelfGoodsInfo
(
row
){
let
{
deliveryType
,
expressFee
,
goodsVideo
,
merchantId
,
merchantName
,
retailPrice
,
originalPrice
,
serviceDesc
:
introduction
}
=
row
||
{}
this
.
formObj
=
{...
this
.
formObj
,
deliveryType
,
expressFee
,
goodsVideo
,
introduction
}
retailPrice
=
retailPrice
?
Number
(
Number
(
retailPrice
/
100
).
toFixed
(
2
))
:
0
originalPrice
=
originalPrice
?
Number
(
Number
(
originalPrice
/
100
).
toFixed
(
2
))
:
0
this
.
saleMerchantList
=
[{
merchantId
,
merchantName
,
activityPrice
:
retailPrice
,
originalPrice
,
giveIntegral
:
''
}]
},
confirmDialog
(
e
)
{
this
.
saleMerchantList
=
e
||
[]
this
.
saleMerchantList
.
map
(
item
=>
this
.
$set
(
item
,
'giveIntegral'
,
''
))
...
...
@@ -560,16 +628,17 @@ export default {
},
handleSave
()
{
this
.
$refs
.
baseInfoRef
.
$refs
.
formRef
.
validate
(
valid
=>
{
// this.$refs.expressInfoRef
if
(
valid
)
{
const
params
=
this
.
getParams
()
this
.
$apis
.
goods
.
addGoodsApi
(
params
).
then
(
res
=>
{
if
(
res
)
{
this
.
$message
.
success
(
'操作成功'
)
this
.
handleCancel
()
}
})
}
this
.
$refs
.
expressInfoRef
.
$refs
.
formRef
.
validate
(
validate
=>
{
if
(
valid
&&
validate
)
{
const
params
=
this
.
getParams
()
this
.
$apis
.
goods
.
addGoodsApi
(
params
).
then
(
res
=>
{
if
(
res
)
{
this
.
$message
.
success
(
'操作成功'
)
this
.
handleCancel
()
}
})
}
})
})
},
handleCancel
()
{
...
...
src/views/goods/components/selectGoods.vue
View file @
9b1e8b5
...
...
@@ -21,9 +21,11 @@
:noDataImg=
"url"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:beforeSearchFn=
"beforeSearchFn"
:pageConf=
"pageConf"
@
refreshTable=
"getList"
:getListApi=
"getListApi"
:pageSizes=
"pageSizes"
:hasNum=
"false"
:setTableFinishFun=
"setTableFinishFun"
>
<div
slot=
"radioHtml"
...
...
@@ -33,12 +35,22 @@
:label=
"scope.scope.id"
@
click
.
native=
"handleClick(scope.scope)"
></el-radio>
</div>
<div
slot=
"selfRadioHtml"
class=
"store-table"
slot-scope=
"scope"
>
<el-radio
v-model=
"curInfo.goodsId"
:label=
"scope.scope.goodsId"
@
click
.
native=
"handleClick(scope.scope)"
></el-radio>
</div>
<div
slot=
"imageSlot"
slot-scope=
"scope"
>
<el-popover
placement=
"top"
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
<img
class=
"table-popover-img"
:src=
"scope.scope.goodsImage"
/>
<img
class=
"img-36 pointer"
slot=
"reference"
:src=
"scope.scope.goodsImage"
/>
</el-popover>
</div>
<div
slot=
"goodsNameSlot"
class=
"goodsNameSlot"
slot-scope=
"scope"
>
<img
:src=
"scope.scope.goodsImage"
alt=
""
>
{{
scope
.
scope
.
goodsName
}}
</div>
</GLTable>
</GLDialog>
</div>
...
...
@@ -46,6 +58,65 @@
<
script
>
import
url
from
'@/assets/empty.png'
const
MERCHANT_SEARCH_ITEM
=
{
label
:
'门店名称'
,
name
:
'merchantName'
,
type
:
'input'
,
width
:
'200px'
,
labelWidth
:
'10px'
,
isClear
:
true
}
const
defaultTableCol
=
[
{
label
:
''
,
prop
:
''
,
width
:
80
,
addHtml
:
'radioHtml'
},
{
label
:
'商品名称'
,
prop
:
'goodsName'
},
{
label
:
'缩略图'
,
addHtml
:
'imageSlot'
},
{
label
:
'价格(元)'
,
formatter
:
cellValue
=>
{
return
cellValue
.
retailPrice
?
Number
(
Number
(
cellValue
.
retailPrice
/
100
).
toFixed
(
2
))
:
'--'
}
}
]
const
merchantGoodsTableCol
=
[
{
label
:
''
,
prop
:
''
,
width
:
80
,
addHtml
:
'selfRadioHtml'
},
{
label
:
'商品信息'
,
addHtml
:
'goodsNameSlot'
},
{
label
:
'门店名称'
,
prop
:
'merchantName'
},
{
label
:
'零售价(元)'
,
formatter
:
cellValue
=>
{
return
cellValue
.
retailPrice
?
Number
(
Number
(
cellValue
.
retailPrice
/
100
).
toFixed
(
2
))
:
'--'
}
},
{
label
:
'划线价(元)'
,
formatter
:
cellValue
=>
{
return
cellValue
.
originalPrice
?
Number
(
Number
(
cellValue
.
originalPrice
/
100
).
toFixed
(
2
))
:
'--'
}
}
]
export
default
{
name
:
'selectStore'
,
data
()
{
...
...
@@ -67,7 +138,7 @@ export default {
name
:
'goodsName'
,
type
:
'input'
,
placeholder
:
'请输入商品名称'
,
width
:
'
3
00px'
,
width
:
'
2
00px'
,
labelWidth
:
'10px'
,
isClear
:
true
}
...
...
@@ -79,30 +150,10 @@ export default {
getListApi
:
this
.
$apis
.
goods
.
getCarlifeGoodsApi
,
tableParams
:
{
listName
:
'list'
,
tableColumns
:
[
{
label
:
''
,
prop
:
''
,
width
:
80
,
addHtml
:
'radioHtml'
},
{
label
:
'商品名称'
,
prop
:
'goodsName'
},
{
label
:
'缩略图'
,
addHtml
:
'imageSlot'
},
{
label
:
'价格(元)'
,
formatter
:
cellValue
=>
{
return
cellValue
.
retailPrice
?
Number
(
Number
(
cellValue
.
retailPrice
/
100
).
toFixed
(
2
))
:
'--'
}
}
]
tableColumns
:
defaultTableCol
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
},
pageSizes
:
[
5
,
10
,
20
,
30
,
40
],
baseData
:
{}
}
},
...
...
@@ -133,8 +184,13 @@ export default {
// minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0,
// retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0,
// }
this
.
searchForm
.
discoverGoodsId
=
this
.
routeInfo
.
type
==
2
?
this
.
routeInfo
.
id
:
''
this
.
searchForm
.
goodsType
=
this
.
routeInfo
.
goodsType
this
.
searchForm
.
discoverGoodsId
=
this
.
routeInfo
.
type
==
2
?
this
.
routeInfo
.
id
:
''
//1查看,2编辑,空是新增,编辑进来要传id
this
.
searchForm
.
goodsType
=
this
.
routeInfo
.
goodsType
// 1是配置 2是车主
if
(
this
.
goodsInfo
.
goodsSource
==
2
){
//来源是门店自营的搜素和列表字段都要改
this
.
searchFormData
.
push
(
MERCHANT_SEARCH_ITEM
)
this
.
tableParams
.
tableColumns
=
merchantGoodsTableCol
this
.
getListApi
=
this
.
$apis
.
goods
.
getSelfSupportGoodsApi
}
},
mounted
()
{
...
...
@@ -146,6 +202,14 @@ export default {
resetTable
()
{
this
.
$refs
.
goodsRef
.
refreshTable
()
},
beforeSearchFn
()
{
return
new
Promise
(
resolve
=>
{
if
(
this
.
goodsInfo
.
goodsSource
==
2
){
delete
this
.
searchForm
.
goodsType
}
resolve
()
})
},
setTableFinishFun
()
{
this
.
$refs
.
goodsRef
.
tableHeightValues
=
'460px'
},
...
...
@@ -174,6 +238,14 @@ export default {
margin-top
:
1px
;
}
}
.goodsNameSlot
{
img{
width
:
36px
;
height
:
36px
;
vertical-align
:
middle
;
margin-right
:
8px
;
}
}
.select-store
{
.storeDailog
{
width
:
500px
;
...
...
@@ -223,7 +295,7 @@ export default {
.p-16
{
padding
:
16px
;
}
.store-table
.el-radio__label
{
/
deep
/
.store-table
.el-radio__label
{
display
:
none
;
}
}
...
...
src/views/goods/index.vue
View file @
9b1e8b5
...
...
@@ -4,9 +4,7 @@
<preferList
v-if=
"activeName == '2'"
></preferList>
<div
v-else
class=
"table-wrap"
>
<GLCombiForm
ref=
"showSearch"
class=
"search-wrap"
:rowNumber=
"1"
:formObj=
"tableSearchForm"
:formData=
"searchFormData"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
>
<div
slot=
"categorySlot"
>
<brandCascader
ref=
"cascaderRef"
@
clickItem=
"selectCategory"
class=
"category-slot-class"
></brandCascader>
</div>
</GLCombiForm>
<div
class=
"operate-wrap"
>
<span
class=
"table-title"
>
发现商品列表
</span>
...
...
@@ -69,13 +67,11 @@
<
script
>
import
url
from
'@/assets/empty.png'
import
brandCascader
from
'./components/brandCascader'
import
preferList
from
'./preferList'
import
{
exportFn
}
from
'@/common/constant'
export
default
{
name
:
'App'
,
components
:
{
brandCascader
,
preferList
},
beforeRouteEnter
(
to
,
from
,
next
)
{
...
...
@@ -84,6 +80,9 @@
if
(
from
.
path
.
indexOf
(
'/goods/addPrefer'
)
==
0
||
(
from
.
path
.
indexOf
(
'/goods/browseList'
)
==
0
&&
from
.
query
.
activeName
==
2
))
{
vm
.
activeName
=
'2'
}
})
},
created
()
{
this
.
getCategory
()
},
data
()
{
return
{
tableSearchForm
:
{
...
...
@@ -190,9 +189,12 @@
type
:
'input'
},
{
label
:
'商品分类'
,
name
:
'goodsCategory'
,
addHtml
:
'categorySlot'
label
:
'分类名称'
,
name
:
'associationClassifyFirstId'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'id'
,
optionLabel
:
'categoryName'
,
},
],
getListApi
:
this
.
$apis
.
goods
.
getGoodsListApi
,
...
...
@@ -281,7 +283,6 @@
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'pageNum'
,
totalCount
:
'total'
}
}
},
created
()
{},
mounted
()
{},
methods
:
{
// 明细
...
...
@@ -312,6 +313,20 @@
}
})
},
getCategory
()
{
const
params
=
{
pageSize
:
10000
,
pageNum
:
1
,
categoryType
:
1
}
this
.
$apis
.
category
.
getCategoryListApi
(
params
).
then
(
res
=>
{
if
(
res
?.
list
?.
length
)
{
const
_target
=
this
.
searchFormData
.
find
(
item
=>
item
.
name
==
'associationClassifyFirstId'
)
_target
&&
(
_target
.
optionList
=
res
.
list
)
console
.
log
(
this
.
searchFormData
)
}
})
},
handleExport
()
{
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
searchForm
)
params
.
goodsType
=
1
...
...
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