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