<template>
  <div>
    <label>{{f_checker}}{{f_plan_year}}任务月完成情况</label>
    <button type="button" class="btn btn-default" @click="this.$goto('checker-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>
        </tr>
      </template>
      <template partial='body'>
        <td>{{row.f_plan_year}}</td>
        <td>{{row.f_plan_month}}</td>
        <td>{{row.task}}</td>
        <td>{{row.accomplished}}</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.$resetpost(Vue.url + 'sql/统计安检员年任务明细?pageNo=1&pageSize=9999', {
        data: {
            f_checker: self.f_checker,
            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_checker', 'f_plan_year'],
  data() {
    return {
      model: {
        rows: []
      }
    }
  },
  ready () {
    this.getPlan()
  },
  methods: {
    getPlan () {
      let fp = aggCheckerTaskDetail(this)
      co(fp)
    }
  }
}
</script>
