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 283aa717
authored
Jul 10, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
联调
1 parent
d160fe05
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
971 additions
and
123 deletions
src/api/modules/goods.js
src/views/channel/add.vue
src/views/channel/index.vue
src/views/goods/add.vue
src/views/goods/components/brandCascader.vue
src/views/goods/components/selectGoods.vue
src/views/goods/components/selectMerchantDialog.vue
src/views/goods/index.vue
src/views/store/add.vue
src/views/store/components/selectCarDialog.vue
src/api/modules/goods.js
View file @
283aa71
...
@@ -11,6 +11,53 @@ const getGoodsListApi = params => {
...
@@ -11,6 +11,53 @@ const getGoodsListApi = params => {
})
})
}
}
const
updateGoodsStatusApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.configuration.upgrade.update.status'
return
http
({
url
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
const
delGoodsApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.configuration.upgrade.delete'
return
http
({
url
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
const
getCarlifeGoodsApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.smartcarlife.page'
return
http
({
url
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
const
addGoodsApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.configuration.upgrade.add.or.update'
return
http
({
url
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
export
default
{
export
default
{
getGoodsListApi
getGoodsListApi
,
updateGoodsStatusApi
,
delGoodsApi
,
getCarlifeGoodsApi
,
addGoodsApi
}
}
\ No newline at end of file
\ No newline at end of file
src/views/channel/add.vue
View file @
283aa71
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
<div
class=
"add-container"
>
<div
class=
"add-container"
>
<div
class=
"title"
>
{{
this
.
channelForm
.
channelName
}}
编辑
</div>
<div
class=
"title"
>
{{
this
.
channelForm
.
channelName
}}
编辑
</div>
<div
class=
"channel-content gl-form-page"
>
<div
class=
"channel-content gl-form-page"
>
<el-form
ref=
"ruleForm"
:model=
"channelForm"
label-width=
"154px"
size=
"small"
:rules=
"rules"
>
<el-form
ref=
"ruleForm
1
"
:model=
"channelForm"
label-width=
"154px"
size=
"small"
:rules=
"rules"
>
<el-form-item
label=
"频道名称:"
prop=
"channelName"
>
<el-form-item
label=
"频道名称:"
prop=
"channelName"
>
<el-input
v-model=
"channelForm.channelName"
></el-input>
<el-input
v-model=
"channelForm.channelName"
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"频道子名称:"
prop=
"channelName"
>
<el-form-item
label=
"频道子名称:"
prop=
"channel
Child
Name"
>
<el-input
v-model=
"channelForm.channelName"
></el-input>
<el-input
v-model=
"channelForm.channel
Child
Name"
></el-input>
</el-form-item>
</el-form-item>
<span
v-if=
"channelForm.channelType == 1"
>
<span
v-if=
"channelForm.channelType == 1"
>
<el-form-item
label=
"频道主题:"
prop=
"channelStyle"
>
<el-form-item
label=
"频道主题:"
prop=
"channelStyle"
>
...
@@ -70,6 +70,7 @@ export default {
...
@@ -70,6 +70,7 @@ export default {
publicityImgArr
:
[],
publicityImgArr
:
[],
publicityImg
:
''
,
publicityImg
:
''
,
channelImg
:
''
,
channelImg
:
''
,
channelChildName
:
''
,
channelImgArr
:
[]
channelImgArr
:
[]
},
},
channelImgbgArr
:
[
'banner1'
,
'banner2'
],
channelImgbgArr
:
[
'banner1'
,
'banner2'
],
...
@@ -94,11 +95,12 @@ export default {
...
@@ -94,11 +95,12 @@ export default {
isClose
:
true
isClose
:
true
},
},
rules
:
{
rules
:
{
channelName
:
[{
required
:
true
,
message
:
'请输入频道名称'
,
trigger
:
'
blur
'
}],
channelName
:
[{
required
:
true
,
message
:
'请输入频道名称'
,
trigger
:
'
change
'
}],
channelStyle
:
[{
required
:
true
,
message
:
'请选择频道主题'
,
trigger
:
'change'
}],
channelStyle
:
[{
required
:
true
,
message
:
'请选择频道主题'
,
trigger
:
'change'
}],
publicityImg
:
[{
required
:
true
,
message
:
'请上传频道分享预览图'
,
trigger
:
'change'
}],
publicityImg
:
[{
required
:
true
,
message
:
'请上传频道分享预览图'
,
trigger
:
'change'
}],
channelImg
:
[{
required
:
true
,
message
:
'请上传频道banner'
,
trigger
:
'change'
}],
channelImg
:
[{
required
:
true
,
message
:
'请上传频道banner'
,
trigger
:
'change'
}],
promotion
:
[{
required
:
true
,
message
:
'请输入频道分享文案'
,
trigger
:
'blur'
}]
promotion
:
[{
required
:
true
,
message
:
'请输入频道分享文案'
,
trigger
:
'blur'
}],
channelChildName
:
[{
required
:
true
,
message
:
'请输入频道子名称'
,
trigger
:
'change'
}],
}
}
}
}
},
},
...
@@ -144,19 +146,17 @@ export default {
...
@@ -144,19 +146,17 @@ export default {
this
.
$refs
.
ruleForm
.
clearValidate
(
val
.
key
)
this
.
$refs
.
ruleForm
.
clearValidate
(
val
.
key
)
},
},
handleSave
()
{
handleSave
()
{
this
.
$refs
.
ruleForm1
.
validate
(
valid1
=>
{
if
(
valid1
){
this
.
$refs
.
ruleForm
.
validate
(
valid
=>
{
this
.
$refs
.
ruleForm
.
validate
(
valid
=>
{
if
(
!
this
.
channelForm
.
channelImg
)
{
if
(
!
this
.
channelForm
.
channelImg
)
{
this
.
channelImgFlag
=
true
this
.
channelImgFlag
=
true
return
return
}
}
// if (!this.channelForm.publicityImg) {
// this.publicityImgFlag = true
// return
// }
if
(
valid
)
{
if
(
valid
)
{
let
params
=
{
let
params
=
{
channelName
:
this
.
channelForm
.
channelName
,
channelName
:
this
.
channelForm
.
channelName
,
channelChildName
:
this
.
channelForm
.
channelChildName
,
channelType
:
this
.
channelForm
.
channelType
,
channelType
:
this
.
channelForm
.
channelType
,
channelStyle
:
this
.
channelForm
.
channelStyle
,
channelStyle
:
this
.
channelForm
.
channelStyle
,
channelImg
:
this
.
channelForm
.
channelImg
,
channelImg
:
this
.
channelForm
.
channelImg
,
...
@@ -182,6 +182,8 @@ export default {
...
@@ -182,6 +182,8 @@ export default {
}
}
})
})
}
}
})
}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/channel/index.vue
View file @
283aa71
...
@@ -75,7 +75,7 @@ export default {
...
@@ -75,7 +75,7 @@ export default {
},
},
{
{
label
:
'频道子名称'
,
label
:
'频道子名称'
,
prop
:
'channelName'
prop
:
'channel
Child
Name'
},
},
{
{
label
:
'频道宣传语'
,
label
:
'频道宣传语'
,
...
...
src/views/goods/add.vue
View file @
283aa71
...
@@ -2,87 +2,93 @@
...
@@ -2,87 +2,93 @@
<div
class=
"container"
>
<div
class=
"container"
>
<glsx-combi-form
:isInline=
"false"
class=
"glsx-combi-form"
ref=
"baseInfoRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:formObj
.
sync=
"formObj"
:formData=
"formData"
:formRules=
"myRule"
>
<glsx-combi-form
:isInline=
"false"
class=
"glsx-combi-form"
ref=
"baseInfoRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:formObj
.
sync=
"formObj"
:formData=
"formData"
:formRules=
"myRule"
>
<div
slot=
"selectGoodsSlot"
>
<div
slot=
"selectGoodsSlot"
>
<el-button
class=
"el-icon-plus"
size=
"small"
@
click=
"open
BrandDialog"
>
选择商品
</el-button>
<el-button
class=
"el-icon-plus"
size=
"small"
@
click=
"open
GoodsDialog"
>
{{
formObj
.
smartcarlifeInfoId
?
'重新选择'
:
'选择商品'
}}
</el-button>
</div>
</div>
<div
slot=
"goodsInfoSlot"
class=
"goods-wrap"
>
<div
slot=
"goodsInfoSlot"
class=
"goods-wrap"
>
<glsx-combi-form
:isInline=
"false"
ref=
"goodsInfoRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:formObj
.
sync=
"
goodsF
ormObj"
:formData=
"goodsFormData"
:formRules=
"goodsRule"
>
<glsx-combi-form
:isInline=
"false"
ref=
"goodsInfoRef"
labelWidth=
"154px"
defaultWidth=
"432px"
:formObj
.
sync=
"
f
ormObj"
:formData=
"goodsFormData"
:formRules=
"goodsRule"
>
<div
slot=
"uploadSlot"
>
<div
slot=
"uploadSlot"
>
<glsx-preview
:picOptions=
"posterOptions"
:imageUrlArr=
"formObj.
videoCoverArr
"
@
change=
"changeChannelImg"
></glsx-preview>
<glsx-preview
:picOptions=
"posterOptions"
:imageUrlArr=
"formObj.
coverList
"
@
change=
"changeChannelImg"
></glsx-preview>
</div>
</div>
</glsx-combi-form>
</glsx-combi-form>
</div>
</div>
<div
slot=
"paymentSlot"
>
<div
slot=
"paymentSlot"
>
<el-radio-group
v-model=
"formObj.
brand
Type"
>
<el-radio-group
v-model=
"formObj.
payment
Type"
>
<el-radio
:label=
"1"
>
全款
</el-radio>
<el-radio
:label=
"1"
>
全款
</el-radio>
<el-radio
:label=
"2"
>
定金+尾款
</el-radio>
<el-radio
:label=
"2"
>
定金+尾款
</el-radio>
</el-radio-group>
</el-radio-group>
<div
class=
"money-wrap"
v-if=
"formObj.
brand
Type == 2"
>
<div
class=
"money-wrap"
v-if=
"formObj.
payment
Type == 2"
>
<label
class=
"label"
for=
""
>
定金金额/元:
</label>
<label
class=
"label"
for=
""
>
定金金额/元:
</label>
<el-input
v-model=
"
configNam
e"
></el-input>
<el-input
v-model=
"
formObj.depositPric
e"
></el-input>
</div>
</div>
</div>
</div>
<div
slot=
"saleStoreSlot"
>
<div
slot=
"saleStoreSlot"
>
<el-button
class=
"el-icon-plus"
size=
"small"
@
click=
"openBrandDialog"
>
选择门店
</el-button>
<el-button
class=
"el-icon-plus"
size=
"small"
@
click=
"closeDialog"
>
选择门店
</el-button>
<GLTable
class=
"selected-table"
:hasPage=
"false"
ref=
"selectedRef"
:tableParams=
"selectedtableParams"
:tableData=
"[]"
>
<GLTable
class=
"selected-table"
:hasPage=
"false"
ref=
"selectedRef"
:tableParams=
"selectedtableParams"
:tableData=
"merchantRequestList"
>
<div
slot=
"activityPriceSlot"
slot-scope=
"scope"
>
<el-input
placeholder=
"请输入"
v-model=
"scope.scope.activityPrice"
/>
</div>
<div
slot=
"retainagePriceSlot"
slot-scope=
"scope"
>
{{
retainagePriceFn
(
scope
.
scope
.
activityPrice
)
}}
</div>
<div
slot=
"auth-button"
slot-scope=
"scope"
>
<div
slot=
"auth-button"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handle
Edit
(scope.scope)"
>
删除
</el-button>
<el-button
type=
"text"
@
click=
"handle
Del
(scope.scope)"
>
删除
</el-button>
</div>
</div>
</GLTable>
</GLTable>
</div>
</div>
<div
slot=
"carSeriesSlot"
>
<div
slot=
"carSeriesSlot"
>
<el-radio-group
v-model=
"formObj.
brand
Type"
>
<el-radio-group
v-model=
"formObj.
vehicleSeries
Type"
>
<el-radio
:label=
"1"
>
全部
</el-radio>
<el-radio
:label=
"1"
>
全部
</el-radio>
<el-radio
:label=
"2"
>
部分
</el-radio>
<el-radio
:label=
"2"
>
部分
</el-radio>
</el-radio-group>
</el-radio-group>
<div
v-if=
"formObj.brandType == 2"
>
<div
v-if=
"formObj.vehicleSeriesType == 2"
>
<el-select
v-model=
"value1"
multiple
placeholder=
"请选择"
>
<el-button
type=
"default"
class=
"el-icon-plus"
v-if=
"!isDisabled"
@
click=
"handleCarSeriesClose"
>
选择车系
</el-button>
<el-option
<div
class=
"car-series-wrap"
v-if=
"vehicleSeriesRequestList && vehicleSeriesRequestList.length"
>
v-for=
"item in options"
<div
class=
"car-series-item"
v-for=
"item in vehicleSeriesRequestList"
:key=
"item.vehicleSeriesId"
>
{{
item
.
vehicleSeriesName
}}
</div>
:key=
"item.value"
</div>
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</div>
</div>
</div>
</div>
<div
slot=
"categorySlot"
>
<div
slot=
"categorySlot"
>
<brandCascader
v-model=
"brandId
"
></brandCascader>
<brandCascader
:listTree=
"categoryData"
:defaultProps=
"defaultProps"
@
clickItem=
"selectCategory"
v-model=
"brandId"
class=
"category-class
"
></brandCascader>
</div>
</div>
</glsx-combi-form>
</glsx-combi-form>
<GLFooter>
<GLFooter>
<el-button
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave"
>
确定
</el-button>
</GLFooter>
</GLFooter>
<GLDialog
title=
"选择车系"
<selectCarDialog
v-if=
"carDialogVisible"
@
handleClose=
"handleCarSeriesClose"
@
handleConfirm=
"handleConfirm"
:dialogVisible=
"carDialogVisible"
></selectCarDialog>
mode=
"mid"
<selectGoods
:dialogVisible=
"goodsVisible"
:goodsInfo=
"goodsInfo"
@
handleGoodsConfirm=
"handleGoodsConfirm"
@
handleGoodsClose=
"handleGoodsClose"
></selectGoods>
:visible
.
sync=
"dialogVisible"
<selectMerchantDialog
@
confirmDialog=
"confirmDialog"
@
closeDialog=
"closeDialog"
:selectedGoodsList=
"
{}" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible">
</selectMerchantDialog>
:before-close=
"handleClose"
:close-on-click-modal=
"false"
@
onOk=
"handleConfirm"
@
onCancel=
"handleClose"
>
<div
class=
"car-container"
>
</div>
</GLDialog>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
glsxCombiForm
from
'@/components/glsx-combi-form'
import
glsxCombiForm
from
'@/components/glsx-combi-form'
import
brandCascader
from
'./components/brandCascader'
import
brandCascader
from
'./components/brandCascader'
import
selectGoods
from
'./components/selectGoods'
import
selectCarDialog
from
'@/views/store/components/selectCarDialog'
import
selectMerchantDialog
from
'./components/selectMerchantDialog'
export
default
{
export
default
{
name
:
'add'
,
name
:
'add'
,
components
:
{
components
:
{
glsxCombiForm
,
glsxCombiForm
,
brandCascader
brandCascader
,
selectGoods
,
selectCarDialog
,
selectMerchantDialog
},
},
data
()
{
data
()
{
return
{
return
{
brandId
:
''
,
brandId
:
''
,
goodsFormObj
:{
goodsVisible
:
false
,
carDialogVisible
:
false
,
merchantDialogVisible
:
false
,
goodsInfo
:
{},
defaultProps
:{
children
:
'categoryName'
,
label
:
'childs'
},
},
posterOptions
:
{
posterOptions
:
{
width
:
'104px'
,
width
:
'104px'
,
height
:
'1
38
px'
,
height
:
'1
04
px'
,
key
:
'posterImg'
,
key
:
'posterImg'
,
isClose
:
true
isClose
:
true
},
},
...
@@ -94,56 +100,129 @@ export default {
...
@@ -94,56 +100,129 @@ export default {
},
},
{
{
label
:
'商品名称'
,
label
:
'商品名称'
,
name
:
'goodsName'
,
type
:
'input'
,
type
:
'input'
,
isDisabled
:
false
isDisabled
:
false
},
},
{
{
label
:
'售价'
,
label
:
'售价
(元)
'
,
name
:
'
titl
e'
,
name
:
'
retailPric
e'
,
type
:
'showTxt'
type
:
'showTxt'
},
},
{
{
label
:
'最低售价'
,
label
:
'最低售价
(元)
'
,
name
:
'
titl
e'
,
name
:
'
minSellPric
e'
,
type
:
'showTxt'
type
:
'showTxt'
},
},
],
],
options
:
[{
value
:
'选项1'
,
label
:
'黄金糕'
},
{
value
:
'选项2'
,
label
:
'双皮奶'
},
{
value
:
'选项3'
,
label
:
'蚵仔煎'
},
{
value
:
'选项4'
,
label
:
'龙须面'
},
{
value
:
'选项5'
,
label
:
'北京烤鸭'
}],
dialogVisible
:
false
,
dialogVisible
:
false
,
formObj
:{
formObj
:{
brandType
:
1
smartcarlifeInfoId
:
''
,
goodsName
:
''
,
goodsImage
:
''
,
coverList
:
[],
paymentType
:
1
,
depositPrice
:
''
,
vehicleSeriesType
:
1
,
associationClassifyFirstId
:
''
,
associationClassifySecondId
:
''
},
categoryData
:
[],
merchantRequestList
:[],
vehicleSeriesRequestList
:
[],
myRule
:
{
selectGoodsName
:
[
{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
!
this
.
formObj
.
smartcarlifeInfoId
){
callback
(
new
Error
(
'请选择商品'
))
}
else
{
callback
()
}
},
trigger
:
'change'
}
],
goodsInfoName
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
!
this
.
formObj
.
coverList
&&
!
this
.
formObj
.
coverList
[
0
]){
callback
(
new
Error
(
'请上传商品图'
))
}
else
if
(
!
this
.
formObj
.
goodsName
){
callback
(
new
Error
(
'请输入商品名称'
))
}
else
{
callback
()
}
},
trigger
:
'change'
}],
paymentType
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
formObj
.
paymentType
==
2
&&
!
this
.
formObj
.
depositPrice
){
callback
(
new
Error
(
'请输入定金金额'
))
}
else
{
callback
()
}
},
trigger
:
'change'
}],
saleStore
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
const
target
=
this
.
merchantRequestList
.
find
(
item
=>
!
item
.
activityPrice
)
if
(
!
this
.
merchantRequestList
.
length
){
callback
(
new
Error
(
'请选择门店'
))
}
else
if
(
target
){
callback
(
new
Error
(
'请输入门店活动价'
))
}
else
{
callback
()
}
},
trigger
:
'change'
}],
carSeriesName
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
formObj
.
vehicleSeriesType
==
2
&&
!
this
.
vehicleSeriesRequestList
.
length
){
callback
(
new
Error
(
'请选择适用车系'
))
}
else
{
callback
()
}
},
trigger
:
'change'
}],
categoryName
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
!
this
.
formObj
.
associationClassifyFirstId
||
!
this
.
formObj
.
associationClassifySecondId
){
callback
(
new
Error
(
'请选择关联商品分类'
))
}
else
{
callback
()
}
},
trigger
:
'change'
}],
},
},
formData
:[
formData
:[
{
{
label
:
'选择商品'
,
label
:
'选择商品'
,
name
:
'selectGoodsName'
,
addHtml
:
'selectGoodsSlot'
,
addHtml
:
'selectGoodsSlot'
,
type
:
'input'
,
type
:
'input'
,
isDisabled
:
false
isDisabled
:
false
},
},
{
{
label
:
'商品信息'
,
label
:
'商品信息'
,
name
:
'goodsInfoName'
,
addHtml
:
'goodsInfoSlot'
,
addHtml
:
'goodsInfoSlot'
,
type
:
'input'
,
type
:
'input'
,
isDisabled
:
false
isDisabled
:
false
},
},
{
{
label
:
'收款方式'
,
label
:
'收款方式'
,
name
:
'
titl
e'
,
name
:
'
paymentTyp
e'
,
addHtml
:
'paymentSlot'
addHtml
:
'paymentSlot'
},
},
{
{
...
@@ -153,45 +232,165 @@ export default {
...
@@ -153,45 +232,165 @@ export default {
},
},
{
{
label
:
'适用车系'
,
label
:
'适用车系'
,
name
:
'carSeries'
,
name
:
'carSeries
Name
'
,
addHtml
:
'carSeriesSlot'
,
addHtml
:
'carSeriesSlot'
,
},
},
{
{
label
:
'关联商品分类'
,
label
:
'关联商品分类'
,
name
:
'
titl
e'
,
name
:
'
categoryNam
e'
,
addHtml
:
'categorySlot'
addHtml
:
'categorySlot'
}
}
],
],
selectedtableParams
:
{
selectedtableParams
:
{
listName
:
'list'
,
listName
:
'list'
,
tableOption
:
{
tableOption
:
{
width
:
1
5
0
width
:
1
8
0
},
},
tableColumns
:
[
tableColumns
:
[
{
{
label
:
'门店名称'
,
label
:
'门店名称'
,
width
:
12
0
,
width
:
20
0
,
prop
:
'
brand
Name'
prop
:
'
merchant
Name'
},
},
{
{
label
:
'门店活动价(元)'
,
label
:
'门店活动价(元)'
,
addHtml
:
'
goodName
'
addHtml
:
'
activityPriceSlot
'
},
},
{
{
label
:
'尾款金额(元)'
,
label
:
'尾款金额(元)'
,
addHtml
:
'
couponCos
t'
addHtml
:
'
retainagePriceSlo
t'
}
}
]
]
}
}
}
}
},
},
created
(){
// this.getCategory()
},
methods
:{
methods
:{
retainagePriceFn
(
price
){
let
depositPrice
=
this
.
formObj
.
paymentType
==
1
?
0
:
this
.
formObj
.
depositPrice
if
(
!
price
){
return
'待计算'
}
else
{
return
price
-
depositPrice
}
},
openBrandDialog
(){
openBrandDialog
(){
this
.
dialogVisible
=
!
this
.
dialogVisible
this
.
dialogVisible
=
!
this
.
dialogVisible
},
},
openGoodsDialog
(){
this
.
goodsVisible
=
true
},
handleGoodsClose
(){
this
.
goodsVisible
=
false
},
handleGoodsConfirm
(
e
){
let
{
id
:
smartcarlifeInfoId
,
goodsName
,
goodsImage
,
minSellPrice
,
retailPrice
}
=
e
||
{}
minSellPrice
=
minSellPrice
?
Number
(
Number
(
minSellPrice
/
100
).
toFixed
(
2
))
:
0
retailPrice
=
retailPrice
?
Number
(
Number
(
retailPrice
/
100
).
toFixed
(
2
))
:
0
this
.
formObj
=
{...
this
.
formObj
,
smartcarlifeInfoId
,
goodsName
,
goodsImage
,
coverList
:
[
goodsImage
],
minSellPrice
,
retailPrice
}
this
.
handleGoodsClose
()
},
handleCarSeriesClose
(){
this
.
carDialogVisible
=
!
this
.
carDialogVisible
},
handleConfirm
(
e
=
{}){
let
carList
=
[]
for
(
const
key
in
e
){
for
(
const
sonKey
in
e
[
key
]){
carList
=
[...
carList
,
...
e
[
key
][
sonKey
]]
}
}
this
.
vehicleSeriesRequestList
=
carList
.
map
(
item
=>
{
const
{
id
,
name
,
parentId
,
parentName
,
rootId
,
rootName
}
=
item
return
{
brandId
:
rootId
,
brandName
:
rootName
,
childBrandId
:
parentId
,
childBrandName
:
parentName
,
vehicleSeriesId
:
id
,
vehicleSeriesName
:
name
}
})
this
.
handleCarSeriesClose
()
},
confirmDialog
(
e
){
console
.
log
(
e
)
this
.
merchantRequestList
=
e
||
[]
this
.
closeDialog
()
},
closeDialog
(){
this
.
merchantDialogVisible
=
!
this
.
merchantDialogVisible
console
.
log
(
this
.
merchantDialogVisible
)
},
handleDel
(
row
)
{
const
idx
=
this
.
merchantRequestList
.
findIndex
(
item
=>
item
.
id
==
row
.
id
)
this
.
merchantRequestList
.
splice
(
idx
,
1
)
// this.validateGoods()
},
selectCategory
(
e
){
this
.
formObj
.
associationClassifyFirstId
=
e
?.
parent
?.
id
this
.
formObj
.
associationClassifySecondId
=
e
?.
data
?.
id
},
getParams
(){
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
formObj
))
obj
.
goodsImage
=
obj
.
coverList
[
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
let
merchantRequestList
=
this
.
merchantRequestList
.
map
(
item
=>
{
let
{
merchantNo
:
merchantId
,
merchantName
,
activityPrice
}
=
item
let
price
=
this
.
formObj
.
paymentType
==
1
?
0
:
this
.
formObj
.
depositPrice
let
retainagePrice
=
activityPrice
-
price
activityPrice
=
activityPrice
?
Number
(
Number
(
activityPrice
*
10
*
10
).
toFixed
(
0
))
:
0
retainagePrice
=
retainagePrice
?
Number
(
Number
(
retainagePrice
*
10
*
10
).
toFixed
(
0
))
:
0
return
{
merchantId
,
merchantName
,
activityPrice
,
retainagePrice
}
})
const
params
=
{
merchantRequestList
,
vehicleSeriesRequestList
:
this
.
vehicleSeriesRequestList
,
...
obj
}
return
params
},
handleSave
(){
handleSave
(){
console
.
log
(
this
.
brandId
)
this
.
$refs
.
baseInfoRef
.
$refs
.
formRef
.
validate
(
valid
=>
{
if
(
valid
){
console
.
log
(
this
.
getParams
())
const
params
=
this
.
getParams
()
this
.
$apis
.
goods
.
addGoodsApi
(
params
).
then
(
res
=>
{
if
(
res
)
{
this
.
$message
.
success
(
'新增成功'
)
}
})
}
})
},
getCategory
(){
const
params
=
{
pageSize
:
1000
,
pageNum
:
1
,
categoryType
:
1
}
this
.
$apis
.
category
.
getCategoryListApi
(
params
).
then
(
res
=>
{
if
(
res
?.
list
?.
length
){
let
list
=
res
.
list
.
filter
(
item
=>
item
.
categoryLevel
==
1
).
map
(
item
=>
({...
item
,
childs
:
[]}))
let
level2List
=
res
.
list
.
filter
(
item
=>
item
.
categoryLevel
==
2
)
level2List
.
forEach
(
item
=>
{
const
target
=
list
.
find
(
row
=>
row
.
id
==
item
.
parentCategoryId
)
if
(
target
){
target
[
'childs'
].
push
(
item
)
}
})
this
.
categoryData
=
list
console
.
log
(
this
.
categoryData
)
}
}
})
},
}
}
}
}
</
script
>
</
script
>
...
@@ -204,6 +403,9 @@ export default {
...
@@ -204,6 +403,9 @@ export default {
background
:
#F9F9F9
;
background
:
#F9F9F9
;
border-radius
:
4px
;
border-radius
:
4px
;
}
}
.category-class
{
width
:
432px
;
}
.money-wrap
{
.money-wrap
{
.label{
.label{
width
:
92px
;
width
:
92px
;
...
@@ -223,5 +425,26 @@ export default {
...
@@ -223,5 +425,26 @@ export default {
width
:
100%
;
width
:
100%
;
max-width
:
1100px
;
max-width
:
1100px
;
}
}
.car-series-wrap
{
margin-top
:
8px
;
width
:
580px
;
height
:
80px
;
background
:
#FFFFFF
;
border
:
1px
solid
#E8E8EA
;
border-radius
:
4px
;
padding
:
6px
8px
;
overflow-y
:
auto
;
.car-series-item{
display
:
inline-block
;
padding
:
0
8px
;
height
:
24px
;
color
:
#666666
;
line-height
:
24px
;
background
:
#FAFBFE
;
border
:
1px
solid
#E5E5E5
;
border-radius
:
4px
;
margin-right
:
4px
;
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/goods/components/brandCascader.vue
View file @
283aa71
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<i
v-show=
"brandTree"
class=
"el-icon-arrow-down"
style=
"color:#909399"
></i>
<i
v-show=
"brandTree"
class=
"el-icon-arrow-down"
style=
"color:#909399"
></i>
</div>
</div>
<div
:class=
"['tree-box',
{'arrowUp': arrowUp}]" v-show="brandTree">
<div
:class=
"['tree-box',
{'arrowUp': arrowUp}]" v-show="brandTree">
<el-tree
:default-expanded-keys=
"expandedList"
accordion
empty-text=
"暂无数据"
class=
"filter-tree"
:data=
"
brandListTree
"
:props=
"defaultProps"
node-key=
"id"
ref=
"tree"
>
<el-tree
:default-expanded-keys=
"expandedList"
accordion
empty-text=
"暂无数据"
class=
"filter-tree"
:data=
"
categoryData
"
:props=
"defaultProps"
node-key=
"id"
ref=
"tree"
>
<div
:class=
"['custom-tree-node',
{'active': data.id == curBrand.id
&&
node.level==2}]" slot-scope="{ node, data }" @click="selectBrand(node)" >
<div
:class=
"['custom-tree-node',
{'active': data.id == curBrand.id
&&
node.level==2}]" slot-scope="{ node, data }" @click="selectBrand(node)" >
<span>
{{
node
.
label
}}
</span>
<span>
{{
node
.
label
}}
</span>
</div>
</div>
...
@@ -26,52 +26,35 @@ export default {
...
@@ -26,52 +26,35 @@ export default {
brandTree
:
false
,
brandTree
:
false
,
arrowUp
:
false
,
arrowUp
:
false
,
curBrand
:
{},
curBrand
:
{},
expandedList
:[],
categoryData
:
[],
defaultProps
:
{
defaultProps
:
{
children
:
'child
ren
'
,
children
:
'child
s
'
,
label
:
'
label
'
label
:
'
categoryName
'
},
},
expandedList
:[]
}
}
},
},
model
:
{
model
:
{
prop
:
'value'
,
// 默认是value
prop
:
'value'
,
// 默认是value
event
:
'change
Brand
'
,
// 默认是input
event
:
'change'
,
// 默认是input
},
},
props
:
{
props
:
{
// defaultProps: {
// type: Object,
// default: ()=> {
// return {
// children: 'children',
// label: 'label'
// }
// }
// },
value
:
{
value
:
{
type
:
String
type
:
String
},
},
brandL
istTree
:
{
l
istTree
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
{
default
:
()
=>
{
return
[{
return
[]
id
:
1
,
label
:
'一级 1'
,
children
:
[{
id
:
4
,
label
:
'二级 1-1'
}]
},
{
id
:
2
,
label
:
'一级 2'
,
children
:
[{
id
:
5
,
label
:
'二级 2-1'
},
{
id
:
6
,
label
:
'二级 2-2'
}]
},
{
id
:
3
,
label
:
'一级 3'
,
children
:
[{
id
:
7
,
label
:
'二级 3-1'
},
{
id
:
8
,
label
:
'二级 3-2'
,
}]
}]
}
}
}
}
},
},
...
@@ -83,6 +66,9 @@ export default {
...
@@ -83,6 +66,9 @@ export default {
// deep: true
// deep: true
// }
// }
// },
// },
created
(){
this
.
getCategory
()
},
mounted
()
{
mounted
()
{
document
.
addEventListener
(
"click"
,
this
.
eventListener
);
document
.
addEventListener
(
"click"
,
this
.
eventListener
);
},
},
...
@@ -90,6 +76,27 @@ export default {
...
@@ -90,6 +76,27 @@ export default {
document
.
removeEventListener
(
"click"
,
this
.
eventListener
);
document
.
removeEventListener
(
"click"
,
this
.
eventListener
);
},
},
methods
:
{
methods
:
{
getCategory
(){
const
params
=
{
pageSize
:
1000
,
pageNum
:
1
,
categoryType
:
1
}
this
.
$apis
.
category
.
getCategoryListApi
(
params
).
then
(
res
=>
{
if
(
res
?.
list
?.
length
){
let
list
=
res
.
list
.
filter
(
item
=>
item
.
categoryLevel
==
1
).
map
(
item
=>
({...
item
,
childs
:
[]}))
let
level2List
=
res
.
list
.
filter
(
item
=>
item
.
categoryLevel
==
2
)
level2List
.
forEach
(
item
=>
{
const
target
=
list
.
find
(
row
=>
row
.
id
==
item
.
parentCategoryId
)
if
(
target
){
target
[
'childs'
].
push
(
item
)
}
})
this
.
categoryData
=
list
console
.
log
(
this
.
categoryData
)
}
})
},
eventListener
(
e
){
eventListener
(
e
){
if
(
!
this
.
$refs
?.
cascaderRef
?.
contains
(
e
.
target
))
this
.
brandTree
=
false
;
if
(
!
this
.
$refs
?.
cascaderRef
?.
contains
(
e
.
target
))
this
.
brandTree
=
false
;
},
},
...
@@ -103,12 +110,13 @@ export default {
...
@@ -103,12 +110,13 @@ export default {
}
}
this
.
arrowUp
=
distance
<
100
//判断是否向上展示
this
.
arrowUp
=
distance
<
100
//判断是否向上展示
this
.
brandTree
=
!
this
.
brandTree
this
.
brandTree
=
!
this
.
brandTree
this
.
$emit
(
'clickBrand'
,
this
.
brandTree
)
},
},
selectBrand
(
e
){
selectBrand
(
e
){
if
(
e
.
level
==
2
)
{
if
(
e
.
level
==
2
)
{
this
.
curBrand
=
e
.
data
this
.
curBrand
=
e
.
data
this
.
$emit
(
'changeBrand'
,
this
.
curBrand
.
id
)
this
.
brandTree
=
!
this
.
brandTree
this
.
$emit
(
'change'
,
this
.
curBrand
.
id
)
this
.
$emit
(
'clickItem'
,
{
data
:
e
.
data
,
parent
:
e
.
parent
?.
data
||
{}})
}
}
}
}
}
}
...
...
src/views/goods/components/selectGoods.vue
0 → 100644
View file @
283aa71
<
template
>
<div
class=
"select-store"
>
<GLDialog
bigTitle=
"选择门店"
mode=
"big"
:visible
.
sync=
"dialogVisible"
:before-close=
"handleClose"
:close-on-click-modal=
"false"
@
onOk=
"handleConfirm"
@
onCancel=
"handleClose"
>
<!--
<glsx-combi-form
ref=
"showSearch"
labelWidth=
"105px"
:formObj=
"searchForm"
:formData=
"searchFormData"
>
<span
slot=
"footer"
>
<el-button
:size=
"size"
type=
"primary"
@
click=
"resetTable"
>
查询
</el-button>
</span>
</glsx-combi-form>
-->
<GLTable
ref=
"storeRef"
:noDataImg=
"url"
:tableTotal=
"total"
:searchForm=
"searchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
@
refreshTable=
"getList"
:tableData=
"storeList"
:hasNum=
"false"
:setTableFinishFun=
"setTableFinishFun"
>
<div
slot=
"radioHtml"
class=
"store-table"
slot-scope=
"scope"
>
<el-radio
v-model=
"curInfo.id"
:label=
"scope.scope.id"
@
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>
</GLTable>
</GLDialog>
</div>
</
template
>
<
script
>
import
url
from
'@/assets/empty.png'
export
default
{
name
:
'selectStore'
,
data
()
{
return
{
url
:
url
,
searchForm
:
{
},
// getListApi: this.$apis.common.getMerchantList,
total
:
0
,
storeList
:
[],
heightBox
:
200
,
curInfo
:
{},
// 搜索
// searchFormData: [
// {
// label: '商户名称',
// name: 'merchantName',
// type: 'input',
// placeholder: '请输入商户名称',
// width: '300px',
// labelWidth: '10px'
// },
// {
// label: '商户ID',
// name: 'merchantId',
// type: 'input',
// inputType: 'number',
// placeholder: '请输入商户ID',
// width: '300px',
// labelWidth: '10px'
// }
// ],
pageConfig
:
{
pageSize
:
10
,
currentPage
:
1
},
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
))
:
'--'
}
}
]
},
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'currentPage'
,
totalCount
:
'total'
},
baseData
:
{}
}
},
props
:
{
dialogVisible
:
{
type
:
Boolean
,
default
:
false
},
storeSearchForm
:
{
type
:
Object
},
goodsInfo
:
{
required
:
true
,
default
:
()
=>
{}
}
},
mounted
()
{
let
clientHeight
=
document
.
documentElement
.
clientHeight
this
.
heightBox
=
clientHeight
-
0.15
*
clientHeight
-
425
this
.
curInfo
=
this
.
goodsInfo
||
{}
this
.
getList
()
},
methods
:
{
getList
(
pageCon
)
{
pageCon
&&
(
this
.
pageConfig
=
pageCon
)
var
params
=
{
merchantId
:
this
.
merchantId
,
...
this
.
searchForm
,
...
this
.
pageConfig
// merchantId: '44209390',
}
this
.
$apis
.
goods
.
getCarlifeGoodsApi
(
params
).
then
(
res
=>
{
this
.
storeList
=
res
.
list
this
.
total
=
res
.
total
let
nowIndex
=
this
.
pageConfig
.
pageSize
*
(
this
.
pageConfig
.
currentPage
-
1
)
this
.
storeList
.
forEach
((
item
,
index
)
=>
{
item
.
idx
=
index
+
1
+
nowIndex
})
})
},
resetTable
()
{
this
.
$refs
.
storeRef
.
page
.
currentPage
=
1
this
.
getList
()
},
setTableFinishFun
()
{
this
.
$refs
.
staffRef
.
tableHeightValues
=
'460px'
},
handleClick
(
item
)
{
console
.
log
(
item
)
this
.
curInfo
=
item
},
handleClose
()
{
this
.
$emit
(
'handleGoodsClose'
)
},
handleConfirm
()
{
this
.
$emit
(
'handleGoodsConfirm'
,
this
.
curInfo
)
}
}
}
</
script
>
<
style
lang=
"scss"
>
.select-store
{
.storeDailog
{
width
:
500px
;
}
.title
{
margin-bottom
:
12px
;
}
.customer-tag-box
{
display
:
flex
;
margin
:
20px
16px
;
.tag-label
{
display
:
inline-block
;
height
:
30px
;
line-height
:
30px
;
}
.input-tag-wrapper
{
max-height
:
75px
;
overflow
:
auto
;
position
:
relative
;
font-size
:
14px
;
background-color
:
#fff
;
background-image
:
none
;
border-radius
:
4px
;
border
:
1px
solid
#dcdfe6
;
box-sizing
:
border-box
;
color
:
#666
;
display
:
inline-block
;
outline
:
none
;
padding
:
5px
;
flex-wrap
:
wrap
;
transition
:
border-color
0.2s
cubic-bezier
(
0.645
,
0.045
,
0.355
,
1
);
width
:
648px
;
display
:
flex
;
align-items
:
center
;
cursor
:
pointer
;
i
{
color
:
#75acff
;
margin-right
:
3px
;
font-size
:
14px
;
}
}
}
//
.customer-list
{
//
width
:
calc
(
100%
-
280px
);
//
margin-right
:
10px
;
//
}
.p-16
{
padding
:
16px
;
}
.store-table
.el-radio__label
{
display
:
none
;
}
}
</
style
>
src/views/goods/components/selectMerchantDialog.vue
0 → 100644
View file @
283aa71
<
template
>
<GLDialog
bigTitle=
"选择商品优惠券"
mode=
"big"
:visible
.
sync=
"isVisible"
:show-close=
"true"
:before-close=
"handleClose"
:close-on-click-modal=
"false"
@
onOk=
"onOk"
@
onCancel=
"handleClose"
>
<div
class=
"dialog_body"
>
<GLCombiForm
:rowNumber=
"1"
class=
"dialog_search"
ref=
"searchRef"
:formObj=
"dialogSearchForm"
:formData=
"dialogFormData"
@
handleOk=
"handleOk"
@
handleRest=
"handleRest"
></GLCombiForm>
<div
class=
"dialog_table"
>
<GLTable
v-if=
"showTable"
:pageSizes=
"pageSizes"
ref=
"tableRef"
:pageConf=
"pageConf"
@
setTableFinishFun=
"setTableFinishFun"
:searchForm=
"dialogSearchForm"
:tableParams=
"tableParams"
:getListApi=
"getListApi"
>
<div
slot=
"spreadPrice"
slot-scope=
"scope"
>
<span
:style=
"
{ color: Number(scope.scope.lineationPrice - scope.scope.costPrice)
<
= 0 ? '#eb4e4e' : '#666666' }">
{{
Number
(
Number
(
scope
.
scope
.
lineationPrice
-
scope
.
scope
.
costPrice
).
toFixed
(
1
))
}}
</span>
</div>
</GLTable>
</div>
</div>
</GLDialog>
</
template
>
<
script
>
export
default
{
name
:
'index'
,
props
:
{
isVisible
:
{
type
:
Boolean
,
default
:
false
},
selectedList
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
data
()
{
return
{
showTable
:
true
,
copyList
:
[],
couponList
:
[],
directChargeList
:
[],
pageSizes
:
[
5
,
10
,
20
,
30
,
40
],
dialogSearchForm
:
{
merchantName
:
''
,
merchantId
:
''
},
dialogFormData
:
[
{
label
:
'商户名称'
,
name
:
'merchantName'
,
type
:
'input'
,
isClear
:
true
},
{
label
:
'商户ID'
,
name
:
'merchantId'
,
type
:
'input'
,
isClear
:
true
}
],
getListApi
:
this
.
$apis
.
common
.
getMerchantList
,
pageConf
:
{
pageSize
:
'pageSize'
,
pageNum
:
'currentPage'
,
totalCount
:
'total'
},
tableParams
:
{
listName
:
'list'
,
mutiSelectName
:
'goodsIndex'
,
mutiSelectUniqueKey
:
'id'
,
tableOption
:
false
,
tableColumns
:
[
{
label
:
'商户名称'
,
prop
:
'merchantName'
},
{
label
:
'商户id'
,
prop
:
'merchantNo'
},
]
}
}
},
created
()
{
},
methods
:
{
handleOk
()
{
this
.
$refs
.
tableRef
.
refreshTable
()
},
handleRest
()
{
this
.
dialogSearchForm
=
{
merchantName
:
''
,
merchantId
:
''
}
this
.
handleOk
()
},
onOk
()
{
let
list
=
this
.
$refs
.
tableRef
.
mutiSelectArr
[
this
.
tableParams
.
mutiSelectName
]
||
[]
for
(
let
i
=
0
;
i
<
this
.
selectedList
.
length
;
i
++
)
{
let
idx
=
list
.
findIndex
(
item
=>
item
.
id
==
this
.
selectedList
[
i
].
id
)
if
(
idx
>
-
1
)
{
list
.
splice
(
idx
,
1
)
}
}
list
.
map
(
item
=>
this
.
$set
(
item
,
'activityPrice'
,
''
))
this
.
$emit
(
'confirmDialog'
,
[...
list
,
...
this
.
selectedList
])
},
handleClose
()
{
this
.
$emit
(
'closeDialog'
)
},
setTableFinishFun
()
{
// this.copyList = [...this.selectedGoodsList, ...this[this.curType == 1 ? 'couponList' : 'directChargeList']]
// this.copyList.forEach(row => {
// this.$nextTick(() => {
// let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id)
// if (idx > -1) {
// try {
// this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true)
// let id = this.copyList.findIndex(item => item.id == row.id)
// if (id > -1) this.copyList.splice(id, 1)
// } catch (err) {
// console.log(err)
// }
// }
// })
// })
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.container
{
/deep/
.table-header
{
display
:
inline-flex
!important
;
align-items
:
center
;
justify-content
:
center
;
padding
:
0
!important
;
.el-button
{
min-width
:
0
;
}
}
.good_name
{
img
{
width
:
40px
;
height
:
20px
;
vertical-align
:
text-bottom
;
}
}
.dialog_body
{
border
:
1px
solid
#e5e5e5
;
.dialog_search
{
padding
:
20px
20px
0
;
/deep/
.el-form-item
{
width
:
312px
;
}
}
.coupon_type
{
width
:
100%
;
display
:
inline-block
;
border-bottom
:
1px
solid
#eee
;
.type
{
display
:
inline-block
;
height
:
40px
;
width
:
70px
;
line-height
:
40px
;
font-weight
:
500
;
text-align
:
center
;
font-size
:
16px
;
cursor
:
pointer
;
}
.active_type
{
color
:
#5850ff
;
border-bottom
:
2px
solid
#5850ff
;
}
}
.dialog_table
{
padding
:
20px
;
}
}
}
</
style
>
src/views/goods/index.vue
View file @
283aa71
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
</
template
>
</
template
>
</div>
</div>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<GLTableButton
:buttonList=
"buttonList"
:buttonItem=
"scope"
:buttonNum=
"
3
"
></GLTableButton>
<GLTableButton
:buttonList=
"buttonList"
:buttonItem=
"scope"
:buttonNum=
"
4
"
></GLTableButton>
</div>
</div>
</GLTable>
</GLTable>
</div>
</div>
...
@@ -67,6 +67,59 @@
...
@@ -67,6 +67,59 @@
listeners
:
{
listeners
:
{
click
:
row
=>
this
.
addContent
(
row
.
scope
,
1
)
click
:
row
=>
this
.
addContent
(
row
.
scope
,
1
)
}
}
},
{
type
:
'el-button'
,
name
:
'编辑'
,
attrs
:
{
type
:
'text'
,
fn
:
'编辑'
},
listeners
:
{
click
:
row
=>
this
.
addContent
(
row
.
scope
,
1
)
}
},
{
type
:
'el-button'
,
name
:
'上架'
,
attrs
:
{
type
:
'text'
,
fn
:
'上架'
},
condition
:
row
=>
{
return
row
.
scope
.
goodsStatus
!=
1
},
listeners
:
{
click
:
row
=>
this
.
shelfGoodsFn
(
row
.
scope
,
1
)
}
},
{
type
:
'el-button'
,
name
:
'下架'
,
attrs
:
{
type
:
'text'
,
fn
:
'下架'
},
condition
:
row
=>
{
return
row
.
scope
.
goodsStatus
==
1
},
listeners
:
{
click
:
row
=>
this
.
shelfGoodsFn
(
row
.
scope
,
0
)
}
},
{
type
:
'el-button'
,
name
:
'删除'
,
attrs
:
{
type
:
'text'
,
fn
:
'删除'
},
condition
:
row
=>
{
return
row
.
scope
.
goodsStatus
!=
1
},
listeners
:
{
click
:
row
=>
this
.
delGoodsFn
(
row
.
scope
)
}
}
}
],
],
searchForm
:
{},
searchForm
:
{},
...
@@ -107,7 +160,7 @@
...
@@ -107,7 +160,7 @@
tableParams
:
{
tableParams
:
{
listName
:
'list'
,
listName
:
'list'
,
tableOption
:
{
tableOption
:
{
width
:
1
00
width
:
2
00
},
},
tableColumns
:
[
tableColumns
:
[
{
{
...
@@ -167,6 +220,47 @@
...
@@ -167,6 +220,47 @@
created
()
{},
created
()
{},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
shelfGoodsFn
(
item
,
type
){
if
(
type
==
1
){
this
.
updateStatus
(
item
.
id
,
type
)
}
else
{
this
.
$confirm
(
`确定下架该商品吗`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
callback
:
action
=>
{
if
(
action
==
'confirm'
)
{
this
.
updateStatus
(
item
.
id
,
type
)
}
}
})
}
},
delGoodsFn
(
item
){
this
.
$confirm
(
`确定删除该商品吗`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
callback
:
action
=>
{
if
(
action
==
'confirm'
)
{
this
.
$apis
.
goods
.
delGoodsApi
({
id
:
item
.
id
}).
then
(
res
=>
{
if
(
res
){
this
.
$message
.
success
(
'删除成功'
)
this
.
handleSearch
()
}
})
}
}
})
},
updateStatus
(
id
,
goodsStatus
){
this
.
$apis
.
goods
.
updateGoodsStatusApi
({
id
,
goodsStatus
}).
then
(
res
=>
{
if
(
res
){
this
.
$message
.
success
(
'操作成功'
)
this
.
handleSearch
()
}
})
},
filterData
({
merchantList
:
list
}){
filterData
({
merchantList
:
list
}){
return
list
?.
map
(
item
=>
{
return
list
?.
map
(
item
=>
{
let
activityPrice
=
item
.
activityPrice
?
Number
((
Number
(
item
.
activityPrice
)
/
100
).
toFixed
(
2
))
:
0
let
activityPrice
=
item
.
activityPrice
?
Number
((
Number
(
item
.
activityPrice
)
/
100
).
toFixed
(
2
))
:
0
...
...
src/views/store/add.vue
View file @
283aa71
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<p>
所属门店
</p>
<p>
所属门店
</p>
<div
class=
"merchantName ellipsis-1"
>
{{
editForm
.
merchantName
}}
</div>
<div
class=
"merchantName ellipsis-1"
>
{{
editForm
.
merchantName
}}
</div>
</div>
</div>
<
div
class=
"el-form-item__error mrt5"
v-if=
"merchantFlag"
>
请选择门店
</div
>
<
!--
<div
class=
"el-form-item__error mrt5"
v-if=
"merchantFlag"
>
请选择门店
</div>
--
>
</div>
</div>
<div
slot=
"channelHtml"
>
<div
slot=
"channelHtml"
>
<el-checkbox-group
v-model=
"editForm.channelIds"
@
change=
"handleCheckedChannelChange"
>
<el-checkbox-group
v-model=
"editForm.channelIds"
@
change=
"handleCheckedChannelChange"
>
...
@@ -18,16 +18,14 @@
...
@@ -18,16 +18,14 @@
</div>
</div>
<div
slot=
"carSeriesHtml"
>
<div
slot=
"carSeriesHtml"
>
<el-button
type=
"default"
class=
"el-icon-plus"
v-if=
"!isDisabled"
@
click=
"handleCarSeriesClose"
>
选择车系
</el-button>
<el-button
type=
"default"
class=
"el-icon-plus"
v-if=
"!isDisabled"
@
click=
"handleCarSeriesClose"
>
选择车系
</el-button>
<div
class=
"merchantNameLabel"
v-if=
"editForm.merchantName"
>
<div
class=
"car-series-wrap"
v-if=
"editForm.vehicleSeriesRequests && editForm.vehicleSeriesRequests.length"
>
<p>
所属门店
</p>
<div
class=
"car-series-item"
v-for=
"item in editForm.vehicleSeriesRequests"
:key=
"item.vehicleSeriesId"
>
{{
item
.
vehicleSeriesName
}}
</div>
<div
class=
"merchantName ellipsis-1"
>
{{
editForm
.
merchantName
}}
</div>
</div>
</div>
<div
class=
"el-form-item__error mrt5"
v-if=
"merchantFlag"
>
请选择门店
</div>
</div>
</div>
</glsx-combi-form>
</glsx-combi-form>
</div>
</div>
<select-store
v-if=
"relateStoreVisible"
ref=
"relateStore"
:dialogVisible=
"relateStoreVisible"
:storeSelected=
"selectedList"
:merchantInfo=
"editForm.merchantId"
@
handleRelateStoreConfirm=
"handleRelateStoreConfirm"
@
handleRelateStoreClose=
"handleRelateStoreClose"
></select-store>
<select-store
v-if=
"relateStoreVisible"
ref=
"relateStore"
:dialogVisible=
"relateStoreVisible"
:storeSelected=
"selectedList"
:merchantInfo=
"editForm.merchantId"
@
handleRelateStoreConfirm=
"handleRelateStoreConfirm"
@
handleRelateStoreClose=
"handleRelateStoreClose"
></select-store>
<selectCarDialog
v-if=
"carDialogVisible"
:dialogVisible=
"carDialogVisible"
></selectCarDialog>
<selectCarDialog
v-if=
"carDialogVisible"
singleChoice
@
handleClose=
"handleClose"
@
handleConfirm=
"handleConfirm"
:dialogVisible=
"carDialogVisible"
></selectCarDialog>
<GLFooter>
<GLFooter>
<el-button
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave"
>
确定
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave"
>
确定
</el-button>
...
@@ -49,6 +47,7 @@ export default {
...
@@ -49,6 +47,7 @@ export default {
merchantId
:
this
.
$route
.
query
.
merchantId
?
this
.
$route
.
query
.
merchantId
:
''
,
merchantId
:
this
.
$route
.
query
.
merchantId
?
this
.
$route
.
query
.
merchantId
:
''
,
editForm
:
{
editForm
:
{
channelIds
:
[],
channelIds
:
[],
vehicleSeriesRequests
:
[],
merchantId
:
''
,
merchantId
:
''
,
merchantName
:
''
merchantName
:
''
},
},
...
@@ -75,7 +74,27 @@ export default {
...
@@ -75,7 +74,27 @@ export default {
relateStoreVisible
:
false
,
// 选择门店
relateStoreVisible
:
false
,
// 选择门店
carDialogVisible
:
false
,
//选择车系
carDialogVisible
:
false
,
//选择车系
editRule
:
{
editRule
:
{
channelIds
:
[{
required
:
true
,
message
:
'请选择频道名称'
,
trigger
:
'change'
}]
merchantId
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
editForm
.
merchantId
){
callback
()
}
else
{
callback
(
new
Error
(
`请选择门店`
))
}
},
trigger
:
'change'
}],
channel
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
editForm
.
channelIds
&&
this
.
editForm
.
channelIds
.
length
){
callback
()
}
else
{
callback
(
new
Error
(
`请选择频道`
))
}
},
trigger
:
'change'
}],
carId
:
[{
required
:
true
,
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
editForm
.
vehicleSeriesRequests
&&
this
.
editForm
.
vehicleSeriesRequests
.
length
){
callback
()
}
else
{
callback
(
new
Error
(
`请选择主营品牌车系`
))
}
},
trigger
:
'change'
}]
}
}
}
}
},
},
...
@@ -135,7 +154,8 @@ export default {
...
@@ -135,7 +154,8 @@ export default {
let
params
=
{
let
params
=
{
merchantId
:
this
.
editForm
.
merchantId
,
merchantId
:
this
.
editForm
.
merchantId
,
merchantName
:
this
.
editForm
.
merchantName
,
merchantName
:
this
.
editForm
.
merchantName
,
channelIds
:
this
.
editForm
.
channelIds
channelIds
:
this
.
editForm
.
channelIds
,
vehicleSeriesRequests
:
this
.
editForm
.
vehicleSeriesRequests
}
}
this
.
loading
=
true
this
.
loading
=
true
this
.
$apis
.
store
.
configMerchant
(
params
).
then
(
res
=>
{
this
.
$apis
.
store
.
configMerchant
(
params
).
then
(
res
=>
{
...
@@ -168,6 +188,30 @@ export default {
...
@@ -168,6 +188,30 @@ export default {
selectedData
.
merchantId
&&
(
this
.
editForm
.
merchantId
=
selectedData
.
merchantId
)
selectedData
.
merchantId
&&
(
this
.
editForm
.
merchantId
=
selectedData
.
merchantId
)
selectedData
.
merchantName
&&
((
this
.
editForm
.
merchantName
=
selectedData
.
merchantName
),
(
this
.
merchantFlag
=
false
))
selectedData
.
merchantName
&&
((
this
.
editForm
.
merchantName
=
selectedData
.
merchantName
),
(
this
.
merchantFlag
=
false
))
this
.
handleRelateStoreClose
()
this
.
handleRelateStoreClose
()
},
handleClose
(){
this
.
carDialogVisible
=
false
},
handleConfirm
(
e
=
{}){
let
carList
=
[]
for
(
const
key
in
e
){
for
(
const
sonKey
in
e
[
key
]){
carList
=
[...
carList
,
...
e
[
key
][
sonKey
]]
}
}
this
.
editForm
.
vehicleSeriesRequests
=
carList
.
map
(
item
=>
{
const
{
id
,
name
,
parentId
,
parentName
,
rootId
,
rootName
}
=
item
return
{
brandId
:
rootId
,
brandName
:
rootName
,
childBrandId
:
parentId
,
childBrandName
:
parentName
,
vehicleSeriesId
:
id
,
vehicleSeriesName
:
name
}
})
this
.
handleClose
()
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validateField
(
'carId'
)
}
}
}
}
}
}
...
@@ -218,5 +262,27 @@ export default {
...
@@ -218,5 +262,27 @@ export default {
padding
:
0
8px
;
padding
:
0
8px
;
}
}
}
}
.car-series-wrap
{
margin-top
:
8px
;
width
:
580px
;
height
:
80px
;
background
:
#FFFFFF
;
border
:
1px
solid
#E8E8EA
;
border-radius
:
4px
;
padding
:
6px
8px
;
overflow-y
:
auto
;
.car-series-item{
display
:
inline-block
;
padding
:
0
8px
;
height
:
24px
;
color
:
#666666
;
line-height
:
24px
;
background
:
#FAFBFE
;
border
:
1px
solid
#E5E5E5
;
border-radius
:
4px
;
margin-right
:
4px
;
}
}
}
}
</
style
>
</
style
>
src/views/store/components/selectCarDialog.vue
View file @
283aa71
...
@@ -191,7 +191,11 @@
...
@@ -191,7 +191,11 @@
})
})
},
},
handleConfirm
(){
handleConfirm
(){
console
.
log
(
this
.
selectdData
,
155
)
console
.
log
(
this
.
selectdData
)
this
.
$emit
(
'handleConfirm'
,
this
.
selectdData
)
},
handleClose
(){
this
.
$emit
(
'handleClose'
)
}
}
}
}
}
}
...
...
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