117 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			117 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
<template>
 | 
						|
  <ai-list v-if="!isShowDetail">
 | 
						|
    <template slot="title">
 | 
						|
      <ai-title title="订单管理" :isShowBottomBorder="false" v-model="areaId" :isShowArea="currIndex === '1'" :hideLevel="hideLevel - 1" @change="onAreaChange">
 | 
						|
      </ai-title>
 | 
						|
    </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>
 | 
						|
  <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>
 | 
						|
</template>
 | 
						|
 | 
						|
<script>
 | 
						|
  import ResidentDetail from './components/ResidentDetail'
 | 
						|
  import GirdDetail from './components/GirdDetail'
 | 
						|
  import GirdList from './components/GirdList'
 | 
						|
  import ResidentList from './components/ResidentList'
 | 
						|
  import { mapState } from 'vuex'
 | 
						|
 | 
						|
  export default {
 | 
						|
    name: 'AppIntegratingOrder',
 | 
						|
    label: '订单管理',
 | 
						|
 | 
						|
    components: {
 | 
						|
      ResidentList,
 | 
						|
      GirdList,
 | 
						|
      ResidentDetail,
 | 
						|
      GirdDetail
 | 
						|
    },
 | 
						|
 | 
						|
    props: {
 | 
						|
      instance: Function,
 | 
						|
      dict: Object,
 | 
						|
      permissions: Function
 | 
						|
    },
 | 
						|
 | 
						|
    computed: {
 | 
						|
      ...mapState(['user']),
 | 
						|
 | 
						|
      hideLevel () {
 | 
						|
        return this.user.info.areaList?.length || 0
 | 
						|
      },
 | 
						|
 | 
						|
      tabs () {
 | 
						|
        const tabList = [
 | 
						|
          {label: '网格积分订单', name: 'GirdList', comp: GirdList, permission: ''},
 | 
						|
          {label: '居民积分订单', name: 'ResidentList', comp: ResidentList, permission: ''}
 | 
						|
        ].filter(item => {
 | 
						|
          return true
 | 
						|
        })
 | 
						|
 | 
						|
        return tabList
 | 
						|
      }
 | 
						|
    },
 | 
						|
 | 
						|
    data () {
 | 
						|
      return {
 | 
						|
        activeName: 'GoodsList',
 | 
						|
        currIndex: '0',
 | 
						|
        componentName: '',
 | 
						|
        params: {},
 | 
						|
        areaName: '',
 | 
						|
        areaId: '',
 | 
						|
        isShowDetail: false
 | 
						|
      }
 | 
						|
    },
 | 
						|
 | 
						|
    created () {
 | 
						|
      this.areaId = this.user.info.areaId
 | 
						|
    },
 | 
						|
 | 
						|
    methods: {
 | 
						|
      onAreaChange () {
 | 
						|
        if (this.currIndex === '1') {
 | 
						|
          this.$nextTick(() => {
 | 
						|
            this.$refs[this.currIndex][0].getList()
 | 
						|
          })
 | 
						|
        }
 | 
						|
      },
 | 
						|
 | 
						|
      onChange (data) {
 | 
						|
        if (data.type === 'GirdList') {
 | 
						|
          this.componentName = 'GirdList'
 | 
						|
          this.isShowDetail = false
 | 
						|
          this.params = data.params
 | 
						|
        }
 | 
						|
        if (data.type === 'ResidentList') {
 | 
						|
          this.componentName = 'ResidentList'
 | 
						|
          this.isShowDetail = false
 | 
						|
          this.params = data.params
 | 
						|
        }
 | 
						|
 | 
						|
        if (data.type === 'GirdDetail') {
 | 
						|
          this.componentName = 'GirdDetail'
 | 
						|
          this.isShowDetail = true
 | 
						|
          this.params = data.params
 | 
						|
        }
 | 
						|
 | 
						|
        if (data.type === 'ResidentDetail') {
 | 
						|
          this.componentName = 'ResidentDetail'
 | 
						|
          this.isShowDetail = true
 | 
						|
          this.params = data.params
 | 
						|
        }
 | 
						|
      }
 | 
						|
    }
 | 
						|
  }
 | 
						|
</script>
 | 
						|
 | 
						|
<style lang="scss" scoped>
 | 
						|
</style>
 |