<template>
  <div>
    {{f_subcompany}}<a href="#" class="btn btn-primary" @click="this.$back('items')">&lt;&lt;</a>
    <table class="table table-bordered">
      <thead class="thead-default">
        <th>年</th>
        <th>月</th>
        <th>计划</th>
        <th>已检</th>
        <th>入户</th>
        <th>拒检</th>
        <th>到访不遇</th>
       <!-- <th>应修</th>
        <th>已修</th>-->
        <th>A类隐患</th>
        <th>B类隐患</th>
        <th>C类隐患</th>
      </thead>
      <tr v-for="row in rows">
          <td>{{row.f_plan_year}}</td>
          <td>{{row.f_plan_month}}</td>
          <td>{{row.cplan}}</td>
          <td>{{row.call}}</td>
          <td>{{row.centry}}</td>
          <td>{{row.cdeny}}</td>
          <td>{{row.cabsent}}</td>
          <!--<td>{{row.ctoberepaired}}</td>
          <td>{{row.crepaired}}</td>-->
          <td>{{row.clevel1}}</td>
          <td>{{row.clevel2}}</td>
          <td>{{row.clevel3}}</td>
      </tr>
    </table>
    <div style="height:50px;"></div>
  </div>
</template>


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

let search = function * (self) {
  let splash = yield self.$resetpost('api/af-safecheck/sql/汇总明细查询', {data: {f_plan_year: self.f_plan_year, f_subcompany: self.f_subcompany}}, {resolveMsg: null, rejectMsg: '查询出错！'})
  self.$set('rows', splash.data)
}

export default {
  title: '安检概况',
  props: ['f_plan_year', 'f_subcompany'],
  data() {
    return {
      rows: []
    }
  },
  methods: {
    search () {
      let gen = search(this)
      return co(gen)
    },
  },
  ready () {
    this.search()
  }
}
</script>
