<template>
  <div class="auto">
    <partial-view v-ref:pv>
      <div class="row">
        <label class = "col-sm-4">开始日期:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.min_hand_date}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">结束日期:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.max_hand_date}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">缴费月数:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.month}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">总金额:</label>
        <span class = "col-sm-8" style="text-align:left">{{model.money}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">操作人:</label>
        <span class = "col-sm-8" style="text-align:left">{{data.f_operator}}</span>
      </div>
      <div class="row">
        <label class = "col-sm-4">操作时间:</label>
        <span class = "col-sm-8" style="text-align:left">{{data.f_operate_date}}</span>
      </div>
    </partial-view>
  </div>
</template>

<script>
  export default {
    title: '垃圾费收费详情',
    props: ['data'],
    data () {
      return {
        model: {}
      }
    },
    ready () {
      let sql = 'garbageDetail'
      let condition = {
        recordId: this.data.id
      }
      this.$info(`加载数据中..., sql:${sql}`)
      this.$refs.pv.load('rs/logic/getOneData', {data: {sql: sql, params: condition}}).then((a) => {
        this.$info(`成功获取到数据！, data:${JSON.stringify(a.data)}`)
        this.model = a.data
      }).catch((error) => {
        if (error.status) {
          this.$warn(`加载数据出错, ${JSON.stringify(error)}`)
          return
        }
        throw error
      })
    }
  }
</script>
