Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-merchant-data
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 9ae2078f
authored
Mar 29, 2019
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化
1 parent
7b55dc63
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
src/views/customer/businessGroupDetail/addBusiness.vue
src/views/customer/businessGroupDetail/addBusiness.vue
View file @
9ae2078
...
@@ -251,22 +251,24 @@ export default {
...
@@ -251,22 +251,24 @@ export default {
request
.
req
(
params
).
then
(
res
=>
{
request
.
req
(
params
).
then
(
res
=>
{
this
.
childLoading
=
false
this
.
childLoading
=
false
const
arr
=
res
.
merchantParams
const
arr
=
res
.
merchantParams
const
index
=
[]
//
const index = []
let
list
=
[]
let
list
=
[]
if
(
!
res
.
merchantParams
||
!
res
.
merchantParams
.
length
)
{
if
(
!
res
.
merchantParams
||
!
res
.
merchantParams
.
length
)
{
this
.
businessChildList
=
[]
this
.
businessChildList
=
[]
return
return
}
}
for
(
var
i
of
res
.
merchantParams
)
{
// for (var i of res.merchantParams)
{
for
(
var
j
of
this
.
addList
)
{
// for (var j of this.addList)
{
if
(
i
.
merchantId
===
j
.
merchantId
)
{
// if (i.merchantId === j.merchantId)
{
index
.
push
(
i
.
merchantId
)
// index.push(i.merchantId)
}
//
}
}
//
}
}
//
}
list
=
arr
.
filter
(
item
=>
!
index
.
includes
(
item
.
merchantId
))
// list = arr.filter(item => !index.includes(item.merchantId))
// list = [...arr].filter(item => [...this.addList].every(obj => obj.merchantId !== item.merchantId))
list
=
[...
arr
].
filter
(
item
=>
[...
this
.
addList
].
every
(
obj
=>
obj
.
merchantId
!==
item
.
merchantId
))
this
.
businessChildList
=
index
.
length
?
list
:
arr
console
.
log
(
list
)
// this.businessChildList = index.length ? list : arr
this
.
businessChildList
=
list
}
).
catch
(
err
=>
{
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
notice
.
errorTips
(
err
)
}
)
}
)
...
...
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