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 6d448750
authored
Mar 25, 2019
by
wangql
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
提交代码
2 parents
0fe5e70a
232e3b4e
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
381 additions
and
271 deletions
package-lock.json
package.json
src/api/businessGroup.js
src/api/businessGroupDetail.js
src/api/bussinessListApi.js
src/api/index.js
src/api/sign.js
src/base.js
src/views/customer/businessDetails/index.vue
src/views/customer/businessGroup/index.vue
src/views/customer/businessGroupDetail/index.vue
src/views/customer/businessList/index.vue
src/views/customer/businessManagement/index.vue
src/views/customer/components/src/cityArea.vue
package-lock.json
View file @
6d44875
...
...
@@ -2270,6 +2270,11 @@
"integrity"
:
"sha1-2VUfnemPH82h5oPRfukaBgLuLrk="
,
"dev"
:
true
},
"blueimp-md5"
:
{
"version"
:
"2.10.0"
,
"resolved"
:
"https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.10.0.tgz"
,
"integrity"
:
"sha512-EkNUOi7tpV68TqjpiUz9D9NcT8um2+qtgntmMbi5UKssVX2m/2PLqotcric0RE63pB3HPN/fjf3cKHN2ufGSUQ=="
},
"bn.js"
:
{
"version"
:
"4.11.8"
,
"resolved"
:
"http://registry.npm.taobao.org/bn.js/download/bn.js-4.11.8.tgz"
,
...
...
@@ -6025,9 +6030,9 @@
}
},
"glsx-vue-common"
:
{
"version"
:
"1.2.
0
"
,
"resolved"
:
"http
://registry.npm.taobao.org/glsx-vue-common/download/glsx-vue-common-1.2.0
.tgz"
,
"integrity"
:
"sha
1-wyMWhUiCwyjsQjM2kih4NuTbMgM
="
,
"version"
:
"1.2.
1
"
,
"resolved"
:
"http
s://registry.npmjs.org/glsx-vue-common/-/glsx-vue-common-1.2.1
.tgz"
,
"integrity"
:
"sha
512-QlTi29xq4lwV4I0l7FgdEaIyXyCbdKMUF6JvlYT0S/7rdfHzZRR3Y1GtO3e3y62S3dyku+7EQLXbr7y9Qd27Xw=
="
,
"requires"
:
{
"vue"
:
"^2.5.10"
}
...
...
@@ -7304,6 +7309,11 @@
"resolved"
:
"http://registry.npm.taobao.org/js-base64/download/js-base64-2.4.9.tgz"
,
"integrity"
:
"sha1-dIkR+wT0imDEdxs3XKxFqA3xHAM="
},
"js-md5"
:
{
"version"
:
"0.7.3"
,
"resolved"
:
"https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz"
,
"integrity"
:
"sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
},
"js-message"
:
{
"version"
:
"1.0.5"
,
"resolved"
:
"http://registry.npm.taobao.org/js-message/download/js-message-1.0.5.tgz"
,
...
...
package.json
View file @
6d44875
...
...
@@ -9,8 +9,10 @@
},
"dependencies"
:
{
"axios"
:
"^0.18.0"
,
"glsx-vue-common"
:
"^1.1.14"
,
"glsx-vue-common"
:
"^1.2.1"
,
"blueimp-md5"
:
"^2.10.0"
,
"glsx-vue-components"
:
"^1.0.13"
,
"js-md5"
:
"^0.7.3"
,
"node-sass"
:
"^4.9.3"
,
"sass-loader"
:
"^7.1.0"
,
"vee-validate"
:
"^2.1.7"
,
...
...
src/api/businessGroup.js
View file @
6d44875
import
{
GlAxios
}
from
'glsx-vue-common'
const
path
=
'/glsx.accounts.admin.merchant.group'
const
__groupList
=
`
${
path
}
.dict`
const
__create
=
`
${
path
}
.create`
const
getMerchantGroupList
=
{
p
:
[
__groupList
],
req
:
params
=>
GlAxios
.
get
(
__groupList
,
{
params
})
const
path
=
'/glsx.accounts.admin.merchant.group.'
const
methods
=
{
Search
:
`
${
path
}
dict`
,
Create
:
`
${
path
}
create`
}
const
createGroup
=
{
p
:
[
__create
],
req
:
params
=>
GlAxios
.
get
(
__groupList
,
{
params
})
}
export
{
getMerchantGroupList
,
createGroup
methods
}
src/api/businessGroupDetail.js
View file @
6d44875
import
{
GlAxios
}
from
'glsx-vue-common'
const
path
=
'/glsx.accounts.admin.merchant.group'
const
__groupDetailList
=
`
${
path
}
.search`
const
getMerchantGroupDetailList
=
{
p
:
[
__groupDetailList
],
req
:
params
=>
GlAxios
.
get
(
__groupDetailList
,
{
params
})
const
path
=
'/glsx.accounts.admin.merchant.group.'
const
methods
=
{
Search
:
`
${
path
}
search`
}
export
{
getMerchantGroupDetailList
methods
}
src/api/bussinessListApi.js
View file @
6d44875
import
{
GlAxios
}
from
'glsx-vue-common'
const
path
=
'/glsx.accounts.admin.merchant.'
const
__sGetList
=
`
${
path
}
search`
const
__sDetail
=
`
${
path
}
detail`
const
__sPersonal
=
`
${
path
}
personal`
const
__sGroup
=
`
${
path
}
group`
const
__sSaveMerchant
=
`
${
path
}
create`
const
__sLevel
=
`
${
path
}
group.level`
// 获取商户列表(根据条件获取商户列表)
const
getList
=
{
p
:
[
__sGetList
],
req
:
params
=>
GlAxios
.
get
(
__sGetList
,
{
params
})
const
methods
=
{
Search
:
`
${
path
}
search`
,
Detail
:
`
${
path
}
detail`
,
Personal
:
`
${
path
}
personal`
,
Group
:
`
${
path
}
group`
,
Create
:
`
${
path
}
create`
,
GroupLevel
:
`
${
path
}
group.level`
}
// 获取商户详情(通过商户id获取商户详情)
const
merchantDetail
=
{
p
:
[
__sDetail
],
req
:
params
=>
GlAxios
.
get
(
__sDetail
,
{
params
})
}
// 获取员工信息(通过商户id获取员工信息)
const
merchantPersonal
=
{
p
:
[
__sPersonal
],
req
:
params
=>
GlAxios
.
get
(
__sPersonal
,
{
params
})
}
// 获取分组信息(通过商户id获取分组信息)
const
merchantGroup
=
{
p
:
[
__sGroup
],
req
:
params
=>
GlAxios
.
get
(
__sGroup
,
{
params
})
}
// 新增商户
const
saveMerchant
=
{
p
:
[
__sSaveMerchant
],
req
:
params
=>
GlAxios
.
get
(
__sSaveMerchant
,
{
params
})
}
// 根据分组跟商户查询父子商户
const
merchantGroupLevel
=
{
p
:
[
__sLevel
],
req
:
params
=>
GlAxios
.
get
(
__sLevel
,
{
params
})
}
export
{
getList
,
merchantDetail
,
merchantPersonal
,
merchantGroup
,
saveMerchant
,
merchantGroupLevel
methods
}
src/api/index.js
View file @
6d44875
import
{
getBusinessList
}
from
'./businessManagement'
GlAxios
}
from
'glsx-vue-common'
import
{
sign
}
from
'./sign'
import
{
getList
,
merchantDetail
,
merchantPersonal
,
merchantGroup
,
saveMerchant
,
merchantGroupLevel
methods
as
bizMethods
}
from
'./bussinessListApi'
import
{
getMerchantGroupList
,
createGroup
methods
as
groupMethods
}
from
'./businessGroup'
import
{
getMerchantGroupDetailList
methods
as
groupDetailMethods
}
from
'./businessGroupDetail'
const
request
=
{
req
:
params
=>
{
const
url
=
process
.
env
.
NODE_ENV
===
'production'
?
'router'
:
params
.
methods
return
GlAxios
.
get
(
url
,
{
'params'
:
sign
(
params
)
})
}
}
export
{
getBusinessList
,
getList
,
saveMerchant
,
getMerchantGroupList
,
createGroup
,
getMerchantGroupDetailList
,
merchantDetail
,
merchantPersonal
,
merchantGroup
,
merchantGroupLevel
bizMethods
,
request
,
groupMethods
,
groupDetailMethods
}
src/api/sign.js
0 → 100644
View file @
6d44875
import
MD5
from
'js-md5'
const
sign
=
params
=>
{
const
secret
=
'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const
keys
=
Object
.
keys
(
params
).
sort
()
var
str
=
[]
keys
.
forEach
(
e
=>
{
str
.
push
(
e
+
params
[
e
])
})
params
.
sign
=
MD5
(
secret
+
str
.
join
(
''
)
+
secret
)
return
params
}
export
{
sign
}
src/base.js
View file @
6d44875
...
...
@@ -35,7 +35,19 @@ Vue.use(VeeValidate, {
var
mixin
=
{
data
()
{
return
{
flag
:
true
flag
:
true
,
// paramsTrans: '',
/**
* 定义一个事件传输总线
* 提示:页面与子组件间的参数都可以用之来互相传递
* 如:
* this.$root.eventBus.$emit('params', {id:123});
*
this.$root.eventBus.$on('params', (params)=>{
console.log(params);
});
*/
eventBus
:
new
Vue
()
}
},
mounted
()
{
...
...
@@ -86,21 +98,10 @@ var mixin = {
})
}
}
},
data
()
{
return
{
/**
* 定义一个事件传输总线
* 提示:页面与子组件间的参数都可以用之来互相传递
* 如:
* this.$root.eventBus.$emit('params', {id:123});
*
this.$root.eventBus.$on('params', (params)=>{
console.log(params);
});
*/
eventBus
:
new
Vue
()
}
// getParamsTrans() {
// console.log(this.paramsTrans)
// return this.paramsTrans
// }
}
}
const
URL
=
' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
...
...
src/views/customer/businessDetails/index.vue
View file @
6d44875
<
template
>
<div
class=
"detail"
>
<gl-breadcrumb
separator=
'/'
>
<gl-breadcrumb-item><a
href=
'#'
@
click=
'back'
>
商户列表
</a></gl-breadcrumb-item>
<gl-breadcrumb-item><a
href=
'#'
@
click=
'back'
>
商户列表
</a></gl-breadcrumb-item>
<gl-breadcrumb-item>
商户详情
</gl-breadcrumb-item>
<gl-breadcrumb-item>
{{
nam
e
}}
</gl-breadcrumb-item>
<gl-breadcrumb-item>
{{
List
[
0
].
valu
e
}}
</gl-breadcrumb-item>
</gl-breadcrumb>
<!--
<gl-button
type=
'text'
@
click=
'back'
>
商户列表
</gl-button>
<!--
<gl-button
type=
'text'
@
click=
'back'
>
商户列表
</gl-button>
<span>
\ 商户详情 \
{{
name
}}
</span>
-->
<gl-tabs
v-model=
'activeName'
@
tab-click=
'handleClick'
>
<gl-tab-pane
label=
'基本信息'
name=
'first'
>
<gl-col
class=
"detail-row"
:span=
"i.isMap || i.img? 24 : 12"
v-for=
"(i, index) in List"
:key=
"index+''"
>
<gl-tabs
v-model=
'activeName'
@
tab-click=
'handleClick'
>
<gl-tab-pane
label=
'基本信息'
name=
'first'
>
<gl-col
class=
"detail-row"
:span=
"i.isMap || i.img? 24 : 12"
v-for=
"(i, index) in List"
:key=
"index+''"
>
<span>
{{
i
.
label
}}
:
<div
v-if=
"i.isMap"
class=
'amap-page-container'
>
<el-amap
vid=
'amapDemo'
:center=
'center'
:amap-manager=
'amapManager'
:zoom=
'zoom'
:events=
'events'
class=
'amap-demo'
>
</el-amap>
</div>
<img
v-else-if=
"i.isImg"
class=
"detail-logo"
:src=
"i.value"
alt=
""
>
<span
v-else
>
{{
i
.
value
}}
</span>
<div
v-if=
"i.isMap"
class=
'amap-page-container'
>
<el-amap
vid=
'amapDemo'
:center=
'center'
:amap-manager=
'amapManager'
:zoom=
'zoom'
class=
'amap-demo'
>
</el-amap>
</div>
<img
v-else-if=
"i.isImg"
class=
"detail-logo"
:src=
"i.value"
alt=
""
>
<span
v-else
>
{{
i
.
value
}}
</span>
</span>
</gl-col>
<!--
<gl-col
:span=
'24'
style=
''
><span>
商户名称:
</span>
</gl-col>
-->
</gl-tab-pane>
<gl-tab-pane
label=
'员工信息'
name=
'second'
>
配置管理
<gl-tab-pane
label=
'员工信息'
name=
'second'
>
<gl-table
:table=
"staffTableData"
></gl-table>
</gl-tab-pane>
<gl-tab-pane
label=
'分组信息'
name=
'third'
>
角色管理
<gl-tab-pane
label=
'分组信息'
name=
'third'
>
<gl-table
:table=
"groupTableData"
></gl-table>
</gl-tab-pane>
</gl-tabs>
</div>
...
...
@@ -36,7 +70,7 @@
<
script
>
import
VueAMap
from
'vue-amap'
import
Vue
from
'vue'
import
{
merchant
Personal
}
from
'@/api/index'
import
{
merchant
Detail
,
merchantPersonal
,
merchantGroup
}
from
'@/api/index'
import
notice
from
'@/common/notice'
const
amapManager
=
new
VueAMap
.
AMapManager
()
VueAMap
.
initAMapApiLoader
({
...
...
@@ -47,60 +81,68 @@ Vue.use(VueAMap)
export
default
{
name
:
'BusinessDetails'
,
data
()
{
const
_this
=
this
return
{
name
:
''
,
merchantId
:
''
,
// 标记merchantId是否改变
IdChange
:
[
0
,
0
,
0
],
activeName
:
'first'
,
merchantInfo
:
{},
List
:
[
{
name
:
'merchantName'
,
label
:
'商户名称'
,
value
:
'
深圳市安卓讯航科技有限公司
'
value
:
''
},
{
name
:
'merchantId'
,
label
:
'商户号'
,
value
:
'
44186213
'
value
:
''
},
{
name
:
'address'
,
label
:
'商户地址'
,
value
:
'
广东省深圳市南山区科兴科学园C3单元
'
value
:
''
},
{
name
:
'merchantChannelName'
,
label
:
'商户渠道'
,
value
:
'
自有渠道
'
value
:
''
},
{
name
:
'contactor'
,
label
:
'联系人'
,
value
:
'
彭裕
'
value
:
''
},
{
name
:
'createTime'
,
label
:
'注册时间'
,
value
:
'
2018-03-16
'
value
:
''
},
{
name
:
'contactPhone'
,
label
:
'联系电话'
,
value
:
'
15999682114
'
value
:
''
},
{
label
:
'POI位置点'
,
value
:
'
深圳市安卓讯航科技有限公司
'
,
value
:
''
,
isMap
:
true
},
{
name
:
'phone'
,
label
:
'服务电话'
,
value
:
'
0755-88888888
'
value
:
''
},
{
name
:
'email'
,
label
:
'邮箱'
,
value
:
'
GLSX@didihu.com
'
value
:
''
},
{
label
:
'商户LOGO'
,
value
:
'
http://www.pptbz.com/pptpic/UploadFiles_6909/201203/2012031220134655.jpg
'
,
value
:
''
,
isImg
:
true
}
],
zoom
:
12
,
center
:
[
121.59996
,
31.197646
],
// 地图中心点
// 地图中心点(初始化得有值);也是标记点
center
:
[
121.59996
,
31.197646
],
amapManager
,
events
:
{
init
(
o
)
{
const
marker
=
new
AMap
.
Marker
({
position
:
_this
.
point
})
marker
.
setMap
(
o
)
}
// 员工状态:0可用,1不可用
status
:
{
0
:
'启用'
,
1
:
'停用'
},
point
:
[
116.397428
,
39.90923
],
// 赋值的点,有接口可删
// 员工信息
staffTableData
:
{
border
:
true
,
...
...
@@ -124,54 +166,126 @@ export default {
prop
:
'phone'
},
{
label
:
'状态'
,
prop
:
'status'
prop
:
'status'
,
formatter
:
(
cellValue
)
=>
{
return
this
.
status
[
cellValue
.
status
]
}
}]
},
// 分组信息
groupTableData
:
{
border
:
true
,
height
:
parseInt
(
this
.
$client_height
()
-
140
),
align
:
'center'
,
data
:
[],
column
:
[{
label
:
'ID'
,
prop
:
'id'
},
{
label
:
'加入分组名称'
,
prop
:
'groupName'
},
{
label
:
'业务名称'
,
prop
:
'bussinessName'
},
{
label
:
'商户类型'
,
prop
:
'merchantTypeName'
},
{
label
:
'加入分组时间'
,
prop
:
'createTime'
}],
console
:
{
show
:
true
,
label
:
'操作'
,
button
:
[{
label
:
'详情'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
console
.
log
(
rows
[
index
])
}
}]
}
}
}
},
watch
:
{
merchantId
(
val
)
{
// 标记merchantId改变
this
.
IdChange
=
[
1
,
1
,
1
]
this
.
getBasicInfo
()
}
},
mounted
()
{
console
.
log
(
this
)
this
.
$root
.
eventBus
.
$on
(
'params'
,
(
params
)
=>
{
console
.
log
(
params
)
this
.
name
=
params
.
name
if
(
params
.
merchantId
!==
this
.
merchantId
)
{
this
.
activeName
=
'first'
this
.
merchantId
=
params
.
merchantId
}
})
// setTimeout(() => {
// const theme = new this.$Theme()
// theme.change('#FF0000')
// }, 1000)
// const theme = new this.$Theme()
// console.log(theme)
// theme.change('#FF0000')
// this.center = this.point
// 链接,接受参数
// var url = location.search
// var theRequest = {}
// if (url.indexOf('?') !== -1) {
// // substr()方法返回从参数值开始到结束的字符串
// var str = url.substr(1)
// var strs = str.split('&')
// const text = []
// for (var i = 0; i < strs.length; i++) {
// // 处理乱码
// text[i] = decodeURI(strs[i])
// theRequest[text[i].split('=')[0]] = (text[ i ].split('=')[1])
// }
// this.name = theRequest.name
// }
},
methods
:
{
back
()
{
// history.back()
this
.
$parent
.
to
([
'商户数据平台'
,
'商户数据平台'
,
'商户数据平台'
,
'业务管理'
,
'业务管理列表'
])
},
// 切换tab
handleClick
(
tab
,
event
)
{
console
.
log
(
tab
,
event
)
// console.log(tab, event)
// console.log(this.IdChange)
switch
(
tab
.
name
)
{
case
'first'
:
this
.
IdChange
[
0
]
&&
this
.
getBasicInfo
()
break
case
'second'
:
this
.
IdChange
[
1
]
&&
this
.
getStaffInfo
()
break
case
'third'
:
this
.
IdChange
[
2
]
&&
this
.
getGroupInfo
()
break
}
},
// 基本信息
getBasicInfo
()
{
merchantDetail
.
req
({
merchantId
:
this
.
merchantId
}).
then
(
res
=>
{
this
.
merchantInfo
=
res
this
.
assignBasicInfo
()
this
.
IdChange
[
0
]
=
0
// notice.okTips()
}).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
})
},
assignBasicInfo
()
{
for
(
var
i
in
this
.
List
)
{
if
(
this
.
List
[
i
].
isMap
)
{
this
.
center
=
[
+
this
.
merchantInfo
.
lng
,
+
this
.
merchantInfo
.
lat
]
const
o
=
amapManager
.
getMap
()
const
marker
=
new
AMap
.
Marker
({
position
:
this
.
center
})
marker
.
setMap
(
o
)
}
else
if
(
this
.
List
[
i
].
isImg
)
{
this
.
List
[
i
].
value
=
'http://www.pptbz.com/pptpic/UploadFiles_6909/201203/2012031220134655.jpg'
}
else
{
this
.
List
[
i
].
value
=
this
.
merchantInfo
[
this
.
List
[
i
].
name
]
}
}
},
// 员工信息
getStaffInfo
()
{
merchantPersonal
.
req
({
merchantId
:
this
.
merchantId
}).
then
(
res
=>
{
this
.
staffTableData
.
data
=
res
.
merchantPersonals
this
.
IdChange
[
1
]
=
0
// notice.okTips()
}).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
})
},
// 员工信息-接口
getStaffList
()
{
merchantPersonal
.
req
().
then
(
res
=>
{
notice
.
okTips
(
res
)
// 分组信息
getGroupInfo
()
{
merchantGroup
.
req
({
merchantId
:
this
.
merchantId
}).
then
(
res
=>
{
this
.
groupTableData
.
data
=
res
.
merchantGroups
this
.
IdChange
[
2
]
=
0
// notice.okTips()
}).
catch
(
err
=>
{
notice
.
errorTips
(
err
)
})
...
...
src/views/customer/businessGroup/index.vue
View file @
6d44875
...
...
@@ -100,9 +100,10 @@
<
script
>
// import Edit from './Edit'
// import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common'
import
{
getMerchantGroupList
,
createGroup
}
from
'@/api/index'
//
import { getMerchantGroupList, createGroup } from '@/api/index'
// import { NoticeMixin } from '@/mixins'
// import Vue from 'vue'
import
{
groupMethods
,
request
}
from
'@/api'
export
default
{
name
:
'businessGroup'
,
components
:
{
...
...
@@ -220,8 +221,10 @@ export default {
// },
getList
()
{
// const params = this.getParams()
getMerchantGroupList
.
req
({})
const
params
=
{}
params
.
methods
=
groupMethods
.
Search
request
.
req
(
params
)
.
then
(
res
=>
{
this
.
total
=
res
.
pagination
.
totalCount
this
.
tableData
.
data
=
res
.
groupDicts
...
...
@@ -255,8 +258,10 @@ export default {
}
})
},
createGroup
(
params
)
{
createGroup
createGroup
(
pas
)
{
const
params
=
pas
params
.
methods
=
groupMethods
.
Create
request
.
req
(
params
)
.
then
(
res
=>
{
console
.
log
(
res
)
...
...
src/views/customer/businessGroupDetail/index.vue
View file @
6d44875
...
...
@@ -125,9 +125,10 @@
<
script
>
// import Edit from './Edit'
// import { fn, treeCheckKeys, deleteEmptyAttribute } from '@/common/common'
import
{
getMerchantGroupDetailList
}
from
'@/api/index'
//
import { getMerchantGroupDetailList } from '@/api/index'
// import { NoticeMixin } from '@/mixins'
// import Vue from 'vue'
import
{
groupDetailMethods
,
request
}
from
'@/api'
import
AddBusiness
from
'./addBusiness'
export
default
{
name
:
'detail'
,
...
...
@@ -244,7 +245,8 @@ export default {
},
getList
()
{
const
params
=
this
.
getParams
()
getMerchantGroupDetailList
params
.
methods
=
groupDetailMethods
.
Search
request
.
req
(
params
)
.
then
(
res
=>
{
this
.
total
=
res
.
pagination
.
totalCount
...
...
src/views/customer/businessList/index.vue
View file @
6d44875
...
...
@@ -44,7 +44,7 @@
<
script
>
import
SearchDialog
from
'./SearchDialog'
import
AddDialog
from
'./AddDialog'
import
{
getList
,
saveMerchant
}
from
'@/api/bussinessListA
pi'
import
{
bizMethods
,
request
}
from
'@/a
pi'
import
notice
from
'@/common/notice'
export
default
{
name
:
'businessList'
,
...
...
@@ -128,8 +128,7 @@ export default {
label
:
'详情'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
const
url
=
encodeURI
(
`../../customer/businessDetails.html?id=
${
rows
[
index
].
merchantId
}
&name=
${
rows
[
index
].
merchantName
}
`
)
location
.
href
=
url
this
.
$root
.
to
([
'商户数据平台'
,
'商户数据平台'
,
'商户数据平台'
,
'业务管理'
,
'商户详情'
],
{
merchantId
:
rows
[
index
].
merchantId
})
}
}]
}
...
...
@@ -150,7 +149,8 @@ export default {
// 接口请求-start
getList
()
{
const
params
=
this
.
getParams
()
getList
.
req
(
params
).
then
(
res
=>
{
params
.
methods
=
bizMethods
.
Search
request
.
req
(
params
).
then
(
res
=>
{
this
.
ListTableData
.
data
=
res
.
merchants
this
.
total
=
res
.
pagination
.
totalCount
this
.
reset
(
this
.
merchantSearch
)
...
...
@@ -161,7 +161,7 @@ export default {
})
},
saveMerchant
()
{
saveMerchan
t
.
req
(
this
.
merchantForm
).
then
(
res
=>
{
reques
t
.
req
(
this
.
merchantForm
).
then
(
res
=>
{
notice
.
okTips
()
this
.
reset
(
this
.
merchantForm
)
}).
catch
(
err
=>
{
...
...
src/views/customer/businessManagement/index.vue
View file @
6d44875
...
...
@@ -54,7 +54,7 @@
>
{{
errorBags
.
first
(
'businessDescription'
)
}}
</span>
</gl-form-item>
<gl-form-item
label=
"地址"
>
<city-area
@
cityArea=
"getCityArea"
></city-area>
<city-area
ref=
"c"
:showCity=
"showCity"
:eventBus=
"$root.eventBus"
:validateCity=
"validateCity"
@
cityArea=
"getCityArea"
></city-area>
</gl-form-item>
</gl-form>
<div
...
...
@@ -77,7 +77,7 @@
<
script
>
import
{
CityArea
}
from
'../components'
import
addBusiness
from
'./addBusiness'
import
{
jumpLink
}
from
'../../../common/common.js'
//
import { jumpLink } from '../../../common/common.js'
export
default
{
name
:
'BusinessManagement'
,
components
:
{
...
...
@@ -85,7 +85,6 @@ export default {
CityArea
},
data
()
{
const
_this
=
this
return
{
tableData
:
{
border
:
true
,
...
...
@@ -151,19 +150,45 @@ export default {
businessDescription
:
[{
required
:
true
}]
},
// 商户分组组件数据
addDialogVisible
:
false
addDialogVisible
:
false
,
// 省市区
showCity
:
[
1
,
1
],
validateCity
:
[
1
,
1
]
}
},
provide
()
{
return
{
$validator
:
this
.
$validator
}
},
watch
:
{
dialogFormVisible
(
val
)
{
if
(
val
)
{
this
.
form
=
{
businessName
:
''
,
businessDescription
:
''
,
area
:
''
}
}
else
{
this
.
$validator
.
errors
.
clear
()
this
.
$refs
[
'c'
].
$validator
.
errors
.
clear
()
}
},
'this.$root.eventBus'
(
val
)
{
console
.
log
(
val
,
11212
)
if
(
val
)
{
this
.
$root
.
eventBus
.
$emit
(
'reset'
)
}
}
},
methods
:
{
// 显示隐藏弹窗
showDialog
()
{
this
.
dialogFormVisible
=
!
this
.
dialogFormVisible
this
.
$validator
.
errors
.
clear
()
},
// 提交表单
submit
()
{
this
.
$validator
.
validateAll
().
then
((
result
)
=>
{
if
(
result
)
{
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
()
...
...
src/views/customer/components/src/cityArea.vue
View file @
6d44875
<
template
>
<!--
<div>
-->
<gl-row
style=
"margin-left: 0"
:gutter=
"10"
>
<gl-col
:span=
"8"
>
:gutter=
"10"
>
<gl-col
:span=
"showCity[2] ? 8 : showCity[1] ? 12 : 24"
>
<gl-select
v-show=
"showCity[0]"
filterable
clearable
v-model=
"province"
name=
"province"
v-validate=
"validateCity[0] ? 'required' : false"
data-vv-as=
"省"
@
change=
"selectProvince"
placeholder=
"请选择省"
>
placeholder=
"请选择省"
>
<gl-option
v-for=
"(item, k) in provinceList"
:key=
"k"
:label=
"item.provinceName"
:value=
"item.provinceId"
>
:value=
"item.provinceId"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('province')"
class=
"error"
>
{{
errorBags
.
first
(
'province'
)
}}
</span>
</gl-col>
<gl-col
:span=
"
8
"
>
<gl-col
:span=
"
showCity[2]? 8 : 12
"
>
<gl-select
v-show=
"showCity[1]"
filterable
clearable
v-model=
"city"
name=
"city"
v-validate=
"validateCity[1] ? 'required' : false"
data-vv-as=
"市"
@
change=
"selectCity"
placeholder=
"请选择市"
>
placeholder=
"请选择市"
>
<gl-option
v-for=
"item in cityList"
:key=
"item.cityId"
:label=
"item.cityName"
:value=
"item.cityId"
>
:value=
"item.cityId"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('city')"
class=
"error"
>
{{
errorBags
.
first
(
'city'
)
}}
</span>
</gl-col>
<gl-col
:span=
"
8
"
>
<gl-col
:span=
"
showCity[2]? 8 : 12
"
>
<gl-select
v-show=
"showCity[2]"
filterable
clearable
v-model=
"area"
name=
"area"
v-validate=
"validateCity[2] ? 'required' : false"
data-vv-as=
"区"
@
change=
"selectArea"
placeholder=
"请选择区"
>
placeholder=
"请选择区"
>
<gl-option
v-for=
"item in areaList"
:key=
"item.areaId"
:label=
"item.areaName"
:value=
"item.areaId"
>
:value=
"item.areaId"
>
</gl-option>
</gl-select>
<span
v-show=
"errorBags.has('area')"
class=
"error"
>
{{
errorBags
.
first
(
'area'
)
}}
</span>
</gl-col>
</gl-row>
<!--
</div>
-->
</
template
>
<
script
>
export
default
{
name
:
'CityArea'
,
inject
:
[
'$validator'
],
data
()
{
return
{
AllData
:
[],
...
...
@@ -72,72 +79,81 @@ export default {
city
:
''
,
// 市值
area
:
''
,
// 区值
mutIndex
:
[],
// 存储下标
mutArray
:
[]
//
mutArray
:
[]
//
传值给父组件的数组
}
},
props
:
{
// value: Array
showCity
:
Array
,
validateCity
:
Array
,
eventBus
:
Object
},
mounted
()
{
const
URL
=
' http://192.168.3.171:7300/mock/5be17454f31545347559d499/config'
const
getConfig
=
(
url
=
URL
+
'/area_config'
)
=>
{
return
new
Promise
(
resolve
=>
{
const
xhr
=
new
XMLHttpRequest
()
xhr
.
onreadystatechange
=
()
=>
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
resolve
({
'config'
:
JSON
.
parse
(
xhr
.
responseText
)
})
}
watch
:
{
// 监听省市被clear清空市区数组
province
(
val
)
{
console
.
log
(
val
)
!
val
?
this
.
cityList
=
[]
&&
(
this
.
areaList
=
[])
:
false
},
city
(
val
)
{
!
val
?
this
.
areaList
=
[]
:
false
},
eventBus
:
{
handler
(
__eventBus
)
{
if
(
__eventBus
)
{
__eventBus
.
$on
(
'reset'
,
()
=>
{
console
.
log
(
'虫豸'
)
})
}
xhr
.
open
(
'GET'
,
url
)
xhr
.
send
()
})
}
}
},
mounted
()
{
console
.
log
(
this
.
showCity
)
// 初始化
getConfig
().
then
(
data
=>
{
console
.
log
(
data
.
config
)
this
.
AllData
=
JSON
.
parse
(
JSON
.
stringify
(
data
.
config
.
provinceInfoList
))
this
.
$request
({
url
:
'http://192.168.3.171:7300/mock/5be17454f31545347559d499/config/area_config'
}).
then
(
data
=>
{
this
.
AllData
=
JSON
.
parse
(
data
.
data
).
provinceInfoList
this
.
AllData
.
forEach
(
element
=>
{
this
.
provinceList
.
push
({
provinceId
:
element
.
provinceId
,
provinceName
:
element
.
provinceName
})
})
this
.
getCity
(
0
)
this
.
getArea
(
0
,
0
)
// this.getCity(0)
// this.getArea(0, 0)
})
},
methods
:
{
// 选择省
selectProvince
(
val
)
{
this
.
mutArray
=
[
val
,
,
]
this
.
mutArray
=
[
val
,
null
,
null
]
this
.
AllData
.
forEach
((
element
,
index
)
=>
{
if
(
element
.
provinceId
===
val
)
{
this
.
mutIndex
[
0
]
=
index
}
})
this
.
mutIndex
[
1
]
=
''
this
.
mutIndex
[
2
]
=
''
this
.
getCity
(
this
.
mutIndex
[
0
])
this
.
getArea
(
this
.
mutIndex
[
0
],
0
)
// this.getArea(this.mutIndex[0], 0)
// 选择省清空已选的市区value
this
.
city
=
''
this
.
area
=
''
this
.
$emit
(
'cityArea'
,
this
.
mutArray
)
},
// 选择市
selectCity
(
val
)
{
this
.
mutArray
[
1
]
=
val
this
.
mutArray
[
2
]
=
''
this
.
mutArray
[
2
]
=
null
const
i
=
this
.
mutIndex
[
0
]
this
.
AllData
[
i
].
cityInfoList
.
forEach
((
element
,
index
)
=>
{
if
(
element
.
cityId
===
val
)
{
this
.
mutIndex
[
1
]
=
index
}
})
this
.
getArea
(
this
.
mutIndex
[
0
],
this
.
mutIndex
[
1
])
val
?
this
.
getArea
(
this
.
mutIndex
[
0
],
this
.
mutIndex
[
1
])
:
false
this
.
area
=
''
val
?
this
.
$emit
(
'cityArea'
,
this
.
mutArray
)
:
false
val
?
this
.
$emit
(
'cityArea'
,
this
.
mutArray
)
:
false
},
// 选择区
selectArea
(
val
)
{
this
.
mutArray
[
2
]
=
val
val
?
this
.
$emit
(
'cityArea'
,
this
.
mutArray
)
:
false
val
?
this
.
$emit
(
'cityArea'
,
this
.
mutArray
)
:
false
},
// 获取市
getCity
(
index
)
{
...
...
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