<template>
  <div>
    <div id="h">
      <criteria-paged :model="model">
        <criteria partial='criteria' @condition-changed='search'>
          <div novalidate class="form-inline auto" partial>
            <div class="form-group">
              <!-- 营业网点:
              <v-select :value.sync="model.network"
                  :options='$parent.$parent.network' placeholder='请选择'
                  close-on-select clear-button
                  v-model="model.network"></v-select>
              操作员姓名:
              <v-select :value.sync="model.operator"
                  :options='$parent.$parent.operator' placeholder='请选择'
                  close-on-select clear-button
                  v-model="model.operator"></v-select> -->
              <label for="startDate">查询日期:</label>
              <datepicker id="startDate" placeholder="开始日期"
                          v-model="model.startDate"
                          :value.sync="model.startDate"
                          :disabled-days-of-Week="[]"
                          :format="'yyyy-MM-dd'"
                          :show-reset-button="reset">
              </datepicker>
              <label for="startDate">结束日期:</label>
              <datepicker id="endDate" placeholder="结束日期"
                          v-model="model.endDate"
                          :value.sync="model.endDate"
                          :disabled-days-of-Week="[]"
                          :format="'yyyy-MM-dd'"
                          :show-reset-button="reset">
              </datepicker>
              <label for="operator" class="control-label">操作员</label>
              <v-select :value.sync="model.operator" v-model="model.operator"
                        :options='$parent.$parent.operator' placeholder='操作员'
                        default-value="['']"
                        close-on-select></v-select>
              <button class="btn btn-default" @click="search()">查询</button>
              <report-print id='gongye' top='1cm' left='1cm' width='100%' height='100%'></report-print>
              <report-excel id='gongye'></report-excel>
            </div>
          </div>
        </criteria>

        <div partial='list' id='gongye'>
          <data-grid :model="model" classname="reporttable" partial='list'>
            <template partial='head'>
              <tr>
                <th colspan='14' style="border: 1px solid white; border-bottom: 1px solid black; text-align: center;">
                  <h1 align="center">话务员考核表</h1>
                </th>
              </tr>
              <tr>
                <th>姓名</th>
                <th>有效工作</th>
                <th>置忙时长/次数</th>
                <th>话务总量</th>
                <th>未接</th>
                <th>已接</th>
                <th>外拨</th>
                <th>接听时长(分)</th>
                <th>满意度</th>
                <th>接入</th>
                <th>接出</th>
                <th>咨询单</th>
                <th>投诉单</th>
                <th>报修单</th>
              </tr>
            </template>
            <template partial='body'>
              <tr>
                <td style="text-align: center;">{{row.nam}}</td>
                <td style="text-align: center;">{{((row.denglushichang)===0?0:((row.denglushichang-row.zhimangshichang)/row.denglushichang)*100).toFixed(0)+'%'}}</td>
                <td style="text-align: center;">{{row.zhimangshichang}}秒/{{row.zhimangcishu}}次</td>
                <td style="text-align: center;">{{row.weijie+row.yijie}}</td>
                <td style="text-align: center;">{{row.weijie}}</td>
                <td style="text-align: center;">{{row.yijie}}</td>
                <td style="text-align: center;">{{row.weibo}}</td>
                <td style="text-align: center;">{{parseInt(row.zhimangshichang/60)}}分</td>
                <td style="text-align: center;">{{((row.quanbujieting)===0?0:(row.threesjieting/row.quanbujieting)*100).toFixed(0)+'%'}}</td>
                <td style="text-align: center;">{{row.jieru}}</td>
                <td style="text-align: center;">{{row.jiechu}}</td>
                <td style="text-align: center;">{{row.zixundan}}</td>
                <td style="text-align: center;">{{row.tousudan}}</td>
                <td style="text-align: center;">{{row.baoxiudan}}</td>
              </tr>
            </template>
          </data-grid>
        </div>
      </criteria-paged>
    </div>
  </div>
</template>
<script>
  import { PagedList } from 'vue-client'
  import AppData from '../../stores/AppData'
  export default {
    title: '话务员考核表',
    data () {
      return {
        model: new PagedList('rs/sql/getTelman', 20, {startDate: 'this.model.startDate',endDate:'this.model.endDate',operator:'this.model.operator[0]'})
      }
    },
    computed: {
      // outlets () {
      //   return [{label: '全部', value: ''}, ...AppData.getParam('营业网点')]
      // },
      operator () {
        return [{label: '全部', value: ''}, ...AppData.getParam('操作员')]
      }
    }
  }

</script>
