<template>
  <!--  <div v-if="listpage">-->
  <tab-button v-ref:list :active="-1">
    <tabs header="收费查询" v-if="permission('收费查询')">
      <charge-query v-if="show.includes('收费查询')" @deal-msg="dealMsg" :data="data"></charge-query>
    </tabs>
    <tabs header="其他收费查询" v-if="permission('其他收费查询')">
      <other-charge-query v-if="show.includes('其他收费查询')" @deal-msg="dealMsg" :data="data"></other-charge-query>
    </tabs>
    <tabs header="其他收费欠费查询" v-if="permission('其他收费欠费查询')">
      <other-charge-nopay-query v-if="show.includes('其他收费欠费查询')" @deal-msg="dealMsg" :data="data"></other-charge-nopay-query>
    </tabs>
    <tabs header="机表抄表查询" v-if="permission('机表抄表查询')">
      <handplan-query v-if="show.includes('机表抄表查询')" @deal-msg="dealMsg" :data="data"></handplan-query>
    </tabs>
    <tabs header="物联网表抄表查询" v-if="permission('物联网表抄表查询')">
      <web-handplan-query v-if="show.includes('物联网表抄表查询')" @deal-msg="dealMsg" :data="data"></web-handplan-query>
    </tabs>
    <tabs header="免费送气查询" v-if="permission('免费送气查询')">
      <privilege-query v-if="show.includes('免费送气查询')" @deal-msg="dealMsg" :data="data"></privilege-query>
    </tabs>
    <tabs header="过户查询" v-if="permission('过户查询')">
      <transfer-query v-if="show.includes('过户查询')" @deal-msg="dealMsg" :data="data"></transfer-query>
    </tabs>
    <tabs header="换表查询" v-if="permission('换表查询')">
      <change-meter-query v-if="show.includes('换表查询')" @deal-msg="dealMsg" :data="data"></change-meter-query>
    </tabs>
    <tabs header="冲正查询" v-if="permission('冲正查询')">
      <reverse-query v-if="show.includes('冲正查询')" @deal-msg="dealMsg" :data="data"></reverse-query>
    </tabs>
    <tabs header="补卡查询" v-if="permission('补卡查询')">
      <fill-card-query v-if="show.includes('补卡查询')" @deal-msg="dealMsg" :data="data"></fill-card-query>
    </tabs>
    <tabs header="补气查询" v-if="permission('补气查询')">
      <fill-gas-query v-if="show.includes('补气查询')" @deal-msg="dealMsg" :data="data"></fill-gas-query>
    </tabs>
    <tabs header="启用查询" v-if="permission('启用查询')">
      <enable-query v-if="show.includes('启用查询')" @deal-msg="dealMsg" :data="data" :residentialarea="residentialArea"></enable-query>
    </tabs>
    <tabs header="停用查询" v-if="permission('停用查询')">
      <disable-query v-if="show.includes('停用查询')" @deal-msg="dealMsg" :data="data" :residentialarea="residentialArea"></disable-query>
    </tabs>
    <tabs header="销户查询" v-if="permission('销户查询')">
      <cancellation-query v-if="show.includes('销户查询')" @deal-msg="dealMsg" :data="data"></cancellation-query>
    </tabs>
    <tabs header="减免优惠查询" v-if="permission('减免优惠查询')">
      <over-due-query v-if="show.includes('减免优惠查询')" @deal-msg="dealMsg" :data="data"></over-due-query>
    </tabs>
    <tabs header="调价补差查询" v-if="permission('调价补差查询')">
      <priceadjust-query v-if="show.includes('调价补差查询')" @deal-msg="dealMsg" :data="data"></priceadjust-query>
    </tabs>
    <tabs header="迁表查询" v-if="permission('迁表查询')">
      <movemeter-query v-if="show.includes('迁表查询')" @deal-msg="dealMsg" :data="data"></movemeter-query>
    </tabs>
    <tabs header="卡表抄表查询" v-if="permission('卡表抄表查询')">
      <card-handplan-query v-if="show.includes('卡表抄表查询')" @deal-msg="dealMsg" :data="data"></card-handplan-query>
    </tabs>
    <tabs header="收据查询" v-if="permission('收据查询')">
        <meter-receipt-query v-if="show.includes('收据查询')" @deal-msg="dealMsg" :data="data"></meter-receipt-query>
    </tabs>
    <!--      <tabs header="操作记录查询" v-if="permission('操作记录查询')">-->
    <!--        <record-query v-if="show == '操作记录查询'" @deal-msg="dealMsg" :data="data"></record-query>-->
    <!--      </tabs>-->
    <tabs header="业务查询" v-if="permission('业务查询')">
      <busines-query v-if="show.includes('业务查询')" @deal-msg="dealMsg" :data="data"></busines-query>
    </tabs>
    <tabs header="预存查询" v-if="permission('预存查询')">
      <yucun-detailss v-if="show.includes('预存查询')" @deal-msg="dealMsg" :data="data"></yucun-detailss>
    </tabs>
    <tabs header="发折查询" v-if="permission('发折查询')">
      <sendbook-query v-if="show.includes('发折查询')" @deal-msg="dealMsg" :data="data"></sendbook-query>
    </tabs>
    <tabs header="可疑用户查询" v-if="permission('可疑用户查询')">
      <suspicious-user-query v-if="show.includes('可疑用户查询')" @deal-msg="dealMsg" :data="data"></suspicious-user-query>
    </tabs>
    <tabs header="气价变更查询" v-if="permission('气价变更查询')">
      <price-change v-if="show.includes('气价变更查询')" @deal-msg="dealMsg" :data="data"></price-change>
    </tabs>
    <tabs header="扎帐查询" v-if="permission('扎帐查询')">
      <prick-bill-query v-if="show.includes('扎帐查询')" @deal-msg="dealMsg" :data="data"></prick-bill-query>
    </tabs>
    <!--      <tabs header="资源操作记录查询" v-if="permission('资源操作记录查询')">-->
    <!--        <resource-operating-query v-if="show == '资源操作记录查询'" @deal-msg="dealMsg" :data="data"></resource-operating-query>-->
    <!--      </tabs>-->
    <tabs header="调价记录查询" v-if="permission('调价记录查询')">
      <pricechange-record v-if="show.includes('调价记录查询')" @deal-msg="dealMsg" :data="data"></pricechange-record>
    </tabs>
    <tabs header="维护记录查询" v-if="permission('维护记录查询')">
      <infooperate-record v-if="show.includes('维护记录查询')" @deal-msg="dealMsg" :data="data"></infooperate-record>
    </tabs>
    <tabs header="气损收费查询" v-if="permission('气损收费查询')">
      <gasloss-query v-if="show.includes('气损收费查询')" @deal-msg="dealMsg" :data="data"></gasloss-query>
    </tabs>
    <tabs header="气价信息查询" v-if="permission('气价信息查询')">
      <gas-price-query v-if="show.includes('气价信息查询')" @deal-msg="dealMsg" :data="data"></gas-price-query>
    </tabs>
    <tabs header="团缴查询" v-if="permission('团缴查询')">
      <group-charge-query v-if="show.includes('团缴查询')" @deal-msg="dealMsg" :data="data"></group-charge-query>
    </tabs>
    <tabs header="气费阶梯明细" v-if="permission('气费阶梯明细')">
      <selling-charge-price v-if="show.includes('气费阶梯明细')" @deal-msg="dealMsg" :data="data"></selling-charge-price>
    </tabs>
  </tab-button>
  <!--  </div>-->
  <!--  <div v-if="!listpage">-->
  <!--    <meter-info-manage :row="rowData" :f_start_date="f_start_date" :f_end_date="f_end_date"></meter-info-manage>-->
  <!--  </div>-->
</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()
    console.log(this.$refs.list)
    console.log('业务查询')
  },
  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>
