<template>
  <div
    class="big-dataservice-box"
    style="border-color:#bbdefb!important;"
    :class="{ 'hide-border': shouType == '1' }"
  >
    <div class="tag-title" style="background:#bbdefb!important">客户动态</div>
    <div class="row q-gutter-md">
      <q-card flat>
        <div class="data-title">客户线索</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.Stu.split(",")[0] }}
              <span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.Stu.split(",")[1] }}<span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.Stu.split(",")[2] }}<span class="unit">人</span>
            </div>
          </div>
          <div>
            <div class="label big">总数</div>
            <div class="value samll">
              {{ d.Stu.split(",")[3] }}
              <span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">到访客户</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.Visit.split(",")[0] }}
              <span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.Visit.split(",")[1] }}<span class="unit">人</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.Visit.split(",")[2] }}<span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">试听客户</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.Reserve.split(",")[0] }}
              <span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.Reserve.split(",")[1] }}<span class="unit">人</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.Reserve.split(",")[2] }}<span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">跟进客户</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.Follow.split(",")[0] }}
              <span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.Follow.split(",")[1] }}<span class="unit">人</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.Follow.split(",")[2] }}<span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">无效客户</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.Invalid.split(",")[0] }}
              <span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.Invalid.split(",")[1] }}<span class="unit">人</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.Invalid.split(",")[2] }}<span class="unit">人</span>
            </div>
          </div>
          <div>
            <div class="label big">总数</div>
            <div class="value samll">
              {{ d.Invalid.split(",")[3] }}<span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">未跟进学员</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">截止到当日未跟进</div>
            <div class="value">
              {{ d.UnFollow }}
              <span class="unit">人</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">有效通话</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.MakeCall.split(",")[0] }}
              <span class="unit">次</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.MakeCall.split(",")[1] }}<span class="unit">次</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.MakeCall.split(",")[2] }}<span class="unit">次</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">无效通话</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.InvalidCall.split(",")[0] }}
              <span class="unit">次</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.InvalidCall.split(",")[1] }}<span class="unit">次</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.InvalidCall.split(",")[2] }}<span class="unit">次</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">新增同业</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.Company.split(",")[0] }}
              <span class="unit">次</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.Company.split(",")[1] }}<span class="unit">次</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.Company.split(",")[2] }}<span class="unit">次</span>
            </div>
          </div>
        </div>
      </q-card>
      <q-card flat>
        <div class="data-title">新增同业联系人</div>
        <div class="data-time">{{ formatDate.date }} {{ formatDate.week }}</div>
        <div class="wrapper">
          <div class="col">
            <div class="label">当日</div>
            <div class="value">
              {{ d.Contacts.split(",")[0] }}
              <span class="unit">次</span>
            </div>
          </div>
          <div class="q-mr-lg">
            <div class="label big">当周</div>
            <div class="value samll">
              {{ d.Contacts.split(",")[1] }}<span class="unit">次</span>
            </div>
          </div>
          <div>
            <div class="label big">当月</div>
            <div class="value samll">
              {{ d.Contacts.split(",")[2] }}<span class="unit">次</span>
            </div>
          </div>
        </div>
      </q-card>
    </div>
  </div>
</template>

<script>
export default {
  props: ["d", "formatDate", "shouType"],
  data() {
    return {};
  },
  methods: {
    numberFormat(value) {
      let param = {};
      let k = 10000;
      let sizes = ["元", "万", "亿", "万亿"];
      let i;
      if (value < k) {
        param.value = parseFloat(value).toFixed(2);
        param.unit = "元";
      } else {
        i = Math.floor(Math.log(value) / Math.log(k));
        param.value = (value / Math.pow(k, i)).toFixed(2);
        param.unit = sizes[i];
      }
      return param;
    }
  }
};
</script>

<style></style>
