<template>
  <partial-view v-ref:pv>
    <div  id="stair" class="panel panel-info auto;" style="height:auto">
      <div class="panel-heading">
        <h4>气价信息</h4>
      </div>
      <div class="auto info-content">
        <div class="row">
          <label class = "col-sm-5 control-label">当前价格:</label>
          <span class = "col-sm-7">{{model.f_price}}</span>
        </div>
      </div>
    </div>
  </partial-view>
</template>

<script>
  import co from 'co'
  import Vue from  'vue'

  let getPriceGen = function * (self) {
    console.log('看看拿到的data', self.data.f_user_id)
    let getPrice = yield self.$refs.pv.load('rs/sql/singleTable_OrderBy', {data: {items: '*', tablename: 't_detailprice', condition: `f_stairprice_id = (select id from t_stairprice where f_price_id = '${self.data.f_price_id}' and f_filialeids = '${Vue.$login.f.f_orgids}' and f_state = '有效')`, orderitem: 'id'}})
    console.log('获取单价。', getPrice)
    self.model.f_price = getPrice.data[0].f_price
  }

  export default {
    title: '表具使用情况',
    props: ['data'],
    data () {
      return {
        model: {
          f_price: 0
        }
      }
    },
    ready () {
      co(getPriceGen(this))
    }
  }
</script>

<style scoped>

</style>
