<template>
  <div class="span">
    <div class="panel panel-info auto;" style="height:auto">
      <div class="panel-heading" style="text-align: center">
        <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>
  </div>

</template>

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

  let getPriceGen = async function (self) {
    console.log('看看拿到的data', self.data.f_user_id)
    let http = new HttpResetClass()
    let getPrice = await 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 f_filialeids = '${Vue.$login.f.f_orgids}' and f_state = '有效')`, orderitem: 'id'}}, {resolveMsg: null, rejectMsg: '获取价格信息出错'})
    console.log('获取单价。', getPrice)
    self.model.f_price = getPrice.data[0].f_price
  }

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

<style scoped>

</style>
