Commit e21b53b1 by cwq0219

商户详情-修改

1 parent 743c302f
<template> <template>
<div class="detail"> <div class="detail">
<gl-breadcrumb separator='/'> <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>商户详情</gl-breadcrumb-item>
<gl-breadcrumb-item>{{List[0].value}}</gl-breadcrumb-item> <gl-breadcrumb-item>{{List[0].value}}</gl-breadcrumb-item>
</gl-breadcrumb> </gl-breadcrumb>
<!-- <gl-button type='text' @click='back'>商户列表</gl-button> <!-- <gl-button type='text' @click='back'>商户列表</gl-button>
<span>\ 商户详情 \{{name}}</span> --> <span>\ 商户详情 \{{name}}</span> -->
<gl-tabs v-model='activeName' @tab-click='handleClick'> <gl-tabs
<gl-tab-pane label='基本信息' name='first'> v-model='activeName'
<gl-col class="detail-row" :span="i.isMap || i.img? 24 : 12" v-for="(i, index) in List" :key="index+''"> @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}}: <span>{{i.label}}:
<div v-if="i.isMap" class='amap-page-container'> <div
<el-amap vid='amapDemo' :center='center' :amap-manager='amapManager' :zoom='zoom' :events='events' class='amap-demo'> v-if="i.isMap"
</el-amap> class='amap-page-container'
</div> >
<img v-else-if="i.isImg" class="detail-logo" :src="i.value" alt=""> <el-amap
<span v-else>{{i.value}}</span> 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> </span>
</gl-col> </gl-col>
<!-- <gl-col :span='24' style=''><span>商户名称:</span> <!-- <gl-col :span='24' style=''><span>商户名称:</span>
</gl-col> --> </gl-col> -->
</gl-tab-pane> </gl-tab-pane>
<gl-tab-pane label='员工信息' name='second'>配置管理 <gl-tab-pane
label='员工信息'
name='second'
>
<gl-table :table="staffTableData"></gl-table> <gl-table :table="staffTableData"></gl-table>
</gl-tab-pane> </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-tab-pane>
</gl-tabs> </gl-tabs>
</div> </div>
...@@ -36,7 +70,7 @@ ...@@ -36,7 +70,7 @@
<script> <script>
import VueAMap from 'vue-amap' import VueAMap from 'vue-amap'
import Vue from 'vue' import Vue from 'vue'
import { merchantDetail } from '@/api/index' import { merchantDetail, merchantPersonal, merchantGroup } from '@/api/index'
import notice from '@/common/notice' import notice from '@/common/notice'
const amapManager = new VueAMap.AMapManager() const amapManager = new VueAMap.AMapManager()
VueAMap.initAMapApiLoader({ VueAMap.initAMapApiLoader({
...@@ -47,70 +81,68 @@ Vue.use(VueAMap) ...@@ -47,70 +81,68 @@ Vue.use(VueAMap)
export default { export default {
name: 'BusinessDetails', name: 'BusinessDetails',
data() { data() {
const _this = this
return { return {
merchantId: '', merchantId: '',
// 标记merchantId是否改变
IdChange: [0, 0, 0],
activeName: 'first', activeName: 'first',
merchantInfo: {}, merchantInfo: {},
List: [ List: [
{ {
name: 'merchantName', name: 'merchantName',
label: '商户名称', label: '商户名称',
value: '深圳市安卓讯航科技有限公司' value: ''
}, { }, {
name: 'merchantId', name: 'merchantId',
label: '商户号', label: '商户号',
value: '44186213' value: ''
}, { }, {
name: 'address', name: 'address',
label: '商户地址', label: '商户地址',
value: '广东省深圳市南山区科兴科学园C3单元' value: ''
}, { }, {
name: 'merchantChannelName', name: 'merchantChannelName',
label: '商户渠道', label: '商户渠道',
value: '自有渠道' value: ''
}, { }, {
name: 'contactor', name: 'contactor',
label: '联系人', label: '联系人',
value: '彭裕' value: ''
}, { }, {
name: 'createTime', name: 'createTime',
label: '注册时间', label: '注册时间',
value: '2018-03-16' value: ''
}, { }, {
name: 'contactPhone', name: 'contactPhone',
label: '联系电话', label: '联系电话',
value: '15999682114' value: ''
}, { }, {
label: 'POI位置点', label: 'POI位置点',
value: '深圳市安卓讯航科技有限公司', value: '',
isMap: true isMap: true
}, { }, {
name: 'phone', name: 'phone',
label: '服务电话', label: '服务电话',
value: '0755-88888888' value: ''
}, { }, {
name: 'email', name: 'email',
label: '邮箱', label: '邮箱',
value: 'GLSX@didihu.com' value: ''
}, { }, {
label: '商户LOGO', label: '商户LOGO',
value: 'http://www.pptbz.com/pptpic/UploadFiles_6909/201203/2012031220134655.jpg', value: '',
isImg: true isImg: true
} }
], ],
zoom: 12, zoom: 12,
center: [121.59996, 31.197646], // 地图中心点 // 地图中心点(初始化得有值);也是标记点
center: [121.59996, 31.197646],
amapManager, amapManager,
events: { // 员工状态:0可用,1不可用
init(o) { status: {
const marker = new AMap.Marker({ 0: '启用',
position: _this.point 1: '停用'
})
marker.setMap(o)
}
}, },
point: [116.397428, 39.90923], // 赋值的点,有接口可删
// 员工信息 // 员工信息
staffTableData: { staffTableData: {
border: true, border: true,
...@@ -134,77 +166,129 @@ export default { ...@@ -134,77 +166,129 @@ export default {
prop: 'phone' prop: 'phone'
}, { }, {
label: '状态', 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: { watch: {
merchantId(val) { merchantId(val) {
this.getStaffList() // 标记merchantId改变
this.IdChange = [1, 1, 1]
this.getBasicInfo()
} }
}, },
mounted() { mounted() {
this.$root.eventBus.$on('params', (params) => { this.$root.eventBus.$on('params', (params) => {
if (params.merchantId !== this.merchantId) { if (params.merchantId !== this.merchantId) {
this.activeName = 'first'
this.merchantId = params.merchantId 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: { methods: {
back() { back() {
// history.back()
this.$parent.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '业务管理列表']) this.$parent.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '业务管理列表'])
}, },
// 切换tab
handleClick(tab, event) { 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
}
}, },
// 员工信息-接口--start // 基本信息
getStaffList() { getBasicInfo() {
merchantDetail.req({ merchantId: this.merchantId }).then(res => { merchantDetail.req({ merchantId: this.merchantId }).then(res => {
this.merchantInfo = res this.merchantInfo = res
this.assignStaffInfo() this.assignBasicInfo()
notice.okTips() this.IdChange[0] = 0
// notice.okTips()
}).catch(err => { }).catch(err => {
notice.errorTips(err) notice.errorTips(err)
}) })
}, },
assignStaffInfo() { assignBasicInfo() {
console.log(this.merchantInfo)
for (var i in this.List) { for (var i in this.List) {
if (this.List[i].isMap) { if (this.List[i].isMap) {
console.log('000') this.center = [+this.merchantInfo.lng, +this.merchantInfo.lat]
this.point = [this.merchantInfo.lng, this.merchantId.lat] const o = amapManager.getMap()
const marker = new AMap.Marker({
position: this.center
})
marker.setMap(o)
} else if (this.List[i].isImg) { } else if (this.List[i].isImg) {
console.log('000') this.List[i].value = 'http://www.pptbz.com/pptpic/UploadFiles_6909/201203/2012031220134655.jpg'
} else { } else {
this.List[i].value = this.merchantInfo[this.List[i].name] 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)
})
},
// 分组信息
getGroupInfo() {
merchantGroup.req({ merchantId: this.merchantId }).then(res => {
this.groupTableData.data = res.merchantGroups
this.IdChange[2] = 0
// notice.okTips()
}).catch(err => {
notice.errorTips(err)
})
} }
} }
} }
......
...@@ -129,7 +129,6 @@ export default { ...@@ -129,7 +129,6 @@ export default {
type: 'text', type: 'text',
callback: (index, rows) => { callback: (index, rows) => {
this.$root.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '商户详情'], { merchantId: rows[index].merchantId }) this.$root.to(['商户数据平台', '商户数据平台', '商户数据平台', '业务管理', '商户详情'], { merchantId: rows[index].merchantId })
// this.$root.getParamsTrans()
} }
}] }]
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!