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 fc26783d
authored
Mar 28, 2019
by
wangql
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
提交代码
2 parents
01283ffe
57978827
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
484 additions
and
465 deletions
src/api/businessGroupDetail.js
src/api/businessManagement.js
src/api/sign.js
src/views/customer/businessDetails/index.vue
src/views/customer/businessGroup/index.vue
src/views/customer/businessGroupDetail/addBusiness.vue
src/views/customer/businessGroupDetail/index.vue
src/views/customer/businessList/AddDialog.vue
src/views/customer/businessList/SearchDialog.vue
src/views/customer/businessList/index.vue
src/views/customer/businessManagement/addBusiness.vue
src/views/customer/businessManagement/index.vue
src/api/businessGroupDetail.js
View file @
fc26783
const
path
=
'glsx.accounts.admin.merchant.'
const
methods
=
{
Create
:
`
${
path
}
group.relation.create`
,
// 分组新增商户
Search
:
`
${
path
}
group.search`
,
MerchantType
:
`
${
path
}
dict.type`
MerchantType
:
`
${
path
}
dict.type`
,
SearchChildList
:
`
${
path
}
group.search.param`
,
// 子商户根据商户号或者商户名搜索商户列表
SearchList
:
`
${
path
}
group.search.parampar`
// 父商户根据商户号或者商户名搜索商户列表
}
export
{
methods
...
...
src/api/businessManagement.js
View file @
fc26783
// 业务管理
const
path
=
'glsx.accounts.admin.merchant.dict.'
const
methods
=
{
Business
:
`
${
path
}
business`
,
Create
:
`
${
path
}
create`
,
Channel
:
`
${
path
}
channel`
,
Type
:
`
${
path
}
type`
Business
:
`
${
path
}
business`
,
// 业务列表
Create
:
`
${
path
}
business.create`
,
// 新增业务
Channel
:
`
${
path
}
channel`
,
// 获取渠道列表
Type
:
`
${
path
}
type`
// 获取商户类型列表
}
export
{
methods
...
...
src/api/sign.js
View file @
fc26783
import
MD5
from
'js-md5'
const
sign
=
params
=>
{
delete
params
.
sign
const
secret
=
'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const
keys
=
Object
.
keys
(
params
).
sort
()
var
str
=
[]
...
...
src/views/customer/businessDetails/index.vue
View file @
fc26783
<
template
>
<div
class=
"detail"
>
<gl-breadcrumb
separator=
'/'
>
<gl-breadcrumb
s
tyle=
"font-size: 20px;background: #f0f0f0;padding: 5px 10px;border-radius: 10px;display: inline-block;"
s
eparator=
'/'
>
<gl-breadcrumb-item><a
href=
'#'
@
click=
'back'
...
...
@@ -8,9 +8,9 @@
<gl-breadcrumb-item>
商户详情
</gl-breadcrumb-item>
<gl-breadcrumb-item>
{{
List
[
0
].
value
}}
</gl-breadcrumb-item>
</gl-breadcrumb>
<!--
<gl-button
type=
'text'
@
click=
'back'
>
商户列表
</gl-button>
<span>
\ 商户详情 \
{{
name
}}
</span>
-->
<gl-tabs
style=
"margin-top: 20px;"
:tab-position=
"tabPosition"
v-model=
'activeName'
@
tab-click=
'handleClick'
>
...
...
@@ -18,6 +18,7 @@
label=
'基本信息'
name=
'first'
>
<gl-col
:span=
"24"
style=
"border: 1px solid #ebeef5;background: #fafafa;padding: 10px 20px;"
>
<gl-col
class=
"detail-row"
:span=
"i.isMap || i.img? 24 : 12"
...
...
@@ -47,7 +48,7 @@
<span
v-else
>
{{
i
.
value
}}
</span>
</span>
</gl-col>
</gl-col>
</gl-tab-pane>
<gl-tab-pane
label=
'员工信息'
...
...
@@ -129,6 +130,7 @@ export default {
name
:
'BusinessDetails'
,
data
()
{
return
{
tabPosition
:
'left'
,
merchantId
:
''
,
// 标记merchantId是否改变
IdChange
:
[
0
,
0
,
0
],
...
...
@@ -248,7 +250,8 @@ export default {
label
:
'详情'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
this
.
getGroupLevelInfo
(
rows
[
index
].
GroupName
)
// console.log(rows[index])
this
.
getGroupLevelInfo
(
rows
[
index
].
id
)
}
}]
}
...
...
@@ -299,13 +302,14 @@ export default {
},
methods
:
{
back
()
{
this
.
$parent
.
to
([
'商户数据平台'
,
'商户数据平台'
,
'商户数据平台'
,
'
业务管理'
,
'业务管理
列表'
])
this
.
$parent
.
to
([
'商户数据平台'
,
'商户数据平台'
,
'商户数据平台'
,
'
商户列表'
,
'商户
列表'
])
},
goGroupDetail
(
row
)
{
this
.
$root
.
to
([
'商户数据平台'
,
'商户数据平台'
,
'商户数据平台'
,
'商户分组'
,
'*商户分组详情'
],
{
merchantId
:
row
.
merchantId
})
console
.
log
(
row
)
this
.
$root
.
to
([
'商户数据平台'
,
'商户数据平台'
,
'商户数据平台'
,
'商户分组'
,
'*商户分组详情'
],
{
groudId
:
row
.
id
})
},
goBusinessDetail
(
row
)
{
this
.
handleDetailClos
e
()
this
.
detailVisibl
e
()
this
.
activeName
=
'first'
this
.
merchantId
=
row
.
merchantId
},
...
...
@@ -356,7 +360,7 @@ export default {
},
// 员工信息
getStaffInfo
()
{
const
params
=
({
merchantId
:
this
.
merchantId
})
const
params
=
{
merchantId
:
this
.
merchantId
}
params
.
method
=
bizMethods
.
Personal
request
.
req
(
params
).
then
(
res
=>
{
this
.
staffTableData
.
data
=
res
.
merchantPersonals
...
...
@@ -368,7 +372,7 @@ export default {
},
// 分组信息
getGroupInfo
()
{
const
params
=
({
merchantId
:
this
.
merchantId
})
const
params
=
{
merchantId
:
this
.
merchantId
}
params
.
method
=
bizMethods
.
Group
request
.
req
(
params
).
then
(
res
=>
{
this
.
groupTableData
.
data
=
res
.
merchantGroups
...
...
@@ -379,15 +383,17 @@ export default {
})
},
// 分组信息-详情
getGroupLevelInfo
(
group
Name
)
{
const
params
=
({
merchantId
:
this
.
merchantId
,
groupId
:
groupName
})
getGroupLevelInfo
(
group
Id
)
{
const
params
=
{
merchantId
:
this
.
merchantId
,
groupId
:
groupId
}
params
.
method
=
bizMethods
.
GroupLevel
console
.
log
(
params
)
this
.
detailVisible
()
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
([
res
.
parentMerchantLevel
])
//
console.log([res.parentMerchantLevel])
this
.
parentLevelTableData
.
data
=
[
res
.
parentMerchantLevel
]
this
.
childLevelTableData
.
data
=
res
.
childMerchantLevels
this
.
detailVisible
()
}).
catch
(
err
=>
{
// console.log(err)
notice
.
errorTips
(
err
)
})
},
...
...
@@ -404,11 +410,11 @@ export default {
<
style
>
.amap-page-container
{
/* display: inline-block; */
width
:
75
%
;
width
:
100
%
;
height
:
300px
;
/* vertical-align: text-top; */
}
.amap-demo
{
.amap-demo
{
height
:
300px
;
}
.detail
{
...
...
@@ -420,11 +426,15 @@ export default {
}
.detail-row
{
line-height
:
36px
;
/* padding-left: 20px */
}
.detail-logo
{
width
:
40px
;
height
:
40px
;
vertical-align
:
text-top
;
}
.el-tabs__header
{
background-color
:
#fafafa
;
}
</
style
>
src/views/customer/businessGroup/index.vue
View file @
fc26783
<
template
>
<div
class=
"group"
>
<div
class=
"default"
>
<gl-form
:inline=
"true"
:model=
"searchCondition"
>
<!--
<gl-form-item>
<gl-input
v-model=
"searchCondition.brand"
class=
"input-with-select"
placeholder=
"请输入品牌"
clearable
/>
</gl-form-item>
<gl-form-item>
<gl-button
type=
"primary"
@
click=
"getList"
>
搜索
</gl-button>
</gl-form-item>
-->
<gl-form-item
style=
"float:right;"
>
<div
class=
"m-b10"
>
<gl-button
class=
"newButton"
type=
"primary"
@
click=
"dialog"
>
新增分组
</gl-button>
</gl-form-item>
</gl-form>
</div>
</div>
<gl-table
:table=
"tableData"
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'
>
<template
slot-scope=
"scope"
>
<template
v-if=
'i.prop === "ipBackgroundList"'
>
<img
class=
"tableImg"
:src=
"tableData.data[scope.scope.$index][i.prop]"
>
</
template
>
<
template
v-else
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</
template
>
</template>
</gl-table-column>
-->
v-loading=
"tableLoading"
>
</gl-table>
<gl-pagination
background
...
...
@@ -50,22 +18,20 @@
:current-page=
"pageNum"
:page-sizes=
"[10,20,30,40]"
:page-size=
"pageSize"
layout=
"
total, sizes
, prev, pager, next, jumper"
layout=
"
sizes, total, ->
, prev, pager, next, jumper"
:total=
"total"
>
</gl-pagination>
></gl-pagination>
<gl-dialog
title=
"新增分组"
width=
"30%"
:visible
.
sync=
"dialogVisible"
:before-close=
"handleClose"
>
:close-on-click-modal=
"false"
>
<gl-form
:model=
"addParams"
:rules=
"rules"
ref=
"addParams"
label-width=
"120px"
>
label-width=
"120px"
>
<gl-form-item
label=
"分组名称:"
prop=
"groupName"
>
<gl-input
name=
"groupName"
placeholder=
"请输入名称"
v-model=
"addParams.groupName"
></gl-input>
</gl-form-item>
...
...
@@ -75,23 +41,19 @@
v-validate=
"'required'"
data-vv-as=
"业务类型"
v-model=
"addParams.businessCode"
placeholder=
"请选择"
>
placeholder=
"请选择"
>
<gl-option
v-for=
"item in businessList"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
>
:key=
"item.
confId
"
:label=
"item.
confKey
"
:value=
"item.
confId
"
>
</gl-option>
</gl-select>
<!-- <span v-show="errorBags.has('businessCode')" class="error">
{{ errorBags.first('businessCode') }}
</span> -->
</gl-form-item>
</gl-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<gl-button
type=
"primary"
@
click=
"handleSubmit('addParams')"
:loading=
"addLoading"
>
提交
</gl-button>
<gl-button
@
click=
"handleClose"
>
取消
</gl-button>
<gl-button
type=
"primary"
@
click=
"handleSubmit('addParams')"
:loading=
"addLoading"
>
提交
</gl-button>
<gl-button
@
click=
"handleClose"
>
取消
</gl-button>
</div>
</gl-dialog>
</div>
...
...
@@ -104,6 +66,7 @@
// import { NoticeMixin } from '@/mixins'
// import Vue from 'vue'
import
{
groupMethods
,
request
}
from
'@/api'
import
notice
from
'@/common/notice'
export
default
{
name
:
'businessGroup'
,
components
:
{
...
...
@@ -143,7 +106,7 @@ export default {
tableData
:
{
border
:
true
,
align
:
'center'
,
//
height: parseInt(this.$client_height() - 140),
height
:
parseInt
(
this
.
$client_height
()
-
140
),
data
:
[],
column
:
[
{
...
...
@@ -168,12 +131,12 @@ export default {
},
{
label
:
'创建时间'
,
prop
:
'createTime'
//
formatter: cellValue => {
//
if (cellValue.createTime) {
//
return new Date(cellValue.createTime).format('yyyy-MM-dd')
//
}
//
}
prop
:
'createTime'
,
formatter
:
cellValue
=>
{
if
(
cellValue
.
createTime
)
{
return
new
Date
(
cellValue
.
createTime
).
format
(
'yyyy-MM-dd'
)
}
}
}
],
// number: {
...
...
@@ -202,7 +165,7 @@ export default {
}
},
mounted
()
{
this
.
g
etList
()
this
.
loadingG
etList
()
this
.
getBusinessList
()
},
methods
:
{
...
...
@@ -211,18 +174,14 @@ export default {
this
.
getList
()
},
/* 接口请求-start */
// getParams() {
// return Object.assign(
// {
// pageNum: this.pageNum,
// pageSize: this.pageSize
// },
// this.searchCondition
// )
// },
getList
()
{
// const params = this.getParams()
getParams
()
{
const
params
=
{}
params
.
pageCount
=
this
.
pageSize
params
.
pageSize
=
this
.
pageNum
return
params
},
getList
()
{
const
params
=
this
.
getParams
()
params
.
method
=
groupMethods
.
Search
request
.
req
(
params
)
...
...
@@ -242,9 +201,7 @@ export default {
request
.
req
(
params
)
.
then
(
res
=>
{
res
.
merchantDictList
.
forEach
((
item
,
index
)
=>
{
this
.
businessList
.
push
({
'label'
:
item
.
confKey
,
'value'
:
item
.
confId
})
})
this
.
businessList
=
res
.
merchantDictList
})
.
catch
(
err
=>
{
this
.
tableLoading
=
false
...
...
@@ -281,6 +238,7 @@ export default {
.
req
(
params
)
.
then
(
res
=>
{
this
.
loadingGetList
()
notice
.
okTips
()
this
.
dialogVisible
=
!
this
.
dialogVisible
})
.
catch
(
err
=>
console
.
log
(
err
))
...
...
@@ -294,11 +252,11 @@ export default {
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
>
.group
{
.cell
{
.el-button
{
padding
:
2px
10px
;
}
}
}
//
.group
{
//
.cell
{
//
.el-button
{
//
padding
:
2px
10px
;
//
}
//
}
//
}
</
style
>
src/views/customer/businessGroupDetail/addBusiness.vue
View file @
fc26783
...
...
@@ -4,7 +4,8 @@
title=
"添加商户"
:visible
.
sync=
"addDialogVisible"
width=
"400px"
:before-close=
"showAddDialog"
>
:before-close=
"showAddDialog"
:close-on-click-modal=
"false"
>
<gl-form
ref=
"addForm"
:model=
"addForm"
label-width=
"100px"
...
...
@@ -19,25 +20,28 @@
placeholder=
"请输入商户名称/商户号"
data-vv-as=
"商户名称/商户号"
v-validate=
"'required'"
:remote-method=
"remote
Method
"
:remote-method=
"remote
List
"
:loading=
"loading"
>
<gl-option
v-for=
"item in
options4
"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
>
v-for=
"item in
businessList
"
:key=
"item.
merchantId
"
:label=
"item.
merchantName
"
:value=
"item.
merchantId
"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('merchant')"
class=
"error"
>
{{
errorBags
.
first
(
'merchant'
)
}}
</span>
</gl-form-item>
<gl-form-item
label=
"商户类型:"
prop=
"merchantType"
>
<gl-select
v-model=
"addForm.merchantType"
name=
"merchantType"
data-vv-as=
"商户类型"
v-validate=
"'required'"
placeholder=
"请搜索"
>
<gl-select
v-model=
"addForm.merchantType"
name=
"merchantType"
data-vv-as=
"商户类型"
v-validate=
"'required'"
placeholder=
"请搜索"
>
<gl-option
v-for=
"item in merchantTypeList"
:key=
"item.
merchant
Id"
:label=
"item.
merchantName
"
:value=
"item.
merchant
Id"
>
:key=
"item.
conf
Id"
:label=
"item.
confKey
"
:value=
"item.
conf
Id"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('merchantType')"
class=
"error"
>
{{
errorBags
.
first
(
'merchantType'
)
}}
</span>
...
...
@@ -48,30 +52,43 @@
v-model=
"item.merchant"
filterable
remote
:name=
"`item.merchant$
{idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户${idx+1}`"
clearable
placeholder="请输入商户名称/商户号"
:remote-method=
"remote
Method
"
:loading=
"
l
oading"
>
:remote-method="remote
ChildList
"
:loading="
childL
oading">
<gl-option
v-for=
"item in
options4
"
:key=
"item.
value
"
:label=
"item.
label"
:value=
"item.
value
"
>
v-for=
"item in
businessChildList
"
:key=
"item.
merchantId
"
:label=
"item.
merchantName"
:value=
"item.
merchantId
"
>
</gl-option>
</gl-select>
<i
v-show=
"item.show"
class=
"el-icon-delete delete"
@
click=
"deleteBusiness(idx)"
></i>
<span
v-show=
"errorBags.has(`item.merchant$
{idx+1}`)" class="error">
{{
errorBags
.
first
(
`item.merchant${idx+1
}
`
)
}}
<
/span
>
<!--
<
span
v
-
show
=
"item.merchant? !item.merchant : !!item.merchantType"
class
=
"error"
>
{{
`请填写子商户${idx+1
}
的商户名称/商户号`
}}
<
/span> --
>
<
/gl-form-item
>
<
gl
-
form
-
item
label
=
"商户类型:"
>
<gl-select
v-model=
"item.merchantType"
placeholder=
"请选择"
>
<
gl
-
select
v
-
model
=
"item.merchantType"
:
name
=
"
`item.merchantType${idx+1
}
`"
v-validate="
item
.
merchant
||
item
.
merchantType
?
'required'
:
''
"
:data-vv-as="`子商户${idx+1
}
类型`"
clearable
placeholder="
请选择
">
<gl-option
v-for="
item
in
merchantTypeList
"
:key=
"item.
merchant
Id"
:label=
"item.
merchantName
"
:value=
"item.
merchant
Id"
>
:key="
item
.
conf
Id
"
:label="
item
.
confKey
"
:value="
item
.
conf
Id
">
</gl-option>
</gl-select>
<span v-show="
errorBags
.
has
(
`item.merchantType${idx+1
}
`
)
" class="
error
"
>
{{
errorBags
.
first
(
`item.merchantType${idx+1
}
`
)
}}
<
/span
>
<!--
<
span
v
-
show
=
"item.merchantType? !item.merchantType : !!item.merchant"
class
=
"error"
>
{{
`请填写子商户${idx+1
}
的商户类型`
}}
<
/span> --
>
<
/gl-form-item
>
<
/div
>
<
span
v
-
show
=
"tip"
class
=
"error"
style
=
"float:right; margin-right: 43px;"
>
{{
'请填写上一条子商户数据'
}}
<
/span
>
<
gl
-
button
@
click
=
"addMore"
>
添加更多
<
/gl-button
>
<
/gl-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
...
...
@@ -83,6 +100,8 @@
<
/template
>
<
script
>
import
notice
from
'@/common/notice'
import
{
businessManagenMethods
,
groupDetailMethods
,
request
}
from
'@/api'
export
default
{
name
:
'AddBusiness'
,
props
:
{
...
...
@@ -90,46 +109,21 @@ export default {
}
,
data
()
{
return
{
tip
:
false
,
addForm
:
{
merchant
:
''
,
merchantType
:
''
}
,
merchantTypeList
:
[
{
merchantId
:
1
,
merchantName
:
'广联'
},
{
merchantId
:
2
,
merchantName
:
'分组'
},
{
merchantId
:
3
,
merchantName
:
'富强'
}
],
merchantTypeList
:
[],
rules
:
{
merchant
:
[{
required
:
true
}
],
merchantType
:
[{
required
:
true
}
]
}
,
// 远程搜索
loading
:
false
,
options4
:
[],
states
:
[
'Alabama'
,
'Alaska'
,
'Arizona'
,
'Arkansas'
,
'California'
,
'Colorado'
,
'Connecticut'
,
'Delaware'
,
'Florida'
,
'Georgia'
,
'Hawaii'
,
'Idaho'
,
'Illinois'
,
'Indiana'
,
'Iowa'
,
'Kansas'
,
'Kentucky'
,
'Louisiana'
,
'Maine'
,
'Maryland'
,
'Massachusetts'
,
'Michigan'
,
'Minnesota'
,
'Mississippi'
,
'Missouri'
,
'Montana'
,
'Nebraska'
,
'Nevada'
,
'New Hampshire'
,
'New Jersey'
,
'New Mexico'
,
'New York'
,
'North Carolina'
,
'North Dakota'
,
'Ohio'
,
'Oklahoma'
,
'Oregon'
,
'Pennsylvania'
,
'Rhode Island'
,
'South Carolina'
,
'South Dakota'
,
'Tennessee'
,
'Texas'
,
'Utah'
,
'Vermont'
,
'Virginia'
,
'Washington'
,
'West Virginia'
,
'Wisconsin'
,
'Wyoming'
],
childLoading
:
false
,
businessList
:
[],
businessChildList
:
[],
addList
:
[
{
label
:
'子商户1'
,
...
...
@@ -145,53 +139,102 @@ export default {
}
}
,
mounted
()
{
this
.
list
=
this
.
states
.
map
(
item
=>
{
return
{
value
:
item
,
label
:
item
}
})
this
.
getBusinessType
()
}
,
methods
:
{
// 确定按钮
ok
()
{
this
.
tip
=
false
this
.
$validator
.
validateAll
().
then
((
result
)
=>
{
if
(
result
)
{
this
.
addList
.
forEach
(
item
=>
{
delete
item
.
label
}
)
this
.
addForm
.
merchantRelationAdds
=
this
.
addList
this
.
showAddDialog
()
this
.
addList
=
[{
label
:
'子商户1'
,
merchant
:
''
,
merchantType
:
''
}]
this
.
addForm
=
{
merchant
:
''
,
merchantType
:
''
}
if
(
this
.
addList
[
0
].
merchantId
)
{
this
.
addForm
.
merchantRelationAdds
=
this
.
addList
}
const
params
=
this
.
$deep_clone
(
this
.
addForm
)
params
.
method
=
groupDetailMethods
.
Create
request
.
req
(
params
).
then
(
res
=>
{
notice
.
okTips
()
this
.
showAddDialog
()
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
}
)
}
,
// 显示隐藏添加商户按钮
showAddDialog
()
{
this
.
$emit
(
'addData'
)
setTimeout
(()
=>
{
this
.
addList
=
[{
label
:
'子商户1'
,
merchant
:
''
,
merchantType
:
''
}
]
this
.
addForm
=
{
merchant
:
''
,
merchantType
:
''
}
}
,
400
)
}
,
// 添加更多按钮
addMore
()
{
console
.
log
(
this
.
addList
.
length
)
this
.
addList
.
push
({
label
:
'子商户'
+
(
this
.
addList
.
length
+
1
),
merchant
:
''
,
merchantType
:
''
,
show
:
true
})
const
len
=
this
.
addList
.
length
-
1
if
(
this
.
addList
[
len
].
merchant
==
''
||
this
.
addList
[
len
].
merchantType
==
''
)
{
this
.
tip
=
true
}
else
{
this
.
tip
=
false
this
.
addList
.
push
({
label
:
'子商户'
+
(
this
.
addList
.
length
+
1
),
merchant
:
''
,
merchantType
:
''
,
show
:
true
}
)
}
}
,
deleteBusiness
(
idx
)
{
console
.
log
(
idx
)
this
.
addList
.
splice
(
idx
,
1
)
}
,
remoteMethod
(
query
)
{
// 父商户搜索
remoteList
(
query
)
{
if
(
query
!==
''
)
{
this
.
loading
=
true
setTimeout
(()
=>
{
const
params
=
{
}
params
.
groupId
=
1
params
.
searchWrod
=
query
params
.
method
=
groupDetailMethods
.
SearchList
request
.
req
(
params
).
then
(
res
=>
{
this
.
loading
=
false
this
.
options4
=
this
.
list
.
filter
(
item
=>
{
return
item
.
label
.
toLowerCase
()
.
indexOf
(
query
.
toLowerCase
())
>
-
1
})
},
200
)
this
.
businessList
=
res
.
merchantParams
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
else
{
this
.
options4
=
[]
this
.
businessList
=
[]
}
}
,
// 子商户远程搜索
remoteChildList
(
query
)
{
if
(
query
!==
''
)
{
this
.
childLoading
=
true
const
params
=
{
}
params
.
groupId
=
1
params
.
searchWrod
=
query
params
.
method
=
groupDetailMethods
.
SearchChildList
request
.
req
(
params
).
then
(
res
=>
{
this
.
childLoading
=
false
this
.
businessChildList
=
res
.
merchantParams
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
else
{
this
.
businessChildList
=
[]
}
}
,
// 获取商户类型列表
getBusinessType
()
{
const
params
=
{
}
params
.
method
=
businessManagenMethods
.
Type
request
.
req
(
params
).
then
(
res
=>
{
this
.
merchantTypeList
=
res
.
merchantDictList
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
}
}
...
...
src/views/customer/businessGroupDetail/index.vue
View file @
fc26783
<
template
>
<div
class=
"detail"
>
<div
class=
"default"
>
<gl-form
:inline=
"true"
>
<!--
<gl-form-item>
<gl-input
v-model=
"searchCondition.brand"
class=
"input-with-select"
placeholder=
"请输入品牌"
clearable
/>
</gl-form-item>
<gl-form-item>
<gl-button
type=
"primary"
@
click=
"getList"
>
搜索
</gl-button>
</gl-form-item>
-->
<gl-form-item
style=
"float:right;"
>
<gl-button
class=
"newButton"
type=
"primary"
@
click=
"searchDialog"
>
高级搜索
</gl-button>
<gl-button
class=
"newButton"
type=
"primary"
@
click=
"addDialog"
>
添加商户
</gl-button>
</gl-form-item>
</gl-form>
</div>
<gl-table
:table=
"tableData"
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'
>
<template
slot-scope=
"scope"
>
<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>
</
template
>
<
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>
</
template
>
<
template
v-else
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</
template
>
<div
class=
"m-b10"
>
<gl-button
class=
"newButton"
type=
"primary"
@
click=
"searchDialog"
>
高级搜索
</gl-button>
<gl-button
class=
"newButton"
type=
"primary"
@
click=
"addDialog"
>
添加商户
</gl-button>
</div>
<gl-table
:table=
"tableData"
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'
>
<template
slot-scope=
"scope"
>
<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>
</
template
>
<
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>
</
template
>
<
template
v-else
>
{{
tableData
.
data
[
scope
.
scope
.
$index
][
i
.
prop
]
}}
</
template
>
</gl-table-column>
</gl-table>
</template>
</gl-table-column>
</gl-table>
<gl-pagination
background
@
size-change=
"handleSizeChange"
...
...
@@ -66,12 +45,11 @@
width=
"40%"
:visible
.
sync=
"dialogVisible_search"
:before-close=
"handleClose_search"
>
:close-on-click-modal=
"false"
>
<gl-form
:model=
"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>
...
...
@@ -82,8 +60,7 @@
<gl-select
name=
"merchantType"
v-model=
"searchParams.merchantType"
placeholder=
"请选择"
>
placeholder=
"请选择"
>
<gl-option
v-for=
"item in merchantTypeList"
:key=
"item.value"
...
...
@@ -92,8 +69,7 @@
</gl-option>
</gl-select>
</gl-form-item>
<gl-form-item
label=
"地区:"
prop=
"area"
>
<gl-form-item
label=
"地区:"
>
<city-area
ref=
"c"
:showCity=
"showCity"
...
...
@@ -129,7 +105,7 @@
// import { getMerchantGroupDetailList } from '@/api/index'
// import { NoticeMixin } from '@/mixins'
// import Vue from 'vue'
import
Vue
from
'vue'
//
import Vue from 'vue'
import
{
groupDetailMethods
,
request
}
from
'@/api'
import
AddBusiness
from
'./addBusiness'
import
{
CityArea
}
from
'../components'
...
...
@@ -140,7 +116,7 @@ export default {
CityArea
},
watch
:
{
'searchParams.groupId'
(
val
)
{
groupId
(
val
)
{
this
.
getList
()
}
},
...
...
@@ -148,13 +124,14 @@ export default {
data
()
{
return
{
// searchCondition: {},
groupId
:
''
,
searchParams
:
{
groupId
:
null
,
groupId
:
''
,
merchantName
:
''
,
merchantId
:
null
,
merchantType
:
null
,
provinceId
:
null
,
cityId
:
null
,
merchantId
:
''
,
merchantType
:
''
,
provinceId
:
''
,
cityId
:
''
,
startTime
:
''
,
endTime
:
''
},
...
...
@@ -216,41 +193,20 @@ export default {
prop
:
'parentMerchantId'
}
]
// number: {
// label: '序号',
// width: '50px',
// index: index => {
// ++index
// return index < 10 && index > 0 ? '0' + index : index
// }
// },
// console: {
// show: true,
// label: '操作',
// prop: 'options',
// button: [
// {
// label: '详情',
// type: 'text',
// callback: (index, row) => {
// this.detail(row)
// }
// }
// ]
// }
}
}
},
mounted
()
{
// this.$root.eventBus.$on('params', (params) => {
// this.searchParams.merchantId = params.merchantId
// })
// this.getList()
this
.
getMerchantType
()
this
.
eventBus
=
new
Vue
()
this
.
$root
.
eventBus
.
$on
(
'params'
,
(
params
)
=>
{
this
.
groupId
=
params
.
groupId
this
.
searchParams
.
groupId
=
params
.
groupId
})
this
.
loadingGetList
()
this
.
getMerchantType
()
this
.
eventBus
=
this
.
$root
.
eventBus
// this.$root.eventBus.$on('params', (params) => {
// this.searchParams.groupId = params.groupId
// })
},
methods
:
{
loadingGetList
()
{
...
...
@@ -261,8 +217,8 @@ export default {
getParams
()
{
return
Object
.
assign
(
{
page
Num
:
this
.
pageNum
,
pageSize
:
this
.
page
Size
page
Count
:
this
.
pageSize
,
pageSize
:
this
.
page
Num
},
this
.
searchParams
)
...
...
@@ -273,11 +229,13 @@ export default {
this
.
searchParams
.
endTime
=
this
.
times
[
1
].
format
(
'yyyy-MM-dd HH:mm:ss'
)
}
const
params
=
this
.
getParams
()
params
.
groupId
=
1
params
.
method
=
groupDetailMethods
.
Search
console
.
log
(
params
)
request
.
req
(
params
)
.
then
(
res
=>
{
console
.
log
(
res
)
this
.
total
=
res
.
pagination
.
totalCount
this
.
tableData
.
data
=
res
.
merchantGroupRelations
this
.
tableLoading
=
false
...
...
@@ -328,6 +286,8 @@ export default {
searchReset
()
{
this
.
$refs
[
'searchParams'
].
resetFields
()
this
.
eventBus
.
$emit
(
'reset'
)
this
.
searchParams
.
provinceId
=
''
this
.
searchParams
.
cityId
=
''
this
.
times
=
[]
},
addDialog
()
{
...
...
src/views/customer/businessList/AddDialog.vue
View file @
fc26783
<!-- 新增商户 -->
<
template
>
<div>
<div
class=
"newBusiness"
>
<gl-dialog
:title=
"title"
:visible
.
sync=
"isVisible"
:before-close=
"handleClose"
:width=
"diaWidth"
:close-on-click-modal=
"false"
>
<gl-form
label-width=
"85px"
...
...
@@ -48,7 +49,14 @@
<gl-select
v-model=
"merchantForm.merchantChannel"
placeholder=
"请选择"
></gl-select>
>
<gl-option
v-for=
"item in channelList"
:key=
"item.confId"
:label=
"item.confKey"
:value=
"item.confId"
>
</gl-option>
</gl-select>
</gl-form-item>
<gl-form-item
label=
"联系人:"
>
<gl-input
...
...
@@ -87,6 +95,7 @@
<
script
>
import
Vue
from
'vue'
import
{
CityArea
}
from
'../components'
import
{
businessManagenMethods
,
request
}
from
'@/api'
const
isPhone
=
{
validate
:
(
value
,
args
)
=>
{
return
value
.
length
===
11
&&
/^1
[
345789
]\d{9}
$/
.
test
(
value
)
...
...
@@ -97,6 +106,7 @@ export default {
data
()
{
return
{
title
:
'新增商户'
,
channelList
:
[],
// 省市区组件-配置
eventBus
:
null
,
showCity
:
[
1
,
1
,
1
],
...
...
@@ -128,8 +138,10 @@ export default {
},
watch
:
{
isVisible
(
val
)
{
this
.
$validator
.
errors
.
clear
()
val
&&
this
.
getChannel
()
if
(
!
val
)
{
this
.
$validator
.
errors
.
clear
(
)
this
.
eventBus
.
$emit
(
'reset'
)
this
.
areaInfo
=
{}
}
}
...
...
@@ -140,7 +152,7 @@ export default {
},
methods
:
{
handleClose
()
{
this
.
eventBus
.
$emit
(
'reset'
)
//
this.eventBus.$emit('reset')
this
.
$emit
(
'hideDialog'
)
},
handleComfrim
()
{
...
...
@@ -150,10 +162,19 @@ export default {
]).
then
((
result
)
=>
{
if
(
result
[
0
]
&&
result
[
1
])
{
this
.
$emit
(
'comfirmDialog'
,
this
.
areaInfo
)
this
.
eventBus
.
$emit
(
'reset'
)
//
this.eventBus.$emit('reset')
}
})
},
getChannel
()
{
const
params
=
{}
params
.
method
=
businessManagenMethods
.
Channel
request
.
req
(
params
).
then
(
res
=>
{
this
.
channelList
=
res
.
merchantDictList
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
getCityArea
(
params
)
{
// console.log(params)
this
.
areaInfo
.
provinceId
=
params
[
0
]
...
...
@@ -168,4 +189,7 @@ export default {
</
script
>
<
style
>
.newBusiness
.el-dialog__body
{
padding
:
0
20px
;
}
</
style
>
\ No newline at end of file
src/views/customer/businessList/SearchDialog.vue
View file @
fc26783
...
...
@@ -6,6 +6,7 @@
:visible
.
sync=
"isVisible"
:before-close=
"handleClose"
:width=
"diaWidth"
:close-on-click-modal=
"false"
>
<gl-form
:model=
"merchantSearch"
...
...
@@ -91,6 +92,7 @@
type=
"date"
placeholder=
"选择日期"
v-model=
"merchantSearch.startTime"
value-format=
"yyyy-MM-dd"
style=
"width:92%;"
></gl-date-picker>
</gl-col>
...
...
@@ -103,6 +105,7 @@
type=
"date"
placeholder=
"选择日期"
v-model=
"merchantSearch.endTime"
value-format=
"yyyy-MM-dd"
style=
"width: 100%;"
></gl-date-picker>
</gl-col>
...
...
src/views/customer/businessList/index.vue
View file @
fc26783
...
...
@@ -97,9 +97,6 @@ export default {
align
:
'center'
,
data
:
[],
column
:
[{
label
:
'序号'
,
prop
:
'id'
},
{
label
:
'商户名称'
,
prop
:
'merchantName'
},
{
...
...
@@ -137,6 +134,14 @@ export default {
this
.
$root
.
to
([
'商户数据平台'
,
'商户数据平台'
,
'商户数据平台'
,
'商户列表'
,
'*商户详情'
],
{
merchantId
:
rows
[
index
].
merchantId
})
}
}]
},
number
:
{
label
:
'序号'
,
width
:
'90'
,
index
:
(
index
)
=>
{
++
index
return
index
}
}
}
}
...
...
@@ -156,27 +161,28 @@ export default {
getList
()
{
const
params
=
this
.
getParams
()
params
.
method
=
bizMethods
.
Search
console
.
log
(
params
)
request
.
req
(
params
).
then
(
res
=>
{
this
.
ListTableData
.
data
=
res
.
merchants
this
.
totalCount
=
res
.
pagination
.
totalCount
this
.
reset
(
this
.
merchantSearch
)
}).
catch
(
err
=>
{
// console.log(err)
notice
.
errorTips
(
err
)
console
.
log
(
'失败-------------'
)
this
.
reset
(
this
.
merchantSearch
)
})
},
saveMerchant
(
areaInfo
)
{
this
.
merchantForm
=
Object
.
assign
(
this
.
merchantForm
,
areaInfo
)
const
params
=
this
.
merchantForm
params
.
method
s
=
bizMethods
.
Create
params
.
method
=
bizMethods
.
Create
request
.
req
(
params
).
then
(
res
=>
{
notice
.
okTips
()
this
.
reset
(
this
.
merchantForm
)
this
.
handleAdd
()
this
.
getList
()
}).
catch
(
err
=>
{
console
.
log
(
err
)
notice
.
errorTips
()
notice
.
errorTips
(
err
)
})
},
// 接口请求-end
...
...
@@ -217,7 +223,7 @@ export default {
this
.
reset
(
this
.
merchantForm
)
},
handleAddComfirm
(
areaInfo
)
{
this
.
handleAdd
()
//
this.handleAdd()
this
.
saveMerchant
(
areaInfo
)
}
}
...
...
src/views/customer/businessManagement/addBusiness.vue
View file @
fc26783
...
...
@@ -19,25 +19,28 @@
placeholder=
"请输入商户名称/商户号"
data-vv-as=
"商户名称/商户号"
v-validate=
"'required'"
:remote-method=
"remote
Method
"
:remote-method=
"remote
List
"
:loading=
"loading"
>
<gl-option
v-for=
"item in
options4
"
:key=
"item.
value
"
:label=
"item.
label
"
:value=
"item.
value
"
>
v-for=
"item in
businessList
"
:key=
"item.
merchantId
"
:label=
"item.
merchantName
"
:value=
"item.
merchantId
"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('merchant')"
class=
"error"
>
{{
errorBags
.
first
(
'merchant'
)
}}
</span>
</gl-form-item>
<gl-form-item
label=
"商户类型:"
prop=
"merchantType"
>
<gl-select
v-model=
"addForm.merchantType"
name=
"merchantType"
data-vv-as=
"商户类型"
v-validate=
"'required'"
placeholder=
"请搜索"
>
<gl-select
v-model=
"addForm.merchantType"
name=
"merchantType"
data-vv-as=
"商户类型"
v-validate=
"'required'"
placeholder=
"请搜索"
>
<gl-option
v-for=
"item in merchantTypeList"
:key=
"item.
merchant
Id"
:label=
"item.
merchantName
"
:value=
"item.
merchant
Id"
>
:key=
"item.
conf
Id"
:label=
"item.
confKey
"
:value=
"item.
conf
Id"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('merchantType')"
class=
"error"
>
{{
errorBags
.
first
(
'merchantType'
)
}}
</span>
...
...
@@ -48,30 +51,43 @@
v-model=
"item.merchant"
filterable
remote
:name=
"`item.merchant$
{idx+1}`"
v-validate="item.merchant || item.merchantType ? 'required' : ''"
:data-vv-as="`子商户${idx+1}`"
clearable
placeholder="请输入商户名称/商户号"
:remote-method=
"remote
Method
"
:loading=
"
l
oading"
>
:remote-method="remote
ChildList
"
:loading="
childL
oading">
<gl-option
v-for=
"item in
options4
"
:key=
"item.
value
"
:label=
"item.
label"
:value=
"item.
value
"
>
v-for=
"item in
businessChildList
"
:key=
"item.
merchantId
"
:label=
"item.
merchantName"
:value=
"item.
merchantId
"
>
</gl-option>
</gl-select>
<i
v-show=
"item.show"
class=
"el-icon-delete delete"
@
click=
"deleteBusiness(idx)"
></i>
<span
v-show=
"errorBags.has(`item.merchant$
{idx+1}`)" class="error">
{{
errorBags
.
first
(
`item.merchant${idx+1
}
`
)
}}
<
/span
>
<!--
<
span
v
-
show
=
"item.merchant? !item.merchant : !!item.merchantType"
class
=
"error"
>
{{
`请填写子商户${idx+1
}
的商户名称/商户号`
}}
<
/span> --
>
<
/gl-form-item
>
<
gl
-
form
-
item
label
=
"商户类型:"
>
<gl-select
v-model=
"item.merchantType"
placeholder=
"请选择"
>
<
gl
-
select
v
-
model
=
"item.merchantType"
:
name
=
"
`item.merchantType${idx+1
}
`"
v-validate="
item
.
merchant
||
item
.
merchantType
?
'required'
:
''
"
:data-vv-as="`子商户${idx+1
}
类型`"
clearable
placeholder="
请选择
">
<gl-option
v-for="
item
in
merchantTypeList
"
:key=
"item.
merchant
Id"
:label=
"item.
merchantName
"
:value=
"item.
merchant
Id"
>
:key="
item
.
conf
Id
"
:label="
item
.
confKey
"
:value="
item
.
conf
Id
">
</gl-option>
</gl-select>
<span v-show="
errorBags
.
has
(
`item.merchantType${idx+1
}
`
)
" class="
error
"
>
{{
errorBags
.
first
(
`item.merchantType${idx+1
}
`
)
}}
<
/span
>
<!--
<
span
v
-
show
=
"item.merchantType? !item.merchantType : !!item.merchant"
class
=
"error"
>
{{
`请填写子商户${idx+1
}
的商户类型`
}}
<
/span> --
>
<
/gl-form-item
>
<
/div
>
<
span
v
-
show
=
"tip"
class
=
"error"
style
=
"float:right; margin-right: 43px;"
>
{{
'请填写上一条子商户数据'
}}
<
/span
>
<
gl
-
button
@
click
=
"addMore"
>
添加更多
<
/gl-button
>
<
/gl-form
>
<
div
slot
=
"footer"
class
=
"dialog-footer"
>
...
...
@@ -83,6 +99,8 @@
<
/template
>
<
script
>
import
notice
from
'@/common/notice'
import
{
businessManagenMethods
,
groupDetailMethods
,
request
}
from
'@/api'
export
default
{
name
:
'AddBusiness'
,
props
:
{
...
...
@@ -90,46 +108,21 @@ export default {
}
,
data
()
{
return
{
tip
:
false
,
addForm
:
{
merchant
:
''
,
merchantType
:
''
}
,
merchantTypeList
:
[
{
merchantId
:
1
,
merchantName
:
'广联'
},
{
merchantId
:
2
,
merchantName
:
'分组'
},
{
merchantId
:
3
,
merchantName
:
'富强'
}
],
merchantTypeList
:
[],
rules
:
{
merchant
:
[{
required
:
true
}
],
merchantType
:
[{
required
:
true
}
]
}
,
// 远程搜索
loading
:
false
,
options4
:
[],
states
:
[
'Alabama'
,
'Alaska'
,
'Arizona'
,
'Arkansas'
,
'California'
,
'Colorado'
,
'Connecticut'
,
'Delaware'
,
'Florida'
,
'Georgia'
,
'Hawaii'
,
'Idaho'
,
'Illinois'
,
'Indiana'
,
'Iowa'
,
'Kansas'
,
'Kentucky'
,
'Louisiana'
,
'Maine'
,
'Maryland'
,
'Massachusetts'
,
'Michigan'
,
'Minnesota'
,
'Mississippi'
,
'Missouri'
,
'Montana'
,
'Nebraska'
,
'Nevada'
,
'New Hampshire'
,
'New Jersey'
,
'New Mexico'
,
'New York'
,
'North Carolina'
,
'North Dakota'
,
'Ohio'
,
'Oklahoma'
,
'Oregon'
,
'Pennsylvania'
,
'Rhode Island'
,
'South Carolina'
,
'South Dakota'
,
'Tennessee'
,
'Texas'
,
'Utah'
,
'Vermont'
,
'Virginia'
,
'Washington'
,
'West Virginia'
,
'Wisconsin'
,
'Wyoming'
],
childLoading
:
false
,
businessList
:
[],
businessChildList
:
[],
addList
:
[
{
label
:
'子商户1'
,
...
...
@@ -145,53 +138,108 @@ export default {
}
}
,
mounted
()
{
this
.
list
=
this
.
states
.
map
(
item
=>
{
return
{
value
:
item
,
label
:
item
}
})
this
.
getBusinessType
()
}
,
methods
:
{
// 确定按钮
ok
()
{
this
.
tip
=
false
this
.
$validator
.
validateAll
().
then
((
result
)
=>
{
if
(
result
)
{
this
.
addList
.
forEach
(
item
=>
{
delete
item
.
label
}
)
this
.
addForm
.
merchantRelationAdds
=
this
.
addList
this
.
showAddDialog
()
this
.
addList
=
[{
label
:
'子商户1'
,
merchant
:
''
,
merchantType
:
''
}]
this
.
addForm
=
{
merchant
:
''
,
merchantType
:
''
}
if
(
this
.
addList
[
0
].
merchantId
)
{
this
.
addForm
.
merchantRelationAdds
=
this
.
addList
}
console
.
log
(
this
.
addForm
)
const
params
=
this
.
$deep_clone
(
this
.
addForm
)
params
.
method
=
groupDetailMethods
.
Create
request
.
req
(
params
).
then
(
res
=>
{
notice
.
okTips
()
this
.
showAddDialog
()
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
}
)
}
,
// 显示隐藏添加商户按钮
showAddDialog
()
{
this
.
$emit
(
'addData'
)
setTimeout
(()
=>
{
this
.
addList
=
[{
label
:
'子商户1'
,
merchant
:
''
,
merchantType
:
''
}
]
this
.
addForm
=
{
merchant
:
''
,
merchantType
:
''
}
}
,
400
)
}
,
// 添加更多按钮
addMore
()
{
console
.
log
(
this
.
addList
.
length
)
this
.
addList
.
push
({
label
:
'子商户'
+
(
this
.
addList
.
length
+
1
),
merchant
:
''
,
merchantType
:
''
,
show
:
true
})
console
.
log
(
this
.
addList
)
const
len
=
this
.
addList
.
length
-
1
if
(
this
.
addList
[
len
].
merchant
==
''
||
this
.
addList
[
len
].
merchantType
==
''
)
{
console
.
log
(
'请填写完上一条数据'
)
this
.
tip
=
true
}
else
{
this
.
tip
=
false
this
.
addList
.
push
({
label
:
'子商户'
+
(
this
.
addList
.
length
+
1
),
merchant
:
''
,
merchantType
:
''
,
show
:
true
}
)
}
}
,
deleteBusiness
(
idx
)
{
console
.
log
(
idx
)
this
.
addList
.
splice
(
idx
,
1
)
}
,
remoteMethod
(
query
)
{
// 父商户搜索
remoteList
(
query
)
{
if
(
query
!==
''
)
{
this
.
loading
=
true
setTimeout
(()
=>
{
const
params
=
{
}
params
.
groupId
=
1
params
.
searchWrod
=
query
params
.
method
=
groupDetailMethods
.
SearchList
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
.
merchantParams
)
this
.
loading
=
false
this
.
options4
=
this
.
list
.
filter
(
item
=>
{
return
item
.
label
.
toLowerCase
()
.
indexOf
(
query
.
toLowerCase
())
>
-
1
})
},
200
)
this
.
businessList
=
res
.
merchantParams
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
else
{
this
.
options4
=
[]
this
.
businessList
=
[]
}
}
,
// 子商户远程搜索
remoteChildList
(
query
)
{
if
(
query
!==
''
)
{
this
.
childLoading
=
true
const
params
=
{
}
params
.
groupId
=
1
params
.
searchWrod
=
query
params
.
method
=
groupDetailMethods
.
SearchChildList
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
.
merchantParams
)
this
.
childLoading
=
false
this
.
businessChildList
=
res
.
merchantParams
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
else
{
this
.
businessChildList
=
[]
}
}
,
// 获取商户类型列表
getBusinessType
()
{
const
params
=
{
}
params
.
method
=
businessManagenMethods
.
Type
request
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
merchantTypeList
=
res
.
merchantDictList
}
).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
}
)
}
}
}
...
...
src/views/customer/businessManagement/index.vue
View file @
fc26783
<
template
>
<div>
<gl-button
type=
"primary"
@
click=
"showDialog"
>
新增业务
</gl-button>
<gl-button
type=
"primary"
@
click=
"add"
>
新增商户
</gl-button>
<div
class=
"default"
>
<div
class=
"m-b10"
>
<gl-button
type=
"primary"
@
click=
"showDialog"
>
新增业务
</gl-button>
<!--
<gl-button
type=
"primary"
@
click=
"add"
>
新增商户
</gl-button>
-->
</div>
<gl-table
:table=
"tableData"
></gl-table>
<gl-dialog
title=
"新增业务"
:visible
.
sync=
"dialogFormVisible"
:close-on-click-modal=
"false"
>
:close-on-click-modal=
"false"
>
<gl-form
:model=
"form"
label-width=
"100px"
...
...
@@ -21,46 +22,37 @@
>
<gl-form-item
label=
"业务名称"
prop=
"
businessName
"
prop=
"
confKey
"
>
<gl-input
v-model=
"form.
businessName
"
name=
"
businessName
"
v-model=
"form.
confKey
"
name=
"
confKey
"
placeholder=
"请输入业务名称"
data-vv-as=
"业务名称"
v-validate=
"'required'"
></gl-input>
<span
v-show=
"errorBags.has('
businessName
')"
v-show=
"errorBags.has('
confKey
')"
class=
"error"
>
{{
errorBags
.
first
(
'
businessName
'
)
}}
</span>
>
{{
errorBags
.
first
(
'
confKey
'
)
}}
</span>
</gl-form-item>
<gl-form-item
label=
"业务描述"
prop=
"
businessDescription
"
prop=
"
memo
"
>
<gl-input
v-model=
"form.
businessDescription
"
v-model=
"form.
memo
"
type=
"textarea"
:rows=
"4"
placeholder=
"请输入业务描述"
name=
"
businessDescription
"
name=
"
memo
"
data-vv-as=
"业务描述"
v-validate=
"'required'"
></gl-input>
<span
v-show=
"errorBags.has('
businessDescription
')"
v-show=
"errorBags.has('
memo
')"
class=
"error"
>
{{
errorBags
.
first
(
'businessDescription'
)
}}
</span>
</gl-form-item>
<gl-form-item
label=
"地址"
>
<city-area
ref=
"c"
:showCity=
"showCity"
:eventBus=
"eventBus"
:validateCity=
"validateCity"
@
cityArea=
"getCityArea"
></city-area>
>
{{
errorBags
.
first
(
'memo'
)
}}
</span>
</gl-form-item>
</gl-form>
<div
...
...
@@ -74,117 +66,71 @@
>
确 定
</gl-button>
</div>
</gl-dialog>
<add-business
<
!--
<
add-business
:addDialogVisible=
"addDialogVisible"
@
addData=
"
handleAddData
"
></add-business>
@
addData=
"
add
"
></add-business>
-->
</div>
</
template
>
<
script
>
import
Vue
from
'vue'
import
{
CityArea
}
from
'../components'
import
addBusiness
from
'./addBusiness'
// import { jumpLink } from '../../../common/common.js'
import
notice
from
'@/common/notice'
import
{
businessManagenMethods
,
request
}
from
'@/api'
export
default
{
name
:
'BusinessManagement'
,
components
:
{
addBusiness
,
CityArea
addBusiness
},
data
()
{
return
{
eventBus
:
null
,
tableData
:
{
border
:
true
,
stripe
:
'true'
,
align
:
'center'
,
data
:
[
{
businessId
:
1
,
businessName
:
'爱车保镖'
,
businessCode
:
'11'
,
businessDescription
:
' 基于车联网智能终端大数据为汽车金融提供资产保全的服务'
,
createdTime
:
'2018-03-16'
},
{
businessId
:
2
,
businessName
:
'爱车保镖'
,
businessCode
:
'11'
,
businessDescription
:
' 基于车联网智能终端大数据为汽车金融提供资产保全的服务'
,
createdTime
:
'2018-03-16'
}
],
data
:
[],
column
:
[
{
label
:
'业务ID'
,
prop
:
'businessId'
prop
:
'confId'
,
width
:
'100'
},
{
label
:
'业务名称'
,
prop
:
'businessName'
},
{
label
:
'业务编号'
,
prop
:
'businessCode'
prop
:
'confKey'
},
{
label
:
'业务描述'
,
prop
:
'
businessDescription
'
prop
:
'
memo
'
},
{
label
:
'创建时间'
,
prop
:
'create
d
Time'
prop
:
'createTime'
}
],
// 详情
console
:
{
show
:
true
,
label
:
'操作'
,
width
:
'150'
,
fixed
:
'right'
,
button
:
[
{
type
:
'text'
,
label
:
'详情'
,
callback
:
(
index
,
rows
)
=>
{
this
.
$parent
.
to
([
'商户数据平台'
,
'商户数据平台'
,
'商户数据平台'
,
'业务管理'
,
'商户详情'
],
{
id
:
rows
[
index
].
businessId
,
name
:
rows
[
index
].
businessName
})
}
}
]
}
]
},
form
:
{
businessName
:
''
,
businessDescription
:
''
,
confKey
:
''
,
memo
:
''
,
area
:
''
},
dialogFormVisible
:
false
,
rules
:
{
businessName
:
[{
required
:
true
}],
businessDescription
:
[{
required
:
true
}]
confKey
:
[{
required
:
true
}],
memo
:
[{
required
:
true
}]
},
// 商户分组组件数据
addDialogVisible
:
false
,
// 省市区
showCity
:
[
1
,
1
],
validateCity
:
[
1
,
1
]
}
},
provide
()
{
return
{
$validator
:
this
.
$validator
// addDialogVisible: false,
}
},
watch
:
{
dialogFormVisible
(
val
)
{
if
(
val
)
{
this
.
form
=
{
businessName
:
''
,
businessDescription
:
''
,
area
:
''
}
this
.
form
=
{
confKey
:
''
,
memo
:
''
,
area
:
''
}
}
else
{
this
.
eventBus
.
$emit
(
'reset'
)
this
.
$validator
.
errors
.
clear
()
clearTimeout
(
timer
)
const
timer
=
setTimeout
(()
=>
{
this
.
$refs
[
'c'
].
$validator
.
errors
.
clear
()
},
400
)
}
}
},
mounted
()
{
this
.
eventBus
=
new
Vue
()
this
.
getList
()
},
methods
:
{
// 显示隐藏弹窗
...
...
@@ -193,25 +139,40 @@ export default {
},
// 提交表单
submit
()
{
Promise
.
all
([
this
.
$refs
[
'c'
].
$validator
.
validateAll
(),
this
.
$validator
.
validateAll
()
]).
then
((
result
)
=>
{
if
(
result
[
0
]
&&
result
[
1
])
{
console
.
log
(
'提交成功'
)
console
.
log
(
this
.
form
)
this
.
showDialog
()
this
.
$validator
.
validateAll
().
then
((
result
)
=>
{
if
(
result
)
{
this
.
businessCreate
()
}
})
},
add
()
{
this
.
addDialogVisible
=
!
this
.
addDialogVisible
},
handleAddData
()
{
this
.
addDialogVisible
=
!
this
.
addDialogVisible
// add() {
// this.addDialogVisible = !this.addDialogVisible
// },
// handleAddData() {
// this.addDialogVisible = !this.addDialogVisible
// },
// 接口请求
getList
()
{
const
params
=
{}
params
.
method
=
businessManagenMethods
.
Business
request
.
req
(
params
).
then
(
res
=>
{
// console.log(res)
this
.
tableData
.
data
=
res
.
merchantDictList
}).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
})
},
getCityArea
(
params
)
{
businessCreate
()
{
const
params
=
this
.
$deep_clone
(
this
.
form
)
delete
params
.
area
console
.
log
(
params
)
params
.
method
=
businessManagenMethods
.
Create
request
.
req
(
params
).
then
(
res
=>
{
notice
.
okTips
()
this
.
showDialog
()
}).
catch
(
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