Files
dvcp_v2_webapp/project/fengdu/app/AppIntegratingOrder/AppIntegratingOrder.vue

117 lines
3.2 KiB
Vue
Raw Normal View History

2023-04-11 15:37:08 +08:00
<template>
<ai-list v-if="!isShowDetail">
<template slot="title">
2023-04-14 14:04:32 +08:00
<ai-title title="订单管理" :isShowBottomBorder="false" v-model="areaId" :isShowArea="currIndex === '1'" :hideLevel="hideLevel - 1" @change="onAreaChange">
2023-04-11 17:52:19 +08:00
</ai-title>
2023-04-11 15:37:08 +08:00
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :areaId="areaId" :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance" :dict="dict" :permissions="permissions"/>
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
2023-04-13 18:01:02 +08:00
<ResidentDetail v-else-if="componentName === 'ResidentDetail'" :areaId="areaId" :params="params" :instance="instance" :dict="dict" @change="onChange"></ResidentDetail>
<GirdDetail v-else-if="componentName === 'GirdDetail'" :areaId="areaId" :params="params" :instance="instance" :dict="dict" @change="onChange"></GirdDetail>
2023-04-11 15:37:08 +08:00
</template>
<script>
2023-04-13 18:01:02 +08:00
import ResidentDetail from './components/ResidentDetail'
import GirdDetail from './components/GirdDetail'
import GirdList from './components/GirdList'
import ResidentList from './components/ResidentList'
2023-04-11 15:37:08 +08:00
import { mapState } from 'vuex'
export default {
name: 'AppIntegratingOrder',
label: '订单管理',
components: {
2023-04-13 18:01:02 +08:00
ResidentList,
GirdList,
ResidentDetail,
GirdDetail
2023-04-11 15:37:08 +08:00
},
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
...mapState(['user']),
2023-04-14 14:04:32 +08:00
hideLevel () {
return this.user.info.areaList?.length || 0
},
2023-04-11 15:37:08 +08:00
tabs () {
const tabList = [
2023-04-23 15:24:30 +08:00
{label: '居民积分订单', name: 'ResidentList', comp: ResidentList, permission: ''},
{label: '网格积分订单', name: 'GirdList', comp: GirdList, permission: ''}
2023-04-11 15:37:08 +08:00
].filter(item => {
return true
})
return tabList
}
},
data () {
return {
2023-04-13 18:01:02 +08:00
activeName: 'GoodsList',
2023-04-11 15:37:08 +08:00
currIndex: '0',
componentName: '',
params: {},
areaName: '',
areaId: '',
isShowDetail: false
}
},
created () {
this.areaId = this.user.info.areaId
},
methods: {
onAreaChange () {
2023-04-14 14:04:32 +08:00
if (this.currIndex === '1') {
2023-04-11 15:37:08 +08:00
this.$nextTick(() => {
this.$refs[this.currIndex][0].getList()
})
}
},
onChange (data) {
2023-04-13 18:01:02 +08:00
if (data.type === 'GirdList') {
this.componentName = 'GirdList'
2023-04-11 15:37:08 +08:00
this.isShowDetail = false
this.params = data.params
}
2023-04-13 18:01:02 +08:00
if (data.type === 'ResidentList') {
this.componentName = 'ResidentList'
2023-04-11 15:37:08 +08:00
this.isShowDetail = false
this.params = data.params
}
2023-04-13 18:01:02 +08:00
if (data.type === 'GirdDetail') {
this.componentName = 'GirdDetail'
this.isShowDetail = true
this.params = data.params
}
if (data.type === 'ResidentDetail') {
this.componentName = 'ResidentDetail'
2023-04-11 15:37:08 +08:00
this.isShowDetail = true
this.params = data.params
}
}
}
}
</script>
<style lang="scss" scoped>
</style>