Commit de00ec8d by wangql
2 parents 6d448750 a86c2e1b
......@@ -47,8 +47,6 @@
<span v-else>{{i.value}}</span>
</span>
</gl-col>
<!-- <gl-col :span='24' style=''><span>商户名称:</span>
</gl-col> -->
</gl-tab-pane>
<gl-tab-pane
......@@ -61,16 +59,43 @@
label='分组信息'
name='third'
>
<gl-table :table="groupTableData"></gl-table>
<gl-table :table="groupTableData">
<gl-table-column align="center" v-for="(i, index) in groupTableData.column" :key="index" :label='i.label' :prop='i.prop' >
<template slot-scope="scope">
<template v-if='i.prop === "groupName"'>
{{groupTableData.data[scope.scope.$index][i.prop] === '云商' ? 1 : 2}}
</template>
<template v-else>
{{22222222222222}}
</template>
</template>
</gl-table-column>
</gl-table>
</gl-tab-pane>
</gl-tabs>
<gl-dialog
:visible.sync="isVisible"
:before-close="handleDetailClose"
:width="diaWidth"
>
<span>父商户信息:</span>
<gl-table :table="parentLevelTableData"></gl-table>
<span>子商户信息:</span>
<gl-table :table="childLevelTableData"></gl-table>
<span slot="footer">
<el-button
type="primary"
@click="handleDetailClose"
>确 定</el-button>
</span>
</gl-dialog>
</div>
</template>
<script>
import VueAMap from 'vue-amap'
import Vue from 'vue'
import { merchantDetail, merchantPersonal, merchantGroup } from '@/api/index'
import { bizMethods, request } from '@/api'
import notice from '@/common/notice'
const amapManager = new VueAMap.AMapManager()
VueAMap.initAMapApiLoader({
......@@ -201,10 +226,37 @@ export default {
label: '详情',
type: 'text',
callback: (index, rows) => {
console.log(rows[index])
this.getGroupLevelInfo(rows[index].GroupName)
}
}]
}
},
// 分组信息-详情
isVisible: false,
diaWidth: '40%',
parentLevelTableData: {
border: true,
align: 'center',
data: [],
column: [{
label: '商户号',
prop: 'merchantId'
}, {
label: '商户名称',
prop: 'merchantName'
}]
},
childLevelTableData: {
border: true,
align: 'center',
data: [],
column: [{
label: '商户号',
prop: 'merchantId'
}, {
label: '商户名称',
prop: 'merchantName'
}]
}
}
},
......@@ -245,7 +297,9 @@ export default {
},
// 基本信息
getBasicInfo() {
merchantDetail.req({ merchantId: this.merchantId }).then(res => {
const params = ({ merchantId: this.merchantId })
params.methods = bizMethods.Detail
request.req(params).then(res => {
this.merchantInfo = res
this.assignBasicInfo()
this.IdChange[0] = 0
......@@ -272,7 +326,9 @@ export default {
},
// 员工信息
getStaffInfo() {
merchantPersonal.req({ merchantId: this.merchantId }).then(res => {
const params = ({ merchantId: this.merchantId })
params.methods = bizMethods.Personal
request.req(params).then(res => {
this.staffTableData.data = res.merchantPersonals
this.IdChange[1] = 0
// notice.okTips()
......@@ -282,13 +338,34 @@ export default {
},
// 分组信息
getGroupInfo() {
merchantGroup.req({ merchantId: this.merchantId }).then(res => {
const params = ({ merchantId: this.merchantId })
params.methods = bizMethods.Group
request.req(params).then(res => {
this.groupTableData.data = res.merchantGroups
this.IdChange[2] = 0
// notice.okTips()
}).catch(err => {
notice.errorTips(err)
})
},
// 分组信息-详情
getGroupLevelInfo(groupName) {
const params = ({ merchantId: this.merchantId, groupId: groupName })
params.methods = bizMethods.GroupLevel
request.req(params).then(res => {
console.log([res.parentMerchantLevel])
this.parentLevelTableData.data = [res.parentMerchantLevel]
this.childLevelTableData.data = res.childMerchantLevels
this.detailVisible()
}).catch(err => {
notice.errorTips(err)
})
},
detailVisible() {
this.isVisible = !this.isVisible
},
handleDetailClose() {
this.detailVisible()
}
}
}
......
......@@ -54,7 +54,13 @@
>{{ errorBags.first('businessDescription') }}</span>
</gl-form-item>
<gl-form-item label="地址">
<city-area ref="c" :showCity="showCity" :eventBus="$root.eventBus" :validateCity="validateCity" @cityArea="getCityArea"></city-area>
<city-area
ref="c"
:showCity="showCity"
:eventBus="eventBus"
:validateCity="validateCity"
@cityArea="getCityArea"
></city-area>
</gl-form-item>
</gl-form>
<div
......@@ -75,6 +81,7 @@
</div>
</template>
<script>
import Vue from 'vue'
import { CityArea } from '../components'
import addBusiness from './addBusiness'
// import { jumpLink } from '../../../common/common.js'
......@@ -86,6 +93,7 @@ export default {
},
data() {
return {
eventBus: null,
tableData: {
border: true,
align: 'center',
......@@ -166,17 +174,18 @@ export default {
if (val) {
this.form = { businessName: '', businessDescription: '', area: '' }
} else {
this.eventBus.$emit('reset')
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')
clearTimeout(timer)
const timer = setTimeout(() => {
this.$refs['c'].$validator.errors.clear()
}, 400)
}
}
},
mounted() {
this.eventBus = new Vue()
},
methods: {
// 显示隐藏弹窗
showDialog() {
......
......@@ -90,24 +90,33 @@ export default {
watch: {
// 监听省市被clear清空市区数组
province(val) {
console.log(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('虫豸')
})
}
}
}
// eventBus(val) {
// console.log(val)
// },
// eventBus: {
// handler(__eventBus) {
// if (__eventBus) {
// __eventBus.$on('reset', () => {
// console.log('reset----------')
// this.$validator.errors.clear()
// })
// }
// }
// }
},
mounted() {
console.log(this.showCity)
// console.log(this.showCity)
this.eventBus.$on('reset', () => {
this.province = ''
this.city = ''
this.area = ''
})
// 初始化
this.$request({ url: 'http://192.168.3.171:7300/mock/5be17454f31545347559d499/config/area_config' }).then(data => {
this.AllData = JSON.parse(data.data).provinceInfoList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!