Commit e21b53b1 by cwq0219

商户详情-修改

1 parent 743c302f
<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>{{List[0].value}}</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 { merchantDetail } from '@/api/index'
import { merchantDetail, merchantPersonal, merchantGroup } from '@/api/index'
import notice from '@/common/notice'
const amapManager = new VueAMap.AMapManager()
VueAMap.initAMapApiLoader({
......@@ -47,70 +81,68 @@ Vue.use(VueAMap)
export default {
name: 'BusinessDetails',
data() {
const _this = this
return {
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,
......@@ -134,77 +166,129 @@ 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) {
this.getStaffList()
// 标记merchantId改变
this.IdChange = [1, 1, 1]
this.getBasicInfo()
}
},
mounted() {
this.$root.eventBus.$on('params', (params) => {
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
}
},
// 员工信息-接口--start
getStaffList() {
// 基本信息
getBasicInfo() {
merchantDetail.req({ merchantId: this.merchantId }).then(res => {
this.merchantInfo = res
this.assignStaffInfo()
notice.okTips()
this.assignBasicInfo()
this.IdChange[0] = 0
// notice.okTips()
}).catch(err => {
notice.errorTips(err)
})
},
assignStaffInfo() {
console.log(this.merchantInfo)
assignBasicInfo() {
for (var i in this.List) {
if (this.List[i].isMap) {
console.log('000')
this.point = [this.merchantInfo.lng, this.merchantId.lat]
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) {
console.log('000')
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)
})
},
// 分组信息
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 {
type: 'text',
callback: (index, rows) => {
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!