<template>
  <div class="flex" style="height: 90%;overflow-y: scroll">
    <mix-price-info :data="data" v-if="data.f_price_type === '固定气价'"></mix-price-info>
    <stairinfo :data="data" v-if="data.f_price_type === '阶梯气价'"></stairinfo>
    <bill-message @setstate="setstate" :state="state" :data="data"></bill-message>
    <valueaddinfo :data="data" v-ref:valueaddinfo></valueaddinfo>
    <sale-safecheck-info :data="data"></sale-safecheck-info>
    <!--  未处理隐患  -->
    <sale-hidden-danger-info :data="data"></sale-hidden-danger-info>
    <service-repair :data="data" v-if="name==='维修情况查询'"></service-repair>
    <check-gas :data="data" v-if="checkgas==='气量核对'"></check-gas>
  </div>
</template>

<script>
/**
*客户相关信息
*/

import MixPriceInfo from './MixPriceInfo'
import ServiceRepair from './ServiceRepair'
import CheckGas from './CheckGas'
export default {
  title: '客户相关信息',
  data () {
    return {
      name: '',
      checkgas: ''
    }
  },
  components: {MixPriceInfo, ServiceRepair, CheckGas},
  props: {
    data: {
      type: Object
    },
    cardData: {
      type: Object,
      default: function () {
        return {}
      }
    },
    state:{
      type: String,
      default:null
    }
  },
  ready () {
    this.getAuthority()
  },
  methods: {
    getAuthority () {
      if (this.$login.r.find(value => value == '维修情况查询')) {
        this.name = '维修情况查询'
        console.log(this.name)
      }
      if (this.$login.r.find(value => value == '气量核对')) {
        this.checkgas = '气量核对'
        console.log(this.checkgas)
      }
      console.log('查看权限', this.$login.r)
    },
    dealMsg (obj) {
      this.$dispatch('deal-msg', obj)
    },
    setstate(state){
      this.$dispatch('setstate',state)
    }
  }
}
</script>
<style lang="less">
  #mulit-info-class {
    width: 280px;
    margin-right: 20px;
    overflow-y: auto;
    > div {
      height: auto;
      margin-bottom: 8px;
    }
  }
  // 内容显示样式
  .control-label {
    height: 23px;
    border-right: 1px solid #F2F6FA;
    margin-bottom: 0;
    text-align: left;
  }

  .info-content {
    padding:6px;
    span {
      padding-left: 5px;
    }
  }
// 信息区域的表格显示紧凑
  .self-table > tbody > tr > td {
    padding: 3px;
    text-align: center;
  }
</style>
