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

  <!--</partial-view>-->
</template>

<script>
  import co from 'co'
  import Vue from 'vue'
  import {HttpResetClass} from 'vue-client'

  let getPriceGen = function * (self) {
    console.log('看看拿到的data', self.data.f_user_id)

    let http = new HttpResetClass()
    let getPrice = yield http.load('POST', '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
        getdate()>=f_perform_date and getdate()<=f_end_date)`,
      orderitem: 'id'}}, {resolveMsg: null, rejectMsg: null})
    self.model.f_price = getPrice.data[0].f_price
  }

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

<style scoped>

</style>
