Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-settings
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 a7c31d9a
authored
Mar 18, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'yangm_dev_v2.0.0' into 'v2.0.0'
Yangm dev v2.0.0 See merge request
!13
2 parents
ec219301
3a11b89f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
30 deletions
src/api/modules/baseInfo.js
src/views/account/addAccount.vue
src/views/account/components/baseInfo.vue
src/views/account/editAccount.vue
src/views/baseInfo/editInfo.vue
src/views/baseInfo/selectBrand.vue
src/api/modules/baseInfo.js
View file @
a7c31d9
...
...
@@ -6,7 +6,7 @@
* @param {*} params
* @returns
*/
import
{
http_config
,
http
_car
}
from
'@/main'
import
{
http_config
,
http
}
from
'@/main'
const
getMerchantTree
=
params
=>
{
params
.
method
=
'entmicro.api.common.findMerchantTreeByMerchantNo.list'
return
http_config
({
...
...
@@ -44,9 +44,9 @@ const merchantInfo = params => {
})
}
const
brandList
=
params
=>
{
params
.
method
=
'
dj.api.get.car.brandList
'
return
http
_car
({
url
:
'/rop-
dj-car-boutique
/router'
,
params
.
method
=
'
merchants.api.merchantCommon.getCarbrandTree
'
return
http
({
url
:
'/rop-
merchants
/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
...
...
src/views/account/addAccount.vue
View file @
a7c31d9
...
...
@@ -299,9 +299,8 @@ export default {
if
(
params
.
businessType
)
{
params
.
businessType
=
params
.
businessType
.
join
(
','
)
}
const
getCheckedArr
=
this
.
$refs
.
baseInfoForm
.
$refs
.
brandListTree
.
getCheckedArr
const
merchantBrandMain
=
getCheckedArr
.
map
(
item
=>
item
.
id
)
params
.
merchantBrandMain
=
merchantBrandMain
.
join
(
','
)
const
merchantBrandList
=
this
.
$refs
.
baseInfoForm
.
$refs
.
brandListTree
.
getMerchantBrandList
()
params
.
merchantBrandListJson
=
JSON
.
stringify
(
merchantBrandList
)
params
.
isloginName
?
(
params
.
isloginName
=
1
)
:
(
params
.
isloginName
=
0
)
params
.
merchantAccountLevel
=
this
.
accountDetail
.
merchantAccountLevel
params
.
status
=
1
...
...
src/views/account/components/baseInfo.vue
View file @
a7c31d9
...
...
@@ -200,13 +200,14 @@ export default {
}
},
methods
:
{
checkBrandList
(
merchantBrandMain
)
{
checkBrandList
(
chant
)
{
let
merchantBrandMain
=
chant
.
filter
(
item
=>
item
)
this
.
$set
(
this
.
accountAddForm
,
'merchantBrandMain'
,
merchantBrandMain
)
console
.
log
(
this
.
accountAddForm
.
merchantBrandMain
)
if
(
!
this
.
accountAddForm
.
merchantBrandMain
)
{
this
.
accountAddForm
.
merchantBrandMain
=
[]
}
else
{
this
.
accountAddForm
.
merchantBrandMain
=
this
.
accountAddForm
.
merchantBrandMain
.
split
(
','
)
}
console
.
log
(
this
.
accountAddForm
.
merchantBrandMain
)
this
.
$refs
.
brandListTree
.
getCheckList
(
this
.
accountAddForm
.
merchantBrandMain
)
},
checkBusinessType
(
type
)
{
...
...
@@ -224,11 +225,12 @@ export default {
async
brandList
()
{
this
.
$refs
.
brandListTree
.
loading
=
true
this
.
businessType
=
await
this
.
$apis
.
store
.
findAllDictData
({
dictType
:
'business_type'
})
const
brandListTree
=
await
this
.
$apis
.
baseInfo
.
brandList
({
needCarSeries
:
true
})
const
brandListTree
=
await
this
.
$apis
.
baseInfo
.
brandList
({})
brandListTree
.
forEach
(
item
=>
{
let
child
=
item
.
childs
let
child
=
item
.
children
if
(
!
child
)
return
child
.
forEach
(
k
=>
{
delete
k
.
child
s
delete
k
.
child
ren
})
})
this
.
brandListTree
=
brandListTree
...
...
src/views/account/editAccount.vue
View file @
a7c31d9
...
...
@@ -314,9 +314,8 @@ export default {
let
businessScopeCustomize
=
this
.
businessScopeCustomize
.
map
(
item
=>
item
.
name
)
params
.
businessScopeCustomize
=
businessScopeCustomize
.
join
(
','
)
params
.
merchantFiles
=
JSON
.
stringify
(
params
.
merchantFiles
)
const
getCheckedArr
=
this
.
$refs
.
baseInfoForm
.
$refs
.
brandListTree
.
getCheckedArr
const
merchantBrandMain
=
getCheckedArr
.
map
(
item
=>
item
.
id
)
params
.
merchantBrandMain
=
merchantBrandMain
.
join
(
','
)
const
merchantBrandList
=
this
.
$refs
.
baseInfoForm
.
$refs
.
brandListTree
.
getMerchantBrandList
()
params
.
merchantBrandListJson
=
JSON
.
stringify
(
merchantBrandList
)
Promise
.
all
([
pm1
,
pm2
]).
then
(()
=>
{
this
.
$apis
.
store
.
updateMerchant
(
params
).
then
(
res
=>
{
if
(
res
)
{
...
...
@@ -424,6 +423,7 @@ export default {
accounttypeId
:
accountType
,
merchantBrandMain
})
merchantBrandMain
=
merchantBrandMain
.
replaceAll
(
';'
,
','
).
split
(
','
)
this
.
$refs
.
baseInfoForm
.
checkBrandList
(
merchantBrandMain
)
this
.
$refs
.
baseInfoForm
.
checkBusinessType
(
businessType
)
this
.
$nextTick
(()
=>
{
...
...
src/views/baseInfo/editInfo.vue
View file @
a7c31d9
...
...
@@ -95,11 +95,13 @@ export default {
console
.
log
(
this
.
infoForm
.
businessType
)
}
console
.
log
(
this
.
infoForm
.
businessType
)
const
brandListTree
=
await
this
.
$apis
.
baseInfo
.
brandList
({
needCarSeries
:
true
})
const
brandListTree
=
await
this
.
$apis
.
baseInfo
.
brandList
({})
console
.
log
(
brandListTree
)
brandListTree
.
forEach
(
item
=>
{
let
child
=
item
.
childs
let
child
=
item
.
children
if
(
!
child
)
return
child
.
forEach
(
k
=>
{
delete
k
.
child
s
delete
k
.
child
ren
})
})
this
.
brandListTree
=
brandListTree
...
...
@@ -107,7 +109,7 @@ export default {
if
(
!
this
.
infoForm
.
merchantBrandMain
)
{
this
.
infoForm
.
merchantBrandMain
=
[]
}
else
{
this
.
infoForm
.
merchantBrandMain
=
this
.
infoForm
.
merchantBrandMain
.
split
(
','
)
this
.
infoForm
.
merchantBrandMain
=
this
.
infoForm
.
merchantBrandMain
.
replaceAll
(
';'
,
','
).
split
(
','
)
}
this
.
$refs
.
brandListTree
.
getCheckList
(
this
.
infoForm
.
merchantBrandMain
)
this
.
$nextTick
(()
=>
{
...
...
@@ -147,9 +149,8 @@ export default {
delete
params
.
stores
params
.
businessType
=
params
.
businessType
.
join
(
','
)
//merchantBrandMain 品牌id
const
getCheckedArr
=
this
.
$refs
.
brandListTree
.
getCheckedArr
const
merchantBrandMain
=
getCheckedArr
.
map
(
item
=>
item
.
id
)
params
.
merchantBrandMain
=
merchantBrandMain
.
join
(
','
)
const
merchantBrandList
=
this
.
$refs
.
brandListTree
.
getMerchantBrandList
()
params
.
merchantBrandListJson
=
JSON
.
stringify
(
merchantBrandList
)
this
.
$apis
.
store
.
updateMerchant
(
params
).
then
(
res
=>
{
if
(
res
)
{
this
.
$router
.
push
({
path
:
'/baseInfo/index'
})
...
...
src/views/baseInfo/selectBrand.vue
View file @
a7c31d9
...
...
@@ -11,13 +11,13 @@
<div
class=
"select-input-box"
>
<template
v-for=
"(item, idx) in getCheckedArr"
>
<el-tag
effect=
"plain"
type=
"info"
:key=
"idx"
closable
:disable-transitions=
"false"
@
close=
"removeItem(item, idx)"
v-if=
"idx
< 3
"
>
{{
item
.
name
}}
{{
item
.
label
}}
</el-tag>
</
template
>
<el-popover
placement=
"top"
width=
"600"
trigger=
"hover"
class=
"select-popover"
>
<div
class=
"select-popover-box"
>
<el-tag
effect=
"plain"
class=
"popover-item"
v-for=
"(item, idx) in getCheckedArr"
type=
"info"
:key=
"idx"
closable
:disable-transitions=
"false"
@
close=
"removeItem(item, idx)"
>
{{ item.
name
}}
{{ item.
label
}}
</el-tag>
</div>
<el-tag
effect=
"plain"
slot=
"reference"
type=
"info"
v-show=
"getCheckedArr.length > 3"
>
+ {{ getCheckedArr.length - 3 }}
</el-tag>
...
...
@@ -47,8 +47,8 @@ export default {
treeArr
:
[],
getCheckedArr
:
[],
defaultProps
:
{
children
:
'child
s
'
,
label
:
'
name
'
children
:
'child
ren
'
,
label
:
'
label
'
}
}
},
...
...
@@ -65,7 +65,7 @@ export default {
handler
()
{
const
getCheckedNodes
=
this
.
$refs
.
tree
.
getCheckedNodes
()
this
.
getCheckedArr
=
getCheckedNodes
.
reduce
((
prev
,
cur
)
=>
{
if
(
Object
.
keys
(
cur
).
includes
(
'child
s'
)
&&
cur
.
childs
.
length
>
0
)
{
if
(
Object
.
keys
(
cur
).
includes
(
'child
ren'
)
&&
cur
.
children
.
length
>
0
)
{
return
prev
}
return
prev
.
concat
(
cur
)
...
...
@@ -75,6 +75,37 @@ export default {
}
},
methods
:
{
getMerchantBrandList
()
{
let
getCheckedNodes
=
this
.
$refs
.
tree
.
getCheckedNodes
()
const
getCheckedKeys
=
this
.
$refs
.
tree
.
getCheckedKeys
()
const
getHalfCheckedNodes
=
this
.
$refs
.
tree
.
getHalfCheckedNodes
()
let
merchantBrandList
=
getHalfCheckedNodes
.
map
(
car
=>
{
let
merchantBrandId
=
[]
car
.
children
.
forEach
(
item
=>
{
if
(
getCheckedKeys
.
includes
(
item
.
id
))
{
merchantBrandId
.
push
(
item
.
id
)
}
})
return
{
cars
:
car
.
id
,
merchantBrandId
}
})
getCheckedNodes
=
getCheckedNodes
.
filter
(
item
=>
item
.
children
)
let
merchantBrandList2
=
getCheckedNodes
.
map
(
car
=>
{
let
merchantBrandId
=
[]
car
.
children
.
forEach
(
item
=>
{
if
(
getCheckedKeys
.
includes
(
item
.
id
))
{
merchantBrandId
.
push
(
item
.
id
)
}
})
return
{
cars
:
car
.
id
,
merchantBrandId
}
})
return
merchantBrandList
.
concat
(
merchantBrandList2
)
},
//勾选
handleCheck
()
{
this
.
treeArr
=
this
.
getTreeArray
()
...
...
@@ -86,6 +117,8 @@ export default {
}
},
getCheckList
(
checkArr
=
[])
{
checkArr
.
forEach
(
item
=>
item
=
parseInt
(
item
));
console
.
log
(
checkArr
)
this
.
$refs
.
tree
.
setCheckedKeys
(
checkArr
)
this
.
$nextTick
(()
=>
{
this
.
handleCheck
()
...
...
@@ -95,7 +128,7 @@ export default {
getTreeArray
()
{
let
tree_arr
=
[]
this
.
brandListTree
.
forEach
(
k
=>
{
let
child
=
k
.
child
s
let
child
=
k
.
child
ren
if
(
child
&&
child
.
length
>
0
)
{
child
.
forEach
(
j
=>
{
tree_arr
.
push
(
j
.
id
)
...
...
@@ -133,7 +166,7 @@ export default {
this
.
getCheckedArr
.
splice
(
index
,
1
)
const
getCheckedNodes
=
this
.
$refs
.
tree
.
getCheckedNodes
()
let
getCheckedArr
=
getCheckedNodes
.
reduce
((
prev
,
cur
)
=>
{
if
(
Object
.
keys
(
cur
).
includes
(
'child
s
'
))
{
if
(
Object
.
keys
(
cur
).
includes
(
'child
ren
'
))
{
return
prev
}
return
prev
.
concat
(
cur
)
...
...
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