<template>
  <!--  <div v-if="listpage">-->
  <tab-button v-ref:list :active="-1">
    <tabs header="收费查询" v-if="permission('收费查询')">
      <charge-query  @deal-msg="dealMsg" :data="data"></charge-query>
    </tabs>
    <tabs header="换表查询" v-if="permission('换表查询')">
      <change-meter-query @deal-msg="dealMsg" :data="data"></change-meter-query>
    </tabs>
    <tabs header="机表抄表查询" v-if="permission('机表抄表查询')">
      <handplan-query @deal-msg="dealMsg" :data="data"></handplan-query>
    </tabs>
    <tabs header="过户查询" v-if="permission('过户查询')">
      <transfer-query @deal-msg="dealMsg" :data="data"></transfer-query>
    </tabs>
    <tabs header="其他收费查询" v-if="permission('其他收费查询')">
      <other-charge-query @deal-msg="dealMsg" :data="data"></other-charge-query>
    </tabs>
    <tabs header="补卡查询" v-if="permission('补卡查询')">
      <fill-card-query @deal-msg="dealMsg" :data="data"></fill-card-query>
    </tabs>
    <tabs header="补气查询" v-if="permission('补气查询')">
      <fill-gas-query @deal-msg="dealMsg" :data="data"></fill-gas-query>
    </tabs>
    <tabs header="启用查询" v-if="permission('启用查询')">
      <enable-query @deal-msg="dealMsg" :data="data" :residentialarea="residentialArea"></enable-query>
    </tabs>
    <tabs header="停用查询" v-if="permission('停用查询')">
      <disable-query @deal-msg="dealMsg" :data="data" :residentialarea="residentialArea"></disable-query>
    </tabs>
    <tabs header="销户查询" v-if="permission('销户查询')">
      <cancellation-query @deal-msg="dealMsg" :data="data"></cancellation-query>
    </tabs>
    <tabs header="卡表抄表查询" v-if="permission('卡表抄表查询')">
      <card-handplan-query @deal-msg="dealMsg" :data="data"></card-handplan-query>
    </tabs>
    <tabs header="业务查询" v-if="permission('业务查询')">
      <busines-query @deal-msg="dealMsg" :data="data"></busines-query>
    </tabs>
    <tabs header="调价记录查询" v-if="permission('调价记录查询')">
      <pricechange-record @deal-msg="dealMsg" :data="data"></pricechange-record>
    </tabs>
  </tab-button>
</template>

<script>
import TabButton from './../../components/sale/common/TabButton'
import Tabs from './../../components/sale/common/Tabs'
import ChargeQuery from './ChargeQuery'
import { HttpResetClass } from 'vue-client'

export default {
  name: "BusinessQuery",
  title: '业务查询',
  data() {
    return {// 页面开关
      residentialArea: [],
      f_start_date: '',
      f_end_date: '',
      listpage: true,
      width: {
        left: '100%',
        right: '0%'
      },
      // searchNumber:'',
      rowData: {},
      show: [],
      data: {
        startDate: this.$login.toStandardDateString() + ' 00:00:00',
        endDate: this.$login.toStandardDateString() + ' 23:59:59',
        f_userinfo_code:''
      }

    }
  },
  components: {Tabs, TabButton, ChargeQuery},
  ready() {
    this.getaddress()
  },
  methods: {
    async  getaddress(){
      let HttpReset = new HttpResetClass()
      var data = await HttpReset.load('POST', 'api/af-revenue/sql/manage_getarealist', {
        data: {
          condition: `1=1 and s.f_orgid = '${this.$login.f.orgid}'`
        }
      }, {resolveMsg: null, rejectMsg: '获取小区失败!'})
      console.log('小区',data)
      let house = []
      for (let row of data.data){
        house.push({label: row.f_residential_area, value: row.f_residential_area})
      }
      house.unshift({label: '全部', value: ''})
      this.residentialArea = house
    },
    permission(name) {
      if (this.$login.r.find(value => value == '综合查询')) {
        if (!this.$login.r.find(value => value == name)) {
          return false
        }
      }
      return true
    },
    cancel(obj) {
      this.listpage = true
    },
    dealMsg(obj) {
      this.rowData = obj
      this.listpage = false
      this.f_start_date = obj.model.startDate
      this.f_end_date = obj.model.endDate
    }
  }
}
</script>

<style scoped>

</style>
