<template>
  <div id="unit" class="flex-row" v-if="listpage" >
    <div :class="{'basic-main':((!isdetail) && (!usershow)),'binary-left':isdetail||usershow}" >
      <check-plan-area-list v-ref:list :row="row" :config="config" :f_filialeid.sync="f_filialeid" @select-changed="selected" ></check-plan-area-list>
    </div>
    <div class="binary-right" style="overflow-y: scroll" v-if="isdetail">
      <check-plan-user-list :checkrow="checkrow" ></check-plan-user-list>
    </div>
  </div>
  <div v-if="!listpage">
    <user-info-detail-manage :f_userinfo_id="f_userinfo_id" @cancel-main="cancel"></user-info-detail-manage>
  </div>

</template>
<script>
  import Vue from 'vue'

  export default {
    title: '安检情况汇总',
    data () {
      return {
        f_userinfo_id: '',
        f_filialeid: this.$login.f.orgid,
        config: {
          isLimit: false, // 限购
          audit: false,  // 启用审核
          heatingSeason: false, // 采暖季
          deductionWay: 'cycle'  // 'cycle: 周期扣费； day: 日运算扣费； singleHS: 采暖季独立扣费； dayHS: 采暖季日扣费；' 此值不配置默认周期扣费
        },
        listpage: true,
        row: null,
        checkrow: null,
        parentData: '',
        isdetail: false,
        gasPriceShow: false,
        usershow: false,
        // 控制气价信息界面和变更操作记录界面的展示
        changeView: false,
        nocivilshow:true,
        modalshow:false,
      }
    },
    ready () {
    },
    methods: {
      cancel(obj) {
        this.listpage = true
      },
      dealMsg(val) {
        this.listpage = false
        this.f_userinfo_id = val.f_userinfo_id
      },
      selected (obj) {
        //tag)
        //tag)
        this.checkrow = obj.val
        this.parentData = this.checkrow.id
        this.isdetail = true
        this.usershow = false
        this.listpage = true
      },
      selected2 (obj) {

      },
      refresh () {
        this.row = null
        this.gasPriceShow = false
        this.isdetail = false
        this.usershow =false
        this.listpage=true
        this.$refs.list.search()
      }
    },
    events: {
      'success' (name, row, res) {
        this.row = row
        this.gasPriceShow = false
        this.isdetail = false
        this.usershow =false
        this.listpage=true
        this.$refs.list.search()
      },
      'error' (name, row, res) {
        this.row = row
        this.gasPriceShow = false
        this.isdetail = false
        this.usershow =false
        this.listpage=true
        this.$refs.list.search()
      },
      'close' (res) {
        this.row = null
        this.gasPriceShow = false
        this.isdetail = false
        this.usershow =false
        this.listpage=true
      },
      'search' () {
        this.row = null
        this.gasPriceShow = false
        this.isdetail = false
        this.usershow =false
        this.listpage=true
        // this.$refs.list.search()
      }
    }
  }
</script>
<style>

</style>
