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
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
684 additions
and
59 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
This diff is collapsed.
Click to expand it.
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