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 6c42b130
authored
Jun 24, 2019
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
http://192.168.3.233:8090/glsx-web/glsx-oss-merchant-data
2 parents
9287851d
5fe48c71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
389 additions
and
69 deletions
src/api/businessGroupDetail.js
src/views/customer/businessGroupDetail/index.vue
src/api/businessGroupDetail.js
View file @
6c42b13
...
@@ -4,8 +4,8 @@ const methods = {
...
@@ -4,8 +4,8 @@ const methods = {
Search
:
`
${
path
}
group.search`
,
Search
:
`
${
path
}
group.search`
,
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`
}
}
export
{
export
{
methods
methods
...
...
src/views/customer/businessGroupDetail/index.vue
View file @
6c42b13
<
template
>
<
template
>
<div
class=
"default businessGD"
>
<div
class=
"default businessGD"
>
<div
class=
"m-b10"
>
<div
class=
"m-b10"
>
<gl-button
<gl-button
class=
"newButton"
class=
"newButton"
type=
"primary"
type=
"primary"
@
click=
"searchDialog"
@
click=
"searchDialog"
>
高级搜索
</gl-button>
>
高级搜索
</gl-button>
<gl-button
<gl-button
class=
"newButton"
class=
"newButton"
type=
"primary"
type=
"primary"
@
click=
"addDialog"
@
click=
"addDialog"
>
添加商户
</gl-button>
>
添加商户
</gl-button>
</div>
</div>
<div>
<gl-table
<gl-table
style=
"width: 808px;display: inline-block;"
class=
"m-b10"
class=
"m-b10"
:table=
"tableData"
:table=
"tableData"
v-loading=
"tableLoading"
>
v-loading=
"tableLoading"
<gl-table-column
align=
"center"
v-for=
"(i, index) in tableData.column"
:key=
"index"
:label=
'i.label'
:prop=
'i.prop'
:width=
'i.width'
>
>
<gl-table-column
align=
"center"
v-for=
"(i, index) in tableData.column"
:key=
"index"
:label=
'i.label'
:prop=
'i.prop'
:width=
'i.width'
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<template
v-if=
'i.prop === "merchantName"'
>
<template
v-if=
'i.prop === "merchantName"'
>
<a
@
click=
"merchantDetail(scope.scope.row.merchantId)"
class=
"el-button el-button--text"
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</a>
<a
@
click=
"merchantDetail(scope.scope.row.merchantId)"
class=
"el-button el-button--text"
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</a>
</
template
>
</
template
>
<
template
v-else-if=
'i.prop === "parentMerchantName"'
>
<
template
v-else-if=
'i.prop === "parentMerchantName"'
>
<a
@
click=
"merchantDetail(scope.scope.row.parentMerchantId)"
class=
"el-button el-button--text"
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</a>
<a
@
click=
"merchantDetail(scope.scope.row.parentMerchantId)"
class=
"el-button el-button--text"
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</a>
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
...
@@ -30,43 +47,108 @@
...
@@ -30,43 +47,108 @@
</template>
</template>
</gl-table-column>
</gl-table-column>
</gl-table>
</gl-table>
<gl-pagination
<div
style=
"width: 350px;display: inline-block;height: 500px;overflow-y: auto;"
>
background
<!-- <gl-form-item label="商户:" prop="merchantId"> -->
@
size-change=
"handleSizeChange"
<gl-input
@
current-change=
"handleCurrentChange"
v-model=
"searchResult.merchantName"
:current-page=
"pageNum"
placeholder=
"请输入内容"
:page-sizes=
"[10,20,30,40]"
></gl-input>
:page-size=
"pageSize"
<!-- <gl-select
layout=
"total, sizes, ->, prev, pager, next, jumper"
v-model="searchResult.merchantName"
:total=
"total"
filterable
>
remote
</gl-pagination>
clearable
name="merchantId"
placeholder="请输入商户名称/商户号"
data-vv-as="商户名称/商户号"
v-validate="'required'"
@change="changeMerchant"
:remote-method="remoteList"
:loading="loading">
<gl-option
v-for="item in businessList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId">
</gl-option>
</gl-select> -->
<gl-button
class=
"newButton"
type=
"primary"
@
click=
"searchMerchant"
@
keyup
.
enter=
"searchMerchant"
>
查询
</gl-button>
<!-- </gl-form-item> -->
<!-- <gl-input v-model="searchTree" placeholder="请输入内容"></gl-input> -->
<gl-tree
:style=
"{height: parseInt(this.$client_height() - 140) + 'px'}"
style=
"overflow-x: auto"
:data=
"dataTree"
:props=
"defaultProps"
node-key=
'merchantId'
ref=
"tree"
></gl-tree>
</div>
<gl-pagination
style=
"width: 808px;"
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pageNum"
:page-sizes=
"[10,20,30,40]"
:page-size=
"pageSize"
layout=
"total, sizes, ->, prev, pager, next, jumper"
:total=
"total"
>
</gl-pagination>
</div>
<gl-dialog
<gl-dialog
title=
"高级搜索"
title=
"高级搜索"
width=
"40%"
width=
"40%"
:visible
.
sync=
"dialogVisible_search"
:visible
.
sync=
"dialogVisible_search"
:before-close=
"handleClose_search"
:before-close=
"handleClose_search"
:close-on-click-modal=
"false"
>
:close-on-click-modal=
"false"
>
<gl-form
<gl-form
:model=
"searchParams"
:model=
"searchParams"
ref=
"searchParams"
ref=
"searchParams"
label-width=
"120px"
>
label-width=
"120px"
<gl-form-item
label=
"商户名称:"
prop=
"merchantName"
>
>
<gl-input
name=
"merchantName"
placeholder=
"请输入商户名称"
v-model=
"searchParams.merchantName"
></gl-input>
<gl-form-item
label=
"商户名称:"
prop=
"merchantName"
>
<gl-input
name=
"merchantName"
placeholder=
"请输入商户名称"
v-model=
"searchParams.merchantName"
></gl-input>
</gl-form-item>
</gl-form-item>
<gl-form-item
label=
"商户号:"
prop=
"merchantId"
>
<gl-form-item
<gl-input
name=
"merchantId"
placeholder=
"请输入商户号"
v-model=
"searchParams.merchantId"
></gl-input>
label=
"商户号:"
prop=
"merchantId"
>
<gl-input
name=
"merchantId"
placeholder=
"请输入商户号"
v-model=
"searchParams.merchantId"
></gl-input>
</gl-form-item>
</gl-form-item>
<gl-form-item
label=
"商户类型:"
prop=
"merchantType"
>
<gl-form-item
label=
"商户类型:"
prop=
"merchantType"
>
<gl-select
<gl-select
name=
"merchantType"
name=
"merchantType"
v-model=
"searchParams.merchantType"
v-model=
"searchParams.merchantType"
placeholder=
"请选择"
>
placeholder=
"请选择"
>
<gl-option
<gl-option
v-for=
"item in merchantTypeList"
v-for=
"item in merchantTypeList"
:key=
"item.value"
:key=
"item.value"
:label=
"item.label"
:label=
"item.label"
:value=
"item.value"
>
:value=
"item.value"
>
</gl-option>
</gl-option>
</gl-select>
</gl-select>
</gl-form-item>
</gl-form-item>
...
@@ -79,28 +161,96 @@
...
@@ -79,28 +161,96 @@
></city-area>
></city-area>
</gl-form-item>
</gl-form-item>
<gl-form-item
label=
'加入分组时间:'
>
<gl-form-item
label=
'加入分组时间:'
>
<gl-date-picker
<gl-date-picker
v-model=
"times"
v-model=
"times"
type=
"daterange"
type=
"daterange"
range-separator=
"至"
range-separator=
"至"
start-placeholder=
"开始日期"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
end-placeholder=
"结束日期"
value-format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
:picker-options=
"pickerOptions"
:picker-options=
"pickerOptions"
>
>
</gl-date-picker>
</gl-date-picker>
</gl-form-item>
</gl-form-item>
</gl-form>
</gl-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<div
<gl-button
type=
"primary"
@
click=
"handleSubmit_search"
:loading=
"searchLoading"
>
搜索
</gl-button>
slot=
"footer"
<gl-button
@
click=
"searchReset"
>
重置
</gl-button>
class=
"dialog-footer"
>
<gl-button
type=
"primary"
@
click=
"handleSubmit_search"
:loading=
"searchLoading"
>
搜索
</gl-button>
<gl-button
@
click=
"searchReset"
>
重置
</gl-button>
</div>
</div>
</gl-dialog>
</gl-dialog>
<add-business
<add-business
:groupId=
"groupId+''"
:groupId=
"groupId+''"
:addDialogVisible=
"addDialogVisible"
:addDialogVisible=
"addDialogVisible"
@
addData=
"handleAddData"
@
addData=
"handleAddData"
></add-business>
></add-business>
<gl-dialog
title=
"编辑商户"
: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> -->
<div>
{{merchantInfo.merchantName}}
</div>
</gl-form-item>
<gl-form-item
label=
"商户类型:"
:label-width=
"formLabelWidth"
>
<div>
{{merchantInfo.merchantTypeName}}
</div>
</gl-form-item>
<gl-form-item
label=
"父商户:"
:label-width=
"formLabelWidth"
prop=
"parentMerchantId"
>
<gl-select
v-model=
"merchantInfo.parentMerchantName"
filterable
remote
clearable
name=
"merchantId"
placeholder=
"请输入商户名称/商户号"
data-vv-as=
"商户名称/商户号"
v-validate=
"'required'"
@
change=
"changeMerchant"
:remote-method=
"remoteList"
:loading=
"loading"
>
<gl-option
v-for=
"item in businessList"
:key=
"item.merchantId"
:label=
"item.merchantName"
:value=
"item.merchantName"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('merchantId')"
class=
"error"
>
{{ errorBags.first('merchantId') }}
</span>
</gl-form-item>
</gl-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<gl-button
@
click=
"merchantDialogVisible = false"
>
取 消
</gl-button>
<gl-button
type=
"primary"
@
click=
"submitMerchant"
>
确 定
</gl-button>
</div>
</gl-dialog>
</div>
</div>
</template>
</template>
...
@@ -168,27 +318,32 @@ export default {
...
@@ -168,27 +318,32 @@ export default {
{
{
label
:
'序号'
,
label
:
'序号'
,
prop
:
'id'
,
prop
:
'id'
,
width
:
'
80
px'
width
:
'
55
px'
},
},
{
{
label
:
'商户名称'
,
label
:
'商户名称'
,
prop
:
'merchantName'
prop
:
'merchantName'
,
width
:
'170px'
},
},
{
{
label
:
'商户号'
,
label
:
'商户号'
,
prop
:
'merchantId'
prop
:
'merchantId'
,
width
:
'70px'
},
},
{
{
label
:
'地区'
,
label
:
'地区'
,
prop
:
'areaAddress'
prop
:
'areaAddress'
,
width
:
'90px'
},
},
{
{
label
:
'商户类型'
,
label
:
'商户类型'
,
prop
:
'merchantTypeName'
prop
:
'merchantTypeName'
,
width
:
'80px'
},
},
{
{
label
:
'加入分组时间'
,
label
:
'加入分组时间'
,
prop
:
'createTime'
prop
:
'createTime'
,
width
:
'155px'
// formatter: cellValue => {
// formatter: cellValue => {
// if (cellValue.createTime) {
// if (cellValue.createTime) {
// return new Date(cellValue.createTime).format('yyyy-MM-dd')
// return new Date(cellValue.createTime).format('yyyy-MM-dd')
...
@@ -197,13 +352,57 @@ export default {
...
@@ -197,13 +352,57 @@ export default {
},
},
{
{
label
:
'父商户名称'
,
label
:
'父商户名称'
,
prop
:
'parentMerchantName'
prop
:
'parentMerchantName'
,
width
:
'100px'
},
},
{
{
label
:
'父商户号'
,
label
:
'父商户号'
,
prop
:
'parentMerchantId'
prop
:
'parentMerchantId'
,
width
:
'70px'
}
}
]
],
console
:
{
show
:
true
,
label
:
'操作'
,
prop
:
'options'
,
button
:
[
{
label
:
'编辑'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
console
.
log
(
rows
[
index
])
this
.
editMerchat
(
rows
[
index
])
}
}
]
}
},
// 编辑商户
merchantDialogVisible
:
false
,
merchantInfo
:
{
// merchantName: '',
// merchantType: '',
// parentMerchantId: ''
},
formLabelWidth
:
'120px'
,
// 树
dataTree
:
[],
defaultProps
:
{
children
:
'list'
,
label
:
'merchantName'
},
businessList
:
[],
loading
:
false
,
searchResult
:
{},
// 搜索结果的对象
allTree
:
[],
target
:
[]
}
},
created
()
{
document
.
onkeydown
=
e
=>
{
if
(
e
.
keyCode
===
13
)
{
console
.
log
(
'enter'
)
this
.
searchMerchant
()
}
}
}
}
},
},
...
@@ -218,6 +417,13 @@ export default {
...
@@ -218,6 +417,13 @@ export default {
// this.loadingGetList()
// this.loadingGetList()
this
.
getMerchantType
()
this
.
getMerchantType
()
this
.
eventBus
=
this
.
$root
.
eventBus
this
.
eventBus
=
this
.
$root
.
eventBus
// gettree
const
params
=
{}
params
.
method
=
groupDetailMethods
.
GetTree
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
dataTree
=
res
.
data
})
},
},
methods
:
{
methods
:
{
loadingGetList
()
{
loadingGetList
()
{
...
@@ -320,6 +526,120 @@ export default {
...
@@ -320,6 +526,120 @@ export default {
},
},
merchantDetail
(
merchantId
)
{
merchantDetail
(
merchantId
)
{
this
.
$root
.
to
([
'商户数据平台'
,
'商户数据管理'
,
'商户数据'
,
'商户列表管理'
,
'*商户详情'
],
{
merchantId
:
merchantId
})
this
.
$root
.
to
([
'商户数据平台'
,
'商户数据管理'
,
'商户数据'
,
'商户列表管理'
,
'*商户详情'
],
{
merchantId
:
merchantId
})
},
// 编辑商户
editMerchat
(
row
)
{
this
.
merchantInfo
=
{
merchantName
:
row
.
merchantName
,
merchantTypeName
:
row
.
merchantTypeName
,
parentMerchantId
:
row
.
parentMerchantId
,
parentMerchantName
:
row
.
parentMerchantName
}
// this.$set(this.merchantInfo.merchantName, row.merchantName)
// this.$set(this.merchantInfo.merchantTypeName, row.merchantTypeName)
// this.merchantInfo.merchantName = row.merchantName
// this.merchantInfo.merchantTypeName = row.merchantTypeName
this
.
merchantDialogVisible
=
!
this
.
merchantDialogVisible
},
submitMerchant
()
{
// 调用接口
this
.
merchantDialogVisible
=
!
this
.
merchantDialogVisible
},
// 树操作
// 父商户搜索
remoteList
(
query
)
{
if
(
query
!==
''
)
{
this
.
loading
=
true
const
params
=
{}
params
.
groupId
=
this
.
groupId
params
.
searchWrod
=
query
params
.
method
=
groupDetailMethods
.
SearchList
request
.
req
(
params
).
then
(
res
=>
{
this
.
loading
=
false
this
.
businessList
=
res
.
merchantParams
}).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
})
}
else
{
this
.
businessList
=
[]
}
},
changeMerchant
(
val
)
{
if
(
val
)
{
this
.
businessList
.
forEach
(
item
=>
{
if
(
item
.
merchantId
===
val
&&
item
.
merchantType
!==
null
)
{
this
.
merchantInfo
.
merchantType
=
item
.
merchantType
this
.
disabledMerchant
=
true
}
})
this
.
businessList
=
[]
}
},
// 查询
searchMerchant
()
{
this
.
searchResult
.
merchantId
=
205
// 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
.
allTree
=
this
.
$refs
.
tree
.
$children
[
0
].
store
.
_getAllNodes
()
let
result
=
''
this
.
allTree
.
forEach
(
element
=>
{
if
(
element
.
key
===
this
.
searchResult
.
merchantId
)
{
// console.log(element)
result
=
element
}
})
this
.
searchChildren
(
this
.
$refs
.
tree
.
$children
[
0
].
store
.
_getAllNodes
(),
result
.
key
)
const
rootList
=
this
.
$refs
.
tree
.
$children
[
0
].
$children
// const sencondList = []
console
.
log
(
rootList
)
console
.
log
(
this
.
target
)
rootList
.
forEach
(
i
=>
{
if
(
i
.
node
.
key
===
this
.
target
[
0
].
key
)
{
console
.
log
(
i
.
$children
)
// sencondList = i.$children
i
.
$children
.
forEach
(
j
=>
{
console
.
log
(
j
)
// if (j.node.key === this.target[1].key) {
// console.log(j)
// }
})
// for (const j in sencondList) {
// }
}
})
// for (const i in rootList) {
// if (rootList[i].node.key === this.target[0].key) {
// console.log(rootList[i])
// const sencondList = rootList[i].$children
// // for (const j in sencondList) {
// // }
// // console.log(typeof (sencondList))
// }
// if (rootList[i].children && rootList[i].children[1]) {
// console.log(rootList[i].children[1])
// }
// {if (rootList[i].children && rootList[i].children.length === 2) {
// console.log(rootList[i])
// }}
// }
},
searchChildren
(
data
,
id
)
{
data
.
forEach
(
el
=>
{
if
(
el
.
key
===
id
)
{
this
.
$set
(
el
,
'expanded'
,
true
)
this
.
searchParent
(
el
)
}
})
},
searchParent
(
e
)
{
if
(
e
.
level
!==
1
)
{
this
.
$set
(
e
.
parent
,
'expanded'
,
true
)
this
.
searchParent
(
e
.
parent
)
this
.
target
[
e
.
level
-
1
]
=
e
}
else
{
this
.
target
[
0
]
=
e
}
}
}
}
}
}
}
...
@@ -333,9 +653,9 @@ export default {
...
@@ -333,9 +653,9 @@ export default {
}
}
}
}
}
}
.businessGD
a
{
.businessGD
a
{
/* color: #0000FF; */
/* color: #0000FF; */
text-decoration
:
underline
text-decoration
:
underline
;
}
}
//
.tableImg
{
//
.tableImg
{
//
width
:
36px
;
//
width
:
36px
;
...
...
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