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 f9e8801b
authored
Jul 07, 2023
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
处理车系弹框
1 parent
3ca7f0e1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
50 deletions
src/api/modules/goods.js
src/views/case/index.vue
src/views/goods/index.vue
src/views/store/components/selectCarDialog.vue
src/api/modules/goods.js
0 → 100644
View file @
f9e8801
import
{
http
}
from
'@/main'
const
url
=
'rop-scrm-shopmall/router'
const
getGoodsListApi
=
params
=>
{
params
.
method
=
'scrm.api.shopmall.goods.configuration.page'
return
http
({
url
,
method
:
'post'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getGoodsListApi
}
\ No newline at end of file
\ No newline at end of file
src/views/case/index.vue
View file @
f9e8801
...
@@ -20,14 +20,14 @@
...
@@ -20,14 +20,14 @@
width=
"400"
width=
"400"
trigger=
"hover"
>
trigger=
"hover"
>
<span>
<span>
{{
scope
.
scope
.
brandList
.
join
(
'、'
)
}}
{{
filterBrand
(
scope
.
scope
)
.
join
(
'、'
)
}}
</span>
</span>
<span
class=
"more-brand"
slot=
"reference"
>
...[
{{
scope
.
scope
.
brandList
.
length
}}
]
</span>
<span
class=
"more-brand"
slot=
"reference"
>
...[
{{
scope
.
scope
.
brandList
.
length
}}
]
</span>
</el-popover>
</el-popover>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<span
v-if=
"!scope.scope.brandList || !scope.scope.brandList.length"
>
--
</span>
<span
v-if=
"!scope.scope.brandList || !scope.scope.brandList.length"
>
--
</span>
<span>
{{
filterBrand
(
scope
.
scope
).
join
(
'、'
)
}}
</span>
<span
v-else
>
{{
filterBrand
(
scope
.
scope
).
join
(
'、'
)
}}
</span>
</
template
>
</
template
>
</div>
</div>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
...
@@ -228,6 +228,7 @@
...
@@ -228,6 +228,7 @@
background-color
:
#fff
;
background-color
:
#fff
;
padding
:
20px
;
padding
:
20px
;
.more-brand{
.more-brand{
white-space
:
nowrap
;
color
:
#5850FF
;
color
:
#5850FF
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
...
...
src/views/goods/index.vue
View file @
f9e8801
...
@@ -10,23 +10,32 @@
...
@@ -10,23 +10,32 @@
<GLTable
ref=
"channelRef"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"searchForm"
:beforeSearchFn=
"beforeSearchFn"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
@
setTableFinishFun=
"setTableFinishFun"
>
<GLTable
ref=
"channelRef"
:getListApi=
"getListApi"
:noDataImg=
"url"
:searchForm=
"searchForm"
:beforeSearchFn=
"beforeSearchFn"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
@
setTableFinishFun=
"setTableFinishFun"
>
<div
slot=
"imageSlot"
class=
"table-image"
slot-scope=
"scope"
>
<div
slot=
"imageSlot"
class=
"table-image"
slot-scope=
"scope"
>
<el-popover
placement=
"top"
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
<el-popover
placement=
"top"
width=
"160"
trigger=
"hover"
popper-class=
"table-popover-block"
>
<img
class=
"table-popover-img"
:src=
"scope.scope.
publicityImg
"
/>
<img
class=
"table-popover-img"
:src=
"scope.scope.
goodsImage
"
/>
<img
class=
"img-36 pointer"
slot=
"reference"
:src=
"scope.scope.
publicityImg
"
/>
<img
class=
"img-36 pointer"
slot=
"reference"
:src=
"scope.scope.
goodsImage
"
/>
</el-popover>
</el-popover>
</div>
</div>
<div
slot=
"statusSlot"
slot-scope=
"scope"
>
<div
slot=
"statusSlot"
slot-scope=
"scope"
>
<span
:class=
"['status', scope.scope.
channelType==3
? 'success-status': 'error-status']"
></span>
<span
:class=
"['status', scope.scope.
goodsStatus==1
? 'success-status': 'error-status']"
></span>
<span>
{{
scope
.
scope
.
channelType
==
3
?
'上架'
:
'下架'
}}
</span>
<span>
{{
scope
.
scope
.
goodsStatus
==
1
?
'上架'
:
'下架'
}}
</span>
</div>
</div>
<template
slot=
"activityLink"
slot-scope=
"scope"
>
<div
slot=
"merchantPriceSlot"
slot-scope=
"scope"
>
<span
class=
"relink"
>
{{
scope
.
scope
.
activityName
}}
</span>
<template
v-if=
"scope.scope.merchantList && scope.scope.merchantList.length > 1"
>
</
template
>
<span>
{{
filterData
(
scope
.
scope
).
slice
(
0
,
1
).
join
(
'、'
)
}}
</span>
<
template
slot=
"moveCarCodeCount"
slot-scope=
"scope"
>
<el-popover
<span
class=
"moveCarCodeCount"
@
click=
"opneMoveMessage(scope.scope)"
>
{{
scope
.
scope
.
moveCarCodeCount
}}
</span>
placement=
"top"
width=
"400"
trigger=
"hover"
>
<div
v-for=
"(item,index) in filterData(scope.scope)"
:key=
"index"
>
{{
item
}}
</div>
<span
class=
"more-info"
slot=
"reference"
>
...[
{{
scope
.
scope
.
merchantList
.
length
}}
]
</span>
</el-popover>
</
template
>
</
template
>
<
template
slot=
"switch"
slot-scope=
"scope"
>
<
template
v-else
>
<el-switch
v-model=
"scope.scope.isOpen"
@
change=
"updateState(scope.scope)"
></el-switch>
<span
v-if=
"!scope.scope.merchantList || !scope.scope.merchantList.length"
>
--
</span>
<span
v-else
>
{{
filterData
(
scope
.
scope
).
join
(
'、'
)
}}
</span>
</
template
>
</
template
>
</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=
"3"
></GLTableButton>
</div>
</div>
...
@@ -65,7 +74,7 @@
...
@@ -65,7 +74,7 @@
searchFormData
:
[
searchFormData
:
[
{
{
label
:
'商品名称'
,
label
:
'商品名称'
,
name
:
'
channel
Name'
,
name
:
'
goods
Name'
,
type
:
'input'
type
:
'input'
},
},
{
{
...
@@ -85,7 +94,7 @@
...
@@ -85,7 +94,7 @@
},
},
{
{
label
:
'商户名称'
,
label
:
'商户名称'
,
name
:
'
channel
Name'
,
name
:
'
merchant
Name'
,
type
:
'input'
type
:
'input'
},
},
{
{
...
@@ -94,7 +103,7 @@
...
@@ -94,7 +103,7 @@
type
:
'select'
type
:
'select'
},
},
],
],
getListApi
:
this
.
$apis
.
channel
.
getChannel
ListApi
,
getListApi
:
this
.
$apis
.
goods
.
getGoods
ListApi
,
tableParams
:
{
tableParams
:
{
listName
:
'list'
,
listName
:
'list'
,
tableOption
:
{
tableOption
:
{
...
@@ -103,7 +112,7 @@
...
@@ -103,7 +112,7 @@
tableColumns
:
[
tableColumns
:
[
{
{
label
:
'商品名称'
,
label
:
'商品名称'
,
prop
:
'
channel
Name'
prop
:
'
goods
Name'
},
},
{
{
label
:
'缩略图'
,
label
:
'缩略图'
,
...
@@ -112,20 +121,25 @@
...
@@ -112,20 +121,25 @@
{
{
label
:
'收款方式'
,
label
:
'收款方式'
,
formatter
:
cellValue
=>
{
formatter
:
cellValue
=>
{
return
cellValue
.
channelName
||
'--
'
return
cellValue
.
paymentType
==
1
?
'全款'
:
'定金+尾款
'
}
}
},
},
{
{
label
:
'定金(元)'
,
label
:
'定金(元)'
,
prop
:
'channelName'
formatter
:
cellValue
=>
{
return
cellValue
.
depositPrice
?
Number
((
Number
(
cellValue
.
depositPrice
)
/
100
).
toFixed
(
2
))
:
'--'
}
},
},
{
{
label
:
'门店活动价(元)'
,
label
:
'门店活动价(元)'
,
prop
:
'channelName'
width
:
200
,
addHtml
:
'merchantPriceSlot'
},
},
{
{
label
:
'分类'
,
label
:
'分类'
,
prop
:
'channelName'
formatter
:
cellValue
=>
{
return
`
${
cellValue
.
associationClassifyFirstName
||
''
}
-
${
cellValue
.
associationClassifySecondName
||
''
}
`
}
},
},
{
{
label
:
'状态'
,
label
:
'状态'
,
...
@@ -134,20 +148,16 @@
...
@@ -134,20 +148,16 @@
{
{
label
:
'创建日期'
,
label
:
'创建日期'
,
prop
:
'createdDate'
,
prop
:
'createdDate'
,
formatter
:
cellValue
=>
{
width
:
220
return
dayjs
(
cellValue
.
createdDate
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
},
},
{
{
label
:
'更新时间'
,
label
:
'更新时间'
,
prop
:
'createdDate'
,
prop
:
'updatedDate'
,
formatter
:
cellValue
=>
{
width
:
220
return
dayjs
(
cellValue
.
createdDate
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
},
},
{
{
label
:
'操作人'
,
label
:
'操作人'
,
prop
:
'
channelName'
prop
:
'
operator'
,
},
},
]
]
},
},
...
@@ -157,13 +167,18 @@
...
@@ -157,13 +167,18 @@
created
()
{},
created
()
{},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
filterData
({
merchantList
:
list
}){
return
list
?.
map
(
item
=>
{
let
activityPrice
=
item
.
activityPrice
?
Number
((
Number
(
item
.
activityPrice
)
/
100
).
toFixed
(
2
))
:
0
return
`
${
item
.
merchantName
||
'--'
}
:
${
activityPrice
||
'0'
}
`
})
||
[]
},
getParams
()
{
getParams
()
{
var
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
tableSearchForm
))
var
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
tableSearchForm
))
if
(
this
.
tableSearchForm
.
createDate
.
length
)
{
if
(
this
.
tableSearchForm
.
createDate
.
length
)
{
params
.
createdDateStrat
=
new
Date
(
this
.
tableSearchForm
.
createDate
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
params
.
createdDateStrat
=
new
Date
(
this
.
tableSearchForm
.
createDate
[
0
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 00:00:00'
params
.
createdDateEnd
=
new
Date
(
this
.
tableSearchForm
.
createDate
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
params
.
createdDateEnd
=
new
Date
(
this
.
tableSearchForm
.
createDate
[
1
]).
toLocaleDateString
().
replace
(
/
\/
/g
,
'-'
)
+
' 23:59:59'
}
}
return
params
return
params
},
},
beforeSearchFn
()
{
beforeSearchFn
()
{
...
@@ -217,6 +232,11 @@
...
@@ -217,6 +232,11 @@
.error-status
{
.error-status
{
background-color
:
#999999
;
background-color
:
#999999
;
}
}
.more-info
{
white-space
:
nowrap
;
color
:
#5850FF
;
cursor
:
pointer
;
}
}
}
}
}
</
style
>
</
style
>
...
...
src/views/store/components/selectCarDialog.vue
View file @
f9e8801
...
@@ -14,18 +14,17 @@
...
@@ -14,18 +14,17 @@
</div>
</div>
</div>
</div>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<div
class=
"item
flex-center
"
v-for=
"(item, index) in sonBrandList"
:key=
"item.id"
>
<div
class=
"item
son-brand-wrap
"
v-for=
"(item, index) in sonBrandList"
:key=
"item.id"
>
<el-checkbox
:indeterminate=
"isIndeterminate(item)"
v-model=
"item.checked"
@
change=
"selectCarSeries(index, item)"
>
<el-checkbox
:indeterminate=
"isIndeterminate(item)"
:value=
"isChecked(item.id, 'son')"
@
change=
"selectSonBrand($event, item, index)"
></el-checkbox
>
<span
class=
"flex-center
"
>
<span
class=
"son-brand-label"
@
click=
"showCarSeries(item)
"
>
{{
item
.
name
}}
{{
item
.
name
}}{{
isIndeterminate
(
item
)
}}
<i
class=
"el-icon-arrow-right"
></i>
<i
class=
"el-icon-arrow-right"
></i>
</span>
</span>
</el-checkbox>
</div>
</div>
</div>
</div>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<el-checkbox-group
v-model=
"selectdData"
@
change=
"
handleCheckedCitiesChange
"
>
<el-checkbox-group
v-model=
"selectdData"
@
change=
"
selectCarSeries()
"
>
<el-checkbox
class=
"item"
v-for=
"item in carSeriesList"
:label=
"item.
name
"
:key=
"item.id"
>
{{
item
.
name
}}
</el-checkbox>
<el-checkbox
class=
"item"
v-for=
"item in carSeriesList"
:label=
"item.
id
"
:key=
"item.id"
>
{{
item
.
name
}}
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>
</div>
</div>
</div>
</div>
...
@@ -40,15 +39,14 @@
...
@@ -40,15 +39,14 @@
return
{
return
{
carSeriesData
:
[],
carSeriesData
:
[],
sonBrandList
:
[],
sonBrandList
:
[],
curSonBrandIdx
:
-
1
,
carSeriesList
:
[],
curSonBrandId
:
''
,
selectdData
:
[],
selectdData
:
[],
isIndeterminate
:
true
checkedList
:
[],
checked
:
true
,
}
}
},
},
computed
:{
computed
:{
carSeriesList
()
{
return
this
.
curSonBrandIdx
==
-
1
?
[]
:
this
.
sonBrandList
[
this
.
curSonBrandIdx
]?.
childs
?.
forEach
(
item
=>
item
.
checked
=
false
)
}
},
},
props
:
{
props
:
{
dialogVisible
:{
dialogVisible
:{
...
@@ -62,8 +60,21 @@
...
@@ -62,8 +60,21 @@
},
},
methods
:{
methods
:{
isChecked
(
id
,
type
){
const
_target
=
this
.
checkedList
.
find
(
ele
=>
ele
==
id
)
if
(
type
==
'son'
){
return
!!
_target
}
else
{
return
!!
_target
?.
child
?.
includes
(
id
)
}
},
isIndeterminate
(
item
){
const
_existItem
=
item
?.
childs
?.
find
(
row
=>
!
this
.
selectdData
.
includes
(
row
.
id
))
const
_notExistItem
=
item
?.
childs
?.
find
(
row
=>
this
.
selectdData
.
includes
(
row
.
id
))
return
!!
_existItem
&&
!!
_notExistItem
},
getCarSeriesData
()
{
getCarSeriesData
()
{
this
.
$apis
.
stor
e
.
getCarSeriesApi
({
needCarSeries
:
true
}).
then
(
res
=>
{
this
.
$apis
.
cas
e
.
getCarSeriesApi
({
needCarSeries
:
true
}).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
if
(
res
?.
length
){
if
(
res
?.
length
){
this
.
carSeriesData
=
res
this
.
carSeriesData
=
res
...
@@ -71,12 +82,37 @@
...
@@ -71,12 +82,37 @@
})
})
},
},
selectBrand
(
item
)
{
selectBrand
(
item
)
{
this
.
curSonBrandIdx
=
-
1
this
.
sonBrandList
=
item
?.
childs
||
[]
this
.
sonBrandList
=
item
.
childs
console
.
log
(
item
,
this
.
sonBrandList
)
console
.
log
(
item
,
this
.
sonBrandList
)
},
},
selectCarSeries
(
idx
,
item
){
selectSonBrand
(
e
,
item
,
index
){
if
(
this
.
curSonBrandIdx
!=
idx
)
this
.
curSonBrandIdx
=
idx
console
.
log
(
e
,
item
,
index
)
const
{
id
}
=
item
const
_targetIdx
=
this
.
checkedList
.
findIndex
(
ele
=>
ele
==
id
)
if
(
_targetIdx
>-
1
){
this
.
checkedList
.
splice
(
_targetIdx
,
1
)
}
else
{
this
.
checkedList
.
push
(
id
)
}
console
.
log
(
this
.
checkedList
)
},
selectCarSeries
(){
const
unChecked
=
this
.
carSeriesList
.
find
(
item
=>
!
this
.
selectdData
.
includes
(
item
.
id
))
const
checked
=
this
.
carSeriesList
.
find
(
item
=>
this
.
selectdData
.
includes
(
item
.
id
))
if
(
!
unChecked
)
{
this
.
checkedList
.
push
(
this
.
curSonBrandId
)
}
if
(
!
checked
){
const
_targetIdx
=
this
.
checkedList
.
findIndex
(
ele
=>
ele
==
this
.
curSonBrandId
)
this
.
checkedList
.
splice
(
_targetIdx
,
1
)
}
},
showCarSeries
(
item
){
this
.
curSonBrandId
=
item
.
id
this
.
carSeriesList
=
item
?.
childs
},
handleConfirm
(){
console
.
log
(
this
.
selectdData
,
155
)
}
}
}
}
}
}
...
@@ -108,13 +144,32 @@
...
@@ -108,13 +144,32 @@
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
center
;
align-items
:
center
;
}
}
.son-item
{
.son-brand-wrap
{
display
:
inline-flex
;
width
:
100%
;
display
:
flex
;
align-items
:
center
;
.son-brand-label{
margin-left
:
4px
;
line-height
:
29px
;
flex
:
1
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
center
;
align-items
:
center
;
width
:
calc
(
100%
-
14px
);
}
}
}
}
//
.son-brand-checkbox
{
//
&,
.el-checkbox__label{
//
width
:
100%
;
//
}
//
&,
.son-brand-label
{
//
display
:
flex
;
//
align-items
:
center
;
//
}
//
.son-brand-label
{
//
justify-content
:
space-between
;
//
}
//
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
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