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 dab08b87
authored
Jun 27, 2019
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
gegnx
1 parent
b2ffe876
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
77 deletions
src/api/businessGroupDetail.js
src/api/index.js
src/views/customer/businessGroupDetail/index.vue
src/api/businessGroupDetail.js
View file @
dab08b8
...
@@ -6,7 +6,8 @@ const methods = {
...
@@ -6,7 +6,8 @@ const methods = {
MerchantType
:
`
${
path
}
dict.type`
,
MerchantType
:
`
${
path
}
dict.type`
,
SearchChildList
:
`
${
path
}
group.search.param`
,
// 子商户根据商户号或者商户名搜索商户列表
SearchChildList
:
`
${
path
}
group.search.param`
,
// 子商户根据商户号或者商户名搜索商户列表
SearchList
:
`
${
path
}
group.search.parampar`
,
// 父商户根据商户号或者商户名搜索商户列表
SearchList
:
`
${
path
}
group.search.parampar`
,
// 父商户根据商户号或者商户名搜索商户列表
GetTree
:
`
${
path
}
tree`
,
GetTree
:
`
${
path
}
group.merchant.tree`
,
GroupSearchMerchant
:
`
${
path
}
group.search.merchant`
,
MerchantModify
:
`
${
path
}
modify`
,
MerchantModify
:
`
${
path
}
modify`
,
MerchantEnable
:
`
${
path2
}
enable.merchant`
,
MerchantEnable
:
`
${
path2
}
enable.merchant`
,
MerchantDisable
:
`
${
path2
}
disable.merchant`
MerchantDisable
:
`
${
path2
}
disable.merchant`
...
...
src/api/index.js
View file @
dab08b8
...
@@ -22,9 +22,9 @@ const request = {
...
@@ -22,9 +22,9 @@ const request = {
params
.
timestamp
=
new
Date
().
getTime
()
params
.
timestamp
=
new
Date
().
getTime
()
params
.
v
=
'1.0.0'
params
.
v
=
'1.0.0'
params
.
format
=
'json'
params
.
format
=
'json'
const
url
=
process
.
env
.
NODE_ENV
===
'production'
?
'router'
:
params
.
method
//
const url = process.env.NODE_ENV === 'production' ? 'router' : params.method
return
GlAxios
.
get
(
url
,
{
'params'
:
sign
(
params
)
})
//
return GlAxios.get(url, { 'params': sign(params) })
//
return GlAxios.get('router', { 'params': sign(params) })
return
GlAxios
.
get
(
'router'
,
{
'params'
:
sign
(
params
)
})
}
}
}
}
export
{
export
{
...
...
src/views/customer/businessGroupDetail/index.vue
View file @
dab08b8
...
@@ -63,19 +63,15 @@
...
@@ -63,19 +63,15 @@
placeholder="请输入内容"
placeholder="请输入内容"
></gl-input> -->
></gl-input> -->
<gl-select
<gl-select
v-model=
"searchResult.merchant
Name
"
v-model=
"searchResult.merchant
Id
"
filterable
filterable
remote
remote
clearable
clearable
name=
"merchantId"
placeholder=
"请输入商户名称/商户号"
data-vv-as=
"商户名称/商户号"
v-validate=
"'required'"
@
change=
"changeMerchant"
@
change=
"changeMerchant"
:remote-method=
"remoteList"
:remote-method=
"remote
Merchant
List"
:loading=
"
l
oading"
>
:loading=
"
treeL
oading"
>
<gl-option
<gl-option
v-for=
"item in businessList"
v-for=
"item in business
Tree
List"
:key=
"item.merchantId"
:key=
"item.merchantId"
:label=
"item.merchantName"
:label=
"item.merchantName"
:value=
"item.merchantId"
>
:value=
"item.merchantId"
>
...
@@ -189,16 +185,13 @@
...
@@ -189,16 +185,13 @@
:addDialogVisible=
"addDialogVisible"
:addDialogVisible=
"addDialogVisible"
@
addData=
"handleAddData"
@
addData=
"handleAddData"
></add-business>
></add-business>
<gl-dialog
<
!-- <
gl-dialog
title="编辑商户"
title="编辑商户"
:visible
.
sync=
"merchantDialogVisible"
:visible.sync="merchantDialogVisible">
>
<gl-form :model="merchantInfo">
<gl-form :model="merchantInfo">
<gl-form-item
<gl-form-item
label="商户名称:"
label="商户名称:"
:label-width=
"formLabelWidth"
:label-width="formLabelWidth">
>
<!-- <gl-input v-model="merchantInfo.merchantName" auto-complete="off"></gl-input> -->
<div>{{merchantInfo.merchantName}}</div>
<div>{{merchantInfo.merchantName}}</div>
</gl-form-item>
</gl-form-item>
<gl-form-item
<gl-form-item
...
@@ -233,10 +226,6 @@
...
@@ -233,10 +226,6 @@
>
>
</gl-option>
</gl-option>
</gl-select>
</gl-select>
<!-- <span
v-show="errorBags.has('merchantId')"
class="error"
>{{ errorBags.first('merchantId') }}</span> -->
</gl-form-item>
</gl-form-item>
</gl-form>
</gl-form>
<div
<div
...
@@ -249,7 +238,7 @@
...
@@ -249,7 +238,7 @@
@click="submitMerchant"
@click="submitMerchant"
>确 定</gl-button>
>确 定</gl-button>
</div>
</div>
</gl-dialog>
</gl-dialog>
-->
</div>
</div>
</template>
</template>
...
@@ -390,8 +379,8 @@ export default {
...
@@ -390,8 +379,8 @@ export default {
children
:
'list'
,
children
:
'list'
,
label
:
'merchantName'
label
:
'merchantName'
},
},
businessList
:
[],
business
Tree
List
:
[],
l
oading
:
false
,
treeL
oading
:
false
,
searchResult
:
{},
// 搜索结果的对象
searchResult
:
{},
// 搜索结果的对象
allTree
:
[],
allTree
:
[],
target
:
[],
target
:
[],
...
@@ -413,18 +402,17 @@ export default {
...
@@ -413,18 +402,17 @@ export default {
this
.
addDialogVisible
=
false
this
.
addDialogVisible
=
false
this
.
dialogVisible_search
=
false
this
.
dialogVisible_search
=
false
// this.searchParams.groupId = params.groupId
// this.searchParams.groupId = params.groupId
const
para
=
{}
para
.
groupId
=
this
.
groupId
para
.
method
=
groupDetailMethods
.
GetTree
request
.
req
(
para
).
then
(
res
=>
{
this
.
dataTree
=
res
})
})
})
// this.loadingGetList()
// this.loadingGetList()
this
.
getMerchantType
()
this
.
getMerchantType
()
this
.
eventBus
=
this
.
$root
.
eventBus
this
.
eventBus
=
this
.
$root
.
eventBus
// gettree
// gettree
const
params
=
{}
// params.groupId = this.groupId
params
.
method
=
groupDetailMethods
.
GetTree
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
dataTree
=
res
.
data
})
},
},
methods
:
{
methods
:
{
loadingGetList
()
{
loadingGetList
()
{
...
@@ -548,78 +536,49 @@ export default {
...
@@ -548,78 +536,49 @@ export default {
},
},
// 树操作
// 树操作
// 父商户搜索
// 父商户搜索
remoteList
(
query
)
{
remote
Merchant
List
(
query
)
{
if
(
query
!==
''
)
{
if
(
query
!==
''
)
{
this
.
l
oading
=
true
this
.
treeL
oading
=
true
const
params
=
{}
const
params
=
{}
params
.
groupId
=
this
.
groupId
params
.
groupId
=
this
.
groupId
params
.
searchWrod
=
query
params
.
searchWrod
=
query
params
.
method
=
groupDetailMethods
.
SearchLis
t
params
.
method
=
groupDetailMethods
.
GroupSearchMerchan
t
request
.
req
(
params
).
then
(
res
=>
{
request
.
req
(
params
).
then
(
res
=>
{
this
.
loading
=
false
console
.
log
(
res
)
this
.
businessList
=
res
.
merchantParams
this
.
treeLoading
=
false
this
.
businessTreeList
=
res
.
merchantParams
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
notice
.
errorTips
(
err
)
})
})
}
else
{
}
else
{
this
.
businessList
=
[]
this
.
business
Tree
List
=
[]
}
}
},
},
changeMerchant
(
val
)
{
changeMerchant
(
val
)
{
if
(
val
)
{
if
(
val
)
{
this
.
businessList
.
forEach
(
item
=>
{
this
.
business
Tree
List
.
forEach
(
item
=>
{
if
(
item
.
merchantId
===
val
&&
item
.
merchantType
!==
null
)
{
if
(
item
.
merchantId
===
val
&&
item
.
merchantType
!==
null
)
{
this
.
merchantInfo
.
merchantType
=
item
.
merchantType
this
.
merchantInfo
.
merchantType
=
item
.
merchantType
this
.
disabledMerchant
=
true
this
.
disabledMerchant
=
true
}
}
})
})
this
.
businessList
=
[]
this
.
business
Tree
List
=
[]
}
}
},
},
// 查询
// 查询
searchMerchant
()
{
searchMerchant
()
{
console
.
log
(
this
.
lastSearch
.
style
?
this
.
lastSearch
.
style
.
backgroundColor
:
null
)
this
.
lastSearch
.
style
?
this
.
lastSearch
.
style
.
backgroundColor
=
'#ffffff'
:
null
console
.
log
(
this
.
lastSearch
)
this
.
searchResult
.
merchantId
=
11221
+
Math
.
round
(
Math
.
random
()
*
100
+
10
)
console
.
log
(
this
.
searchResult
.
merchantId
)
console
.
log
(
this
.
searchResult
.
merchantId
)
console
.
log
(
this
.
$refs
.
tree
.
$children
[
0
])
this
.
lastSearch
.
style
?
this
.
lastSearch
.
style
.
backgroundColor
=
'#ffffff'
:
null
// console.log(this.$refs.tree.$children[0].store._getAllNodes())
// console.log(this.$refs.tree.$children[0].$el.childNodes[0].__vue__.getNodeKey(this.$refs.tree.$children[0].store._getAllNodes()[1]))
this
.
allTree
=
this
.
$refs
.
tree
.
$children
[
0
].
store
.
_getAllNodes
()
this
.
allTree
=
this
.
$refs
.
tree
.
$children
[
0
].
store
.
_getAllNodes
()
let
result
=
''
let
result
=
''
console
.
log
(
this
.
allTree
)
this
.
allTree
.
forEach
(
element
=>
{
this
.
allTree
.
forEach
(
element
=>
{
if
(
element
.
key
===
this
.
searchResult
.
merchantId
)
{
if
(
element
.
key
===
this
.
searchResult
.
merchantId
)
{
// console.log(element)
result
=
element
result
=
element
}
}
})
})
console
.
log
(
result
.
key
)
this
.
searchChildren
(
this
.
$refs
.
tree
.
$children
[
0
].
store
.
_getAllNodes
(),
result
.
key
)
this
.
searchChildren
(
this
.
$refs
.
tree
.
$children
[
0
].
store
.
_getAllNodes
(),
result
.
key
)
const
rootList
=
this
.
$refs
.
tree
.
$children
[
0
].
$children
const
rootList
=
this
.
$refs
.
tree
.
$children
[
0
].
$children
// console.log(rootList)
// console.log(this.target)
this
.
cycle
(
rootList
,
this
.
target
[
0
])
this
.
cycle
(
rootList
,
this
.
target
[
0
])
// rootList.forEach(i => {
// if (i.node.key === this.target[0].key) {
// this.$nextTick(() => {
// i.$children.forEach(j => {
// if (j.node.key === this.target[1].key) {
// j.$children.forEach(n => {
// if (n.node.key === this.target[2].key) {
// this.$nextTick(() => {
// console.log(n, n.$el.offsetTop)
// this.$refs.tree.$el.scrollTop = n.$el.offsetTop - n.$el.offsetHeight
// n.$el.style.background = '#f5f7fa'
// })
// }
// })
// }
// })
// })
// }
// })
},
},
cycle
(
arr
,
target
)
{
cycle
(
arr
,
target
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
@@ -631,11 +590,7 @@ export default {
...
@@ -631,11 +590,7 @@ export default {
this
.
$set
(
this
.
$refs
.
tree
.
$el
,
'scrollTop'
,
top
-
i
.
$el
.
offsetHeight
/
2
)
this
.
$set
(
this
.
$refs
.
tree
.
$el
,
'scrollTop'
,
top
-
i
.
$el
.
offsetHeight
/
2
)
// #f5f7fa
// #f5f7fa
i
.
$el
.
children
[
0
].
style
[
'background-color'
]
=
'#eee'
i
.
$el
.
children
[
0
].
style
[
'background-color'
]
=
'#eee'
console
.
log
(
i
.
$el
.
children
[
0
])
this
.
lastSearch
=
i
.
$el
.
children
[
0
]
this
.
lastSearch
=
i
.
$el
.
children
[
0
]
// console.log(i.node)
// this.$refs.tree.$children[0].store.setCurrentNode(i.node)
// console.log(this.$refs.tree.$children[0].store.getCurrentNode())
},
200
)
},
200
)
})
})
}
else
if
(
i
.
node
.
key
===
target
.
key
)
{
}
else
if
(
i
.
node
.
key
===
target
.
key
)
{
...
@@ -646,10 +601,8 @@ export default {
...
@@ -646,10 +601,8 @@ export default {
},
},
searchChildren
(
data
,
id
)
{
searchChildren
(
data
,
id
)
{
data
.
forEach
(
el
=>
{
data
.
forEach
(
el
=>
{
// console.log(el.store.getCurrentNode())
if
(
el
.
key
===
id
)
{
if
(
el
.
key
===
id
)
{
this
.
$set
(
el
,
'expanded'
,
true
)
this
.
$set
(
el
,
'expanded'
,
true
)
this
.
searchParent
(
el
)
this
.
searchParent
(
el
)
}
else
{
}
else
{
this
.
$set
(
el
,
'expanded'
,
false
)
this
.
$set
(
el
,
'expanded'
,
false
)
...
...
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