Commit de00ec8d by wangql
2 parents 6d448750 a86c2e1b
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
<span v-else>{{i.value}}</span> <span v-else>{{i.value}}</span>
</span> </span>
</gl-col> </gl-col>
<!-- <gl-col :span='24' style=''><span>商户名称:</span>
</gl-col> -->
</gl-tab-pane> </gl-tab-pane>
<gl-tab-pane <gl-tab-pane
...@@ -61,16 +59,43 @@ ...@@ -61,16 +59,43 @@
label='分组信息' label='分组信息'
name='third' 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-tab-pane>
</gl-tabs> </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> </div>
</template> </template>
<script> <script>
import VueAMap from 'vue-amap' import VueAMap from 'vue-amap'
import Vue from 'vue' import Vue from 'vue'
import { merchantDetail, merchantPersonal, merchantGroup } from '@/api/index' import { bizMethods, request } from '@/api'
import notice from '@/common/notice' import notice from '@/common/notice'
const amapManager = new VueAMap.AMapManager() const amapManager = new VueAMap.AMapManager()
VueAMap.initAMapApiLoader({ VueAMap.initAMapApiLoader({
...@@ -201,10 +226,37 @@ export default { ...@@ -201,10 +226,37 @@ export default {
label: '详情', label: '详情',
type: 'text', type: 'text',
callback: (index, rows) => { 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 { ...@@ -245,7 +297,9 @@ export default {
}, },
// 基本信息 // 基本信息
getBasicInfo() { 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.merchantInfo = res
this.assignBasicInfo() this.assignBasicInfo()
this.IdChange[0] = 0 this.IdChange[0] = 0
...@@ -272,7 +326,9 @@ export default { ...@@ -272,7 +326,9 @@ export default {
}, },
// 员工信息 // 员工信息
getStaffInfo() { 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.staffTableData.data = res.merchantPersonals
this.IdChange[1] = 0 this.IdChange[1] = 0
// notice.okTips() // notice.okTips()
...@@ -282,13 +338,34 @@ export default { ...@@ -282,13 +338,34 @@ export default {
}, },
// 分组信息 // 分组信息
getGroupInfo() { 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.groupTableData.data = res.merchantGroups
this.IdChange[2] = 0 this.IdChange[2] = 0
// notice.okTips() // notice.okTips()
}).catch(err => { }).catch(err => {
notice.errorTips(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 @@ ...@@ -54,7 +54,13 @@
>{{ errorBags.first('businessDescription') }}</span> >{{ errorBags.first('businessDescription') }}</span>
</gl-form-item> </gl-form-item>
<gl-form-item label="地址"> <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-item>
</gl-form> </gl-form>
<div <div
...@@ -75,6 +81,7 @@ ...@@ -75,6 +81,7 @@
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue'
import { CityArea } from '../components' import { CityArea } from '../components'
import addBusiness from './addBusiness' import addBusiness from './addBusiness'
// import { jumpLink } from '../../../common/common.js' // import { jumpLink } from '../../../common/common.js'
...@@ -86,6 +93,7 @@ export default { ...@@ -86,6 +93,7 @@ export default {
}, },
data() { data() {
return { return {
eventBus: null,
tableData: { tableData: {
border: true, border: true,
align: 'center', align: 'center',
...@@ -166,17 +174,18 @@ export default { ...@@ -166,17 +174,18 @@ export default {
if (val) { if (val) {
this.form = { businessName: '', businessDescription: '', area: '' } this.form = { businessName: '', businessDescription: '', area: '' }
} else { } else {
this.eventBus.$emit('reset')
this.$validator.errors.clear() this.$validator.errors.clear()
this.$refs['c'].$validator.errors.clear() clearTimeout(timer)
} const timer = setTimeout(() => {
}, this.$refs['c'].$validator.errors.clear()
'this.$root.eventBus'(val) { }, 400)
console.log(val,11212)
if (val) {
this.$root.eventBus.$emit('reset')
} }
} }
}, },
mounted() {
this.eventBus = new Vue()
},
methods: { methods: {
// 显示隐藏弹窗 // 显示隐藏弹窗
showDialog() { showDialog() {
......
...@@ -90,24 +90,33 @@ export default { ...@@ -90,24 +90,33 @@ export default {
watch: { watch: {
// 监听省市被clear清空市区数组 // 监听省市被clear清空市区数组
province(val) { province(val) {
console.log(val) // console.log(val)
!val ? this.cityList = [] && (this.areaList = []) : false !val ? this.cityList = [] && (this.areaList = []) : false
}, },
city(val) { city(val) {
!val ? this.areaList = [] : false !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() { 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.$request({ url: 'http://192.168.3.171:7300/mock/5be17454f31545347559d499/config/area_config' }).then(data => {
this.AllData = JSON.parse(data.data).provinceInfoList 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!