<template>
  <div>
    <label>{{f_repairman}}{{f_plan_year}}任务月完成情况</label>
    <button type="button" class="btn btn-default" @click="this.$goto('plumber-annual', {}, 'master-router')">&lt;&lt;</button>
    <data-grid :model="model" partial='list' v-ref:grid>
      <template partial='head'>
        <tr>
          <th>年</th>
          <th>月</th>
          <th>已检</th>
          <th>在检</th>
          <th>未检</th>
        </tr>
      </template>
      <template partial='body'>
        <td>{{row.f_plan_year}}</td>
        <td>{{row.f_plan_month}}</td>
        <td>{{row.checked}}</td>
        <td>{{row.checking}}</td>
        <td>{{row.unchecked}}</td>
      </template>
    </data-grid>
    <div style="height:50px;"></div>
  </div>
</template>

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

let aggCheckerTaskDetail = function * (self) {
    let result = yield self.$post(Vue.url + 'sql/统计维修员年任务明细?pageNo=1&pageSize=9999', {
        data: {
            f_repairman: self.f_repairman,
            f_plan_year: self.f_plan_year,
            f_subcompany: Vue.user.f_subcompany
        }
    }, {
        resolveMsg: null,
        rejectMsg: '提取任务出错'
    })
    self.$set("model.rows", result.data)
}

export default {
  title: '维修员年任务明细',
  props: ['f_repairman', 'f_plan_year'],
  data() {
    return {
      model: {
        rows: []
      }
    }
  },
  ready () {
    this.getPlan()
  },
  methods: {
    getPlan () {
      let fp = aggCheckerTaskDetail(this)
      co(fp)
    }
  }
}
</script>
