<template>
  <div>
    <div class="heior_box">
      
        <el-date-picker
          size="small"
          style="width:200px"
          v-model="searchModel.time"
          type="daterange"
          range-separator="至"
          start-placeholder="开始时间"
          end-placeholder="结束时间"
        ></el-date-picker>
        <el-button type="primary" size="small" @click="get(1)" plain>今日统计</el-button>
        <el-button type="primary" size="small" @click="get(0)" plain>历史统计</el-button>
    </div>

    <el-table :data="retData.data" size="medium" :height="$getHeight(100)" border>
      <el-table-column prop="starttime" label="日期" width="120px"></el-table-column>
      <el-table-column prop="agent_name" label="坐席姓名" width="160px"></el-table-column>
      <el-table-column prop="agent_tel" label="坐席手机号"></el-table-column>
      <el-table-column prop="total" label="呼叫总数"></el-table-column>
      <el-table-column prop="answer_total" label="接通总数"></el-table-column>
      <el-table-column prop="no_answer_total" label="未接通数"></el-table-column>
      <el-table-column prop="answer_rate" label="接通率"></el-table-column>
      <el-table-column prop="billse" label="接通总时长"></el-table-column>
      <el-table-column prop="avg_billse" label="平均接通时长"></el-table-column>
      <el-table-column prop="in_minutes" label="套餐分钟数"></el-table-column>
      <el-table-column prop="out_minutes" label="超出分钟数"></el-table-column>
    
    </el-table>

  </div>
</template>
<script>
export default {
  name: "managercalled",
  data() {
    return {
      retData:null,
      searchModel:{
        time:null,
      }
    };
  },
  created () {
    this.$store.commit('setCurrentNav', '电话管理>>客户经理拨打统计')
    this.get()

  },
  methods: {
    
    get(r) {
      if (r) {
        this.searchModel.time = null;
      }
      this.$api.post(this.$api.phpURL + "called/index/index", this.searchModel).then(res => {
        this.retData = res;
      });
    },
  }
}
</script>
